diff --git a/BACKLOG.md b/BACKLOG.md
index 8761926..beb56aa 100644
--- a/BACKLOG.md
+++ b/BACKLOG.md
@@ -813,8 +813,13 @@ Labels, fabrics, engines, heartbeat and supervisor settings move to the
store per node and reach the agent over its stream; a change to the file is
noticed and the agent restarts itself.
-### E4. Web settings page (S)
+### E4. Web settings page (S) — done 2026-10-08 (branch `settings-e`)
The same document, edited on /admin/settings, for whoever has no terminal.
+Built: administrators only (staff roles get 404: webhook secrets), checked by
+the same function as PUT /api/v1/settings, made from a base version or
+refused on a newer one (the edit kept in the editor), history with view and
+roll back as a new version, audit with the size not the body, English and
+Turkish, a Settings link in the menu.
---
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3098c5..d46bbc8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,16 @@ is only released once its **exit criterion** is met, not when its code lands.
Until v1.0.0 the minor version is the breaking one: configuration formats and Go
APIs change between minors without a deprecation period.
+## Unreleased
+
+### Added
+
+- **The cluster's settings on the portal** (BACKLOG E4): `/admin/settings`
+ for administrators. It edits the document `llmgw ctl config edit` opens:
+ checked as a control plane would load it, refused when made from a
+ version since replaced, with the history to view and roll back. Changes
+ are audited by size, never by contents.
+
## v0.14.0 — 2026-10-08
Knowledge bases: a company's documents, put in by people from their own
diff --git a/docs/install.md b/docs/install.md
index f148818..7c791b9 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -258,8 +258,14 @@ llmgw ctl config history # who changed what, when, and why
llmgw ctl config rollback 4 # back to version 4, as a new version
```
-or on the console's **Settings** screen. A change is checked before it is
-kept — one that would not load is refused — and recorded in the audit log.
+or on the console's **Settings** screen, or in a browser on the portal's
+**Settings** page (`/admin/settings`, for administrators only: the document
+can hold webhook secrets). The page edits the same document, lists its
+history, and puts an earlier version back. A change is checked before it is
+kept, so one that would not load is refused. A change made from a version
+someone else has replaced since is refused too, rather than overwriting
+theirs. Every change is recorded in the audit log, with the document's size
+but not its contents.
Guardrails change live; anything else has every control plane start again on
the new settings, the standbys first and the leader half a minute later, so
one of them is always serving. Engines keep running through it.
diff --git a/internal/cli/server.go b/internal/cli/server.go
index 5741f30..1978faa 100644
--- a/internal/cli/server.go
+++ b/internal/cli/server.go
@@ -382,6 +382,8 @@ func newServerCmd() *cobra.Command {
// machine's own keys before it is kept.
api.SetSettings(&adminapi.Settings{Store: st, LocalKeys: config.LocalKeys(),
Check: func(body []byte) error { return checkClusterSettings(configPath, body) }})
+ // And the same document on the portal, for administrators.
+ rt.SetSettingsCheck(func(body []byte) error { return checkClusterSettings(configPath, body) }, config.LocalKeys())
}
// Catalog changes need somewhere to persist, so this is wired
// only when there is a store. Without one, the endpoints say so
diff --git a/internal/router/handlers.go b/internal/router/handlers.go
index c97e689..bb885b3 100644
--- a/internal/router/handlers.go
+++ b/internal/router/handlers.go
@@ -247,6 +247,9 @@ func (r *Router) Handler() http.Handler {
if r.store != nil && r.guardLibrary != nil {
pages.RegisterAdminGuard(mux, r.store, r.guardLibrary)
}
+ if r.store != nil && r.settingsCheck != nil {
+ pages.RegisterAdminSettings(mux, r.store, r.settingsCheck, r.settingsLocal)
+ }
pages.Register(mux)
// The docs portal, with the menu of whoever is signed in, and only to
// them when the site asked for that.
diff --git a/internal/router/router.go b/internal/router/router.go
index e01c540..0059437 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -177,6 +177,10 @@ type Router struct {
// collections for kbDefaultTTL.
kbDefMu sync.Mutex
kbDefCache map[string]kbDefaultEntry
+
+ // settingsCheck and settingsLocal mount the portal's settings page.
+ settingsCheck func([]byte) error
+ settingsLocal []string
}
// SetClusterView gives the router the data the /admin page renders.
@@ -200,6 +204,13 @@ func (r *Router) SetGuard(g guard.Guard) { r.guard = g }
// SetGuardLibrary is the policies the guard was built from, for the pages.
func (r *Router) SetGuardLibrary(c func() guard.Config) { r.guardLibrary = c }
+// SetSettingsCheck enables the portal's settings page: check says whether a
+// document would load as the cluster's settings beside this machine's own
+// server.yaml, and local are the keys that file keeps.
+func (r *Router) SetSettingsCheck(check func([]byte) error, local []string) {
+ r.settingsCheck, r.settingsLocal = check, local
+}
+
// SetStopped refuses, or again serves, every request for a model.
func (r *Router) SetStopped(stopped bool) { r.stopped.Store(stopped) }
diff --git a/internal/web/account.go b/internal/web/account.go
index 395c64c..5d03db9 100644
--- a/internal/web/account.go
+++ b/internal/web/account.go
@@ -90,7 +90,9 @@ type AccountPages struct {
audit audit.Sink
// hasGuard is set when /admin/guard is registered, and guardLibrary
// with it: the policies in force, whose judges the mirror page serves.
- hasGuard bool
+ hasGuard bool
+ // hasSettings is set when /admin/settings is registered.
+ hasSettings bool
guardLibrary func() guard.Config
// guardFor names the guardrail policies in force for someone, and
// whether they keep nothing; nil when there are none.
diff --git a/internal/web/admin_settings.go b/internal/web/admin_settings.go
new file mode 100644
index 0000000..fd5e376
--- /dev/null
+++ b/internal/web/admin_settings.go
@@ -0,0 +1,174 @@
+package web
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "strconv"
+ "strings"
+
+ "gitea.mynodes.xyz/ilker/llmgw/internal/store"
+)
+
+// The cluster's settings, edited in the browser (BACKLOG E4): the document
+// `llmgw ctl config edit` opens, for whoever has no terminal on a control
+// plane. The same rules hold here as there — a version is checked as a
+// control plane would load it before it is kept, it is made from the newest
+// version or refused, and every change is in force on every control plane
+// within seconds and in the audit log.
+
+// SettingsAdmin is where the cluster's settings are kept.
+type SettingsAdmin interface {
+ ClusterSettings(ctx context.Context) (store.SettingsVersion, error)
+ ClusterSettingsAt(ctx context.Context, version int64) (store.SettingsVersion, error)
+ ClusterSettingsHistory(ctx context.Context, limit int) ([]store.SettingsVersion, error)
+ PutClusterSettings(ctx context.Context, base int64, body, by, note string) (int64, error)
+}
+
+type settingsPageData struct {
+ Nav Nav
+ Version string
+ CSRF string
+ // Current is the version in force; Shown the one in the editor, which
+ // is an earlier one when ?version= asked for it.
+ Current, Shown store.SettingsVersion
+ Earlier bool
+ // Body is what the editor holds: the version shown, or what was sent
+ // and refused, so a refusal does not lose the edit.
+ Body string
+ Note string
+ History []settingsRow
+ LocalKeys []string
+ Notice string
+ Error string
+}
+
+type settingsRow struct {
+ Version int64
+ At, By string
+ Note string
+ InForce bool
+ Selected bool
+}
+
+// RegisterAdminSettings mounts /admin/settings, for administrators only:
+// the settings hold webhook addresses and the like, so even reading them is
+// not every staff role's.
+func (p *AccountPages) RegisterAdminSettings(mux *http.ServeMux, s SettingsAdmin, check func([]byte) error, localKeys []string) {
+ p.hasSettings = true
+ page := func(w http.ResponseWriter, r *http.Request, admin store.User, d settingsPageData) {
+ ctx, l := r.Context(), langOf(r)
+ d.Nav, d.Version, d.CSRF, d.LocalKeys = p.navFor(r, admin, "settings"), p.version, csrfFor(r), localKeys
+ cur, err := s.ClusterSettings(ctx)
+ if err != nil {
+ d.Error = l.Err(err)
+ }
+ d.Current = cur
+ if d.Shown.Version == 0 {
+ d.Shown = cur
+ }
+ d.Earlier = d.Shown.Version != cur.Version
+ if d.Body == "" {
+ d.Body = d.Shown.Body
+ }
+ if hist, err := s.ClusterSettingsHistory(ctx, 30); err == nil {
+ for _, v := range hist {
+ d.History = append(d.History, settingsRow{Version: v.Version, At: l.Date(v.At.UTC()) + " " + v.At.UTC().Format("15:04"),
+ By: v.By, Note: v.Note, InForce: v.Version == cur.Version, Selected: v.Version == d.Shown.Version})
+ }
+ }
+ noStore(w)
+ render(w, r, "admin_settings", d)
+ }
+ adminsOnly := func(next func(w http.ResponseWriter, r *http.Request, admin store.User)) http.HandlerFunc {
+ return p.adminOnly(func(w http.ResponseWriter, r *http.Request, admin store.User) {
+ if !admin.IsAdmin {
+ http.NotFound(w, r)
+ return
+ }
+ if r.Method == http.MethodPost {
+ sess, _, _ := p.session(r)
+ if !p.accounts.CheckCSRF(sess, r.FormValue("csrf")) {
+ http.Error(w, "bad request", http.StatusBadRequest)
+ return
+ }
+ }
+ next(w, r, admin)
+ })
+ }
+
+ mux.HandleFunc("GET /admin/settings", adminsOnly(func(w http.ResponseWriter, r *http.Request, admin store.User) {
+ var d settingsPageData
+ if q := r.URL.Query().Get("version"); q != "" {
+ n, err := strconv.ParseInt(q, 10, 64)
+ if v, verr := s.ClusterSettingsAt(r.Context(), n); err == nil && verr == nil && v.Version != 0 {
+ d.Shown = v
+ } else {
+ d.Error = langOf(r).T("settings.err.no_version")
+ }
+ }
+ page(w, r, admin, d)
+ }))
+
+ mux.HandleFunc("POST /admin/settings", adminsOnly(func(w http.ResponseWriter, r *http.Request, admin store.User) {
+ l := langOf(r)
+ body := strings.ReplaceAll(r.FormValue("body"), "\r\n", "\n")
+ note := strings.TrimSpace(r.FormValue("note"))
+ base, _ := strconv.ParseInt(r.FormValue("base"), 10, 64)
+ // The audit line records the form; the document can hold webhook
+ // secrets, so it records the document's size, not the document.
+ r.PostForm.Set("body", "("+strconv.Itoa(len(body))+" bytes)")
+ refuse := func(msg string) {
+ noteAudit(r, "cluster settings", "", msg)
+ page(w, r, admin, settingsPageData{Body: body, Note: note, Error: msg})
+ }
+ if cur, err := s.ClusterSettings(r.Context()); err == nil && cur.Body == body {
+ refuse(l.T("settings.err.unchanged"))
+ return
+ }
+ if err := check([]byte(body)); err != nil {
+ refuse(l.T("settings.err.invalid") + " " + err.Error())
+ return
+ }
+ n, err := s.PutClusterSettings(r.Context(), base, body, admin.Email, note)
+ switch {
+ case errors.Is(err, store.ErrSettingsChanged):
+ refuse(l.T("settings.err.changed"))
+ return
+ case err != nil:
+ refuse(l.Err(err))
+ return
+ }
+ noteAudit(r, "cluster settings", "version "+strconv.FormatInt(n, 10), "")
+ page(w, r, admin, settingsPageData{Notice: l.T("settings.saved", n)})
+ }))
+
+ mux.HandleFunc("POST /admin/settings/rollback", adminsOnly(func(w http.ResponseWriter, r *http.Request, admin store.User) {
+ l := langOf(r)
+ n, _ := strconv.ParseInt(r.FormValue("version"), 10, 64)
+ old, err := s.ClusterSettingsAt(r.Context(), n)
+ if err != nil || old.Version == 0 {
+ page(w, r, admin, settingsPageData{Error: l.T("settings.err.no_version")})
+ return
+ }
+ cur, err := s.ClusterSettings(r.Context())
+ if err != nil {
+ page(w, r, admin, settingsPageData{Error: l.Err(err)})
+ return
+ }
+ if err := check([]byte(old.Body)); err != nil {
+ // A version kept before a change to server.yaml may no longer
+ // load beside it; refused here rather than breaking the cluster.
+ noteAudit(r, "cluster settings", "", err.Error())
+ page(w, r, admin, settingsPageData{Error: l.T("settings.err.invalid") + " " + err.Error()})
+ return
+ }
+ v, err := s.PutClusterSettings(r.Context(), cur.Version, old.Body, admin.Email, "back to version "+strconv.FormatInt(n, 10))
+ if err != nil {
+ page(w, r, admin, settingsPageData{Error: l.Err(err)})
+ return
+ }
+ noteAudit(r, "cluster settings", "version "+strconv.FormatInt(v, 10)+" from "+strconv.FormatInt(n, 10), "")
+ page(w, r, admin, settingsPageData{Notice: l.T("settings.rolled_back", n, v)})
+ }))
+}
diff --git a/internal/web/admin_settings_test.go b/internal/web/admin_settings_test.go
new file mode 100644
index 0000000..3a0c0d5
--- /dev/null
+++ b/internal/web/admin_settings_test.go
@@ -0,0 +1,143 @@
+package web
+
+import (
+ "context"
+ "errors"
+ "io"
+ "log/slog"
+ "net/http"
+ "net/url"
+ "strings"
+ "testing"
+ "time"
+
+ "gitea.mynodes.xyz/ilker/llmgw/internal/store"
+)
+
+type fakeSettings struct{ versions []store.SettingsVersion }
+
+func (f *fakeSettings) ClusterSettings(context.Context) (store.SettingsVersion, error) {
+ if len(f.versions) == 0 {
+ return store.SettingsVersion{}, nil
+ }
+ return f.versions[len(f.versions)-1], nil
+}
+
+func (f *fakeSettings) ClusterSettingsAt(_ context.Context, v int64) (store.SettingsVersion, error) {
+ for _, s := range f.versions {
+ if s.Version == v {
+ return s, nil
+ }
+ }
+ return store.SettingsVersion{}, nil
+}
+
+func (f *fakeSettings) ClusterSettingsHistory(context.Context, int) ([]store.SettingsVersion, error) {
+ out := make([]store.SettingsVersion, len(f.versions))
+ for i, v := range f.versions {
+ out[len(f.versions)-1-i] = v
+ }
+ return out, nil
+}
+
+func (f *fakeSettings) PutClusterSettings(_ context.Context, base int64, body, by, note string) (int64, error) {
+ cur, _ := f.ClusterSettings(context.Background())
+ if base != cur.Version {
+ return 0, store.ErrSettingsChanged
+ }
+ n := cur.Version + 1
+ f.versions = append(f.versions, store.SettingsVersion{Version: n, Body: body, By: by, Note: note, At: time.Now()})
+ return n, nil
+}
+
+type auditSink struct{ events []store.AuditEvent }
+
+func (a *auditSink) WriteAudit(_ context.Context, e store.AuditEvent) error {
+ a.events = append(a.events, e)
+ return nil
+}
+
+func clusterSettingsPage(t *testing.T, user store.User) (*http.ServeMux, *fakeSettings, *auditSink) {
+ t.Helper()
+ s := &fakeSettings{versions: []store.SettingsVersion{{Version: 1, Body: "guard:\n enabled: true\n", By: "init", At: time.Now()}}}
+ p := NewAccountPages(fakeAccounts{user: user}, nil, nil, "v0", slog.New(slog.NewTextHandler(io.Discard, nil)))
+ sink := &auditSink{}
+ p.SetAudit(sink)
+ mux := http.NewServeMux()
+ p.RegisterAdminSettings(mux, s, func(b []byte) error {
+ if strings.Contains(string(b), "bogus") {
+ return errors.New("unknown key bogus")
+ }
+ return nil
+ }, []string{"listen", "store"})
+ return mux, s, sink
+}
+
+func TestTheSettingsPageIsForAdministratorsOnly(t *testing.T) {
+ for _, u := range []store.User{
+ {ID: "u1", Email: "v@example.com", Role: store.RoleViewer},
+ {ID: "u2", Email: "o@example.com", Role: store.RoleOperator},
+ {ID: "u3", Email: "b@example.com", Role: store.RoleBilling},
+ } {
+ mux, _, _ := clusterSettingsPage(t, u)
+ if w := mirrorGet(t, mux, "/admin/settings"); w.Code != http.StatusNotFound {
+ t.Errorf("%s saw the settings: %d", u.Role, w.Code)
+ }
+ }
+ mux, _, _ := clusterSettingsPage(t, store.User{ID: "a", Email: "a@example.com", IsAdmin: true})
+ body := mirrorGet(t, mux, "/admin/settings").Body.String()
+ for _, want := range []string{"guard:\n enabled: true", "Version 1, in force", "listen", `href="/admin/settings" aria-current="page"`} {
+ if !strings.Contains(body, want) {
+ t.Errorf("no %q in:\n%s", want, body)
+ }
+ }
+}
+
+func TestSettingsAreCheckedAppliedAndRolledBack(t *testing.T) {
+ mux, s, sink := clusterSettingsPage(t, store.User{ID: "a", Email: "a@example.com", IsAdmin: true})
+ post := func(form url.Values) string {
+ form.Set("csrf", "tok")
+ return mirrorPost(t, mux, "/admin/settings", form).Body.String()
+ }
+ // Refused: does not load. The edit stays in the editor; nothing kept.
+ body := post(url.Values{"base": {"1"}, "body": {"bogus: 1\n"}})
+ if !strings.Contains(body, "unknown key bogus") || !strings.Contains(body, "bogus: 1") || len(s.versions) != 1 {
+ t.Errorf("an invalid document: %d versions\n%s", len(s.versions), body)
+ }
+ // Applied, with its note and who.
+ body = post(url.Values{"base": {"1"}, "body": {"guard:\r\n enabled: false\r\n"}, "note": {"maintenance"}})
+ if !strings.Contains(body, "Version 2 is in force") || len(s.versions) != 2 ||
+ s.versions[1].Body != "guard:\n enabled: false\n" || s.versions[1].By != "a@example.com" || s.versions[1].Note != "maintenance" {
+ t.Errorf("applying: %+v\n%s", s.versions, body)
+ }
+ // Made from a version no longer the newest: refused, not overwritten.
+ body = post(url.Values{"base": {"1"}, "body": {"guard:\n enabled: true\n x: 1\n"}})
+ if !strings.Contains(body, "someone changed the settings") || len(s.versions) != 2 {
+ t.Errorf("a stale edit: %d versions\n%s", len(s.versions), body)
+ }
+ // An earlier version is shown, and put back as a new one.
+ if body := mirrorGet(t, mux, "/admin/settings?version=1").Body.String(); !strings.Contains(body, "Put version 1 back in force") {
+ t.Errorf("viewing version 1:\n%s", body)
+ }
+ w := mirrorPost(t, mux, "/admin/settings/rollback", url.Values{"csrf": {"tok"}, "version": {"1"}})
+ if len(s.versions) != 3 || s.versions[2].Body != s.versions[0].Body || !strings.Contains(w.Body.String(), "as version 3") {
+ t.Errorf("rollback: %+v\n%s", s.versions, w.Body.String())
+ }
+ // Without the CSRF token, nothing.
+ if w := mirrorPost(t, mux, "/admin/settings", url.Values{"base": {"3"}, "body": {"a: 1\n"}}); w.Code != http.StatusBadRequest || len(s.versions) != 3 {
+ t.Errorf("no token: %d", w.Code)
+ }
+ // Audited, without the document itself: it can hold secrets.
+ var saw bool
+ for _, e := range sink.events {
+ if strings.Contains(e.Detail, "enabled") {
+ t.Errorf("the document is in the audit log: %+v", e)
+ }
+ if e.Action == "POST /admin/settings" && strings.Contains(e.Detail, "version 2") {
+ saw = true
+ }
+ }
+ if !saw {
+ t.Errorf("no audit line for version 2: %+v", sink.events)
+ }
+}
diff --git a/internal/web/locales/en/nav.json b/internal/web/locales/en/nav.json
index 2c625db..3aa5d08 100644
--- a/internal/web/locales/en/nav.json
+++ b/internal/web/locales/en/nav.json
@@ -10,5 +10,6 @@
"nav.chat": "Chat",
"nav.account": "Account",
"nav.sign_out": "Sign out",
- "nav.docs": "Docs"
+ "nav.docs": "Docs",
+ "nav.settings": "Settings"
}
diff --git a/internal/web/locales/en/settings.json b/internal/web/locales/en/settings.json
new file mode 100644
index 0000000..e22a79d
--- /dev/null
+++ b/internal/web/locales/en/settings.json
@@ -0,0 +1,28 @@
+{
+ "settings.title": "Settings",
+ "settings.sub": "The cluster's settings: everything that is not one machine's own, the same on every control plane, in force within seconds of a change. llmgw ctl config edit edits the same document.",
+ "settings.current": "Version %d, in force",
+ "settings.earlier": "Version %d",
+ "settings.earlier_sub": "An earlier version; version %d is in force. Rolling back keeps this one as a new version, so nothing is lost.",
+ "settings.rollback": "Put version %d back in force",
+ "settings.back_to_current": "back to the version in force",
+ "settings.local_keys": "Not here, because each machine's server.yaml keeps them:",
+ "settings.note": "Why",
+ "settings.note_hint": "kept with the version, for whoever reads the history",
+ "settings.save": "Check and apply",
+ "settings.save_hint": "Checked as a control plane would load it before it is kept; a change made since this page was opened is not overwritten.",
+ "settings.saved": "Version %d is in force; every control plane applies it within seconds.",
+ "settings.rolled_back": "Version %d's settings are back in force, as version %d.",
+ "settings.history": "History",
+ "settings.col.version": "Version",
+ "settings.col.at": "When",
+ "settings.col.by": "By",
+ "settings.col.note": "Why",
+ "settings.in_force": "in force",
+ "settings.view": "view",
+ "settings.no_history": "No versions yet.",
+ "settings.err.unchanged": "Nothing was changed.",
+ "settings.err.invalid": "Not applied: a control plane could not load it.",
+ "settings.err.changed": "Not applied: someone changed the settings since this page was opened. Your edit is below; compare it with the version now in force and apply it again.",
+ "settings.err.no_version": "There is no such version."
+}
diff --git a/internal/web/locales/tr/nav.json b/internal/web/locales/tr/nav.json
index 8b70a3e..23a22fd 100644
--- a/internal/web/locales/tr/nav.json
+++ b/internal/web/locales/tr/nav.json
@@ -10,5 +10,6 @@
"nav.chat": "Sohbet",
"nav.account": "Hesap",
"nav.sign_out": "Çıkış yap",
- "nav.docs": "Belgeler"
+ "nav.docs": "Belgeler",
+ "nav.settings": "Ayarlar"
}
diff --git a/internal/web/locales/tr/settings.json b/internal/web/locales/tr/settings.json
new file mode 100644
index 0000000..559c1a9
--- /dev/null
+++ b/internal/web/locales/tr/settings.json
@@ -0,0 +1,28 @@
+{
+ "settings.title": "Ayarlar",
+ "settings.sub": "Kümenin ayarları: tek bir makineye ait olmayan her şey; her kontrol düzleminde aynı, değiştikten saniyeler sonra yürürlükte. llmgw ctl config edit aynı belgeyi düzenler.",
+ "settings.current": "Sürüm %d, yürürlükte",
+ "settings.earlier": "Sürüm %d",
+ "settings.earlier_sub": "Önceki bir sürüm; yürürlükte olan sürüm %d. Geri almak bunu yeni bir sürüm olarak kaydeder, hiçbir şey kaybolmaz.",
+ "settings.rollback": "%d numaralı sürümü yeniden yürürlüğe koy",
+ "settings.back_to_current": "yürürlükteki sürüme dön",
+ "settings.local_keys": "Burada değil, çünkü her makinenin kendi server.yaml dosyası tutar:",
+ "settings.note": "Neden",
+ "settings.note_hint": "sürümle birlikte saklanır, geçmişi okuyacak kişi için",
+ "settings.save": "Denetle ve uygula",
+ "settings.save_hint": "Saklanmadan önce bir kontrol düzleminin yükleyeceği gibi denetlenir; bu sayfa açıldıktan sonra yapılmış bir değişikliğin üzerine yazılmaz.",
+ "settings.saved": "%d numaralı sürüm yürürlükte; her kontrol düzlemi saniyeler içinde uygular.",
+ "settings.rolled_back": "%d numaralı sürümün ayarları yeniden yürürlükte; yeni sürüm numarası %d.",
+ "settings.history": "Geçmiş",
+ "settings.col.version": "Sürüm",
+ "settings.col.at": "Ne zaman",
+ "settings.col.by": "Kim",
+ "settings.col.note": "Neden",
+ "settings.in_force": "yürürlükte",
+ "settings.view": "görüntüle",
+ "settings.no_history": "Henüz sürüm yok.",
+ "settings.err.unchanged": "Hiçbir şey değiştirilmedi.",
+ "settings.err.invalid": "Uygulanmadı: bir kontrol düzlemi bunu yükleyemezdi.",
+ "settings.err.changed": "Uygulanmadı: bu sayfa açıldıktan sonra biri ayarları değiştirdi. Düzenlemeniz aşağıda; yürürlükteki sürümle karşılaştırıp yeniden uygulayın.",
+ "settings.err.no_version": "Böyle bir sürüm yok."
+}
diff --git a/internal/web/nav.go b/internal/web/nav.go
index 5bf7d08..89c1719 100644
--- a/internal/web/nav.go
+++ b/internal/web/nav.go
@@ -26,6 +26,9 @@ type Nav struct {
Mirror, Quotas bool
// Guard is whether the guardrails page was mounted.
Guard bool
+ // Settings offers the cluster's settings: mounted, and to an
+ // administrator only.
+ Settings bool
// CSRF signs the sign-out form.
CSRF string
// Org offers the organization page: to an administrator, and to anyone
@@ -38,13 +41,14 @@ type navKey struct{}
// navFor builds the menu for a signed-in person.
func (p *AccountPages) navFor(r *http.Request, user store.User, current string) Nav {
n := Nav{
- Current: current,
- Admin: user.Staff(),
- Role: user.StaffRole(),
- Mirror: p.hasMirror,
- Quotas: p.hasQuotas,
- Guard: p.hasGuard,
- CSRF: csrfFor(r),
+ Current: current,
+ Admin: user.Staff(),
+ Role: user.StaffRole(),
+ Mirror: p.hasMirror,
+ Quotas: p.hasQuotas,
+ Guard: p.hasGuard,
+ Settings: p.hasSettings && user.IsAdmin,
+ CSRF: csrfFor(r),
}
// Only when there is an organization to show: a link that leads to "there
// are none" on every page is noise.
diff --git a/internal/web/static/base.css b/internal/web/static/base.css
index 8df6313..b41a396 100644
--- a/internal/web/static/base.css
+++ b/internal/web/static/base.css
@@ -905,3 +905,13 @@ a.sel-link.small { font-size: .78rem; color: var(--muted); margin-left: .4rem; }
/* The language switcher at the foot of every page. */
.langs a { color: var(--muted); }
.langs b { font-weight: 600; }
+
+/* The cluster's settings, edited as the YAML document they are. */
+.settings-form textarea, pre.settings-body {
+ width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+ font-size: .85rem; line-height: 1.4; padding: .6rem .7rem; border: 1px solid var(--line);
+ border-radius: 6px; background: var(--card); color: var(--fg); tab-size: 2; overflow-x: auto;
+}
+.settings-form label { display: block; margin: .8rem 0; }
+.settings-form input[type=text] { width: 100%; box-sizing: border-box; }
+.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
diff --git a/internal/web/templates/admin_settings.html b/internal/web/templates/admin_settings.html
new file mode 100644
index 0000000..1f97d61
--- /dev/null
+++ b/internal/web/templates/admin_settings.html
@@ -0,0 +1,50 @@
+{{define "admin_settings"}}
+
{{th "settings.sub"}}
+ {{template "nav" .Nav}} +{{.Error}}
{{end}} +{{if .Notice}}{{.Notice}}
{{end}} + +{{if .Earlier}} +{{t "settings.earlier_sub" .Current.Version}}
+{{.Body}}
+
+{{else}}
+{{t "settings.local_keys"}} {{range $i, $k := .LocalKeys}}{{if $i}}, {{end}}{{$k}}{{end}}.
| {{t "settings.col.version"}} | {{t "settings.col.at"}} | {{t "settings.col.by"}} | {{t "settings.col.note"}} | |
|---|---|---|---|---|
| {{.Version}} | {{.At}} | {{.By}} | {{.Note}} | +{{if .InForce}}{{t "settings.in_force"}}{{else}}{{t "settings.view"}}{{end}} | +
{{t "settings.no_history"}}
{{end}} + +