From f37f02c35e65a944493b03d51078b6f33c0d61a2 Mon Sep 17 00:00:00 2001 From: zuevav Date: Thu, 24 Sep 2026 14:10:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D0=B5=D0=BD=D1=8C=20=D1=81?= =?UTF-8?q?=D0=B0=D0=B9=D1=82=D0=B0=20/=20=E2=86=92=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=87=D0=B0=D1=8F=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D0=B0=20(/admin/,=20/first-run=20=D0=B4=D0=BE=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8)=20=D0=B2?= =?UTF-8?q?=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- internal/lkgateway/server.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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,