Compare commits
4 Commits
783086bb0d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9376944373 | |||
| 39213020e2 | |||
| 9234e883e6 | |||
| 98861bc6f3 |
@@ -14,15 +14,6 @@ RUN tar cfz go-src.tgz src && du -sh *
|
||||
|
||||
FROM alpine
|
||||
|
||||
|
||||
54 viper.SetDefault("Debug", false)
|
||||
55 viper.SetDefault("TootsToDisk", false)
|
||||
56 viper.SetDefault("TootsToDB", true)
|
||||
57 viper.SetDefault("HostDiscoveryParallelism", 5)
|
||||
58 viper.SetDefault("FSStorageLocation", os.ExpandEnv("$HOME/Library/ApplicationSupport/feta/tootarchive.d"))
|
||||
59 viper.SetDefault("DBStorageLocation", os.ExpandEnv("$HOME/Library/ApplicationSupport/feta/feta.state.db"))
|
||||
60 viper.SetDefault("LogReportInterval", time.Second*10)
|
||||
|
||||
# here are the levers
|
||||
ENV FETA_HOSTDISCOVERYPARALLELISM 20
|
||||
ENV FETA_FSSTORAGELOCATION /state/tootstore
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
u "git.eeqj.de/sneak/goutil"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo"
|
||||
)
|
||||
|
||||
@@ -87,17 +88,29 @@ func (a *Server) getInstanceListHandler() http.HandlerFunc {
|
||||
}
|
||||
*/
|
||||
|
||||
func (a *Server) notFoundHandler(c echo.Context) error {
|
||||
return c.String(http.StatusNotFound, "404 not found")
|
||||
}
|
||||
|
||||
func (a *Server) instanceHandler(c echo.Context) error {
|
||||
tu := c.Param("uuid")
|
||||
u, err := uuid.Parse(tu)
|
||||
if err != nil {
|
||||
return c.String(http.StatusNotFound, "404 not found")
|
||||
return a.notFoundHandler(c)
|
||||
}
|
||||
|
||||
tc := pongo2.Context{}
|
||||
instances := a.feta.manager.ListInstances()
|
||||
found := false
|
||||
for _, item := range instances {
|
||||
if item.UUID == u {
|
||||
tc["instance"] = item
|
||||
found = true
|
||||
}
|
||||
}
|
||||
|
||||
i := a.feta.manager.ListInstances() {
|
||||
tc := pongo2.Context{
|
||||
"instance": i,
|
||||
if !found {
|
||||
return a.notFoundHandler(c)
|
||||
}
|
||||
|
||||
return c.Render(http.StatusOK, "instance.html", tc)
|
||||
|
||||
Reference in New Issue
Block a user