home-hosted 0.6.2 → 0.6.4
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 +51 -9
- package/README.md +16 -1
- package/dist/cli.js +932 -59
- package/dist/cli.js.map +1 -1
- package/docs/SERVERS.md +47 -0
- package/package.json +1 -1
- package/uis/stock/dist/assets/{index-sj5eYUeD.js → index-CCPLyw-2.js} +6 -6
- package/uis/stock/dist/index.html +1 -1
package/docs/SERVERS.md
CHANGED
|
@@ -27,6 +27,7 @@ servers and its state together.
|
|
|
27
27
|
| `env`, `dataEnvs`, `envFile` | environment; `dataEnvs` also marks data directories for backups, `envFile` keeps secrets out of the config |
|
|
28
28
|
| `port`, `bind` | enables the readiness wait, health checks and the conflict preflight; `local` keeps it on `127.0.0.1` |
|
|
29
29
|
| `onPortConflict` | `block` (default), `warn`, `follow`, `reclaim`, or `kill` — see below |
|
|
30
|
+
| `persistent` | run it under its own nanny so it survives the panel — see below |
|
|
30
31
|
| `health.mode` | `port` (TCP connect) or `http` (path, expected status, expected body) |
|
|
31
32
|
| `health.unhealthyThreshold`, `forceRestartAfterMs` | how many failed probes before the card warns, and when to restart anyway |
|
|
32
33
|
| `restart.*` | backoff: `maxRetries`, `baseDelayMs`, `factor`, `maxDelayMs`, `resetAfterMs` |
|
|
@@ -136,6 +137,52 @@ Because a detached successor is not something the panel supervises, `kill` ends
|
|
|
136
137
|
asking whether it was yours. Only `follow` ever adopts, and only `reclaim` will refuse to act on a
|
|
137
138
|
holder it cannot prove is yours.
|
|
138
139
|
|
|
140
|
+
## Persistent entries
|
|
141
|
+
|
|
142
|
+
`"persistent": true` means "keep this running whatever happens to the panel". It is off by default,
|
|
143
|
+
it is per entry (not a `Settings → Server defaults` field), and it covers the three ways the panel can
|
|
144
|
+
go away: `down`, a restart, or being killed outright.
|
|
145
|
+
|
|
146
|
+
How it works: the panel does not run the entry directly. It spawns a **nanny** — the same CLI, hidden
|
|
147
|
+
`__nanny` mode — which starts the entry, owns its pipes and writes its output to the entry's own log
|
|
148
|
+
file. The nanny is what survives; the panel reattaches to it on the next boot through
|
|
149
|
+
`$HHOSTED_HOME/.state/<id>.json`, and a stale file is how it learns how a child ended while nobody was
|
|
150
|
+
watching.
|
|
151
|
+
|
|
152
|
+
What that changes:
|
|
153
|
+
|
|
154
|
+
- **`down`, `restart` and `stop-all` leave it running** and say so (`2 persistent server(s) left
|
|
155
|
+
running: …`). Only an explicit **Stop** on that entry — or removing/disabling it — ends it.
|
|
156
|
+
- **It is reattached, not restarted.** `--no-autostart` still starts nothing, but a persistent entry
|
|
157
|
+
that is already running is adopted, because leaving it unmanaged would make the panel treat its own
|
|
158
|
+
server as a stranger on the port.
|
|
159
|
+
- **Logs keep flowing.** The panel tails the nanny's file, so history survives the panel being down;
|
|
160
|
+
`logs.persist: false` still keeps it out of the Logs page — but a file has to exist in
|
|
161
|
+
`.logs/`, because there is no pipe to carry the output.
|
|
162
|
+
- **A crash while the panel is away is reported, not restarted.** Retries and backoff remain the
|
|
163
|
+
panel's job, so an entry that dies with nobody watching shows up as **crashed** on the next boot
|
|
164
|
+
with the exit code in its log.
|
|
165
|
+
- **Port policies still apply, as a fallback.** A persistent entry reattaches from its state file
|
|
166
|
+
before any preflight runs, so `onPortConflict` matters only when that state is gone — and `follow`
|
|
167
|
+
is then the policy that adopts instead of blocking.
|
|
168
|
+
- **A program that restarts itself wants `reclaim`, not `follow`.** The nanny lives exactly as long
|
|
169
|
+
as the child it owns: when that child exits to hand over to a successor, the nanny exits too, and
|
|
170
|
+
nothing is left writing the entry's log — `follow` would adopt the successor with no capture at
|
|
171
|
+
all. `reclaim` stops it and starts a fresh nanny, which is both the log and the persistence back.
|
|
172
|
+
|
|
173
|
+
### What still ends one
|
|
174
|
+
|
|
175
|
+
The panel is not the only thing that can sweep a process off a machine. A persistent entry is a
|
|
176
|
+
normal process, so it is still subject to:
|
|
177
|
+
|
|
178
|
+
- **systemd**, when the panel runs as a unit with the default `KillMode=control-group` — stopping the
|
|
179
|
+
unit kills everything in its cgroup, nanny included. Use `KillMode=process` if you want the panel's
|
|
180
|
+
own lifecycle to be the only thing that decides.
|
|
181
|
+
- **A container.** Docker stops everything in the container's PID namespace, so persistence means the
|
|
182
|
+
panel's lifetime inside that container, not the host's.
|
|
183
|
+
- **Windows, on the forced path.** `taskkill /T` walks the parent tree, and `down --force` uses it;
|
|
184
|
+
the graceful path (which is what `down` normally takes) leaves a persistent entry alone.
|
|
185
|
+
|
|
139
186
|
## Editing fields
|
|
140
187
|
|
|
141
188
|
Changes from the panel are atomic and validated before they are written. Editing the file by hand —
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "home-hosted",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.4",
|
|
5
5
|
"packageManager": "pnpm@12.5.1",
|
|
6
6
|
"description": "A self-hosted control panel that keeps your home server processes alive - with a UI you can replace.",
|
|
7
7
|
"author": "NamesMT <dangquoctrung123@gmail.com>",
|