cb8491c200
Tests · Go / test (push) Successful in 1m59s
Consolidate the operator console and the observability / captured-mail UIs behind a single Basic Auth gate, so one password (the admin-console account, dev: gm/gm-dev-password) unlocks all three, with links in the console nav: - Caddyfile.dev: a single basic_auth on /_gm/* fronts nested routes — /_gm/grafana/ -> Grafana, /_gm/mailpit/ -> Mailpit, catch-all -> the gateway/backend console. Caddy forwards the same Authorization header, which the backend console also accepts, so there is one prompt. The former top-level /grafana/ and /mailpit/ routes are removed. - Grafana: served under /_gm/grafana/ (sub-path) as anonymous Admin with the login form and basic auth disabled, so it relies solely on the /_gm gate and ignores the forwarded credentials. - Mailpit: MP_WEBROOT=/_gm/mailpit (and the healthcheck path) so its UI lives under the gate. - Operator console: add Grafana and Mailpit links to the nav.
31 lines
1.1 KiB
Go Template
31 lines
1.1 KiB
Go Template
{{define "layout" -}}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
<title>{{.Title}} · Galaxy GM</title>
|
|
<link rel="stylesheet" href="/_gm/assets/console.css">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<span class="brand">Galaxy · GM</span>
|
|
<nav class="mainnav">
|
|
<a href="/_gm/"{{if eq .ActiveNav "dashboard"}} class="active"{{end}}>Dashboard</a>
|
|
<a href="/_gm/users"{{if eq .ActiveNav "users"}} class="active"{{end}}>Users</a>
|
|
<a href="/_gm/games"{{if eq .ActiveNav "games"}} class="active"{{end}}>Games</a>
|
|
<a href="/_gm/operators"{{if eq .ActiveNav "operators"}} class="active"{{end}}>Operators</a>
|
|
<a href="/_gm/mail"{{if eq .ActiveNav "mail"}} class="active"{{end}}>Mail</a>
|
|
<a href="/_gm/grafana/" target="_blank" rel="noopener">Grafana</a>
|
|
<a href="/_gm/mailpit/" target="_blank" rel="noopener">Mailpit</a>
|
|
</nav>
|
|
<span class="who">{{.Username}}</span>
|
|
</header>
|
|
<main class="content">
|
|
{{template "content" .}}
|
|
</main>
|
|
</body>
|
|
</html>
|
|
{{- end}}
|