add installer alpha version
This commit is contained in:
@@ -13,6 +13,12 @@ func (a *App) routes() {
|
||||
|
||||
// Web UI
|
||||
a.mux.HandleFunc("/", a.handleDashboard)
|
||||
a.mux.HandleFunc("/login", a.handleLoginPage)
|
||||
a.mux.HandleFunc("/storage", a.handleStorage)
|
||||
a.mux.HandleFunc("/shares", a.handleShares)
|
||||
a.mux.HandleFunc("/iscsi", a.handleISCSI)
|
||||
a.mux.HandleFunc("/protection", a.handleProtection)
|
||||
a.mux.HandleFunc("/management", a.handleManagement)
|
||||
|
||||
// Health & metrics
|
||||
a.mux.HandleFunc("/healthz", a.handleHealthz)
|
||||
@@ -173,6 +179,61 @@ func (a *App) routes() {
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/users/", a.handleUserOpsWithAuth)
|
||||
|
||||
// Service Management (requires authentication, admin-only)
|
||||
a.mux.HandleFunc("/api/v1/services", methodHandler(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleListServices)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/status", methodHandler(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceStatus)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/start", methodHandler(
|
||||
nil,
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceStart)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/stop", methodHandler(
|
||||
nil,
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceStop)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/restart", methodHandler(
|
||||
nil,
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceRestart)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/reload", methodHandler(
|
||||
nil,
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceReload)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil,
|
||||
))
|
||||
a.mux.HandleFunc("/api/v1/services/logs", methodHandler(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
adminRole := models.RoleAdministrator
|
||||
a.requireRole(adminRole)(http.HandlerFunc(a.handleServiceLogs)).ServeHTTP(w, r)
|
||||
},
|
||||
nil, nil, nil, nil,
|
||||
))
|
||||
|
||||
// Audit Logs
|
||||
a.mux.HandleFunc("/api/v1/audit", a.handleListAuditLogs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user