vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Summarize accounts, activity, and configuration on the Admin overview
0db980ee6b820127a0310be661b5d2c98fcdde92 · Keenan Nemetz · 4d ago · parent 43e681d8
Summarize accounts, activity, and configuration on the Admin overview The overview is the whole admin surface at a glance now, so it repeats the head of the other tabs: active people, bots, instance admins, and retired accounts from the roster; the newest audit records with their detail and a link into the log; and the configuration warnings, including a browser that cannot sign anyone in. Refs #198 (01M6MK0NNZ2XR1D5TQKNWYT4HN).
server/web/status.go +32
| @@ -122,6 +122,12 @@ func (w *Web) fillStatusView(view *adminPageView) { | |||
| 122 | 122 | } else { | |
| 123 | 123 | view.Views.Disabled = true | |
| 124 | 124 | } | |
| 125 | |||
| 126 | // The overview is the whole admin surface at a glance, so it repeats the | ||
| 127 | // head of the other tabs rather than making the reader visit each one. | ||
| 128 | view.AccountSummary = w.accountSummary() | ||
| 129 | view.RecentAudit = w.recentAudit() | ||
| 130 | view.ConfigWarnings = w.configWarnings() | ||
| 125 | 131 | } | |
| 126 | 132 | if tab == "storage" || tab == "overview" { | |
| 127 | 133 | if w.Cfg != nil { | |
| @@ -155,6 +161,32 @@ func (w *Web) fillStatusView(view *adminPageView) { | |||
| 155 | 161 | } | |
| 156 | 162 | } | |
| 157 | 163 | ||
| 164 | // configWarnings collects the configuration settings worth a second look: a | ||
| 165 | // development-only switch, or a browser that cannot sign anyone in. The full | ||
| 166 | // configuration tab lists every value; this is only what would surprise an | ||
| 167 | // operator reading the overview. | ||
| 168 | func (w *Web) configWarnings() []statusSetting { | ||
| 169 | var out []statusSetting | ||
| 170 | if w.Auth == nil || !w.Auth.Enabled() { | ||
| 171 | note := "" | ||
| 172 | if w.Auth != nil { | ||
| 173 | note = w.Auth.Disabled | ||
| 174 | } | ||
| 175 | out = append(out, statusSetting{Key: "browser sign-in", Value: "disabled", Note: note, Warn: true}) | ||
| 176 | } | ||
| 177 | if w.Cfg == nil { | ||
| 178 | return out | ||
| 179 | } | ||
| 180 | for _, group := range w.statusConfig().Groups { | ||
| 181 | for _, setting := range group.Settings { | ||
| 182 | if setting.Warn { | ||
| 183 | out = append(out, setting) | ||
| 184 | } | ||
| 185 | } | ||
| 186 | } | ||
| 187 | return out | ||
| 188 | } | ||
| 189 | |||
| 158 | 190 | func (w *Web) instanceStats() (storage.Stats, error, statusLFSView) { | |
| 159 | 191 | c := &w.statusCache | |
| 160 | 192 | c.mu.Lock() | |