Serve admin console only on dedicated port

This commit is contained in:
admin committed 2026-10-26 07:11:59 +01:00
1 parent 240c278621
commit fbec6694df
8 files changed
+140 -20

No files matched your search

+4 -2
View File
@@ -67,7 +67,7 @@ Set `METRICS_BEARER_TOKEN` to a random value of at least 32 characters to enable
### Local admin console
The admin console is a read-only status, bucket, and performance view at `http://127.0.0.1:9000/_objectstore/admin/`. It lists buckets, navigates object prefixes, and shows object metadata and bucket access settings. The object-size chart and counts cover only the current page of a listing. The performance view samples every three seconds while visible and graphs S3 request rate, inbound and outbound body bytes, process CPU, and memory. It also shows GC collections. Admin requests and health checks are excluded from those S3 rates, and chart history lives only in the browser tab. RSS is read from Linux when available; otherwise the memory card shows JVM heap plus non-heap usage. This view does not require the separate Prometheus token. It is disabled by default and uses a separate password, not an S3 access key. Its Biscuit widgets are bundled with the image under the MIT license in `admin-ui/LICENSE.Biscuit`. To enable it for the local Compose stack:
The admin console is a read-only status, bucket, and performance view at `http://127.0.0.1:9001/_objectstore/admin/`. It lists buckets, navigates object prefixes, and shows object metadata and bucket access settings. The object-size chart and counts cover only the current page of a listing. The performance view samples every three seconds while visible and graphs S3 request rate, inbound and outbound body bytes, process CPU, and memory. It also shows GC collections. Admin requests and health checks are excluded from those S3 rates, and chart history lives only in the browser tab. RSS is read from Linux when available; otherwise the memory card shows JVM heap plus non-heap usage. This view does not require the separate Prometheus token. It is disabled by default and uses a separate password, not an S3 access key. Its Biscuit widgets are bundled with the image under the MIT license in `admin-ui/LICENSE.Biscuit`. To enable it for the local Compose stack:
```sh
mkdir -p secrets
@@ -80,7 +80,9 @@ docker compose -f compose.yaml -f compose.admin.yaml up -d --build
Read the generated password from `secrets/admin-password` on the host to sign in. The directory is private to your host account, while the file is readable by the container's unprivileged user through a read-only mount. The file is ignored by Git. The password must be at least 16 bytes. Sessions expire after 30 minutes, and five failed logins from one peer pause further attempts for five minutes. A restart clears all sessions. Do not reuse the S3 secret.
The console accepts only loopback Host values by default, including if the S3 port is accidentally published on a wider interface. For access through a reverse proxy, set `ADMIN_UI_ORIGIN` to the exact external HTTPS origin, preserve its Host header, and terminate TLS at the proxy. HTTP access through a remote origin is not supported. The password is still required behind the loopback binding or proxy; neither is an authentication mechanism. The console does not grant access to S3 operations.
The admin Compose overlay maps host port 9001 to a separate admin-only listener, bound to loopback by default. Admin paths return 404 on the S3 port; S3 paths return 404 on the admin port. The console accepts only loopback Host values by default, including if a port is accidentally published on a wider interface. For access through a reverse proxy, set `ADMIN_UI_ORIGIN` to the exact external HTTPS origin, preserve its Host header, and terminate TLS at the proxy.
For a private VPN interface, set `ADMIN_UI_BIND_IP` to that interface's private IPv4 address and `ADMIN_UI_PRIVATE_ORIGIN` to `http://<that-address>:9001`. The origin must use an RFC 1918 IPv4 address and an explicit port; the console then accepts only that Host value. The VPN must encrypt traffic and restrict who can reach the port. Do not publish this HTTP port on the public internet. The password is still required, and the admin listener does not accept S3 operations.
For a bounded local write baseline, run `python3 scripts/benchmark-writes.py --requests 100 --concurrency 8 --size 4096` with `S3_ACCESS_KEY` and `S3_SECRET_KEY` in the environment. It writes under a unique `benchmark/` prefix and deletes successful objects afterward. Results depend on CPU, disks, network, connection reuse, and durability settings; a laptop number does not predict another server. Run a mixed upload/download workload before changing concurrency or public limits.