maintain (release): prepare new release

This commit is contained in:
MickaelK 2025-03-14 13:08:02 +11:00
parent 89688843dc
commit afbceabad2

View file

@ -78,7 +78,7 @@ func Build(a App) *mux.Router {
// Webdav server / Shared Link
middlewares = []Middleware{IndexHeaders, SecureHeaders, PluginInjector}
if os.Getenv("CANARY") == "" { // TODO: remove once migration is done
if os.Getenv("LEGACY") == "true" { // TODO: remove once migration is done
r.HandleFunc(WithBase("/s/{share}"), NewMiddlewareChain(LegacyIndexHandler, middlewares, a)).Methods("GET")
} else {
r.HandleFunc(WithBase("/s/{share}"), NewMiddlewareChain(ServeFrontofficeHandler, middlewares, a)).Methods("GET")
@ -94,7 +94,7 @@ func Build(a App) *mux.Router {
r.HandleFunc(WithBase("/api/plugin"), NewMiddlewareChain(PluginExportHandler, append(middlewares, PublicCORS), a)).Methods("GET", "OPTIONS")
r.HandleFunc(WithBase("/api/config"), NewMiddlewareChain(PublicConfigHandler, append(middlewares, PublicCORS), a)).Methods("GET", "OPTIONS")
middlewares = []Middleware{StaticHeaders, SecureHeaders, PublicCORS, PluginInjector}
if os.Getenv("CANARY") == "" { // TODO: remove after migration is done
if os.Getenv("LEGACY") == "true" { // TODO: remove after migration is done
r.PathPrefix(WithBase("/assets")).Handler(http.HandlerFunc(NewMiddlewareChain(LegacyStaticHandler("/"), middlewares, a))).Methods("GET", "OPTIONS")
r.HandleFunc(WithBase("/favicon.ico"), NewMiddlewareChain(LegacyStaticHandler("/assets/logo/"), middlewares, a)).Methods("GET")
r.HandleFunc(WithBase("/sw_cache.js"), NewMiddlewareChain(LegacyStaticHandler("/assets/worker/"), middlewares, a)).Methods("GET")
@ -125,7 +125,7 @@ func Build(a App) *mux.Router {
middlewares = []Middleware{SecureHeaders, PluginInjector}
r.PathPrefix(WithBase("/admin")).Handler(http.HandlerFunc(NewMiddlewareChain(ServeBackofficeHandler, middlewares, a))).Methods("GET")
middlewares = []Middleware{IndexHeaders, SecureHeaders, PluginInjector}
if os.Getenv("CANARY") == "" { // TODO: remove once migration is done
if os.Getenv("LEGACY") == "true" { // TODO: remove once migration is done
r.PathPrefix("/").Handler(http.HandlerFunc(NewMiddlewareChain(LegacyIndexHandler, middlewares, a))).Methods("GET", "POST")
} else {
r.PathPrefix("/").Handler(http.HandlerFunc(NewMiddlewareChain(ServeFrontofficeHandler, middlewares, a))).Methods("GET", "POST")