feat: add mirror help pages and interactive Debian configuration

This commit is contained in:
2026-11-02 00:33:40 +08:00
parent 8ec5e4e324
commit 70e9f9b884
24 changed files with 691 additions and 18 deletions
+6
View File
@@ -104,6 +104,8 @@ func (a *App) handler() http.Handler {
})
mux.HandleFunc("GET /api/v1/public", a.public)
mux.HandleFunc("GET /api/v1/announcements", a.announcements)
mux.HandleFunc("GET /api/v1/help", a.helpIndex)
mux.HandleFunc("GET /api/v1/help/{name}", a.helpArticle)
mux.HandleFunc("GET /api/v1/monitoring", a.monitoring)
mux.HandleFunc("GET /api/v1/job-speeds", a.jobSpeeds)
mux.HandleFunc("POST /api/v1/auth/login", a.login)
@@ -141,6 +143,10 @@ func (a *App) handler() http.Handler {
return
}
path := r.URL.Path
if path == "/help" || strings.HasPrefix(path, "/help/") {
a.helpPage(w, r)
return
}
if path == "/" || path == "/status" || path == "/status/" || path == "/announcements" || path == "/announcements/" || path == "/admin" || strings.HasPrefix(path, "/admin/") {
http.ServeFile(w, r, filepath.Join(a.cfg.Static, "index.html"))
return