diff --git a/authentik/lib/default.yml b/authentik/lib/default.yml index 54fc3f989..061e2139d 100644 --- a/authentik/lib/default.yml +++ b/authentik/lib/default.yml @@ -9,6 +9,7 @@ postgresql: web: listen: 0.0.0.0:9000 listen_tls: 0.0.0.0:9443 + load_local_files: false redis: host: localhost diff --git a/internal/config/config.go b/internal/config/config.go index c1811dd5c..db640f8d5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -16,8 +16,9 @@ func DefaultConfig() { G = Config{ Debug: false, Web: WebConfig{ - Listen: "localhost:9000", - ListenTLS: "localhost:9443", + Listen: "localhost:9000", + ListenTLS: "localhost:9443", + LoadLocalFiles: false, }, Paths: PathsConfig{ Media: "./media", diff --git a/internal/config/struct.go b/internal/config/struct.go index 155e7f702..6b21b5681 100644 --- a/internal/config/struct.go +++ b/internal/config/struct.go @@ -9,8 +9,9 @@ type Config struct { } type WebConfig struct { - Listen string `yaml:"listen"` - ListenTLS string `yaml:"listen_tls"` + Listen string `yaml:"listen"` + ListenTLS string `yaml:"listen_tls"` + LoadLocalFiles bool `yaml:"load_local_files"` } type PathsConfig struct { diff --git a/internal/web/web_static.go b/internal/web/web_static.go index 41452f480..06d30eddd 100644 --- a/internal/web/web_static.go +++ b/internal/web/web_static.go @@ -10,7 +10,7 @@ import ( func (ws *WebServer) configureStatic() { statRouter := ws.lh.NewRoute().Subrouter() - if config.G.Debug { + if config.G.Debug || config.G.Web.LoadLocalFiles { ws.log.Debug("Using local static files") ws.lh.PathPrefix("/static/dist").Handler(http.StripPrefix("/static/dist", http.FileServer(http.Dir("./web/dist")))) ws.lh.PathPrefix("/static/authentik").Handler(http.StripPrefix("/static/authentik", http.FileServer(http.Dir("./web/authentik"))))