home-hosted 0.13.0 → 0.20.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/README.md +117 -322
- package/bin/home-hosted.mjs +41 -0
- package/dist/chunks/account-DiLrSyww.js +359 -0
- package/dist/chunks/account-DiLrSyww.js.map +1 -0
- package/dist/chunks/add-DEIYVkNK.js +183 -0
- package/dist/chunks/add-DEIYVkNK.js.map +1 -0
- package/dist/chunks/{archive-DP-XQR8X.js → archive-DFi3qK1c.js} +25 -73
- package/dist/chunks/archive-DFi3qK1c.js.map +1 -0
- package/dist/chunks/{atomic-C1PfJpE7.js → atomic-SZUwDtGD.js} +3 -6
- package/dist/chunks/atomic-SZUwDtGD.js.map +1 -0
- package/dist/chunks/{backup-CZcVca2a.js → backup-DnyxIzw0.js} +110 -190
- package/dist/chunks/backup-DnyxIzw0.js.map +1 -0
- package/dist/chunks/backups-BrrN6cwW.js +2203 -0
- package/dist/chunks/backups-BrrN6cwW.js.map +1 -0
- package/dist/chunks/bind-DIxrnUst.js +43 -0
- package/dist/chunks/bind-DIxrnUst.js.map +1 -0
- package/dist/chunks/config-text-DxMOQQnk.js +34 -0
- package/dist/chunks/config-text-DxMOQQnk.js.map +1 -0
- package/dist/chunks/{contracts-CMBD1TF9.js → contracts-CxZ7u1L3.js} +1239 -1454
- package/dist/chunks/contracts-CxZ7u1L3.js.map +1 -0
- package/dist/chunks/daemon-BAAYUYQC.js +211 -0
- package/dist/chunks/daemon-BAAYUYQC.js.map +1 -0
- package/dist/chunks/daemon-log-Ccu-69vB.js +179 -0
- package/dist/chunks/daemon-log-Ccu-69vB.js.map +1 -0
- package/dist/chunks/deploy-CggSOEkq.js +144 -0
- package/dist/chunks/deploy-CggSOEkq.js.map +1 -0
- package/dist/chunks/{docker-Cy9Lyvda.js → docker--Un0uLfF.js} +32 -68
- package/dist/chunks/docker--Un0uLfF.js.map +1 -0
- package/dist/chunks/{down-pKbGCW9d.js → down-CpIN7LEQ.js} +34 -94
- package/dist/chunks/down-CpIN7LEQ.js.map +1 -0
- package/dist/chunks/exposure-CDJNvOCK.js +229 -0
- package/dist/chunks/exposure-CDJNvOCK.js.map +1 -0
- package/dist/chunks/import-Bd4VZH0f.js +205 -0
- package/dist/chunks/import-Bd4VZH0f.js.map +1 -0
- package/dist/chunks/import-plan--fDS_l5r.js +147 -0
- package/dist/chunks/import-plan--fDS_l5r.js.map +1 -0
- package/dist/chunks/import-write-BTfbeV26.js +42 -0
- package/dist/chunks/import-write-BTfbeV26.js.map +1 -0
- package/dist/chunks/{init-BZ7hK9Vf.js → init-Bv3oH65x.js} +14 -50
- package/dist/chunks/init-Bv3oH65x.js.map +1 -0
- package/dist/chunks/job-CYOdN6Ub.js +341 -0
- package/dist/chunks/job-CYOdN6Ub.js.map +1 -0
- package/dist/chunks/jobs-BX4ahcfh.js +489 -0
- package/dist/chunks/jobs-BX4ahcfh.js.map +1 -0
- package/dist/chunks/last-stop-DD3lHwo_.js +42 -0
- package/dist/chunks/last-stop-DD3lHwo_.js.map +1 -0
- package/dist/chunks/layout-D0ysDNav.js +18 -0
- package/dist/chunks/layout-D0ysDNav.js.map +1 -0
- package/dist/chunks/lazy-kfcBNeqj.js +48 -0
- package/dist/chunks/lazy-kfcBNeqj.js.map +1 -0
- package/dist/chunks/log-buffer-B7jmn7ts.js +110 -0
- package/dist/chunks/log-buffer-B7jmn7ts.js.map +1 -0
- package/dist/chunks/log-files-CZL2UhuE.js +488 -0
- package/dist/chunks/log-files-CZL2UhuE.js.map +1 -0
- package/dist/chunks/{logger-B5U4GD3j.js → logger-BnrKTBHQ.js} +2 -6
- package/dist/chunks/logger-BnrKTBHQ.js.map +1 -0
- package/dist/chunks/{logs---TI_bxM.js → logs-DxKI6OW2.js} +23 -73
- package/dist/chunks/logs-DxKI6OW2.js.map +1 -0
- package/dist/chunks/ls-BseUHy_m.js +128 -0
- package/dist/chunks/ls-BseUHy_m.js.map +1 -0
- package/dist/chunks/migrate-D4w_dXDm.js +268 -0
- package/dist/chunks/migrate-D4w_dXDm.js.map +1 -0
- package/dist/chunks/{nanny-B-Eu0sFW.js → nanny-BWh7nuvv.js} +21 -14
- package/dist/chunks/nanny-BWh7nuvv.js.map +1 -0
- package/dist/chunks/{nanny-ChMtq1Zl.js → nanny-BjF2-1pv.js} +3 -3
- package/dist/chunks/{nanny-ChMtq1Zl.js.map → nanny-BjF2-1pv.js.map} +1 -1
- package/dist/chunks/nanny-DGTXVq5d.js +806 -0
- package/dist/chunks/nanny-DGTXVq5d.js.map +1 -0
- package/dist/chunks/{nanny-sweep-DErnlPY1.js → nanny-sweep-hjmZ_p7S.js} +14 -24
- package/dist/chunks/nanny-sweep-hjmZ_p7S.js.map +1 -0
- package/dist/chunks/{nearest-6KgQEDUe.js → nearest-DOx4jySJ.js} +2 -10
- package/dist/chunks/nearest-DOx4jySJ.js.map +1 -0
- package/dist/chunks/{parse-DhmG26fI.js → parse-DVMPLUDe.js} +47 -72
- package/dist/chunks/parse-DVMPLUDe.js.map +1 -0
- package/dist/chunks/password-policy-Clq6PGE-.js +9 -0
- package/dist/chunks/password-policy-Clq6PGE-.js.map +1 -0
- package/dist/chunks/{paths-CGlGDrOU.js → paths-C34-TJLh.js} +32 -56
- package/dist/chunks/paths-C34-TJLh.js.map +1 -0
- package/dist/chunks/{port-B8WBTRMk.js → port-CnsrxKNR.js} +27 -71
- package/dist/chunks/port-CnsrxKNR.js.map +1 -0
- package/dist/chunks/process-CboOFPU_.js +192 -0
- package/dist/chunks/process-CboOFPU_.js.map +1 -0
- package/dist/chunks/{restart-Des4DrAN.js → restart-C0J8dZ2L.js} +11 -29
- package/dist/chunks/restart-C0J8dZ2L.js.map +1 -0
- package/dist/chunks/run-deploy-DoNDvwT4.js +91 -0
- package/dist/chunks/run-deploy-DoNDvwT4.js.map +1 -0
- package/dist/chunks/{schema-B240VXcV.js → schema-CZ6f-PHD.js} +7 -20
- package/dist/chunks/schema-CZ6f-PHD.js.map +1 -0
- package/dist/chunks/secret-MY397r90.js +219 -0
- package/dist/chunks/secret-MY397r90.js.map +1 -0
- package/dist/chunks/secrets-CG5N4lwY.js +1061 -0
- package/dist/chunks/secrets-CG5N4lwY.js.map +1 -0
- package/dist/chunks/server-Dm_dXfTW.js +255 -0
- package/dist/chunks/server-Dm_dXfTW.js.map +1 -0
- package/dist/chunks/server-attention-UQwYXqKe.js +10 -0
- package/dist/chunks/server-attention-UQwYXqKe.js.map +1 -0
- package/dist/chunks/server-create-D7nvhgBd.js +96 -0
- package/dist/chunks/server-create-D7nvhgBd.js.map +1 -0
- package/dist/chunks/server-ids-BEQD2rFz.js +23 -0
- package/dist/chunks/server-ids-BEQD2rFz.js.map +1 -0
- package/dist/chunks/server-vars-DMYmHutL.js +27 -0
- package/dist/chunks/server-vars-DMYmHutL.js.map +1 -0
- package/dist/chunks/service-C8l-ewNA.js +585 -0
- package/dist/chunks/service-C8l-ewNA.js.map +1 -0
- package/dist/chunks/{settings-xu-XTfWg.js → settings-CtYDs5PX.js} +62 -78
- package/dist/chunks/settings-CtYDs5PX.js.map +1 -0
- package/dist/chunks/{setup-temp-CAN4_bA-.js → setup-temp-TAtDmMMU.js} +43 -37
- package/dist/chunks/setup-temp-TAtDmMMU.js.map +1 -0
- package/dist/chunks/shape-CDGeYl_J.js +9 -0
- package/dist/chunks/shape-CDGeYl_J.js.map +1 -0
- package/dist/chunks/{src-BtWMFmzZ.js → src-BnzkVy_M.js} +12548 -10576
- package/dist/chunks/src-BnzkVy_M.js.map +1 -0
- package/dist/chunks/{status-DT1EsA-B.js → status-efbbfYZQ.js} +53 -26
- package/dist/chunks/status-efbbfYZQ.js.map +1 -0
- package/dist/chunks/store-Bs_Lljjm.js +2082 -0
- package/dist/chunks/store-Bs_Lljjm.js.map +1 -0
- package/dist/chunks/template-xan58bJh.js +28 -0
- package/dist/chunks/template-xan58bJh.js.map +1 -0
- package/dist/chunks/token-DDeWfZA4.js +142 -0
- package/dist/chunks/token-DDeWfZA4.js.map +1 -0
- package/dist/chunks/{ui-D562aqw5.js → ui-BcIAtyxE.js} +68 -79
- package/dist/chunks/ui-BcIAtyxE.js.map +1 -0
- package/dist/chunks/{ui-dir-CsU3uLNV.js → ui-dir-ClCzVRc3.js} +3 -7
- package/dist/chunks/ui-dir-ClCzVRc3.js.map +1 -0
- package/dist/chunks/ui-format-CDvvqOoi.js +53 -0
- package/dist/chunks/ui-format-CDvvqOoi.js.map +1 -0
- package/dist/chunks/{ui-release-DKzVvlLd.js → ui-release-XbJ85pYI.js} +36 -38
- package/dist/chunks/ui-release-XbJ85pYI.js.map +1 -0
- package/dist/chunks/{ui-revert-EkBBwRTt.js → ui-revert-Dgawq7ze.js} +4 -4
- package/dist/chunks/ui-revert-Dgawq7ze.js.map +1 -0
- package/dist/chunks/{ui-switch-BnZTdMDd.js → ui-switch-CfQMbZ0g.js} +31 -38
- package/dist/chunks/ui-switch-CfQMbZ0g.js.map +1 -0
- package/dist/chunks/{ui-update-_xryLYxw.js → ui-update-B3PPivUm.js} +30 -48
- package/dist/chunks/ui-update-B3PPivUm.js.map +1 -0
- package/dist/chunks/ui-update-CAiH2tFb.js +109 -0
- package/dist/chunks/ui-update-CAiH2tFb.js.map +1 -0
- package/dist/chunks/{up-Pdz-l6IH.js → up-BQSnYxYd.js} +47 -53
- package/dist/chunks/up-BQSnYxYd.js.map +1 -0
- package/dist/chunks/{usage-DFrCVXpT.js → usage-KG8TeOio.js} +7 -20
- package/dist/chunks/usage-KG8TeOio.js.map +1 -0
- package/dist/chunks/{workspaces-DYcfvKV_.js → workspaces-D9akpzU8.js} +80 -68
- package/dist/chunks/workspaces-D9akpzU8.js.map +1 -0
- package/dist/chunks/{wsl-temperature-BiCI4iK6.js → wsl-temperature-D-_d4Yk1.js} +47 -42
- package/dist/chunks/wsl-temperature-D-_d4Yk1.js.map +1 -0
- package/dist/cli.js +306 -238
- package/dist/cli.js.map +1 -1
- package/dist/client.js +76 -29
- package/dist/client.js.map +1 -1
- package/dist/types/api/acme.d.ts +3 -7
- package/dist/types/api/auth/$.routes.d.ts +107 -16
- package/dist/types/api/backups.d.ts +5 -5
- package/dist/types/api/control.d.ts +747 -38
- package/dist/types/api/ddns.d.ts +13 -18
- package/dist/types/api/events.d.ts +9 -3
- package/dist/types/api/health.d.ts +2 -4
- package/dist/types/api/jobs.d.ts +438 -0
- package/dist/types/api/logs.d.ts +20 -0
- package/dist/types/api/metrics.d.ts +2 -5
- package/dist/types/api/notifications.d.ts +3 -6
- package/dist/types/api/proxy.d.ts +63 -23
- package/dist/types/api/server-ops.d.ts +17 -0
- package/dist/types/api/servers/$.routes.d.ts +418 -186
- package/dist/types/api/session-required.d.ts +16 -0
- package/dist/types/api/settings.d.ts +7 -7
- package/dist/types/api/state.d.ts +100 -10
- package/dist/types/api/static.d.ts +2 -2
- package/dist/types/api/tls.d.ts +2 -5
- package/dist/types/api/workspaces/$.routes.d.ts +186 -12
- package/dist/types/api/wsl-temperature.d.ts +4 -10
- package/dist/types/app.d.ts +4511 -2778
- package/dist/types/cli/account.d.ts +23 -0
- package/dist/types/cli/add.d.ts +96 -0
- package/dist/types/cli/args.d.ts +24 -35
- package/dist/types/cli/backup-offline.d.ts +2 -8
- package/dist/types/cli/backup.d.ts +12 -21
- package/dist/types/cli/down.d.ts +15 -41
- package/dist/types/cli/import-plan.d.ts +55 -0
- package/dist/types/cli/import-write.d.ts +5 -0
- package/dist/types/cli/import.d.ts +86 -0
- package/dist/types/cli/io.d.ts +26 -35
- package/dist/types/cli/job.d.ts +99 -0
- package/dist/types/cli/logs.d.ts +1 -10
- package/dist/types/cli/ls.d.ts +57 -0
- package/dist/types/cli/migrate.d.ts +31 -8
- package/dist/types/cli/nearest.d.ts +1 -9
- package/dist/types/cli/run-deploy.d.ts +36 -0
- package/dist/types/cli/secret.d.ts +90 -0
- package/dist/types/cli/server.d.ts +6 -15
- package/dist/types/cli/service.d.ts +135 -0
- package/dist/types/cli/setup-temp.d.ts +17 -13
- package/dist/types/cli/status.d.ts +7 -1
- package/dist/types/cli/token.d.ts +6 -0
- package/dist/types/cli/ui-switch.d.ts +3 -14
- package/dist/types/cli/ui-update.d.ts +3 -16
- package/dist/types/cli/up.d.ts +9 -22
- package/dist/types/cli/usage.d.ts +2 -6
- package/dist/types/cli.d.ts +1 -10
- package/dist/types/client.d.ts +4099 -1142
- package/dist/types/config/accounts.d.ts +16 -0
- package/dist/types/config/jobs.d.ts +68 -0
- package/dist/types/config/layout.d.ts +2 -8
- package/dist/types/config/migrations.d.ts +9 -41
- package/dist/types/config/parse.d.ts +8 -13
- package/dist/types/config/patch.d.ts +1 -6
- package/dist/types/config/schema.d.ts +16 -18
- package/dist/types/config/secret-parts.d.ts +6 -27
- package/dist/types/config/secrets.d.ts +167 -88
- package/dist/types/config/seed.d.ts +1 -6
- package/dist/types/config/server-ids.d.ts +2 -11
- package/dist/types/config/settings.d.ts +13 -49
- package/dist/types/config/store.d.ts +17 -54
- package/dist/types/config/workspaces.d.ts +24 -56
- package/dist/types/helpers/action-result.d.ts +18 -32
- package/dist/types/helpers/atomic.d.ts +1 -4
- package/dist/types/helpers/backoff.d.ts +0 -1
- package/dist/types/helpers/bind.d.ts +3 -11
- package/dist/types/helpers/config-text.d.ts +4 -19
- package/dist/types/helpers/cookies.d.ts +2 -7
- package/dist/types/helpers/copy-tree.d.ts +4 -12
- package/dist/types/helpers/daemon-log.d.ts +8 -33
- package/dist/types/helpers/daemon.d.ts +20 -70
- package/dist/types/helpers/deferred.d.ts +2 -4
- package/dist/types/helpers/env-file.d.ts +2 -7
- package/dist/types/helpers/error.d.ts +3 -14
- package/dist/types/helpers/event-stream.d.ts +18 -10
- package/dist/types/helpers/factory.d.ts +2 -3
- package/dist/types/helpers/last-stop.d.ts +5 -12
- package/dist/types/helpers/logger.d.ts +1 -5
- package/dist/types/helpers/open.d.ts +0 -1
- package/dist/types/helpers/openapi.d.ts +19 -5
- package/dist/types/helpers/paths.d.ts +18 -53
- package/dist/types/helpers/restore-lock.d.ts +2 -17
- package/dist/types/helpers/runtime.d.ts +3 -13
- package/dist/types/helpers/secret-compare.d.ts +2 -10
- package/dist/types/helpers/server-create.d.ts +15 -0
- package/dist/types/helpers/shell.d.ts +2 -16
- package/dist/types/helpers/sse.d.ts +8 -6
- package/dist/types/helpers/ui-dir.d.ts +1 -5
- package/dist/types/helpers/utf8-chunks.d.ts +2 -8
- package/dist/types/helpers/validate.d.ts +2 -4
- package/dist/types/helpers/validator.d.ts +8 -4
- package/dist/types/helpers/version.d.ts +1 -6
- package/dist/types/helpers/workspace.d.ts +24 -16
- package/dist/types/index.d.ts +2 -3
- package/dist/types/middleware/auth.d.ts +8 -27
- package/dist/types/middleware/body-limit.d.ts +10 -0
- package/dist/types/middleware/host.d.ts +4 -23
- package/dist/types/middleware/loopback.d.ts +1 -8
- package/dist/types/middleware/token-scope.d.ts +34 -0
- package/dist/types/node-compat.d.ts +43 -0
- package/dist/types/openapi-reference.d.ts +4 -19
- package/dist/types/openapi.d.ts +5 -8
- package/dist/types/providers/archive.d.ts +8 -25
- package/dist/types/providers/backup-hook.d.ts +4 -19
- package/dist/types/providers/ddns/dyndns2.d.ts +0 -3
- package/dist/types/providers/ddns/index.d.ts +2 -3
- package/dist/types/providers/ddns/ip.d.ts +2 -12
- package/dist/types/providers/ddns/namecheap-api.d.ts +3 -2
- package/dist/types/providers/ddns/types.d.ts +6 -32
- package/dist/types/providers/ddns/zone.d.ts +1 -4
- package/dist/types/providers/docker.d.ts +18 -45
- package/dist/types/providers/entry-state.d.ts +4 -9
- package/dist/types/providers/health-check.d.ts +1 -5
- package/dist/types/providers/host.d.ts +33 -108
- package/dist/types/providers/identity.d.ts +9 -34
- package/dist/types/providers/log-tail.d.ts +14 -24
- package/dist/types/providers/nanny-sweep.d.ts +8 -25
- package/dist/types/providers/nanny.d.ts +16 -58
- package/dist/types/providers/port.d.ts +28 -83
- package/dist/types/providers/proc.d.ts +22 -80
- package/dist/types/providers/process.d.ts +12 -36
- package/dist/types/providers/proxy/admin.d.ts +11 -0
- package/dist/types/providers/proxy/types.d.ts +4 -16
- package/dist/types/providers/telegram.d.ts +1 -17
- package/dist/types/providers/ui-release.d.ts +15 -25
- package/dist/types/providers/webhook.d.ts +8 -29
- package/dist/types/providers/wsl-temperature.d.ts +13 -22
- package/dist/types/services/acme-challenge.d.ts +2 -16
- package/dist/types/services/auth.d.ts +65 -80
- package/dist/types/services/backups/archive-safety.d.ts +30 -0
- package/dist/types/services/backups/paths.d.ts +31 -0
- package/dist/types/services/backups.d.ts +61 -271
- package/dist/types/services/config-watch.d.ts +3 -15
- package/dist/types/services/control-server.d.ts +6 -10
- package/dist/types/services/ddns.d.ts +12 -13
- package/dist/types/services/dependencies.d.ts +3 -14
- package/dist/types/services/deploy.d.ts +34 -0
- package/dist/types/services/events.d.ts +15 -9
- package/dist/types/services/exposure.d.ts +13 -63
- package/dist/types/services/history.d.ts +5 -14
- package/dist/types/services/host-monitor.d.ts +6 -11
- package/dist/types/services/init.d.ts +5 -35
- package/dist/types/services/job-ledger.d.ts +27 -0
- package/dist/types/services/jobs.d.ts +113 -0
- package/dist/types/services/log-buffer.d.ts +7 -8
- package/dist/types/services/log-files.d.ts +12 -42
- package/dist/types/services/log-relay.d.ts +3 -13
- package/dist/types/services/nanny.d.ts +3 -10
- package/dist/types/services/notifications.d.ts +31 -61
- package/dist/types/services/panel.d.ts +32 -78
- package/dist/types/services/proxy-certificates/certificates.d.ts +31 -69
- package/dist/types/services/proxy-config.d.ts +15 -36
- package/dist/types/services/proxy-dns01.d.ts +14 -0
- package/dist/types/services/proxy.d.ts +73 -254
- package/dist/types/services/scheduler.d.ts +46 -0
- package/dist/types/services/state.d.ts +17 -8
- package/dist/types/services/supervisor/compose.d.ts +2 -6
- package/dist/types/services/supervisor/entry.d.ts +29 -32
- package/dist/types/services/supervisor/health.d.ts +8 -31
- package/dist/types/services/supervisor/job-run.d.ts +36 -0
- package/dist/types/services/supervisor/output.d.ts +13 -77
- package/dist/types/services/supervisor/persistent.d.ts +5 -11
- package/dist/types/services/supervisor/port-preflight.d.ts +4 -10
- package/dist/types/services/supervisor/records.d.ts +27 -60
- package/dist/types/services/supervisor/restart-required.d.ts +13 -0
- package/dist/types/services/supervisor/spawn.d.ts +3 -5
- package/dist/types/services/supervisor/view.d.ts +3 -1
- package/dist/types/services/supervisor.d.ts +31 -43
- package/dist/types/services/tls.d.ts +6 -17
- package/dist/types/services/ui-update.d.ts +19 -17
- package/dist/types/services/ui.d.ts +10 -19
- package/dist/types/shared/action-outcome.d.ts +2 -7
- package/dist/types/shared/api-client.d.ts +133 -177
- package/dist/types/shared/api-scopes.d.ts +17 -0
- package/dist/types/shared/backup-scope.d.ts +16 -90
- package/dist/types/shared/clone.d.ts +2 -11
- package/dist/types/shared/contracts/accounts.d.ts +99 -0
- package/dist/types/shared/contracts/backups.d.ts +219 -0
- package/dist/types/shared/contracts/ddns.d.ts +208 -0
- package/dist/types/shared/contracts/frames.d.ts +1395 -0
- package/dist/types/shared/contracts/index.d.ts +3 -0
- package/dist/types/shared/contracts/logs.d.ts +107 -0
- package/dist/types/shared/contracts/proxy.d.ts +303 -0
- package/dist/types/shared/contracts.d.ts +852 -1982
- package/dist/types/shared/cpu-scale.d.ts +3 -19
- package/dist/types/shared/crash-cause.d.ts +8 -0
- package/dist/types/shared/cron.d.ts +70 -0
- package/dist/types/shared/ddns-form.d.ts +9 -43
- package/dist/types/shared/endpoint.d.ts +1 -7
- package/dist/types/shared/error-codes.d.ts +438 -0
- package/dist/types/shared/error-message.d.ts +1 -7
- package/dist/types/shared/fields.d.ts +7 -17
- package/dist/types/shared/form-repair.d.ts +1 -5
- package/dist/types/shared/generated.d.ts +3 -19
- package/dist/types/shared/host-readings.d.ts +25 -128
- package/dist/types/shared/lazy.d.ts +1 -1
- package/dist/types/shared/live-frames.d.ts +2 -8
- package/dist/types/shared/live-series.d.ts +2 -8
- package/dist/types/shared/live-store.d.ts +4 -8
- package/dist/types/shared/log-download.d.ts +6 -0
- package/dist/types/shared/meta.d.ts +6 -0
- package/dist/types/shared/password-policy.d.ts +10 -0
- package/dist/types/shared/patch-diff.d.ts +13 -72
- package/dist/types/shared/port-reading.d.ts +18 -0
- package/dist/types/shared/probe-latency.d.ts +3 -21
- package/dist/types/shared/proxy-form.d.ts +33 -74
- package/dist/types/shared/proxy-validate.d.ts +11 -0
- package/dist/types/shared/query-params.d.ts +8 -0
- package/dist/types/shared/server-attention.d.ts +2 -27
- package/dist/types/shared/server-form.d.ts +15 -54
- package/dist/types/shared/server-key.d.ts +1 -12
- package/dist/types/shared/server-readings.d.ts +7 -32
- package/dist/types/shared/server-url.d.ts +9 -31
- package/dist/types/shared/shape.d.ts +1 -16
- package/dist/types/shared/stream-access.d.ts +2 -8
- package/dist/types/shared/ui-format.d.ts +25 -65
- package/docs/API.md +315 -107
- package/docs/BACKUPS.md +61 -56
- package/docs/CLI.md +255 -49
- package/docs/DDNS.md +35 -49
- package/docs/JOBS.md +129 -0
- package/docs/NOTIFICATIONS.md +58 -90
- package/docs/REVERSE_PROXY.md +116 -188
- package/docs/SECURITY.md +126 -44
- package/docs/SERVERS.md +282 -409
- package/docs/UI_CREATION.md +90 -47
- package/docs/demo/blank-host-restore.sh +31 -7
- package/package.json +15 -6
- package/scripts/prepare.mjs +47 -0
- package/uis/stock/dist/assets/CopyButton-8mliL0xi.js +1 -0
- package/uis/stock/dist/assets/GlobalSettingsView-BINXY77E.js +1 -0
- package/uis/stock/dist/assets/LogViewer-kiSnTwdY.js +1 -0
- package/uis/stock/dist/assets/LogsView-DDXf_ONs.js +1 -0
- package/uis/stock/dist/assets/Modal-lrUuViF2.js +39 -0
- package/uis/stock/dist/assets/ProxyView-uXMaJdSQ.js +1 -0
- package/uis/stock/dist/assets/ServerDetailView-CW0Vb_c0.js +4 -0
- package/uis/stock/dist/assets/SettingsShell-B135xWjJ.js +1 -0
- package/uis/stock/dist/assets/SettingsView-BLtWxVkl.js +2 -0
- package/uis/stock/dist/assets/de-BIoTrHBQ.js +1 -0
- package/uis/stock/dist/assets/es-x4-ih8lH.js +1 -0
- package/uis/stock/dist/assets/fr-DatqBBkO.js +1 -0
- package/uis/stock/dist/assets/index-CnojaKcA.css +2 -0
- package/uis/stock/dist/assets/index-D-CiZReu.js +16 -0
- package/uis/stock/dist/assets/ja-CW1703Gw.js +1 -0
- package/uis/stock/dist/assets/ko-wFbT4XtK.js +1 -0
- package/uis/stock/dist/assets/ru-C1p5C4VN.js +1 -0
- package/uis/stock/dist/assets/useUnsavedGuard-BcsXsfCC.js +9 -0
- package/uis/stock/dist/assets/vi-CDqr0uie.js +1 -0
- package/uis/stock/dist/assets/zh-CN-BJ7iit-X.js +1 -0
- package/uis/stock/dist/index.html +4 -3
- package/uis/stock/dist/ui.json +3 -3
- package/dist/chunks/archive-DP-XQR8X.js.map +0 -1
- package/dist/chunks/atomic-C1PfJpE7.js.map +0 -1
- package/dist/chunks/backup-CZcVca2a.js.map +0 -1
- package/dist/chunks/backups-CFRaWe_m.js +0 -4691
- package/dist/chunks/backups-CFRaWe_m.js.map +0 -1
- package/dist/chunks/config-text-DifCHhnz.js +0 -50
- package/dist/chunks/config-text-DifCHhnz.js.map +0 -1
- package/dist/chunks/contracts-CMBD1TF9.js.map +0 -1
- package/dist/chunks/daemon-log-BVj8cDEo.js +0 -241
- package/dist/chunks/daemon-log-BVj8cDEo.js.map +0 -1
- package/dist/chunks/daemon-qKVECISl.js +0 -247
- package/dist/chunks/daemon-qKVECISl.js.map +0 -1
- package/dist/chunks/docker-Cy9Lyvda.js.map +0 -1
- package/dist/chunks/down-pKbGCW9d.js.map +0 -1
- package/dist/chunks/init-BZ7hK9Vf.js.map +0 -1
- package/dist/chunks/last-stop-C-BXz_XI.js +0 -53
- package/dist/chunks/last-stop-C-BXz_XI.js.map +0 -1
- package/dist/chunks/layout-DwTtmund.js +0 -24
- package/dist/chunks/layout-DwTtmund.js.map +0 -1
- package/dist/chunks/lazy-Ce5zEAq1.js +0 -66
- package/dist/chunks/lazy-Ce5zEAq1.js.map +0 -1
- package/dist/chunks/log-buffer-Dy9HHDMD.js +0 -414
- package/dist/chunks/log-buffer-Dy9HHDMD.js.map +0 -1
- package/dist/chunks/logger-B5U4GD3j.js.map +0 -1
- package/dist/chunks/logs---TI_bxM.js.map +0 -1
- package/dist/chunks/migrate-Cfoq-Vgh.js +0 -155
- package/dist/chunks/migrate-Cfoq-Vgh.js.map +0 -1
- package/dist/chunks/nanny-B-Eu0sFW.js.map +0 -1
- package/dist/chunks/nanny-BtWfy0QH.js +0 -1167
- package/dist/chunks/nanny-BtWfy0QH.js.map +0 -1
- package/dist/chunks/nanny-sweep-DErnlPY1.js.map +0 -1
- package/dist/chunks/nearest-6KgQEDUe.js.map +0 -1
- package/dist/chunks/parse-DhmG26fI.js.map +0 -1
- package/dist/chunks/paths-CGlGDrOU.js.map +0 -1
- package/dist/chunks/port-B8WBTRMk.js.map +0 -1
- package/dist/chunks/restart-Des4DrAN.js.map +0 -1
- package/dist/chunks/schema-B240VXcV.js.map +0 -1
- package/dist/chunks/secrets-BieELnZh.js +0 -562
- package/dist/chunks/secrets-BieELnZh.js.map +0 -1
- package/dist/chunks/server-Bge2r2qQ.js +0 -169
- package/dist/chunks/server-Bge2r2qQ.js.map +0 -1
- package/dist/chunks/server-ids-DRuNLVCV.js +0 -32
- package/dist/chunks/server-ids-DRuNLVCV.js.map +0 -1
- package/dist/chunks/set-password-D5vZqqSX.js +0 -43
- package/dist/chunks/set-password-D5vZqqSX.js.map +0 -1
- package/dist/chunks/set-token-obPiEJYk.js +0 -78
- package/dist/chunks/set-token-obPiEJYk.js.map +0 -1
- package/dist/chunks/settings-xu-XTfWg.js.map +0 -1
- package/dist/chunks/setup-temp-CAN4_bA-.js.map +0 -1
- package/dist/chunks/shape-DnTKzjQ2.js +0 -24
- package/dist/chunks/shape-DnTKzjQ2.js.map +0 -1
- package/dist/chunks/src-BtWMFmzZ.js.map +0 -1
- package/dist/chunks/status-DT1EsA-B.js.map +0 -1
- package/dist/chunks/ui-D562aqw5.js.map +0 -1
- package/dist/chunks/ui-dir-CsU3uLNV.js.map +0 -1
- package/dist/chunks/ui-release-DKzVvlLd.js.map +0 -1
- package/dist/chunks/ui-revert-EkBBwRTt.js.map +0 -1
- package/dist/chunks/ui-switch-BnZTdMDd.js.map +0 -1
- package/dist/chunks/ui-update-_xryLYxw.js.map +0 -1
- package/dist/chunks/up-Pdz-l6IH.js.map +0 -1
- package/dist/chunks/usage-DFrCVXpT.js.map +0 -1
- package/dist/chunks/workspaces-DYcfvKV_.js.map +0 -1
- package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +0 -1
- package/dist/types/cli/set-password.d.ts +0 -14
- package/dist/types/cli/set-token.d.ts +0 -21
- package/uis/stock/dist/assets/CopyButton-BUBKRJyY.js +0 -1
- package/uis/stock/dist/assets/GlobalSettingsView-yYMcRWvt.js +0 -1
- package/uis/stock/dist/assets/LogViewer-DIliXy62.js +0 -1
- package/uis/stock/dist/assets/LogsView-B7Z-7RNg.js +0 -1
- package/uis/stock/dist/assets/Modal-DmKa5Qpp.js +0 -39
- package/uis/stock/dist/assets/ProxyView-DvZiNkwb.js +0 -1
- package/uis/stock/dist/assets/ServerDetailView-6idGT_EX.js +0 -2
- package/uis/stock/dist/assets/SettingsShell-CeGtleYI.js +0 -1
- package/uis/stock/dist/assets/SettingsView-BrhJIrmk.js +0 -2
- package/uis/stock/dist/assets/de-BRITeb0H.js +0 -1
- package/uis/stock/dist/assets/es-B2zIEssV.js +0 -1
- package/uis/stock/dist/assets/fr-s0ZOBEqh.js +0 -1
- package/uis/stock/dist/assets/index-C1MehbKy.css +0 -2
- package/uis/stock/dist/assets/index-CnBN54wF.js +0 -15
- package/uis/stock/dist/assets/ja-CU7MR85V.js +0 -1
- package/uis/stock/dist/assets/ko-tL5Me6d-.js +0 -1
- package/uis/stock/dist/assets/ru-92yrvkNJ.js +0 -1
- package/uis/stock/dist/assets/vi-CzvY16k2.js +0 -1
- package/uis/stock/dist/assets/zh-CN-DDwFW_uW.js +0 -1
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How the panel last stopped
|
|
3
|
-
*
|
|
4
|
-
* A clean `down` deletes `run.json`, and so does `up` when it finds a record with nothing behind the
|
|
5
|
-
* pid. So "no record" covered both "you stopped it" and "it died and the next start tidied up", and a
|
|
6
|
-
* script could only tell them apart by inferring from which *keys* were absent. This records the
|
|
7
|
-
* answer instead of leaving it to be guessed.
|
|
8
|
-
*
|
|
9
|
-
* Only a deliberate stop writes it. A panel that was killed has nobody to write anything, which is
|
|
10
|
-
* why a *stale record* stays the signal for that one — see `status`.
|
|
2
|
+
* How the panel last stopped, so `status` can tell "you stopped it" from "it died and the next start
|
|
3
|
+
* tidied up". Only a deliberate stop writes it; a killed panel is still signalled by a stale record.
|
|
11
4
|
*/
|
|
12
|
-
|
|
5
|
+
declare const lastStopSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
13
6
|
at: number;
|
|
14
7
|
reason: "down";
|
|
15
8
|
}, {}>;
|
|
16
9
|
export type LastStop = typeof lastStopSchema.infer;
|
|
17
|
-
/** Records a deliberate stop. Best-effort: a
|
|
10
|
+
/** Records a deliberate stop. Best-effort: a missing marker only costs `status` one detail. */
|
|
18
11
|
export declare function recordCleanStop(at?: number): void;
|
|
19
|
-
/** The last deliberate stop, or null when there is none (or it cannot be read). */
|
|
20
12
|
export declare function readLastStop(): LastStop | null;
|
|
13
|
+
export {};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { ConsolaInstance } from 'consola';
|
|
2
|
-
/**
|
|
3
|
-
* Note: this logger will log the `debug` level logs in development mode.
|
|
4
|
-
*
|
|
5
|
-
* For actual debug logs with `NODE_DEBUG`, it is recommended to use the `debug` package.
|
|
6
|
-
*/
|
|
2
|
+
/** Logs `debug` in development mode; for `NODE_DEBUG`-style tracing use the `debug` package. */
|
|
7
3
|
export declare const logger: ConsolaInstance;
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
import type { ResolverReturnType } from 'hono-openapi';
|
|
3
|
-
/**
|
|
4
|
-
* A JSON response body for `describeRoute`. The resolver needs a real Standard
|
|
5
|
-
* Schema, so only ArkType schemas go in here — never a hand-written JSON schema.
|
|
6
|
-
*/
|
|
3
|
+
/** A JSON response body for `describeRoute`. Only ArkType (Standard Schema) schemas go in here. */
|
|
7
4
|
export declare function jsonBody(schema: StandardSchemaV1): {
|
|
8
5
|
'application/json': {
|
|
9
6
|
schema: ResolverReturnType;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A `text/event-stream` response: the media type, plus a `oneOf` over the frame shapes with
|
|
11
|
+
* `discriminator: type` so a generator emits a discriminated union. `x-sse-events` names the
|
|
12
|
+
* `event:` labels, which OpenAPI has no way to express.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sseResponse(description: string, events?: readonly string[]): {
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly content: {
|
|
17
|
+
readonly 'text/event-stream': {
|
|
18
|
+
readonly schema: Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly 'x-sse-events': readonly string[];
|
|
22
|
+
};
|
|
23
|
+
/** A `multipart/form-data` body carrying one required `file` part, for `requestBody`. */
|
|
24
|
+
export declare const multipartFileBody: Record<string, unknown> & {
|
|
25
|
+
type: "object";
|
|
26
|
+
};
|
|
13
27
|
export declare const ERROR_RESPONSES: {
|
|
14
28
|
readonly 400: {
|
|
15
29
|
description: string;
|
|
@@ -1,112 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where home-hosted keeps everything it owns
|
|
3
|
-
*
|
|
4
|
-
* itself ships no configuration at all.
|
|
5
|
-
*
|
|
6
|
-
* Everything below `dataRoot/.hh`: the global panel state at its top level, and
|
|
7
|
-
* one directory per workspace. A workspace owns its settings, servers, secrets,
|
|
8
|
-
* logs and nanny state; only what is genuinely panel-wide (listener, auth,
|
|
9
|
-
* host vitals, backups, TLS, UI, run.json) stays global.
|
|
2
|
+
* Where home-hosted keeps everything it owns; `HHOSTED_HOME` overrides it. Under `dataRoot/.hh`: the
|
|
3
|
+
* panel-wide state at the top level, and one directory per workspace.
|
|
10
4
|
*/
|
|
11
5
|
export declare function resolveDataRoot(): string;
|
|
12
6
|
export declare const dataRoot: string;
|
|
13
7
|
/**
|
|
14
|
-
* The directory home-hosted was started from
|
|
15
|
-
* declared data directories) resolve against it, so the project's own launcher
|
|
16
|
-
* decides the base instead of wherever the package happens to be installed.
|
|
8
|
+
* The directory home-hosted was started from; relative entry paths resolve against it.
|
|
17
9
|
* `HHOSTED_PROJECT` pins it explicitly.
|
|
18
10
|
*/
|
|
19
11
|
export declare function resolveProjectDir(): string;
|
|
20
12
|
export declare const projectDir: string;
|
|
21
|
-
/** The internal state root: global files here, one directory per workspace. */
|
|
22
13
|
export declare const hhDir: string;
|
|
23
14
|
export declare const DEFAULT_WORKSPACE_ID = "default";
|
|
24
15
|
/**
|
|
25
|
-
* Creates `dir` (and its parents) for state this home owns, with `.hh` itself at `0700
|
|
26
|
-
*
|
|
27
|
-
* `.hh` holds server output, configs with `env` values and the proxy's keys, so it is the owner's
|
|
28
|
-
* alone. A bare `mkdirSync(..., { recursive: true })` under it made `.hh` `0755` whenever something
|
|
29
|
-
* other than `up` got there first — `backup list` on a fresh home did. Every creator goes through
|
|
30
|
-
* here, so the mode does not depend on which command ran first. A directory outside `.hh` is
|
|
31
|
-
* created as asked.
|
|
16
|
+
* Creates `dir` (and its parents) for state this home owns, with `.hh` itself at `0700` whichever
|
|
17
|
+
* command gets there first. A directory outside `.hh` is created as asked.
|
|
32
18
|
*/
|
|
33
|
-
export declare function ensureStateDir(dir?: string): void;
|
|
19
|
+
export declare function ensureStateDir(dir?: string, mode?: number): void;
|
|
34
20
|
/**
|
|
35
|
-
* A stable, non-reversible name for a state root
|
|
36
|
-
*
|
|
37
|
-
* The panel reports it on `/healthz` to a loopback caller, so a CLI with no `run.json` can tell its
|
|
38
|
-
* own panel from another home's panel (or anything else) on the configured port — two homes may
|
|
39
|
-
* share one. A hash, not the path, so the answer names no directory.
|
|
21
|
+
* A stable, non-reversible name for a state root, reported on `/healthz` to loopback callers so a CLI
|
|
22
|
+
* can tell its own panel from another home's on the same port.
|
|
40
23
|
*/
|
|
41
24
|
export declare function homeFingerprint(root?: string): string;
|
|
42
25
|
/** Panel-wide settings: listener, auth, TLS policy, host vitals, backups. */
|
|
43
26
|
export declare const globalSettingsPath: string;
|
|
44
27
|
/** Password hash + API token hash; written with mode 0600. */
|
|
45
28
|
export declare const globalSecretsPath: string;
|
|
46
|
-
/** The workspace registry: ids and labels. */
|
|
47
29
|
export declare const workspacesPath: string;
|
|
48
30
|
/** Uploaded TLS PEM pair (the key is written 0600). */
|
|
49
31
|
export declare const tlsDir: string;
|
|
50
|
-
/** The panel's own console log. */
|
|
51
32
|
export declare const daemonLogPath: string;
|
|
52
|
-
/** `run.json` records the live control plane. */
|
|
53
33
|
export declare const runtimePath: string;
|
|
54
|
-
/** The installed UI; `UiService` owns everything under it. */
|
|
55
34
|
export declare const uiDir: string;
|
|
56
|
-
/** Everything the reverse proxy owns: engine binary, its data, its state and logs. */
|
|
57
35
|
export declare const proxyDir: string;
|
|
58
36
|
/** The engine binary the panel installed, plus the record of what it installed. */
|
|
59
37
|
export declare const proxyBinDir: string;
|
|
60
38
|
/** The engine's own data and configuration directories, pinned away from `$HOME`. */
|
|
61
39
|
export declare const proxyEngineDir: string;
|
|
62
|
-
/** The generated engine configuration, rewritten on every change. */
|
|
63
40
|
export declare const proxyConfigPath: string;
|
|
64
41
|
/** The last configuration that applied, kept so a rejected change can be reverted. */
|
|
65
42
|
export declare const proxyPreviousConfigPath: string;
|
|
66
|
-
/** The nanny's spec and state for the engine process, so it outlives the panel. */
|
|
67
43
|
export declare const proxyStateDir: string;
|
|
68
|
-
/** How the panel reaches a running engine's admin endpoint. */
|
|
69
44
|
export declare const proxyAdminPath: string;
|
|
70
45
|
/** The PEM pair a route with `tls: "manual"` serves. */
|
|
71
46
|
export declare const proxyTlsDir: string;
|
|
72
47
|
/** The credentials the engine presents to the panel's DNS-01 endpoint, 0600. */
|
|
73
48
|
export declare const proxyChallengeAuthPath: string;
|
|
74
49
|
export declare function workspaceDir(id: string): string;
|
|
75
|
-
/** Workspace-scoped settings: server defaults, logs, notifications, DDNS. */
|
|
76
50
|
export declare function workspaceSettingsPath(id: string): string;
|
|
77
|
-
/** The servers a workspace supervises. */
|
|
78
51
|
export declare function workspaceServersPath(id: string): string;
|
|
52
|
+
/** A workspace's jobs: short-lived commands on cron schedules, kept apart from its servers. */
|
|
53
|
+
export declare function workspaceJobsPath(id: string): string;
|
|
79
54
|
/** Workspace secrets: Telegram bot token and DDNS credentials. Mode 0600. */
|
|
80
55
|
export declare function workspaceSecretsPath(id: string): string;
|
|
81
|
-
/** Rotated per-server JSONL logs. */
|
|
82
56
|
export declare function workspaceLogsDir(id: string): string;
|
|
83
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* A workspace's job logs, one file per job id. Its own directory: a job and a server may share an id,
|
|
59
|
+
* and it keeps these out of `LogFiles.prune()`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function workspaceJobsLogsDir(id: string): string;
|
|
84
62
|
export declare function workspaceHistoryPath(id: string): string;
|
|
85
63
|
/** Per-entry nanny state and spawn specs — how a persistent server survives a restart. */
|
|
86
64
|
export declare function workspaceStateDir(id: string): string;
|
|
87
|
-
/**
|
|
88
|
-
* The last public address each DDNS target was confirmed to serve.
|
|
89
|
-
*
|
|
90
|
-
* A name no server id can produce (ids carry no `.`): `ddns.json` is also the nanny state of a
|
|
91
|
-
* persistent entry with the id `ddns`, and each overwrote the other.
|
|
92
|
-
*/
|
|
65
|
+
/** The last address each DDNS target was confirmed to serve; the name no server id can produce (ids carry no `.`). */
|
|
93
66
|
export declare function workspaceDdnsStatePath(id: string): string;
|
|
94
67
|
/** Where releases before `ddns.cache.json` kept that cache, read once and then removed. */
|
|
95
68
|
export declare function workspaceLegacyDdnsStatePath(id: string): string;
|
|
96
|
-
/**
|
|
97
|
-
* Where a pre-workspace `$HHOSTED_HOME` kept its config and secrets: directly
|
|
98
|
-
* under `dataRoot`. Nothing reads these; they only identify an instance this
|
|
99
|
-
* release refuses to start against.
|
|
100
|
-
*/
|
|
69
|
+
/** Where a pre-workspace home kept its config and secrets; only used to refuse starting against one. */
|
|
101
70
|
export declare const legacy: {
|
|
102
71
|
readonly configPath: string;
|
|
103
72
|
readonly secretsPath: string;
|
|
104
73
|
};
|
|
105
|
-
/**
|
|
106
|
-
* True when a pre-workspace instance left state at the old paths **and** never
|
|
107
|
-
* crossed into `.hh`: `workspaces.json` means the layout is current, so a stray
|
|
108
|
-
* root-level copy beside it is not an old instance.
|
|
109
|
-
*/
|
|
74
|
+
/** A pre-workspace layout that never crossed into `.hh` (`workspaces.json` means the layout is current). */
|
|
110
75
|
export declare function hasLegacyLayout(): boolean;
|
|
111
76
|
/** Expands `~` and resolves relative paths against `base`, for config-declared paths. */
|
|
112
77
|
export declare function resolveUserPath(target: string, base?: string): string;
|
|
@@ -2,31 +2,16 @@ export interface LockRecord {
|
|
|
2
2
|
pid: number;
|
|
3
3
|
startedAt: number;
|
|
4
4
|
action: string;
|
|
5
|
-
/**
|
|
6
|
-
* The holder's own birth time where the platform reports one.
|
|
7
|
-
*
|
|
8
|
-
* `startedAt` is when the lock was taken, which says nothing about whether the pid still names the
|
|
9
|
-
* same process — comparing the two made a long-held lock look recycled. This is the value that
|
|
10
|
-
* answers the question directly, so a stale-reader compares like with like.
|
|
11
|
-
*/
|
|
5
|
+
/** The holder's own birth time, where the platform reports one. */
|
|
12
6
|
birthAt?: number | null;
|
|
13
7
|
}
|
|
14
8
|
export interface RestoreLock {
|
|
15
|
-
/** Releases the lock. Safe to call twice. */
|
|
16
9
|
release: () => void;
|
|
17
|
-
/** The holder, when the lock was taken over from a dead one. */
|
|
18
10
|
replaced?: LockRecord;
|
|
19
11
|
}
|
|
20
|
-
/** Wall-clock start of a pid in ms, or null where the platform cannot report one. */
|
|
21
12
|
export declare function processBirthSync(pid: number): number | null;
|
|
22
|
-
/** The live holder of the restore lock, without taking it; null when nobody is restoring. */
|
|
23
13
|
export declare function restoreLockHolder(hhDir: string): LockRecord | null;
|
|
24
|
-
/**
|
|
25
|
-
* Take the restore lock, or explain who holds it.
|
|
26
|
-
*
|
|
27
|
-
* `null` means somebody else is restoring. The caller reports it rather than queueing: a restore is
|
|
28
|
-
* an interactive decision, and waiting on one you did not start is not what a person asked for.
|
|
29
|
-
*/
|
|
14
|
+
/** Take the restore lock, or `null` when somebody else holds it (the caller reports, never queues). */
|
|
30
15
|
export declare function acquireRestoreLock(hhDir: string, action?: string): RestoreLock | {
|
|
31
16
|
heldBy: LockRecord;
|
|
32
17
|
};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How to run this CLI again in the same runtime
|
|
3
|
-
*
|
|
4
|
-
* not the package's. Shared by `up` (which re-spawns itself detached) and by the
|
|
5
|
-
* panel (which spawns a persistent entry's nanny).
|
|
6
|
-
*
|
|
7
|
-
* Nothing here reads a state directory, which is why the CLI can import it before
|
|
8
|
-
* `--home`/`--project` have been applied.
|
|
2
|
+
* How to run this CLI again in the same runtime (under tsx, with the resolved loader). Reads no
|
|
3
|
+
* state directory, so the CLI can import it before `--home`/`--project` are applied.
|
|
9
4
|
*/
|
|
10
5
|
export declare function runtimeArgs(): string[];
|
|
11
|
-
/**
|
|
12
|
-
* The hidden command a persistent entry runs under. It is spawned by the panel and
|
|
13
|
-
* never typed by a person, so it stays out of the curated CLI surface (help, the
|
|
14
|
-
* unknown-command message, flag refusal) — but the argv has to be one definition,
|
|
15
|
-
* because process identity reads it back: see `providers/identity.ts`.
|
|
16
|
-
*/
|
|
6
|
+
/** The hidden command a persistent entry runs under; one definition, because `providers/identity.ts` reads the argv back. */
|
|
17
7
|
export declare const NANNY_COMMAND = "__nanny";
|
|
18
8
|
export declare function nannyArgv(entry: string, id: string, specPath: string, statePath: string): string[];
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Compares two secrets
|
|
3
|
-
*
|
|
4
|
-
* `a !== b` short-circuits at the first differing byte, so an attacker who can measure response time
|
|
5
|
-
* recovers a secret one byte at a time. That matters wherever the secret is the *only* thing standing
|
|
6
|
-
* between a caller and a privileged action — the `/_hh` control channel, which is deliberately outside
|
|
7
|
-
* `/api` and guarded by nothing else.
|
|
8
|
-
*
|
|
9
|
-
* Length is compared first because `timingSafeEqual` **throws** on differing lengths. That leaks only
|
|
10
|
-
* the length, which is not secret here (the token has a fixed shape and a `hh_` prefix); rejecting it
|
|
11
|
-
* is what keeps a truncated header from becoming a 500.
|
|
2
|
+
* Compares two secrets in constant time. Length is checked first because `timingSafeEqual` throws on
|
|
3
|
+
* a mismatch; the length is not secret here.
|
|
12
4
|
*/
|
|
13
5
|
export declare function secretEqual(actual: string, expected: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '../config/store.js';
|
|
2
|
+
import type { ServerConfig } from '../shared/contracts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Adds one entry to a workspace, for every caller (`POST /api/servers`, `POST /_hh/servers`, offline
|
|
5
|
+
* `add`). A duplicate id is `409 SERVER_EXISTS`; anything the store refuses is `INVALID_SERVER`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function addServerEntry(store: WorkspaceStore, input: Record<string, unknown>): ServerConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Problems that only show when the entry fails to start, reported beside the success.
|
|
10
|
+
*
|
|
11
|
+
* `command` is a program spawned with no shell, so `"node server.js"` names a program with a space.
|
|
12
|
+
* Deliberately conservative: the split is only claimed when the part before the first space is a bare
|
|
13
|
+
* word with no path separator (`C:\Program Files\app.exe` is one program).
|
|
14
|
+
*/
|
|
15
|
+
export declare function serverWarnings(entry: Pick<ServerConfig, 'command' | 'args'>): string[];
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A value quoted for the shell
|
|
3
|
-
*
|
|
4
|
-
* One rule for every string this package prints for a person to copy: a directory, an id, a
|
|
5
|
-
* workspace. `init` printed `cd my servers && npm run up` for the default `./my-servers`-style
|
|
6
|
-
* directory a person picks, which the shell answers `cd: too many arguments` — a failure in the one
|
|
7
|
-
* line the scaffold exists to hand over.
|
|
8
|
-
*
|
|
9
|
-
* POSIX gets single quotes, with an embedded quote closed and reopened (`'\''`), the one form that is
|
|
10
|
-
* safe inside a single-quoted string. Windows' `cmd.exe` has no single-quote quoting at all, so it
|
|
11
|
-
* gets double quotes: that is what it understands, and a path whose name contains a `"` is not
|
|
12
|
-
* representable there either way.
|
|
13
|
-
*
|
|
14
|
-
* It cannot use the platform to *decide the shell*, only to pick the dialect: a POSIX path is
|
|
15
|
-
* quoted for `sh` even when the process is running on Windows (the panel's CLI under Git Bash), and
|
|
16
|
-
* a Windows path for `cmd.exe`. `process.platform` is the only signal available, so the rule is
|
|
17
|
-
* documented rather than guessed at each call site.
|
|
2
|
+
* A value quoted for the shell a person will paste it into. POSIX gets single quotes (`'\''` for an
|
|
3
|
+
* embedded one); `cmd.exe` has no single-quote quoting, so Windows gets double quotes.
|
|
18
4
|
*/
|
|
19
5
|
export declare function shellQuote(value: string): string;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { SSEStreamingApi } from 'hono/streaming';
|
|
2
2
|
/**
|
|
3
|
-
* One subscriber's outbound queue, bounded
|
|
4
|
-
*
|
|
5
|
-
* A client that stops reading without disconnecting must not grow the panel's memory: a queued
|
|
6
|
-
* `state` or `server` frame is replaced by the newer one (only the latest snapshot matters), and log
|
|
7
|
-
* frames are dropped once too many are waiting.
|
|
3
|
+
* One subscriber's outbound queue, bounded: a queued `state`/`server` frame is replaced by the newer
|
|
4
|
+
* one, and log frames are dropped once too many are waiting.
|
|
8
5
|
*/
|
|
9
6
|
export declare function sseChannel(stream: SSEStreamingApi): {
|
|
10
7
|
readonly closed: boolean;
|
|
11
8
|
close(): void;
|
|
12
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Queue a frame: `key` supersedes a queued frame with the same key; `droppable` caps it. A coalesced
|
|
11
|
+
* frame takes the newer id with its newer data, or a resuming client would be replayed frames it has.
|
|
12
|
+
*/
|
|
13
13
|
send(event: string, data: string, options?: {
|
|
14
14
|
key?: string;
|
|
15
15
|
droppable?: boolean;
|
|
16
|
+
id?: number;
|
|
17
|
+
retry?: number;
|
|
16
18
|
}): void;
|
|
17
19
|
};
|
|
18
20
|
/** The coalescing key for a hub message: snapshots supersede, logs and one-offs do not. */
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where an installed UI lives and whether one is there — deliberately free of the schema module, so
|
|
3
|
-
* a CLI command that only *names* the UI (`status`) does not pay for compiling every contract.
|
|
4
|
-
*/
|
|
1
|
+
/** Where an installed UI lives — free of the schema module, so `status` does not compile every contract. */
|
|
5
2
|
export declare function uiDirectory(dataRoot: string): string;
|
|
6
3
|
export declare function customUiInstalled(dataRoot: string): boolean;
|
|
7
|
-
/** `name`/`version` from `ui.json` when they are strings; the full, validated read is `UiService.readMeta`. */
|
|
8
4
|
export declare function uiIdentity(dataRoot: string): {
|
|
9
5
|
name: string | null;
|
|
10
6
|
version: string | null;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import type { Buffer } from 'node
|
|
2
|
-
/**
|
|
3
|
-
* Decodes one byte stream's chunks as UTF-8, carrying a character split across two chunks.
|
|
4
|
-
*
|
|
5
|
-
* A pipe or a bounded read cuts wherever it likes, so `chunk.toString()` per chunk turned a `€`
|
|
6
|
-
* straddling the cut into two U+FFFD. One decoder per stream, ended when the stream ends.
|
|
7
|
-
*/
|
|
1
|
+
import type { Buffer } from '../node-compat.js';
|
|
2
|
+
/** Decodes one stream's chunks as UTF-8, carrying a character split across two chunks. */
|
|
8
3
|
export declare class Utf8Chunks {
|
|
9
4
|
private decoder;
|
|
10
5
|
write(chunk: string | Buffer): string;
|
|
11
6
|
/** The stream ended: whatever incomplete bytes remain, rendered as U+FFFD. */
|
|
12
7
|
end(): string;
|
|
13
|
-
/** Drop held bytes without rendering them, e.g. when the source was replaced. */
|
|
14
8
|
reset(): void;
|
|
15
9
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validates a value that is not a request target (a
|
|
3
|
-
*
|
|
4
|
-
* Request bodies and queries that a route reads once go through the `validate()`
|
|
5
|
-
* middleware instead, which also carries the type into the handler.
|
|
2
|
+
* Validates a value that is not a request target (a URL parameter, a payload read by hand) into the
|
|
3
|
+
* standard error envelope. Request bodies and queries go through `validate()` instead.
|
|
6
4
|
*/
|
|
7
5
|
export declare function parseOrThrow<T>(schema: (input: unknown) => unknown, input: unknown, label: string): T;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
import type { ValidationTargets } from 'hono';
|
|
3
|
+
import { DetailedError } from '@namesmt/utils';
|
|
3
4
|
/**
|
|
4
|
-
* ArkType-backed request validation
|
|
5
|
-
*
|
|
6
|
-
* becomes a `DetailedError`, which the global error handler turns into the one
|
|
7
|
-
* error envelope this API speaks.
|
|
5
|
+
* ArkType-backed request validation: Hono stores the *parsed* value, so `c.req.valid('json')` is
|
|
6
|
+
* typed and normalised; a failure becomes a `DetailedError`.
|
|
8
7
|
*/
|
|
9
8
|
export declare function validate<Target extends keyof ValidationTargets, Schema extends StandardSchemaV1>(target: Target, schema: Schema): import("hono").MiddlewareHandler<import("hono").Env, string, {
|
|
10
9
|
in: (undefined extends StandardSchemaV1.InferInput<Schema> ? true : false) extends true ? { [K in Target]?: ([StandardSchemaV1.InferInput<Schema>] extends [ValidationTargets[K]] ? StandardSchemaV1.InferInput<Schema> : import("hono/validator").InferInput<StandardSchemaV1.InferInput<Schema>, K, import("hono/types").ParsedFormValue>) | undefined; } : { [K_1 in Target]: [StandardSchemaV1.InferInput<Schema>] extends [ValidationTargets[K_1]] ? StandardSchemaV1.InferInput<Schema> : import("hono/validator").InferInput<StandardSchemaV1.InferInput<Schema>, K_1, import("hono/types").ParsedFormValue>; };
|
|
11
10
|
out: { [K_2 in Target]: StandardSchemaV1.InferOutput<Schema>; };
|
|
12
11
|
}>;
|
|
12
|
+
/**
|
|
13
|
+
* The one `400 INVALID_INPUT` for input that did not validate — a request target here, a value read by
|
|
14
|
+
* hand in `parseOrThrow` — so both answer the same `detail` shape.
|
|
15
|
+
*/
|
|
16
|
+
export declare function invalidInput(message: string, issues: StandardSchemaV1.FailureResult['issues']): DetailedError;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/** The running release, read from the package manifest. */
|
|
2
1
|
export declare function appVersion(): string;
|
|
3
2
|
/** Where the package is installed: the base for files it ships (`uis/stock/dist`). */
|
|
4
3
|
export declare function packageRoot(): string;
|
|
5
|
-
/**
|
|
6
|
-
* The one line to add when this CLI and the panel it is talking to are not the same
|
|
7
|
-
* release — which is what a linked checkout, a global install and a project pin
|
|
8
|
-
* produce. `null` when they agree.
|
|
9
|
-
*/
|
|
4
|
+
/** The line to add when this CLI and the panel are different releases; `null` when they agree. */
|
|
10
5
|
export declare function versionMismatchNote(panelVersion: string): string | null;
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
1
2
|
import type { WorkspaceRuntime } from '../services/panel.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* schema did not name was silently dropped and the request ran against the **default** workspace:
|
|
7
|
-
* measured on the built panel, `POST /api/servers/<id>/stop?worspace=staging` answered
|
|
8
|
-
* `200 {"ok":true}` having stopped that entry in `default` — a destructive action applied to the
|
|
9
|
-
* wrong workspace because of one transposed letter, with nothing naming the typo. A misspelt
|
|
10
|
-
* workspace must be a refused key, never a different workspace.
|
|
11
|
-
*
|
|
12
|
-
* A route that reads a second query key merges its own schema with this one **as the argument**
|
|
13
|
-
* (`extra.merge(workspaceQuerySchema)`): `merge` keeps the argument's `onUndeclaredKey`, so that
|
|
14
|
-
* spelling inherits the rejection while the reverse would lose it.
|
|
4
|
+
* The one query key every workspace-scoped route reads. Strict: a misspelt `?worspace=` must be a
|
|
5
|
+
* refused key, never a run against the default workspace. A route adding a key writes
|
|
6
|
+
* `extra.merge(workspaceQuerySchema)` — `merge` keeps the argument's strictness.
|
|
15
7
|
*/
|
|
16
8
|
export declare const workspaceQuerySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
17
9
|
workspace?: string | undefined;
|
|
18
10
|
}, {}>;
|
|
19
11
|
/**
|
|
20
|
-
* Resolves the workspace a request is about.
|
|
21
|
-
*
|
|
22
|
-
* did on a single-workspace instance; naming one that does not exist is a 404,
|
|
23
|
-
* never a silent fallback to another workspace's servers.
|
|
12
|
+
* Resolves the workspace a request is about. Omitted means the default workspace; naming one that
|
|
13
|
+
* does not exist is a 404, never a fallback.
|
|
24
14
|
*/
|
|
25
15
|
export declare function requireWorkspace(select: (id?: string) => WorkspaceRuntime, id?: string): WorkspaceRuntime;
|
|
16
|
+
/**
|
|
17
|
+
* The workspace a `?workspace=`-scoped route acts on, from the query its `validate('query', …)` already
|
|
18
|
+
* checked. One call instead of threading `requireWorkspace` and the panel through every handler.
|
|
19
|
+
*/
|
|
20
|
+
export declare function workspaceOf(c: Context, deps: {
|
|
21
|
+
panel: {
|
|
22
|
+
requireWorkspace: (id?: string) => WorkspaceRuntime;
|
|
23
|
+
};
|
|
24
|
+
}): WorkspaceRuntime;
|
|
25
|
+
/**
|
|
26
|
+
* The workspaces a credential may read, or `null` for no narrowing.
|
|
27
|
+
*
|
|
28
|
+
* The token-scope guard checks routes that name a workspace. A panel-wide route that publishes
|
|
29
|
+
* per-workspace data asks this instead, so the guard, the feed, the scrape and the snapshots agree.
|
|
30
|
+
* A session of a limited account is narrowed too.
|
|
31
|
+
*/
|
|
32
|
+
export declare function workspaceLimit(c: Context): string[] | null;
|
|
33
|
+
export declare function limitAllows(limit: string[] | null, workspaceId: string): boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,9 +9,8 @@ export interface ControlPlaneOptions {
|
|
|
9
9
|
printConfig: boolean;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Runs the control plane in
|
|
13
|
-
*
|
|
14
|
-
* directly.
|
|
12
|
+
* Runs the control plane in this process until it is stopped. `up` detaches a child that calls this;
|
|
13
|
+
* `--foreground` (systemd, docker) calls it directly.
|
|
15
14
|
*/
|
|
16
15
|
export declare function runControlPlane(options: ControlPlaneOptions): Promise<void>;
|
|
17
16
|
export { ConfigWatch };
|
|
@@ -3,51 +3,32 @@ import type { AuthIdentity, AuthService } from '../services/auth.js';
|
|
|
3
3
|
import type { HistoryActor } from '../shared/contracts.js';
|
|
4
4
|
import { DetailedError } from '@namesmt/utils';
|
|
5
5
|
import { SESSION_COOKIE } from '../services/auth.js';
|
|
6
|
-
/**
|
|
7
|
-
* Endpoints the SPA needs before it can show a login form, plus sign-out: it is idempotent and
|
|
8
|
-
* CSRF-guarded, and a browser whose session already expired must still be able to clear its cookie.
|
|
9
|
-
*/
|
|
6
|
+
/** Reachable before sign-in; logout too, so an expired browser can still clear its cookie. */
|
|
10
7
|
export declare const PUBLIC_API_PATHS: ReadonlySet<string>;
|
|
11
8
|
/** 401s from the guard carry this code so the SPA can route to the login view. */
|
|
12
9
|
export declare const AUTH_REQUIRED_CODE = "AUTH_REQUIRED";
|
|
13
|
-
/** Auth is off and the caller is not this machine (a remote peer, or anything a proxy relayed). */
|
|
14
|
-
export declare const AUTH_DISABLED_CODE = "AUTH_DISABLED_REMOTE";
|
|
15
10
|
/**
|
|
16
|
-
* The one place that reads a request's credentials
|
|
17
|
-
*
|
|
11
|
+
* The one place that reads a request's credentials. The peer address travels with it so a guessing
|
|
12
|
+
* caller is rate-limited per address, like a failed sign-in.
|
|
18
13
|
*/
|
|
19
14
|
export declare function requestIdentity(c: Context, auth: AuthService, options?: {
|
|
20
15
|
slide?: boolean;
|
|
21
16
|
}): AuthIdentity;
|
|
22
17
|
/**
|
|
23
|
-
* Why this caller may not use `/api`, or null
|
|
24
|
-
*
|
|
25
|
-
* connect cannot outlive a sign-out, a password change or an expired session.
|
|
18
|
+
* Why this caller may not use `/api`, or null. A stream re-asks on every ping, so it cannot outlive
|
|
19
|
+
* a sign-out or an expired session.
|
|
26
20
|
*/
|
|
27
21
|
export declare function accessRefusal(c: Context, auth: AuthService, identity: AuthIdentity): DetailedError | null;
|
|
28
22
|
export interface AuthGuardDeps {
|
|
29
23
|
auth: AuthService;
|
|
30
|
-
/** Test hook: bind the guard to an explicit cookie header / ip. */
|
|
31
24
|
now?: () => number;
|
|
32
25
|
}
|
|
33
26
|
/**
|
|
34
|
-
* Guards every `/api/*` route
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* A request may prove itself with the session cookie or with an API token
|
|
38
|
-
* (`Authorization: Bearer …`), which is what lets a script or an agent drive the
|
|
39
|
-
* panel without a browser. Without a password (auth off, or on but unarmed) only
|
|
40
|
-
* this machine — or the token — is trusted; see `accessRefusal`.
|
|
41
|
-
*
|
|
42
|
-
* State-changing requests that carry an `Origin` must come from this same host:
|
|
43
|
-
* with `SameSite=Strict` cookies that closes the cross-site CSRF path.
|
|
27
|
+
* Guards every `/api/*` route with the session cookie or a bearer token. A state-changing request
|
|
28
|
+
* with an `Origin` must come from this host, which with `SameSite=Strict` closes CSRF.
|
|
44
29
|
*/
|
|
45
30
|
export declare function createAuthGuard(deps: AuthGuardDeps): MiddlewareHandler;
|
|
46
31
|
export { SESSION_COOKIE };
|
|
47
|
-
/**
|
|
48
|
-
* Who is behind a request, as a history event names them: a cookie is a person at
|
|
49
|
-
* the panel, a bearer token is a script or an agent. Anonymous callers can only be
|
|
50
|
-
* loopback requests while auth is unarmed, which is the browser's own origin.
|
|
51
|
-
*/
|
|
32
|
+
/** A cookie is a person at the panel; a bearer token is a script or an agent. */
|
|
52
33
|
export declare function requestActor(c: Context, auth: AuthService): HistoryActor;
|
|
53
34
|
export { isLoopbackRequest, requestIp } from './loopback.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from 'hono';
|
|
2
|
+
/** The panel-wide ceiling on a JSON request body, in bytes. File uploads are exempt and set their own. */
|
|
3
|
+
export declare const MAX_JSON_BODY_BYTES: number;
|
|
4
|
+
/** Refuses an oversized body before it is read. Runs after the auth guards, so identity is checked first. */
|
|
5
|
+
export declare function createBodyLimitGuard(): MiddlewareHandler;
|
|
6
|
+
/**
|
|
7
|
+
* The same ceiling for a route that carries a file. Counts the stream through a `TransformStream`
|
|
8
|
+
* instead of `hono/body-limit`, whose request re-wrap fails on srvx with a 500.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createBodyCeiling(maxBytes: number, message?: string, code?: string): MiddlewareHandler;
|
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
* The authority a request named, from either protocol.
|
|
4
|
-
*
|
|
5
|
-
* HTTP/2 carries no `Host` header — the name arrives as the `:authority` pseudo-header, which srvx
|
|
6
|
-
* keeps on the underlying node request and filters out of the header bag. Reading only `host` left
|
|
7
|
-
* the guard blind on every TLS listener, so a rebound name reached the app unchecked.
|
|
8
|
-
*
|
|
9
|
-
* Deliberately **not** `new URL(c.req.url).host`: with `trustProxy: 'loopback'` srvx builds that
|
|
10
|
-
* from `X-Forwarded-Host`, which a rebound page sets freely (it is same-origin with the panel, so no
|
|
11
|
-
* preflight stops it) — using it would hand the attacker back the field being checked.
|
|
12
|
-
*/
|
|
13
|
-
export declare function requestAuthority(c: Context): string | undefined;
|
|
1
|
+
import type { MiddlewareHandler } from 'hono';
|
|
14
2
|
/** The hostname part of a `Host` header: port and IPv6 brackets dropped, lowercased. */
|
|
15
3
|
export declare function hostnameOf(header: string): string;
|
|
16
4
|
/**
|
|
17
|
-
* Whether a request's `Host` names this panel rather than
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the panel — the `Origin` check cannot see it. An IP literal or a name no public DNS can answer
|
|
21
|
-
* (`localhost`, a single label, `.local`, `.lan`, …) cannot be rebound by a remote site, so those are
|
|
22
|
-
* always allowed; a public name must be one the person declared or a proxy route serving the panel.
|
|
23
|
-
*
|
|
24
|
-
* A request that names no host at all is **refused**: HTTP/1.1 requires `Host`, so its absence means
|
|
25
|
-
* the caller reached us through a channel this guard cannot inspect — and answering `true` there is
|
|
26
|
-
* what turned "no `Host` over HTTP/2" into an open door rather than a closed one.
|
|
5
|
+
* Whether a request's `Host` names this panel rather than a DNS-rebinding domain. IP literals and
|
|
6
|
+
* names no public DNS answers are allowed; a public name must be declared or a panel proxy route.
|
|
7
|
+
* A missing host is refused.
|
|
27
8
|
*/
|
|
28
9
|
export declare function isAllowedHost(header: string | undefined, allowed: Iterable<string>): boolean;
|
|
29
10
|
export declare function createHostGuard(allowed: () => Iterable<string>): MiddlewareHandler;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/** Client address helpers shared by the auth guard and the setup routes. */
|
|
2
1
|
export declare function requestIp(c: {
|
|
3
2
|
req: {
|
|
4
3
|
raw: unknown;
|
|
5
4
|
};
|
|
6
5
|
}): string | null;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Whether the request was made on this machine, by something that did not relay it.
|
|
10
|
-
*
|
|
11
|
-
* The panel's own reverse proxy connects from 127.0.0.1, so a loopback peer alone would hand every
|
|
12
|
-
* internet client this machine's trust (the "no password set yet" pass, first-setup, `/_hh`).
|
|
13
|
-
*/
|
|
6
|
+
/** Whether the request was made on this machine, by something that did not relay it. */
|
|
14
7
|
export declare function isLoopbackRequest(c: {
|
|
15
8
|
req: {
|
|
16
9
|
raw: unknown;
|