diff --git a/internal/lkgateway/server.go b/internal/lkgateway/server.go index 6c18688..8d06b68 100644 --- a/internal/lkgateway/server.go +++ b/internal/lkgateway/server.go @@ -191,6 +191,19 @@ func NewServer(cfg ServerConfig) (*Server, error) { registerIncoming(mux, adminTpl, inDeps) globalOutgoingStore = NewOutgoingStore() registerDepoSim(mux, adminTpl) + // корень сайта: http://сервер:8080/ → рабочая страница (до входа authMiddleware отправит на вход, + // до первичной настройки — на /first-run); прочие неизвестные адреса — 404. + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/" { + http.NotFound(w, r) + return + } + if firstRunPending() { + http.Redirect(w, r, "/first-run", http.StatusSeeOther) + return + } + http.Redirect(w, r, "/admin/", http.StatusSeeOther) + }) registerDepoTest(mux, adminTpl) // тестирование DEPO: сценарии с имитацией НРД, только база депозитария // песочница сверки с DEPO (имитация ответа Fancy) outDeps := outgoingDeps{ store: globalOutgoingStore,