home: imp code

This commit is contained in:
Stanislav Chzhen 2025-09-29 15:52:51 +03:00
parent 7db3d79e25
commit 3dd2453697
4 changed files with 7 additions and 7 deletions

View File

@ -264,8 +264,8 @@ func (web *webAPI) handleLogout(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusFound)
}
// registerAuthHandlers registers authentication handlers. web must not be nil.
func registerAuthHandlers(web *webAPI) {
// registerAuthHandlers registers authentication handlers.
func (web *webAPI) registerAuthHandlers() {
web.conf.mux.Handle(
"/control/login",
web.postInstallHandler(ensure(http.MethodPost, web.handleLogin)),

View File

@ -171,8 +171,7 @@ func (web *webAPI) handleStatus(w http.ResponseWriter, r *http.Request) {
}
// registerControlHandlers sets up HTTP handlers for various control endpoints.
// web must not be nil.
func registerControlHandlers(web *webAPI) {
func (web *webAPI) registerControlHandlers() {
mux := web.conf.mux
mux.Handle(
@ -196,7 +195,8 @@ func registerControlHandlers(web *webAPI) {
"/apple/dot.mobileconfig",
web.postInstallHandler(http.HandlerFunc(handleMobileConfigDoT)),
)
registerAuthHandlers(web)
web.registerAuthHandlers()
}
// httpRegister registers an HTTP handler.

View File

@ -506,7 +506,7 @@ func (web *webAPI) finalizeInstall(
web.conf.firstRun = false
web.conf.BindAddr = netip.AddrPortFrom(req.Web.IP, req.Web.Port)
registerControlHandlers(web)
web.registerControlHandlers()
aghhttp.OK(w)
if f, ok := w.(http.Flusher); ok {

View File

@ -180,7 +180,7 @@ func newWebAPI(ctx context.Context, conf *webConfig) (w *webAPI) {
mux.Handle("/install.html", w.preInstallHandler(clientFS))
w.registerInstallHandlers()
} else {
registerControlHandlers(w)
w.registerControlHandlers()
}
w.httpsServer.cond = sync.NewCond(&w.httpsServer.condLock)