mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Fri Dec 6 19:37:13 CET 2024
This commit is contained in:
@@ -127,10 +127,10 @@ func router(isDebug bool, secret string, dohServer string, cors Cors) *chi.Mux {
|
||||
r.Mount("/providers/rules", ruleProviderRouter())
|
||||
r.Mount("/cache", cacheRouter())
|
||||
r.Mount("/dns", dnsRouter())
|
||||
if !embedMode { // disallow restart and upgrade in embed mode
|
||||
if !embedMode { // disallow restart in embed mode
|
||||
r.Mount("/restart", restartRouter())
|
||||
r.Mount("/upgrade", upgradeRouter())
|
||||
}
|
||||
r.Mount("/upgrade", upgradeRouter())
|
||||
addExternalRouters(r)
|
||||
|
||||
})
|
||||
|
||||
@@ -14,9 +14,11 @@ import (
|
||||
|
||||
func upgradeRouter() http.Handler {
|
||||
r := chi.NewRouter()
|
||||
r.Post("/", upgradeCore)
|
||||
r.Post("/ui", updateUI)
|
||||
r.Post("/geo", updateGeoDatabases)
|
||||
if !embedMode { // disallow upgrade core/geo in embed mode
|
||||
r.Post("/", upgradeCore)
|
||||
r.Post("/geo", updateGeoDatabases)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user