home-hosted 0.9.11 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +80 -1
- package/README.md +234 -114
- package/dist/cli.js +2464 -381
- package/dist/cli.js.map +1 -1
- package/docs/NOTIFICATIONS.md +19 -0
- package/docs/RESTORE_DEMO.md +21 -4
- package/docs/REVERSE_PROXY.md +23 -4
- package/docs/SERVERS.md +98 -7
- package/docs/UI_CREATION.md +26 -4
- package/docs/demo/blank-host-restore.sh +4 -5
- package/package.json +1 -2
- package/uis/stock/dist/assets/de-Dy66GhJ0.js +1 -0
- package/uis/stock/dist/assets/es-DV-Sq6ZE.js +1 -0
- package/uis/stock/dist/assets/fr-DgypPCaQ.js +1 -0
- package/uis/stock/dist/assets/index-Cok5msAO.css +2 -0
- package/uis/stock/dist/assets/{index-CB6K3K2b.js → index-Dm3f5Ssr.js} +12 -12
- package/uis/stock/dist/assets/ja-BckgJ7ql.js +1 -0
- package/uis/stock/dist/assets/ko-B4wj7dOk.js +1 -0
- package/uis/stock/dist/assets/ru-jU0fytv4.js +1 -0
- package/uis/stock/dist/assets/vi-DG3AWtuR.js +1 -0
- package/uis/stock/dist/assets/zh-CN-Bk5kP2q-.js +1 -0
- package/uis/stock/dist/index.html +2 -2
- package/uis/stock/dist/ui.json +3 -3
- package/uis/stock/dist/assets/de-BP4HfMC9.js +0 -1
- package/uis/stock/dist/assets/es-Cehmpy7G.js +0 -1
- package/uis/stock/dist/assets/fr-DN3eC8Ey.js +0 -1
- package/uis/stock/dist/assets/index-DGtvgCsU.css +0 -2
- package/uis/stock/dist/assets/ja-CYAuNjfG.js +0 -1
- package/uis/stock/dist/assets/ko-wQEmDRMK.js +0 -1
- package/uis/stock/dist/assets/ru-BtbhojJ0.js +0 -1
- package/uis/stock/dist/assets/vi-BfUCVFk_.js +0 -1
- package/uis/stock/dist/assets/zh-CN-DEhi0m5s.js +0 -1
package/README.md
CHANGED
|
@@ -228,9 +228,12 @@ curl -N -H "Authorization: Bearer hh_9uA2…" 'http://127.0.0.1:3999/api/servers
|
|
|
228
228
|
home-hosted status --json # machine-readable: running, liveness, degraded, pid, url, paths
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
-
A token has the same authority as a signed-in browser and outlives restarts
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
A token has the same authority as a signed-in browser and outlives restarts, with two exceptions:
|
|
232
|
+
it may not clear the panel password, and it may not restore an archive that carries the panel's own
|
|
233
|
+
credentials — both of which would end with the panel armed by whoever holds the token. Treat a token
|
|
234
|
+
as a password: rotate it with `set-token --generate` if it may have leaked, and see
|
|
235
|
+
[Security](#-security) for the rest. Workspace-scoped routes take `?workspace=<id>`; omitting it
|
|
236
|
+
means the panel's default workspace.
|
|
234
237
|
|
|
235
238
|
<details>
|
|
236
239
|
<summary><b>🌐 The endpoints worth knowing</b></summary>
|
|
@@ -240,7 +243,7 @@ default workspace.
|
|
|
240
243
|
| `GET /api/state` | the full snapshot: global settings, every workspace with its servers, host vitals | ❌ |
|
|
241
244
|
| `GET`/`POST /api/workspaces`, `PATCH`/`DELETE /api/workspaces/:id` | the registry: list, create, rename, remove | ❌ |
|
|
242
245
|
| `GET /api/events` | SSE: the live state, plus logs (`?logs=0`, `?serverId=…`; a `server` payload carries its `workspaceId`) | ❌ |
|
|
243
|
-
| `GET`/`POST /api/servers`, `POST /api/servers/start-all`, `POST /api/servers/stop-all` | that workspace's entries, and its lifecycle for all of them | ✅ |
|
|
246
|
+
| `GET`/`POST /api/servers`, `POST /api/servers/start-all`, `POST /api/servers/stop-all` | that workspace's entries, and its lifecycle for all of them (`?withPersistent=true` ends the entries that outlive the panel) | ✅ |
|
|
244
247
|
| `GET`/`PATCH`/`DELETE /api/servers/:id`, `PUT /api/servers/:id` | one entry — `PUT` creates or replaces it, so a re-run converges | ✅ |
|
|
245
248
|
| `POST /api/servers/:id/{start,stop,restart}`, `POST /api/servers/:id/free-port` | one entry's lifecycle, and freeing its port | ✅ |
|
|
246
249
|
| `GET /api/servers/:id/logs`, `GET /api/servers/:id/stream` | that entry's buffered lines, and its SSE | ✅ |
|
|
@@ -262,16 +265,29 @@ default workspace.
|
|
|
262
265
|
`hh_host_load1_per_cpu` beside it is a **count of runnable tasks per core**, not a percentage:
|
|
263
266
|
`1.0` means one core's worth of work waiting, so it is fine on a busy box and not comparable with the
|
|
264
267
|
percentage above. A host gauge appears only once the host has been sampled, so a series that is
|
|
265
|
-
*absent* means "no reading", never "zero": do not let a dashboard fill that in. `
|
|
268
|
+
*absent* means "no reading", never "zero": do not let a dashboard fill that in. `hh_server_restarts`
|
|
266
269
|
counts the retry attempts spent on a server's **current** crash sequence and drops back to `0` when
|
|
267
270
|
someone starts it, so it is a state, not a counter to `rate()` — `hh_server_crashes_24h` is the one
|
|
268
|
-
that only grows within its window.
|
|
271
|
+
that only grows within its window. No series here is a Prometheus counter: every one is a snapshot a
|
|
272
|
+
stop, a delete or a manual start can lower, so no name ends in `_total`.
|
|
273
|
+
|
|
274
|
+
> **Upgrading from 0.9.x — a dashboard needs one edit.** The series formerly named
|
|
275
|
+
> `hh_server_restarts_total` is now `hh_server_restarts` (a gauge, unchanged in meaning and labels).
|
|
276
|
+
> It was never a valid counter: a start you asked for reset it to `0`, so `rate()` reported a phantom
|
|
277
|
+
> counter reset. Replace every query on `hh_server_restarts_total` with `hh_server_restarts`, and use
|
|
278
|
+
> the gauge directly (`hh_server_restarts > 2`) rather than `rate()`/`increase()`. The count series
|
|
279
|
+
> `hh_servers_total` is now `hh_servers` for the same reason. Old dashboards will show *no data*
|
|
280
|
+
> for those two series after the upgrade — the panel publishes neither old name.
|
|
269
281
|
|
|
270
282
|
`GET /openapi/spec.json` describes all of it, `/openapi/ui` is the browsable version, and every error
|
|
271
283
|
comes back as one envelope (`{ message, code, detail }`) with a stable `code` a tool can branch on. The
|
|
272
284
|
document declares its own `securitySchemes` (`bearerAuth`), every documented 2xx carries a schema, and
|
|
273
285
|
each operation is tagged — so `openapi-typescript`, `openapi-generator` or a docs renderer can generate
|
|
274
|
-
a working client without hand-written glue.
|
|
286
|
+
a working client without hand-written glue. `/openapi/ui` builds its route index from the spec itself, so
|
|
287
|
+
it stays readable on a box with no internet; the richer interactive browser it also offers is fetched
|
|
288
|
+
from a **version-pinned** CDN and is optional — the plain index is what you get when that CDN is
|
|
289
|
+
unreachable. Scalar's bundle does render offline when self-hosted, but it is 4.9 MB, so the index is the
|
|
290
|
+
cheaper trade for a panel that ships no other web assets.
|
|
275
291
|
|
|
276
292
|
</details>
|
|
277
293
|
|
|
@@ -296,24 +312,24 @@ can be told what to be: *"Help me build a UI for home-hosted: nostalgic game the
|
|
|
296
312
|
|
|
297
313
|
| | |
|
|
298
314
|
| --- | --- |
|
|
299
|
-
| 🗂 **Workspaces** | One panel, many scopes
|
|
315
|
+
| 🗂 **Workspaces** | One panel, many scopes. A workspace owns its servers, secrets, logs and settings; listener, auth, backups, TLS and UI stay panel-wide in **Global settings**. |
|
|
300
316
|
| 🚦 **Lifecycle** | Start, stop, restart from the panel or the API; `autostart` entries come up with it. A process left behind by a renamed or removed entry is listed on **Servers** with a stop button, instead of running invisible. |
|
|
301
|
-
| 📝 **Hand edits welcome** |
|
|
317
|
+
| 📝 **Hand edits welcome** | Edit `servers.config.json` in an editor or a `git checkout` — the panel notices in seconds, no restart. A file it cannot read is reported, and running servers are left alone. |
|
|
302
318
|
| ♻️ **Auto-restart** | Exponential backoff on crash, with the counter reset once a process stays up. The budget is remembered across a restart of the panel. |
|
|
303
|
-
| 🩺 **Health that acts** | TCP or HTTP probes per server: warn
|
|
319
|
+
| 🩺 **Health that acts** | TCP or HTTP probes per server: warn, then force a restart — bounded by the same retry budget as a crash, so a sick entry stops instead of looping. Ports are checked before starting, and a program that [restarts itself](./docs/SERVERS.md#when-a-program-restarts-itself) can be followed or replaced. |
|
|
304
320
|
| 🔗 **Ordered startup** | `dependsOn` waits for a dependency to be *healthy* — not merely spawned. `stop-all`/`down` stop dependents before their dependencies; stopping one server names the dependents it leaves running. [SERVERS.md](./docs/SERVERS.md#field-reference) |
|
|
305
|
-
| 📜 **Logs** | Live per-server stream, buffer plus rotated files on disk, search, filter to one stream, download, one click to clear. |
|
|
306
|
-
| 📈 **Resources** | CPU and RSS
|
|
307
|
-
| 🌡️ **Host vitals** | CPU usage, memory, swap, disk and CPU temperature, plus the load average as a per-cpu count, with thresholds that notify once and again on recovery. |
|
|
321
|
+
| 📜 **Logs** | Live per-server stream, buffer plus rotated files on disk, search, filter to one stream, download, one click to clear. `Keep rotated files` in **Workspace Settings** bounds the directory, and the search reads every rotation it keeps — lowering it deletes the extras. |
|
|
322
|
+
| 📈 **Resources** | CPU and RSS per process tree — the summed containers for a compose entry — with an optional memory ceiling that restarts the entry. Stopping a compose entry stops its containers even when the wrapper is gone, and says so if one survives. [SERVERS.md](./docs/SERVERS.md#docker-and-compose) |
|
|
323
|
+
| 🌡️ **Host vitals** | CPU usage, memory, swap, disk and CPU temperature, plus the load average as a per-cpu count, with thresholds that notify once and again on recovery. Where the OS exposes no sensor — a WSL2 guest above all — the tile says `n/a`; [set a temperature command](./docs/SERVERS.md#cpu-temperature-where-the-os-exposes-none) to supply the reading (the guide includes a WSL2 setup). |
|
|
308
324
|
| 🤖 **Token API** | Scripts and agents drive it with `Authorization: Bearer` — no browser, no session. [↑](#-agents-scripts-and-tools) |
|
|
309
|
-
| 🔔 **Notifications** |
|
|
325
|
+
| 🔔 **Notifications** | Telegram and webhooks (ntfy, Discord, Slack, anything) on crash, unhealthy, recovery, host thresholds and DNS changes. Toggles and throttle set once; each destination inherits or overrides. [Setup](./docs/NOTIFICATIONS.md). |
|
|
310
326
|
| 🌐 **Dynamic DNS** | Keep hostnames pointed at your public IP — Cloudflare, Namecheap, Spaceship, Porkbun, GoDaddy, Gandi and more. [DDNS.md](./docs/DDNS.md) |
|
|
311
|
-
| 🔀 **Reverse proxy** | One engine in front of everything, with automatic HTTPS: `git.example.com` → a Gitea entry, `
|
|
312
|
-
| 💾 **Backups** |
|
|
313
|
-
| 🌍 **Nine languages** | English, Vietnamese, Chinese, Japanese, Spanish, Korean, Russian, French, German — picked on the login page or in **Global settings → Language**, kept per browser. |
|
|
327
|
+
| 🔀 **Reverse proxy** | One Caddy engine in front of everything, with automatic HTTPS: `git.example.com` → a Gitea entry, `panel.example.com` → the panel itself. Installed and supervised by it. [Details](./docs/REVERSE_PROXY.md) |
|
|
328
|
+
| 💾 **Backups** | One `.zip` of the panel and the workspaces you pick — plain or AES-256, picked per item, from the panel or the CLI. [Details](#-backups). |
|
|
329
|
+
| 🌍 **Nine languages** | English, Vietnamese, Chinese, Japanese, Spanish, Korean, Russian, French, German — picked on the login page or in **Global settings → Language**, kept per browser. Action toasts included. The NOC console ships English-only on purpose; its density is the point. |
|
|
314
330
|
| 🎨 **BYOU — Bring Your Own UI** | Upload a static build, `ui-update` to follow its releases, `ui-revert` to go back. [UI_CREATION.md](./docs/UI_CREATION.md) |
|
|
315
331
|
| 🔐 **Security** | Cookie sessions, API tokens, scrypt hashes, per-IP lockout, optional TLS, and a refusal to expose itself without a password. |
|
|
316
|
-
| 🧩 **Bring any program** | A server is `command
|
|
332
|
+
| 🧩 **Bring any program** | A server is a `command`, its args and a working directory — plus optional `dataEnvs`, `dependsOn` and `dump`/`load` hooks. Presets fill the form; nothing requires one. [Fields](./docs/SERVERS.md) |
|
|
317
333
|
| 🖥 **Cross-platform** | Linux, macOS and Windows: `/proc`, `ps` or Win32_Process, process groups or `taskkill /T`, no shell dependencies. |
|
|
318
334
|
|
|
319
335
|
---
|
|
@@ -372,14 +388,15 @@ restarts itself), and how hand-edits are validated: [SERVERS.md](./docs/SERVERS.
|
|
|
372
388
|
| command | |
|
|
373
389
|
| --- | --- |
|
|
374
390
|
| `home-hosted up` | start the panel detached, and keep it alive in the background |
|
|
375
|
-
| `home-hosted down` | stop it cleanly — supervised processes included, persistent entries left running |
|
|
376
|
-
| `home-hosted restart` | `down`, then `up` — or `restart <id>` to restart one server, leaving the panel up |
|
|
377
|
-
| `home-hosted status` | pid, URL, health, uptime, state and log paths
|
|
378
|
-
| `home-hosted start <id>` | start one server in the default workspace — and anything it `dependsOn` (`--workspace <id>`) |
|
|
391
|
+
| `home-hosted down` | stop it cleanly — supervised processes included, [persistent entries](./docs/SERVERS.md#persistent-entries) left running (`--with-persistent` stops those too) |
|
|
392
|
+
| `home-hosted restart` | `down`, then `up` — or `restart <id>` to restart one server, leaving the panel up (`--with-persistent` restarts the persistent entries as well) |
|
|
393
|
+
| `home-hosted status` | pid, URL, health, uptime, state and log paths (`--json` for scripts). Edge cases are under [what `status` tells you](#-cli). |
|
|
394
|
+
| `home-hosted start <id>` | start one server in the default workspace — and anything it `dependsOn` (`--workspace <id>`). `--free-port` frees the port first, then starts |
|
|
379
395
|
| `home-hosted stop <id>` | stop one server, nothing else (`--workspace <id>`) |
|
|
396
|
+
| `home-hosted free-port <id>` | ask whatever holds that server's port to stop — the panel's **Free port** button. Anything this panel supervises is refused, not signalled (`--workspace <id>`) |
|
|
380
397
|
| `home-hosted restart <id>` | restart one server, nothing else (`--workspace <id>`) — the same as the panel's per-server Restart |
|
|
381
398
|
| `home-hosted logs` | read the panel's own console output — the file `up` redirects it into (`--lines`, `--follow`, `--json`) |
|
|
382
|
-
| `home-hosted backup` | list, create or restore an archive
|
|
399
|
+
| `home-hosted backup` | list, create or restore an archive — **without the panel running** (`--password`, `--include`, `--exclude`). See [Backups](#-backups) and [RESTORE_DEMO.md](./docs/RESTORE_DEMO.md) |
|
|
383
400
|
| `home-hosted set-password` | set the panel password without opening a browser; a running panel picks it up at once and signs every existing session out |
|
|
384
401
|
| `home-hosted set-token` | set the API token scripts and agents use (`--generate`, `--clear`) |
|
|
385
402
|
| `home-hosted migrate` | bring every config up to the schema this release understands (`--dry-run`, `--yes`) |
|
|
@@ -396,12 +413,12 @@ restarts itself), and how hand-edits are validated: [SERVERS.md](./docs/SERVERS.
|
|
|
396
413
|
```text
|
|
397
414
|
up -p/--port --host --open --no-autostart --foreground --print-config
|
|
398
415
|
|
|
399
|
-
down
|
|
416
|
+
down --with-persistent
|
|
400
417
|
status --json
|
|
401
418
|
logs --lines <n> --follow --json
|
|
402
|
-
backup [list|create|restore] [<name>] (--include <ids> | --all) [--exclude <ids>] --password --confirm --json
|
|
419
|
+
backup [list|create|restore] [<name> | --from <path>] (--include <ids> | --all) [--exclude <ids>] --password --confirm --json
|
|
403
420
|
start, stop <id> [-w/--workspace <id>] (both need the panel up)
|
|
404
|
-
restart [<id>] [-w/--workspace <id>] (no id: the panel; with one: that server)
|
|
421
|
+
restart [<id>] [-w/--workspace <id>] [--with-persistent] (no id: the panel; with one: that server)
|
|
405
422
|
init --dir --name --pm --no-install -y/--yes
|
|
406
423
|
set-password --clear
|
|
407
424
|
set-token --generate --clear
|
|
@@ -447,6 +464,24 @@ or a config whose schema is newer than the running release stops `up` with the e
|
|
|
447
464
|
than starting with defaults that quietly differ from your file. Fix the file, or install the release
|
|
448
465
|
that wrote it.
|
|
449
466
|
|
|
467
|
+
### Two things `migrate` cannot fix
|
|
468
|
+
|
|
469
|
+
`migrate` moves a config file. Two changes in this release are *outside* the config, so read these
|
|
470
|
+
before upgrading — a stale one fails quietly, which is the worst way to fail.
|
|
471
|
+
|
|
472
|
+
**A dashboard on `/api/metrics`.** Two series were renamed in the release that made every metric
|
|
473
|
+
honest about being a gauge: `hh_server_restarts_total` is now `hh_server_restarts`, and
|
|
474
|
+
`hh_servers_total` is now `hh_servers`. The old names are not published, so a query still on one
|
|
475
|
+
shows *no data* rather than a stale number. Compare the gauge directly (`hh_server_restarts > 2`);
|
|
476
|
+
do not wrap it in `rate()`/`increase()`, because a start you asked for resets it.
|
|
477
|
+
|
|
478
|
+
**A script that holds only an API token.** Three operations now require a signed-in session, because
|
|
479
|
+
each would otherwise let a stolen token end up holding the panel: clearing the password, switching
|
|
480
|
+
authentication off, and restoring an archive that carries `global:secrets`. Each answers 403
|
|
481
|
+
`SESSION_REQUIRED`. Scripts should either sign in first, pass `--exclude global:secrets` to a
|
|
482
|
+
restore, or run the command on the machine (`home-hosted set-password --clear`,
|
|
483
|
+
`home-hosted backup restore`, which both go through the local channel).
|
|
484
|
+
|
|
450
485
|
### Coming from 0.6.x
|
|
451
486
|
|
|
452
487
|
**Install the latest 0.7.x first, and run it once.** 0.7.0 moved all state from `$HHOSTED_HOME` itself
|
|
@@ -460,42 +495,110 @@ the move on its first run; 0.8.0 then starts against the result.
|
|
|
460
495
|
|
|
461
496
|
</details>
|
|
462
497
|
|
|
498
|
+
<details>
|
|
499
|
+
<summary><b>🤔 What <code>status</code> tells you when things are not simple</b></summary>
|
|
500
|
+
|
|
501
|
+
`home-hosted status` prints the panel's console path *and* the per-server log directory, naming the
|
|
502
|
+
`<id>.log` convention once logs exist.
|
|
503
|
+
|
|
504
|
+
`--json` is for scripts. A stopped panel answers `{ running: false, initialised }` —
|
|
505
|
+
`initialised: false` means nothing was ever set up in this state directory — plus `liveness`:
|
|
506
|
+
|
|
507
|
+
| `liveness` | Means |
|
|
508
|
+
| --- | --- |
|
|
509
|
+
| `alive` | the recorded pid is this panel |
|
|
510
|
+
| `gone` | it is not running; the record is stale and may be cleared |
|
|
511
|
+
| `recycled` | the OS has handed the recorded pid to **another** process. The record is stale, but a signal would hit a stranger, so only the token-authenticated shutdown touches it |
|
|
512
|
+
|
|
513
|
+
Piping a command into `head`, `grep -q` or anything that stops reading early is ordinary shell and it
|
|
514
|
+
works: the command exits **0**, not with a broken-pipe error, so `set -o pipefail` stays happy.
|
|
515
|
+
|
|
516
|
+
`--json` writes one document to stdout on success and nothing to stdout on a refusal — the reason, and
|
|
517
|
+
any list it explains, go to stderr, so a script can parse stdout without filtering prose out of it.
|
|
518
|
+
|
|
519
|
+
</details>
|
|
520
|
+
|
|
463
521
|
---
|
|
464
522
|
|
|
465
523
|
## 🔐 Security
|
|
466
524
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
525
|
+
**Safe out of the box.** The panel answers on `127.0.0.1` only. It will not listen anywhere else —
|
|
526
|
+
not while the password is still the default one, not without a password, not with authentication
|
|
527
|
+
switched off — and a proxy route pointing back at the panel answers to the same rule. Nothing is
|
|
528
|
+
exposed until you decide it should be.
|
|
529
|
+
|
|
530
|
+
One setting only warns: turning on **trust a proxy from any peer** while the panel is also exposed
|
|
531
|
+
weakens the login lockout, and the panel says so at startup rather than refusing, because a proxy on
|
|
532
|
+
another machine is a legitimate setup.
|
|
533
|
+
|
|
534
|
+
<details>
|
|
535
|
+
<summary><b>🛡️ The three things you actually have to do</b></summary>
|
|
536
|
+
|
|
537
|
+
1. **Set your own password before you expose it.** Change it, then bind to `lan` — in the UI, in the
|
|
538
|
+
config, or with `--host lan`. All three go through the same check.
|
|
539
|
+
2. **Treat an API token like the password.** It works as you, it survives restarts, and changing the
|
|
540
|
+
password does *not* revoke it. If one may have leaked, rotate it: `set-token --generate`.
|
|
541
|
+
3. **If you forget the password, clear it from the machine.** `home-hosted set-password --clear`
|
|
542
|
+
edits the secrets file directly, so it needs no login — that is the way back in. Signed in, the
|
|
543
|
+
same thing is *Global settings → Authentication → Clear password*.
|
|
544
|
+
|
|
545
|
+
</details>
|
|
546
|
+
|
|
547
|
+
<details>
|
|
548
|
+
<summary><b>🔍 The details — sessions, tokens, secrets on disk, proxies</b></summary>
|
|
549
|
+
|
|
550
|
+
**Sessions.** Kept in memory only, never on disk. The cookie is `HttpOnly` and `SameSite=Strict`, and
|
|
551
|
+
it is an **idle** timeout: every request slides both the session and the cookie, so a panel in regular
|
|
552
|
+
use stays signed in while one left alone signs out. Repeated login failures lock out per IP — see
|
|
553
|
+
*behind a proxy* below for when that is advisory.
|
|
554
|
+
|
|
555
|
+
**Tokens.** `home-hosted set-token --generate` prints one once and stores only its SHA-256 hash;
|
|
556
|
+
`set-token --clear` revokes it. Three operations need a signed-in session rather than a token, because
|
|
557
|
+
each would otherwise let a stolen token end up holding the panel:
|
|
558
|
+
|
|
559
|
+
| Operation | Instead |
|
|
560
|
+
| --- | --- |
|
|
561
|
+
| clearing the password | sign in, or `set-password --clear` on the machine |
|
|
562
|
+
| switching authentication off | sign in |
|
|
563
|
+
| restoring an archive carrying `global:secrets` | `--exclude global:secrets`, or the CLI on the machine |
|
|
564
|
+
|
|
565
|
+
All three answer `403 SESSION_REQUIRED`. Commands run on the machine use the local channel, so they
|
|
566
|
+
need no session.
|
|
567
|
+
|
|
568
|
+
**Where secrets live.** Never in a config file — every one of these is mode `0600`:
|
|
569
|
+
|
|
570
|
+
| What | Where |
|
|
571
|
+
| --- | --- |
|
|
572
|
+
| panel password hash, API token hash | `.hh/.control-secrets.json` |
|
|
573
|
+
| each workspace's notification tokens and DDNS credentials | `.hh/<workspace>/.secrets.json` |
|
|
574
|
+
| TLS certificate and key | `.hh/.tls/` |
|
|
575
|
+
|
|
576
|
+
DDNS credentials are sealed with AES-256-GCM under `HHOSTED_DDNS_SECRET` (default `hh` — set your
|
|
577
|
+
own) because they are the one thing replayed to a third party.
|
|
578
|
+
|
|
579
|
+
**Behind a proxy.** Choose how far to trust it; `cookieSecure: auto` adds `Secure` on https, or upload
|
|
580
|
+
a PEM pair and let home-hosted terminate TLS itself.
|
|
581
|
+
|
|
582
|
+
| Setting | Trusts `x-forwarded-*` from | Use when |
|
|
583
|
+
| --- | --- | --- |
|
|
584
|
+
| `loopback` | this machine only | a proxy on the same host — real client address in logs and lockout, forged headers ignored |
|
|
585
|
+
| `on` | any peer | the proxy is the only way in. **The client address is then the caller's own header**, so the per-IP lockout counts per *forged* address and stops throttling brute force; the panel warns at startup if that panel is exposed |
|
|
586
|
+
| `off` | nobody | nothing in front, or the proxy sets no header |
|
|
587
|
+
|
|
588
|
+
**A plain-`http://` LAN address is not a secure context.** Browsers withhold some APIs from it, and the
|
|
589
|
+
panel works around the one it uses: **Copy** (the archive directory, the logs directory, the TLS
|
|
590
|
+
fingerprint, a server's JSON config) falls back to the legacy clipboard call, so it still works from
|
|
591
|
+
`http://192.168.1.201:3999`. Where even that is refused, the button says *Could not copy* instead of
|
|
592
|
+
doing nothing.
|
|
593
|
+
|
|
594
|
+
**Port conflicts.** A busy port is named — `port 4010 is already in use (pid 4242)` — and can be
|
|
595
|
+
resolved from a confirmation popover. The holder is looked up again at that moment, never taken from
|
|
596
|
+
the message, and anything the panel supervises is refused rather than killed. A server that
|
|
597
|
+
[restarts itself](./docs/SERVERS.md#when-a-program-restarts-itself) can be followed, or replaced with
|
|
598
|
+
a supervised copy.
|
|
599
|
+
|
|
600
|
+
</details>
|
|
601
|
+
|
|
499
602
|
|
|
500
603
|
---
|
|
501
604
|
|
|
@@ -525,52 +628,62 @@ Provider tokens stay in the workspace's secrets file. **Providers and the config
|
|
|
525
628
|
|
|
526
629
|
## 💾 Backups
|
|
527
630
|
|
|
528
|
-
**Global settings → Backups**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
**What an automatic backup contains** is yours to choose: *What an automatic backup contains →
|
|
544
|
-
Choose…* offers the same two-level list as *Create backup…*, and writes the result into the schedule
|
|
545
|
-
as `scope`. Two modes, the same two the CLI has:
|
|
546
|
-
|
|
547
|
-
- **Only these** — the archive carries only what you tick. The command-line spelling is
|
|
548
|
-
`--include <ids>`.
|
|
549
|
-
- **Everything except** — the archive carries everything but what you tick, *including workspaces you
|
|
550
|
-
add later*. The command-line spelling is `--all --exclude <ids>`.
|
|
551
|
-
|
|
552
|
-
Leave it at **Everything** (no `scope` in the file) and the schedule keeps taking the whole default
|
|
553
|
-
scope — every workspace plus `includePaths` — which is exactly what a schedule written before this
|
|
554
|
-
existed means. That is also the only setting that follows a workspace you add tomorrow; a stored list
|
|
555
|
-
of ids does not, because it names today's ids. Ticking everything in the dialog is therefore saved as
|
|
556
|
-
no scope at all, not as the list it currently amounts to. An empty selection is refused: it cannot be
|
|
557
|
-
told apart from "everything" in the file, and it would capture nothing.
|
|
631
|
+
**Global settings → Backups** takes one `.zip` of the panel and the workspaces you pick — settings,
|
|
632
|
+
servers, secrets, declared data — and puts it back. Plain, or AES-256 with a password.
|
|
633
|
+
|
|
634
|
+
Both directions are **two-level**: pick whole workspaces, or open one and drop any single piece (its
|
|
635
|
+
settings, servers, secrets, or one data directory). Each secret has its own tick.
|
|
636
|
+
|
|
637
|
+
```bash
|
|
638
|
+
home-hosted backup create --all --confirm # everything
|
|
639
|
+
home-hosted backup create --all --exclude global:secrets --confirm
|
|
640
|
+
home-hosted backup restore <name> --all --confirm # see `backup list`
|
|
641
|
+
home-hosted backup restore --from /media/usb/x.zip --all --confirm
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Both work with the panel **stopped**, which is when you actually need them.
|
|
558
645
|
|
|
559
646
|
<details>
|
|
560
|
-
<summary><b
|
|
647
|
+
<summary><b>⏱️ Automatic backups, and choosing what they contain</b></summary>
|
|
648
|
+
|
|
649
|
+
A schedule writes one archive every N hours, with its own retention (`Keep automatic`). The two counts
|
|
650
|
+
are independent: `Keep` bounds the ones you take by hand, and a scheduled pass never prunes yours to
|
|
651
|
+
make room. Automatic archives are named `auto-…` so you can tell them apart.
|
|
561
652
|
|
|
562
|
-
|
|
563
|
-
|
|
653
|
+
**What it contains** is yours to choose, in the same two-level dialog, saved into the schedule as
|
|
654
|
+
`scope`:
|
|
655
|
+
|
|
656
|
+
| Mode | Carries | CLI spelling |
|
|
657
|
+
| --- | --- | --- |
|
|
658
|
+
| **Everything** *(default)* | every workspace, plus `includePaths` | *no flag* |
|
|
659
|
+
| **Only these** | only what you tick | `--include <ids>` |
|
|
660
|
+
| **Everything except** | everything but what you tick, **including workspaces you add later** | `--all --exclude <ids>` |
|
|
564
661
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
662
|
+
Only **Everything** follows a workspace you add tomorrow — a stored list names today's ids. Ticking
|
|
663
|
+
everything in the dialog is therefore saved as *no scope*, not as the list it currently amounts to.
|
|
664
|
+
An empty selection is refused, because it cannot be told apart from "everything" in the file.
|
|
665
|
+
|
|
666
|
+
Generated directories (`node_modules`, `dist`, `.next`, framework caches) are skipped per entry;
|
|
667
|
+
`backupIgnoreGenerated: false` captures them anyway.
|
|
668
|
+
|
|
669
|
+
</details>
|
|
670
|
+
|
|
671
|
+
<details>
|
|
672
|
+
<summary><b>🔑 Restoring a secret, and what not to restore</b></summary>
|
|
673
|
+
|
|
674
|
+
An archive records the release and config schema that wrote it. A restore refuses a **newer** schema
|
|
675
|
+
outright rather than restoring the parts it recognizes, and **lifts an older one** through the same
|
|
676
|
+
migrations `home-hosted migrate` would run — the archive you take before an upgrade is the one you
|
|
677
|
+
reach for afterwards, so its configs are brought to this release's shape as they are written back.
|
|
678
|
+
|
|
679
|
+
Ticking a **single secret** merges by field — restoring the Telegram token leaves the DDNS
|
|
680
|
+
credentials alone. Ticking the whole **Secrets** entry replaces that file with the archive's copy.
|
|
568
681
|
|
|
569
682
|
Two things to know before restoring onto a machine already in use:
|
|
570
683
|
|
|
571
|
-
- **The password hash and API token hash are secrets
|
|
572
|
-
|
|
573
|
-
unticked, or rotate afterwards
|
|
684
|
+
- **The password hash and API token hash are secrets too.** Restoring them reinstates the old
|
|
685
|
+
machine's password and long-lived token, so whoever holds that token keeps access. Leave them
|
|
686
|
+
unticked, or rotate afterwards.
|
|
574
687
|
- **`HHOSTED_DDNS_SECRET` is not in the archive.** DDNS credentials travel sealed under it, so a host
|
|
575
688
|
with a different value cannot open them. Supply the same secret, or re-enter the credentials.
|
|
576
689
|
|
|
@@ -584,20 +697,25 @@ archive and restore. Definitions come back, workspaces the target has never hear
|
|
|
584
697
|
their labels, data lands where *this* machine's config says, and `autostart` entries come up
|
|
585
698
|
immediately.
|
|
586
699
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
absolute path
|
|
590
|
-
follows the restoring panel (`{projectDir}` is `HHOSTED_PROJECT` or the panel's cwd, not
|
|
591
|
-
`HHOSTED_HOME`); a literal absolute path is restored to that same path.
|
|
700
|
+
Path matching is by **declaration** (`omniroute:DATA_DIR`), not by an absolute path from the source
|
|
701
|
+
machine. A declaration using `{projectDir}`, `{dataRoot}` or `{home}` follows the restoring panel; a
|
|
702
|
+
literal absolute path is restored to that same path.
|
|
592
703
|
|
|
593
704
|
**A restore never writes where no config declares, and never across workspaces.** A data path is only
|
|
594
705
|
placed under a workspace the archive says it belongs to — if that workspace's `servers.config.json` is
|
|
595
706
|
not part of the restore, its data is reported as skipped rather than guessed at.
|
|
596
707
|
|
|
708
|
+
**A declared path is the capture boundary.** A symlink *inside* a declared directory that resolves
|
|
709
|
+
outside it is left out of the archive rather than followed, so a `media -> /mnt/nas` link does not
|
|
710
|
+
silently pull a share you never declared into every backup. A link that stays inside is captured once,
|
|
711
|
+
under the first name the walk reaches it by, and a declared path that is *itself* a symlink is
|
|
712
|
+
captured through. File permission bits travel: a `0600` key comes back `0600`, a `0700` directory
|
|
713
|
+
`0700`, a `0755` script executable — a backup must not widen access to what it was taken to protect.
|
|
714
|
+
|
|
597
715
|
</details>
|
|
598
716
|
|
|
599
717
|
<details>
|
|
600
|
-
<summary><b>✅ What comes back, and what
|
|
718
|
+
<summary><b>✅ What comes back, and what is still yours to do</b></summary>
|
|
601
719
|
|
|
602
720
|
| | Restored | Still yours to do |
|
|
603
721
|
| --- | --- | --- |
|
|
@@ -608,7 +726,7 @@ not part of the restore, its data is reported as skipped rather than guessed at.
|
|
|
608
726
|
| Telegram bots and chats, webhook targets | ✅ | Send a test from *Notifications* if the chat id came from another account |
|
|
609
727
|
| DDNS hostnames and their accounts | ✅ | Credentials only open under the same `HHOSTED_DDNS_SECRET`; otherwise re-enter them |
|
|
610
728
|
| Panel password and API token | ⬜ ticked per secret | Leave unticked, or rotate with `home-hosted set-token --generate` |
|
|
611
|
-
| Reverse-proxy routes | ✅ | Automatic HTTPS certificates are reissued
|
|
729
|
+
| Reverse-proxy routes | ✅ | Automatic HTTPS certificates are reissued on the new host. A pair **you uploaded** for a `tls: "manual"` route is not in the archive — re-upload it |
|
|
612
730
|
| Reverse-proxy engine binary | ❌ | Installed again from *Global settings → Reverse proxy* |
|
|
613
731
|
| Server logs, crash history, nanny state | ❌ | These describe the old box; the new one starts a fresh history |
|
|
614
732
|
| A server's `envFile` | ❌ not archived | It is the machine-local layer by design — copy it yourself, or declare its directory in `backupPaths` |
|
|
@@ -620,25 +738,26 @@ not part of the restore, its data is reported as skipped rather than guessed at.
|
|
|
620
738
|
<summary><b>⚠️ A backup of a running database may not be restorable</b></summary>
|
|
621
739
|
|
|
622
740
|
Data directories are copied file by file while your servers keep running — the panel does not stop or
|
|
623
|
-
freeze anything
|
|
741
|
+
freeze anything, because that would mean a backup could take your services down.
|
|
624
742
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
743
|
+
Fine for files, uploads and most app data. **Not** a consistent snapshot of a live database: SQLite
|
|
744
|
+
mid-transaction, a Postgres data directory, or a WAL mid-write can be captured torn, and the copy will
|
|
745
|
+
look complete while failing to open.
|
|
628
746
|
|
|
629
|
-
For anything with a real database, do one of these
|
|
747
|
+
For anything with a real database, do one of these first:
|
|
630
748
|
|
|
631
|
-
- **Quiesce it** — stop that entry
|
|
749
|
+
- **Quiesce it** — stop that entry, take the backup, start it again; or
|
|
632
750
|
- **dump it properly** (`sqlite3 app.db ".backup out.db"`, `pg_dump`, `mysqldump`) into a directory you
|
|
633
751
|
declare in `backupPaths`, so the archive carries the dump rather than the live files.
|
|
634
752
|
|
|
635
753
|
**Restoring** has the mirror-image hazard, and the plan names it: a data path copied over while its
|
|
636
|
-
server is running is replaced under a live process, which keeps its old view and loses
|
|
637
|
-
|
|
638
|
-
|
|
754
|
+
server is running is replaced under a live process, which keeps its old view and loses what it wrote
|
|
755
|
+
since. The restore reports those entries — `Data was replaced under a running server` — and the fix is
|
|
756
|
+
to stop them before applying, or stop and start each one.
|
|
639
757
|
|
|
640
758
|
</details>
|
|
641
759
|
|
|
760
|
+
|
|
642
761
|
---
|
|
643
762
|
|
|
644
763
|
## 🎨 Bring your own UI (BYOU)
|
|
@@ -707,7 +826,8 @@ the same way: every supervised process tree is stopped before the panel exits.
|
|
|
707
826
|
|
|
708
827
|
An entry marked `persistent` is the exception, and `down` names it instead of stopping it: it runs
|
|
709
828
|
under its own nanny process, keeps logging, and is reattached by the next panel
|
|
710
|
-
([SERVERS.md](./docs/SERVERS.md#persistent-entries)).
|
|
829
|
+
([SERVERS.md](./docs/SERVERS.md#persistent-entries)). Add `--with-persistent` to stop those too —
|
|
830
|
+
with the panel up or after it has already gone, since each nanny's state file is enough.
|
|
711
831
|
|
|
712
832
|
</details>
|
|
713
833
|
|