English
admin — Admin API and dashboard
Where the Admin API and dashboard listen and who can log in to them. sing-box does not have this section: it is an ours extension.
yaml
admin:
listen: 127.0.0.1:9090
users:
- username: admin
password_hash: "$argon2id$v=19$m=19456,t=2,p=1$…"
- username: prometheus
password_hash: "$argon2id$v=19$m=19456,t=2,p=1$…"
role: metrics| Field | What it sets |
|---|---|
listen | The Admin API address, as with ours run --dashboard: loopback IP:port only. The flag, if given, takes precedence. Without either, the Admin API is off |
users | Who logs in with HTTP Basic. Empty: log in with the random token printed at startup |
User fields:
| Field | What it sets |
|---|---|
username | The name; without colons and control characters, not repeated |
password_hash | An argon2id password hash in PHC format: $argon2id$v=19$m=…,t=…,p=…$salt$hash. Made by ours generate password-hash (CLI) |
role | admin (default) — the dashboard and the whole API; metrics — only GET /api/v1/metrics |
Checks at load time, with the location:
- a
passwordfield is an error: the password is not stored in the configuration, only the hash; - a hash that is not argon2id (
$2b$…,$argon2i$…, plain text), or a version other thanv=19, is an error; mbelow 19456 KiB ortbelow 2 is a "too weak" error with the minimum values (the OWASP recommendation;ours generate password-hashmakes such a hash);- a non-local
listenis an error with advice aboutssh -L.
check --view replaces password_hash with REDACTED, like the other secrets.
Reload
New users apply immediately on SIGHUP, --watch and applying from the dashboard; remembered password checks are forgotten. A new listen too: the process listens on the new address instead of the old one. Turning the Admin API on or off as a whole takes a restart; the reload writes a warning about it. The section does not affect the proxy components: a reload because of it rebuilds nothing.