home-hosted 0.9.11 → 0.10.0
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 +2 -1
- package/README.md +198 -104
- package/dist/cli.js +773 -150
- package/dist/cli.js.map +1 -1
- package/docs/RESTORE_DEMO.md +21 -4
- package/docs/SERVERS.md +18 -4
- package/docs/UI_CREATION.md +14 -2
- package/docs/demo/blank-host-restore.sh +4 -5
- package/package.json +1 -1
- package/uis/stock/dist/assets/de-pnMS_erQ.js +1 -0
- package/uis/stock/dist/assets/es-BaIbld2Z.js +1 -0
- package/uis/stock/dist/assets/fr-B2gy4ynV.js +1 -0
- package/uis/stock/dist/assets/index-ZrOADDZx.css +2 -0
- package/uis/stock/dist/assets/{index-CB6K3K2b.js → index-aK_CRIGL.js} +12 -12
- package/uis/stock/dist/assets/ja-DFH5Ol5b.js +1 -0
- package/uis/stock/dist/assets/ko-C3LcaLoa.js +1 -0
- package/uis/stock/dist/assets/ru-B7nB7X1y.js +1 -0
- package/uis/stock/dist/assets/vi-CzXGueBM.js +1 -0
- package/uis/stock/dist/assets/zh-CN-Du_sQUjJ.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/AGENTS.md
CHANGED
|
@@ -114,7 +114,8 @@ workspace config guard, so a busy default port turns config tests red for the wr
|
|
|
114
114
|
- **A metric with no reading is absent, never zero.** A scrape has no page to qualify a number, so an
|
|
115
115
|
alerted-on gauge published as `0` from an unsampled view is indistinguishable from a healthy one
|
|
116
116
|
and silences the rule that exists to catch it. Omit the series (`src/api/metrics.ts`), and never
|
|
117
|
-
suffix `_total` a value that a user action resets
|
|
117
|
+
suffix `_total` a value that a user action resets — no series here is a counter, and
|
|
118
|
+
`test/api/panel.test.ts` enumerates the scrape and fails on a `_total` name or a `counter` type.
|
|
118
119
|
- **Name the cause the fix follows, not the one the code path suggests.** Node reports a missing
|
|
119
120
|
working directory and a missing program with the same `ENOENT`, so `describeSpawnError` checks the
|
|
120
121
|
resolved `cwd` **and** whether the field holds a whole command line before it blames the command —
|
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>
|
|
@@ -262,10 +265,19 @@ 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
|
|
@@ -296,24 +308,24 @@ can be told what to be: *"Help me build a UI for home-hosted: nostalgic game the
|
|
|
296
308
|
|
|
297
309
|
| | |
|
|
298
310
|
| --- | --- |
|
|
299
|
-
| 🗂 **Workspaces** | One panel, many scopes
|
|
311
|
+
| 🗂 **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
312
|
| 🚦 **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** |
|
|
313
|
+
| 📝 **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
314
|
| ♻️ **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
|
|
315
|
+
| 🩺 **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
316
|
| 🔗 **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
317
|
| 📜 **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
|
|
318
|
+
| 📈 **Resources** | CPU and RSS per process tree — the summed containers for a compose entry — with an optional memory ceiling that restarts the entry. |
|
|
307
319
|
| 🌡️ **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. |
|
|
308
320
|
| 🤖 **Token API** | Scripts and agents drive it with `Authorization: Bearer` — no browser, no session. [↑](#-agents-scripts-and-tools) |
|
|
309
|
-
| 🔔 **Notifications** |
|
|
321
|
+
| 🔔 **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
322
|
| 🌐 **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** |
|
|
323
|
+
| 🔀 **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) |
|
|
324
|
+
| 💾 **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). |
|
|
313
325
|
| 🌍 **Nine languages** | English, Vietnamese, Chinese, Japanese, Spanish, Korean, Russian, French, German — picked on the login page or in **Global settings → Language**, kept per browser. |
|
|
314
326
|
| 🎨 **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
327
|
| 🔐 **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
|
|
328
|
+
| 🧩 **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
329
|
| 🖥 **Cross-platform** | Linux, macOS and Windows: `/proc`, `ps` or Win32_Process, process groups or `taskkill /T`, no shell dependencies. |
|
|
318
330
|
|
|
319
331
|
---
|
|
@@ -374,12 +386,13 @@ restarts itself), and how hand-edits are validated: [SERVERS.md](./docs/SERVERS.
|
|
|
374
386
|
| `home-hosted up` | start the panel detached, and keep it alive in the background |
|
|
375
387
|
| `home-hosted down` | stop it cleanly — supervised processes included, persistent entries left running |
|
|
376
388
|
| `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>`) |
|
|
389
|
+
| `home-hosted status` | pid, URL, health, uptime, state and log paths (`--json` for scripts). Edge cases are under [what `status` tells you](#-cli). |
|
|
390
|
+
| `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
391
|
| `home-hosted stop <id>` | stop one server, nothing else (`--workspace <id>`) |
|
|
392
|
+
| `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
393
|
| `home-hosted restart <id>` | restart one server, nothing else (`--workspace <id>`) — the same as the panel's per-server Restart |
|
|
381
394
|
| `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
|
|
395
|
+
| `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
396
|
| `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
397
|
| `home-hosted set-token` | set the API token scripts and agents use (`--generate`, `--clear`) |
|
|
385
398
|
| `home-hosted migrate` | bring every config up to the schema this release understands (`--dry-run`, `--yes`) |
|
|
@@ -399,7 +412,7 @@ up -p/--port --host --open --no-autostart --foreground --print-co
|
|
|
399
412
|
down (no flags)
|
|
400
413
|
status --json
|
|
401
414
|
logs --lines <n> --follow --json
|
|
402
|
-
backup [list|create|restore] [<name>] (--include <ids> | --all) [--exclude <ids>] --password --confirm --json
|
|
415
|
+
backup [list|create|restore] [<name> | --from <path>] (--include <ids> | --all) [--exclude <ids>] --password --confirm --json
|
|
403
416
|
start, stop <id> [-w/--workspace <id>] (both need the panel up)
|
|
404
417
|
restart [<id>] [-w/--workspace <id>] (no id: the panel; with one: that server)
|
|
405
418
|
init --dir --name --pm --no-install -y/--yes
|
|
@@ -447,6 +460,24 @@ or a config whose schema is newer than the running release stops `up` with the e
|
|
|
447
460
|
than starting with defaults that quietly differ from your file. Fix the file, or install the release
|
|
448
461
|
that wrote it.
|
|
449
462
|
|
|
463
|
+
### Two things `migrate` cannot fix
|
|
464
|
+
|
|
465
|
+
`migrate` moves a config file. Two changes in this release are *outside* the config, so read these
|
|
466
|
+
before upgrading — a stale one fails quietly, which is the worst way to fail.
|
|
467
|
+
|
|
468
|
+
**A dashboard on `/api/metrics`.** Two series were renamed in the release that made every metric
|
|
469
|
+
honest about being a gauge: `hh_server_restarts_total` is now `hh_server_restarts`, and
|
|
470
|
+
`hh_servers_total` is now `hh_servers`. The old names are not published, so a query still on one
|
|
471
|
+
shows *no data* rather than a stale number. Compare the gauge directly (`hh_server_restarts > 2`);
|
|
472
|
+
do not wrap it in `rate()`/`increase()`, because a start you asked for resets it.
|
|
473
|
+
|
|
474
|
+
**A script that holds only an API token.** Three operations now require a signed-in session, because
|
|
475
|
+
each would otherwise let a stolen token end up holding the panel: clearing the password, switching
|
|
476
|
+
authentication off, and restoring an archive that carries `global:secrets`. Each answers 403
|
|
477
|
+
`SESSION_REQUIRED`. Scripts should either sign in first, pass `--exclude global:secrets` to a
|
|
478
|
+
restore, or run the command on the machine (`home-hosted set-password --clear`,
|
|
479
|
+
`home-hosted backup restore`, which both go through the local channel).
|
|
480
|
+
|
|
450
481
|
### Coming from 0.6.x
|
|
451
482
|
|
|
452
483
|
**Install the latest 0.7.x first, and run it once.** 0.7.0 moved all state from `$HHOSTED_HOME` itself
|
|
@@ -460,42 +491,98 @@ the move on its first run; 0.8.0 then starts against the result.
|
|
|
460
491
|
|
|
461
492
|
</details>
|
|
462
493
|
|
|
494
|
+
<details>
|
|
495
|
+
<summary><b>🤔 What <code>status</code> tells you when things are not simple</b></summary>
|
|
496
|
+
|
|
497
|
+
`home-hosted status` prints the panel's console path *and* the per-server log directory, naming the
|
|
498
|
+
`<id>.log` convention once logs exist.
|
|
499
|
+
|
|
500
|
+
`--json` is for scripts. A stopped panel answers `{ running: false, initialised }` —
|
|
501
|
+
`initialised: false` means nothing was ever set up in this state directory — plus `liveness`:
|
|
502
|
+
|
|
503
|
+
| `liveness` | Means |
|
|
504
|
+
| --- | --- |
|
|
505
|
+
| `alive` | the recorded pid is this panel |
|
|
506
|
+
| `gone` | it is not running; the record is stale and may be cleared |
|
|
507
|
+
| `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 |
|
|
508
|
+
|
|
509
|
+
</details>
|
|
510
|
+
|
|
463
511
|
---
|
|
464
512
|
|
|
465
513
|
## 🔐 Security
|
|
466
514
|
|
|
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
|
-
|
|
515
|
+
**Safe out of the box.** The panel answers on `127.0.0.1` only. It will not listen anywhere else —
|
|
516
|
+
not while the password is still the default one, not without a password, not with authentication
|
|
517
|
+
switched off — and a proxy route pointing back at the panel answers to the same rule. Nothing is
|
|
518
|
+
exposed until you decide it should be.
|
|
519
|
+
|
|
520
|
+
One setting only warns: turning on **trust a proxy from any peer** while the panel is also exposed
|
|
521
|
+
weakens the login lockout, and the panel says so at startup rather than refusing, because a proxy on
|
|
522
|
+
another machine is a legitimate setup.
|
|
523
|
+
|
|
524
|
+
<details>
|
|
525
|
+
<summary><b>🛡️ The three things you actually have to do</b></summary>
|
|
526
|
+
|
|
527
|
+
1. **Set your own password before you expose it.** Change it, then bind to `lan` — in the UI, in the
|
|
528
|
+
config, or with `--host lan`. All three go through the same check.
|
|
529
|
+
2. **Treat an API token like the password.** It works as you, it survives restarts, and changing the
|
|
530
|
+
password does *not* revoke it. If one may have leaked, rotate it: `set-token --generate`.
|
|
531
|
+
3. **If you forget the password, clear it from the machine.** `home-hosted set-password --clear`
|
|
532
|
+
edits the secrets file directly, so it needs no login — that is the way back in. Signed in, the
|
|
533
|
+
same thing is *Global settings → Authentication → Clear password*.
|
|
534
|
+
|
|
535
|
+
</details>
|
|
536
|
+
|
|
537
|
+
<details>
|
|
538
|
+
<summary><b>🔍 The details — sessions, tokens, secrets on disk, proxies</b></summary>
|
|
539
|
+
|
|
540
|
+
**Sessions.** Kept in memory only, never on disk. The cookie is `HttpOnly` and `SameSite=Strict`, and
|
|
541
|
+
it is an **idle** timeout: every request slides both the session and the cookie, so a panel in regular
|
|
542
|
+
use stays signed in while one left alone signs out. Repeated login failures lock out per IP — see
|
|
543
|
+
*behind a proxy* below for when that is advisory.
|
|
544
|
+
|
|
545
|
+
**Tokens.** `home-hosted set-token --generate` prints one once and stores only its SHA-256 hash;
|
|
546
|
+
`set-token --clear` revokes it. Three operations need a signed-in session rather than a token, because
|
|
547
|
+
each would otherwise let a stolen token end up holding the panel:
|
|
548
|
+
|
|
549
|
+
| Operation | Instead |
|
|
550
|
+
| --- | --- |
|
|
551
|
+
| clearing the password | sign in, or `set-password --clear` on the machine |
|
|
552
|
+
| switching authentication off | sign in |
|
|
553
|
+
| restoring an archive carrying `global:secrets` | `--exclude global:secrets`, or the CLI on the machine |
|
|
554
|
+
|
|
555
|
+
All three answer `403 SESSION_REQUIRED`. Commands run on the machine use the local channel, so they
|
|
556
|
+
need no session.
|
|
557
|
+
|
|
558
|
+
**Where secrets live.** Never in a config file — every one of these is mode `0600`:
|
|
559
|
+
|
|
560
|
+
| What | Where |
|
|
561
|
+
| --- | --- |
|
|
562
|
+
| panel password hash, API token hash | `.hh/.control-secrets.json` |
|
|
563
|
+
| each workspace's notification tokens and DDNS credentials | `.hh/<workspace>/.secrets.json` |
|
|
564
|
+
| TLS certificate and key | `.hh/.tls/` |
|
|
565
|
+
|
|
566
|
+
DDNS credentials are sealed with AES-256-GCM under `HHOSTED_DDNS_SECRET` (default `hh` — set your
|
|
567
|
+
own) because they are the one thing replayed to a third party.
|
|
568
|
+
|
|
569
|
+
**Behind a proxy.** Choose how far to trust it; `cookieSecure: auto` adds `Secure` on https, or upload
|
|
570
|
+
a PEM pair and let home-hosted terminate TLS itself.
|
|
571
|
+
|
|
572
|
+
| Setting | Trusts `x-forwarded-*` from | Use when |
|
|
573
|
+
| --- | --- | --- |
|
|
574
|
+
| `loopback` | this machine only | a proxy on the same host — real client address in logs and lockout, forged headers ignored |
|
|
575
|
+
| `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 |
|
|
576
|
+
| `off` | nobody | nothing in front, or the proxy sets no header |
|
|
577
|
+
|
|
578
|
+
**Port conflicts.** A busy port is named — `port 4010 is already in use (pid 4242)` — and can be
|
|
579
|
+
resolved from a confirmation popover. The holder is looked up again at that moment, never taken from
|
|
580
|
+
the message, and anything the panel supervises is refused rather than killed. A server that
|
|
581
|
+
[restarts itself](./docs/SERVERS.md#when-a-program-restarts-itself) can be followed, or replaced with
|
|
582
|
+
a supervised copy.
|
|
583
|
+
|
|
584
|
+
</details>
|
|
585
|
+
|
|
499
586
|
|
|
500
587
|
---
|
|
501
588
|
|
|
@@ -525,52 +612,60 @@ Provider tokens stay in the workspace's secrets file. **Providers and the config
|
|
|
525
612
|
|
|
526
613
|
## 💾 Backups
|
|
527
614
|
|
|
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.
|
|
615
|
+
**Global settings → Backups** takes one `.zip` of the panel and the workspaces you pick — settings,
|
|
616
|
+
servers, secrets, declared data — and puts it back. Plain, or AES-256 with a password.
|
|
617
|
+
|
|
618
|
+
Both directions are **two-level**: pick whole workspaces, or open one and drop any single piece (its
|
|
619
|
+
settings, servers, secrets, or one data directory). Each secret has its own tick.
|
|
620
|
+
|
|
621
|
+
```bash
|
|
622
|
+
home-hosted backup create --all --confirm # everything
|
|
623
|
+
home-hosted backup create --all --exclude global:secrets --confirm
|
|
624
|
+
home-hosted backup restore <name> --all --confirm # see `backup list`
|
|
625
|
+
home-hosted backup restore --from /media/usb/x.zip --all --confirm
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
Both work with the panel **stopped**, which is when you actually need them.
|
|
558
629
|
|
|
559
630
|
<details>
|
|
560
|
-
<summary><b
|
|
631
|
+
<summary><b>⏱️ Automatic backups, and choosing what they contain</b></summary>
|
|
561
632
|
|
|
562
|
-
|
|
563
|
-
|
|
633
|
+
A schedule writes one archive every N hours, with its own retention (`Keep automatic`). The two counts
|
|
634
|
+
are independent: `Keep` bounds the ones you take by hand, and a scheduled pass never prunes yours to
|
|
635
|
+
make room. Automatic archives are named `auto-…` so you can tell them apart.
|
|
564
636
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
637
|
+
**What it contains** is yours to choose, in the same two-level dialog, saved into the schedule as
|
|
638
|
+
`scope`:
|
|
639
|
+
|
|
640
|
+
| Mode | Carries | CLI spelling |
|
|
641
|
+
| --- | --- | --- |
|
|
642
|
+
| **Everything** *(default)* | every workspace, plus `includePaths` | *no flag* |
|
|
643
|
+
| **Only these** | only what you tick | `--include <ids>` |
|
|
644
|
+
| **Everything except** | everything but what you tick, **including workspaces you add later** | `--all --exclude <ids>` |
|
|
645
|
+
|
|
646
|
+
Only **Everything** follows a workspace you add tomorrow — a stored list names today's ids. Ticking
|
|
647
|
+
everything in the dialog is therefore saved as *no scope*, not as the list it currently amounts to.
|
|
648
|
+
An empty selection is refused, because it cannot be told apart from "everything" in the file.
|
|
649
|
+
|
|
650
|
+
Generated directories (`node_modules`, `dist`, `.next`, framework caches) are skipped per entry;
|
|
651
|
+
`backupIgnoreGenerated: false` captures them anyway.
|
|
652
|
+
|
|
653
|
+
</details>
|
|
654
|
+
|
|
655
|
+
<details>
|
|
656
|
+
<summary><b>🔑 Restoring a secret, and what not to restore</b></summary>
|
|
657
|
+
|
|
658
|
+
An archive records the release and config schema that wrote it; a restore refuses a newer schema
|
|
659
|
+
outright rather than restoring the parts it recognizes.
|
|
660
|
+
|
|
661
|
+
Ticking a **single secret** merges by field — restoring the Telegram token leaves the DDNS
|
|
662
|
+
credentials alone. Ticking the whole **Secrets** entry replaces that file with the archive's copy.
|
|
568
663
|
|
|
569
664
|
Two things to know before restoring onto a machine already in use:
|
|
570
665
|
|
|
571
|
-
- **The password hash and API token hash are secrets
|
|
572
|
-
|
|
573
|
-
unticked, or rotate afterwards
|
|
666
|
+
- **The password hash and API token hash are secrets too.** Restoring them reinstates the old
|
|
667
|
+
machine's password and long-lived token, so whoever holds that token keeps access. Leave them
|
|
668
|
+
unticked, or rotate afterwards.
|
|
574
669
|
- **`HHOSTED_DDNS_SECRET` is not in the archive.** DDNS credentials travel sealed under it, so a host
|
|
575
670
|
with a different value cannot open them. Supply the same secret, or re-enter the credentials.
|
|
576
671
|
|
|
@@ -584,11 +679,9 @@ archive and restore. Definitions come back, workspaces the target has never hear
|
|
|
584
679
|
their labels, data lands where *this* machine's config says, and `autostart` entries come up
|
|
585
680
|
immediately.
|
|
586
681
|
|
|
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.
|
|
682
|
+
Path matching is by **declaration** (`omniroute:DATA_DIR`), not by an absolute path from the source
|
|
683
|
+
machine. A declaration using `{projectDir}`, `{dataRoot}` or `{home}` follows the restoring panel; a
|
|
684
|
+
literal absolute path is restored to that same path.
|
|
592
685
|
|
|
593
686
|
**A restore never writes where no config declares, and never across workspaces.** A data path is only
|
|
594
687
|
placed under a workspace the archive says it belongs to — if that workspace's `servers.config.json` is
|
|
@@ -597,7 +690,7 @@ not part of the restore, its data is reported as skipped rather than guessed at.
|
|
|
597
690
|
</details>
|
|
598
691
|
|
|
599
692
|
<details>
|
|
600
|
-
<summary><b>✅ What comes back, and what
|
|
693
|
+
<summary><b>✅ What comes back, and what is still yours to do</b></summary>
|
|
601
694
|
|
|
602
695
|
| | Restored | Still yours to do |
|
|
603
696
|
| --- | --- | --- |
|
|
@@ -608,7 +701,7 @@ not part of the restore, its data is reported as skipped rather than guessed at.
|
|
|
608
701
|
| Telegram bots and chats, webhook targets | ✅ | Send a test from *Notifications* if the chat id came from another account |
|
|
609
702
|
| DDNS hostnames and their accounts | ✅ | Credentials only open under the same `HHOSTED_DDNS_SECRET`; otherwise re-enter them |
|
|
610
703
|
| 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
|
|
704
|
+
| 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
705
|
| Reverse-proxy engine binary | ❌ | Installed again from *Global settings → Reverse proxy* |
|
|
613
706
|
| Server logs, crash history, nanny state | ❌ | These describe the old box; the new one starts a fresh history |
|
|
614
707
|
| 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 +713,26 @@ not part of the restore, its data is reported as skipped rather than guessed at.
|
|
|
620
713
|
<summary><b>⚠️ A backup of a running database may not be restorable</b></summary>
|
|
621
714
|
|
|
622
715
|
Data directories are copied file by file while your servers keep running — the panel does not stop or
|
|
623
|
-
freeze anything
|
|
716
|
+
freeze anything, because that would mean a backup could take your services down.
|
|
624
717
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
718
|
+
Fine for files, uploads and most app data. **Not** a consistent snapshot of a live database: SQLite
|
|
719
|
+
mid-transaction, a Postgres data directory, or a WAL mid-write can be captured torn, and the copy will
|
|
720
|
+
look complete while failing to open.
|
|
628
721
|
|
|
629
|
-
For anything with a real database, do one of these
|
|
722
|
+
For anything with a real database, do one of these first:
|
|
630
723
|
|
|
631
|
-
- **Quiesce it** — stop that entry
|
|
724
|
+
- **Quiesce it** — stop that entry, take the backup, start it again; or
|
|
632
725
|
- **dump it properly** (`sqlite3 app.db ".backup out.db"`, `pg_dump`, `mysqldump`) into a directory you
|
|
633
726
|
declare in `backupPaths`, so the archive carries the dump rather than the live files.
|
|
634
727
|
|
|
635
728
|
**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
|
-
|
|
729
|
+
server is running is replaced under a live process, which keeps its old view and loses what it wrote
|
|
730
|
+
since. The restore reports those entries — `Data was replaced under a running server` — and the fix is
|
|
731
|
+
to stop them before applying, or stop and start each one.
|
|
639
732
|
|
|
640
733
|
</details>
|
|
641
734
|
|
|
735
|
+
|
|
642
736
|
---
|
|
643
737
|
|
|
644
738
|
## 🎨 Bring your own UI (BYOU)
|