home-hosted 0.6.0 → 0.6.2
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 +13 -0
- package/README.md +20 -10
- package/dist/cli.js +896 -293
- package/dist/cli.js.map +1 -1
- package/docs/UI_CREATION.md +35 -4
- package/package.json +1 -1
- package/uis/stock/dist/assets/{index-4_Q69j7h.js → index-sj5eYUeD.js} +1 -1
- package/uis/stock/dist/index.html +1 -1
package/AGENTS.md
CHANGED
|
@@ -85,6 +85,19 @@ exists, so the first release has to be published by hand.
|
|
|
85
85
|
- `uis/<name>/` — each UI is a Vite app (Vue 3 + Tailwind v4) built through `uis/vite.shared.ts`;
|
|
86
86
|
`stock` is the one shipped inside the package. Aliases: `@` → that UI's `src`, `@shared` →
|
|
87
87
|
`src/shared`, `@server` → `src` (**types only** — never import runtime server code into a UI).
|
|
88
|
+
Its `public/ui.json` is the UI's identity: `name` and `version` (what Settings shows),
|
|
89
|
+
`repo`/`tag`/`asset` (which release carries it, for `ui-update`) and `unix` (when it was built).
|
|
90
|
+
`UiService` carries those fields into the installed `$HHOSTED_HOME/.ui/ui.json` unchanged and adds
|
|
91
|
+
`uploadedAt`/`files` of its own.
|
|
92
|
+
- **Bumping a UI ships a new asset, so its `ui.json` is part of the change.** Any commit that alters
|
|
93
|
+
a UI under `uis/<name>/` bumps that `ui.json`'s `version` and sets `unix` to the commit's own epoch
|
|
94
|
+
seconds: patch for a fix, minor for a feature, and **major only for a rewrite or a restyle**. The
|
|
95
|
+
number is what tells a person how big the change is — `ui-update` prints it and holds it against
|
|
96
|
+
the release it is offering. `tag` is what pairs an official UI with its panel, and it is **stamped
|
|
97
|
+
by `build-uis.mjs`**, not trusted from the source file: a UI zip is built before its release is cut,
|
|
98
|
+
so the committed value is always a release behind the asset it ends up inside. The release workflow
|
|
99
|
+
passes `HHOSTED_UI_TAG`; anywhere else the build stamps `v<package.json version>`. Do not hand-edit
|
|
100
|
+
`tag` to chase a release — a stale one makes `ui-update` re-install the same UI on every boot.
|
|
88
101
|
- `bin/home-hosted.mjs` — the published bin: `dist/cli.js`, or `src/cli.ts` through tsx when the
|
|
89
102
|
build is missing (a linked checkout).
|
|
90
103
|
- `scripts/` — `build-uis.mjs` (build one UI, optionally zip it), `typecheck-uis.mjs`,
|
package/README.md
CHANGED
|
@@ -40,8 +40,9 @@ You run a handful of services at home. The usual choices are extremes — 🧟 `
|
|
|
40
40
|
forget about, 📜 a hand-written systemd unit per service (times six), or 🐳 a whole docker/k8s
|
|
41
41
|
stack??? - too extreme! — plus 😩 monitoring, rebooting and changing the host machine, yuck!
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
puts the whole stack on one page, with deep backup support
|
|
43
|
+
🙂✨ home-hosted enhances on top: a panel/supervisor that starts them, watches them, restarts what
|
|
44
|
+
dies, and puts the whole stack on one page, with deep backup support — whether a server is a plain
|
|
45
|
+
command or a `docker compose` stack.
|
|
45
46
|
|
|
46
47
|
```text
|
|
47
48
|
┌──────────────────────────────────────┐
|
|
@@ -54,8 +55,13 @@ puts the whole stack on one page, with deep backup support.
|
|
|
54
55
|
┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
55
56
|
│ gateway │ │ files │ │ bot │
|
|
56
57
|
│ :4000 │ │ :4010 │ │ ... │
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
└────┬────┘ └─────────┘ └─────────┘
|
|
59
|
+
│ compose up -d
|
|
60
|
+
▼
|
|
61
|
+
┌────────────┬────────────┬────────────┐
|
|
62
|
+
│ gateway │ postgres │ redis │ restarts ↻
|
|
63
|
+
└────────────┴────────────┴────────────┘
|
|
64
|
+
health ✓ (the published port is the probe)
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
| | |
|
|
@@ -147,7 +153,7 @@ data/ # per-server data directories, declared through da
|
|
|
147
153
|
|
|
148
154
|
One clone, `pnpm install --frozen-lockfile`, `pnpm run up` — the setup is up on any machine with Node.
|
|
149
155
|
Worked example, with per-server data inside the project:
|
|
150
|
-
**[hhosted-
|
|
156
|
+
**[hhosted-ai-pack](https://github.com/NamesMT/hhosted-ai-pack)**.
|
|
151
157
|
|
|
152
158
|
<sub>Call them as `pnpm run up` — `pnpm up` is pnpm's own update, not your script.</sub>
|
|
153
159
|
|
|
@@ -190,8 +196,8 @@ home-hosted set-token --generate
|
|
|
190
196
|
# hh_9uA2… (printed once; only its hash is kept, mode 0600)
|
|
191
197
|
|
|
192
198
|
curl -H "Authorization: Bearer hh_9uA2…" http://127.0.0.1:3999/api/state
|
|
193
|
-
curl -H "Authorization: Bearer hh_9uA2…" -X POST http://127.0.0.1:3999/api/servers/
|
|
194
|
-
curl -N -H "Authorization: Bearer hh_9uA2…" 'http://127.0.0.1:3999/api/events?serverId=
|
|
199
|
+
curl -H "Authorization: Bearer hh_9uA2…" -X POST http://127.0.0.1:3999/api/servers/omniroute/restart
|
|
200
|
+
curl -N -H "Authorization: Bearer hh_9uA2…" 'http://127.0.0.1:3999/api/events?serverId=omniroute' # SSE
|
|
195
201
|
home-hosted status --json # machine-readable: pid, url, health, paths
|
|
196
202
|
```
|
|
197
203
|
|
|
@@ -251,7 +257,7 @@ can be told what to be: *"Help me build a UI for home-hosted: nostalgic game the
|
|
|
251
257
|
| 🤖 **Token API** | Scripts and agents drive it with `Authorization: Bearer` — no browser, no session. [↑](#-agents-scripts-and-tools) |
|
|
252
258
|
| 🔔 **Notifications** | Telegram on crash, unhealthy, forced restart, recovery and host thresholds — [setup here](./docs/NOTIFICATIONS.md). |
|
|
253
259
|
| 💾 **Backups** | One click for config, secrets, TLS and your declared data directories — plain `.zip`, or AES-256 with a password, restored per path. |
|
|
254
|
-
| 🎨 **BYOU — Bring Your Own UI** | Upload a static build, `
|
|
260
|
+
| 🎨 **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) |
|
|
255
261
|
| 🔐 **Security** | Cookie sessions, API tokens, scrypt hashes, per-IP lockout, optional TLS, and a refusal to expose itself without a password. |
|
|
256
262
|
| 🧩 **No special treatment** | A server is `command` + `args` + `env` + `cwd`; nothing is built in for any particular app. |
|
|
257
263
|
| 🖥 **Cross-platform** | Linux, macOS and Windows: `/proc`, `ps` or Win32_Process, process groups or `taskkill /T`, no shell dependencies. |
|
|
@@ -292,6 +298,7 @@ restarts itself), and how hand-edits are validated: [SERVERS.md](./docs/SERVERS.
|
|
|
292
298
|
| `home-hosted migrate` | bring `servers.config.json` up to this release's schema (`--dry-run`, `--yes`) |
|
|
293
299
|
| `home-hosted init` | scaffold a project that keeps `state/` and its data in the repo |
|
|
294
300
|
| `home-hosted ui-switch` | install a UI from a release asset, a zip file or a URL (interactive) |
|
|
301
|
+
| `home-hosted ui-update` | bring an installed UI up to date, or pick a release (`--old`, `--check`) |
|
|
295
302
|
| `home-hosted ui-revert` | go back to the stock panel UI after uploading your own |
|
|
296
303
|
|
|
297
304
|
<details>
|
|
@@ -309,6 +316,7 @@ set-password --clear
|
|
|
309
316
|
set-token --generate --clear
|
|
310
317
|
migrate --config --dry-run -y/--yes
|
|
311
318
|
ui-switch --repo --tag --asset --file --list --token -y/--yes
|
|
319
|
+
ui-update --check --tag --asset --old --repo --token -y/--yes
|
|
312
320
|
ui-revert (no flags)
|
|
313
321
|
|
|
314
322
|
every command --home <dir> --project <dir> (or $HHOSTED_HOME, $HHOSTED_PROJECT)
|
|
@@ -394,7 +402,7 @@ archive and restore. Definitions come back, data lands where *this* machine's co
|
|
|
394
402
|
`autostart` entries come up immediately.
|
|
395
403
|
|
|
396
404
|
It works because an archive carries its own `servers.config.json` and paths are matched by the
|
|
397
|
-
**declaration** (`
|
|
405
|
+
**declaration** (`omniroute:DATA_DIR`), not by an absolute path from the source machine. A restore never
|
|
398
406
|
writes where no config declares.
|
|
399
407
|
|
|
400
408
|
</details>
|
|
@@ -412,7 +420,9 @@ attaches both as `home-hosted-ui-<name>.zip`. Yours can be anything that compile
|
|
|
412
420
|
the server never cares what built it.
|
|
413
421
|
|
|
414
422
|
<sub>Install a UI from the CLI: `home-hosted ui-switch` — with no flags it fetches the official asset
|
|
415
|
-
built for this release
|
|
423
|
+
built for this release. An **official** UI keeps itself paired with the panel: upgrade the panel and
|
|
424
|
+
the next `up` re-installs the matching asset. Someone else's UI declares its own `repo`/`asset` in
|
|
425
|
+
`ui.json`, and `home-hosted ui-update` offers its newer releases to pick from — `--old` for older ones.</sub>
|
|
416
426
|
|
|
417
427
|
<details>
|
|
418
428
|
<summary><b>🤖 Or have an agent build the UI you actually want</b></summary>
|