diff --git a/server/plugin/index.go b/server/plugin/index.go index 756acbf3..03101edc 100644 --- a/server/plugin/index.go +++ b/server/plugin/index.go @@ -3,6 +3,7 @@ package plugin import ( _ "github.com/mickael-kerjean/filestash/server/plugin/plg_starter_tunnel" _ "github.com/mickael-kerjean/filestash/server/plugin/plg_starter_tor" + _ "github.com/mickael-kerjean/filestash/server/plugin/plg_handler_console" _ "github.com/mickael-kerjean/filestash/server/plugin/plg_video_transcoder" _ "github.com/mickael-kerjean/filestash/server/plugin/plg_editor_onlyoffice" _ "github.com/mickael-kerjean/filestash/server/plugin/plg_handler_syncthing" diff --git a/server/plugin/plg_handler_console/index.go b/server/plugin/plg_handler_console/index.go index 69fc513d..7ba16789 100644 --- a/server/plugin/plg_handler_console/index.go +++ b/server/plugin/plg_handler_console/index.go @@ -42,10 +42,10 @@ func init() { if console_enable() == false { return nil } - r.PathPrefix("/tty/").Handler( + r.PathPrefix("/admin/tty/").Handler( AuthBasic( func() (string, string) { return "admin", Config.Get("auth.admin").String() }, - TTYHandler("/tty/"), + TTYHandler("/admin/tty/"), ), ) return nil @@ -62,7 +62,10 @@ var notAuthorised = func(res http.ResponseWriter, req *http.Request) { func AuthBasic(credentials func() (string, string), fn http.Handler) http.HandlerFunc { return func(res http.ResponseWriter, req *http.Request) { - if console_enable() == false { + if strings.HasSuffix(Config.Get("general.host").String(), "filestash.app") { + http.NotFoundHandler().ServeHTTP(res, req) + return + } else if console_enable() == false { http.NotFoundHandler().ServeHTTP(res, req) return }