@stacksjs/ts-cloud 0.7.18 → 0.7.20

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.
Files changed (61) hide show
  1. package/dist/bin/cli.js +697 -571
  2. package/dist/{chunk-h4pdjzq2.js → chunk-qdhn1s7j.js} +745 -52
  3. package/dist/{chunk-vpyd42tp.js → chunk-xgnxz5dz.js} +98 -34
  4. package/dist/deploy/dashboard-auth.d.ts +82 -0
  5. package/dist/deploy/dashboard-auth.test.d.ts +1 -0
  6. package/dist/deploy/dashboard-guard.d.ts +40 -0
  7. package/dist/deploy/dashboard-login-page.d.ts +16 -0
  8. package/dist/deploy/dashboard-pages.test.d.ts +1 -0
  9. package/dist/deploy/dashboard-policy.d.ts +37 -0
  10. package/dist/deploy/dashboard-policy.test.d.ts +1 -0
  11. package/dist/deploy/dashboard-scope.d.ts +24 -0
  12. package/dist/deploy/dashboard-scope.test.d.ts +1 -0
  13. package/dist/deploy/dashboard-session.d.ts +52 -0
  14. package/dist/deploy/dashboard-users.d.ts +60 -0
  15. package/dist/deploy/index.js +2 -2
  16. package/dist/deploy/local-dashboard-server.d.ts +1 -0
  17. package/dist/drivers/hetzner/client.d.ts +9 -1
  18. package/dist/drivers/hetzner/config.d.ts +83 -0
  19. package/dist/drivers/hetzner/config.test.d.ts +1 -0
  20. package/dist/drivers/hetzner/factory-wiring.test.d.ts +1 -0
  21. package/dist/drivers/index.js +1 -1
  22. package/dist/index.js +2 -2
  23. package/dist/ui/index.html +4 -4
  24. package/dist/ui/server/actions.html +4 -4
  25. package/dist/ui/server/activity.html +1 -1
  26. package/dist/ui/server/backups.html +4 -4
  27. package/dist/ui/server/database.html +4 -4
  28. package/dist/ui/server/deployments.html +4 -4
  29. package/dist/ui/server/diagnostics.html +1 -1
  30. package/dist/ui/server/firewall.html +4 -4
  31. package/dist/ui/server/logs.html +4 -4
  32. package/dist/ui/server/metrics.html +1 -1
  33. package/dist/ui/server/security.html +1 -1
  34. package/dist/ui/server/services.html +4 -4
  35. package/dist/ui/server/sites.html +4 -4
  36. package/dist/ui/server/ssh-keys.html +4 -4
  37. package/dist/ui/server/team.html +1214 -0
  38. package/dist/ui/server/terminal.html +4 -4
  39. package/dist/ui/server/workers.html +4 -4
  40. package/dist/ui/serverless/alarms.html +4 -4
  41. package/dist/ui/serverless/assets.html +4 -4
  42. package/dist/ui/serverless/cost.html +1 -1
  43. package/dist/ui/serverless/data.html +4 -4
  44. package/dist/ui/serverless/deployments.html +4 -4
  45. package/dist/ui/serverless/firewall.html +1 -1
  46. package/dist/ui/serverless/functions.html +4 -4
  47. package/dist/ui/serverless/logs.html +4 -4
  48. package/dist/ui/serverless/metrics.html +1 -1
  49. package/dist/ui/serverless/queues.html +4 -4
  50. package/dist/ui/serverless/scheduler.html +4 -4
  51. package/dist/ui/serverless/secrets.html +4 -4
  52. package/dist/ui/serverless/traces.html +4 -4
  53. package/dist/ui/serverless.html +4 -4
  54. package/dist/ui-src/pages/partials/head.stx +7 -0
  55. package/dist/ui-src/pages/partials/nav.stx +43 -6
  56. package/dist/ui-src/pages/server/deployments.stx +20 -5
  57. package/dist/ui-src/pages/server/firewall.stx +1 -1
  58. package/dist/ui-src/pages/server/logs.stx +26 -8
  59. package/dist/ui-src/pages/server/sites.stx +42 -20
  60. package/dist/ui-src/pages/server/team.stx +171 -0
  61. package/package.json +3 -3
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The single place Hetzner settings are resolved.
3
+ *
4
+ * Every Hetzner value can come from several sources, and they used to be
5
+ * resolved ad-hoc wherever they were needed: the driver, the API client and the
6
+ * dashboard each had their own chain, with defaults duplicated at call sites.
7
+ * That drifted — the dashboard honored `HETZNER_LOCATION` while the driver did
8
+ * not, so a box provisioned in `fsn1` was reported as being somewhere else.
9
+ *
10
+ * One precedence, applied everywhere:
11
+ *
12
+ * 1. an explicit argument (a driver option — the caller means it)
13
+ * 2. `cloud.config.ts` → `hetzner.*` (checked into the repo, reviewable)
14
+ * 3. environment (`HCLOUD_*`, with the `HETZNER_*` alias) — for secrets and
15
+ * per-machine overrides
16
+ * 4. the documented default in {@link HETZNER_DEFAULTS}
17
+ *
18
+ * Config beats environment deliberately, for every field without exception: a
19
+ * value written in `cloud.config.ts` is the reviewed intent for the project,
20
+ * and a stray shell export should not silently redirect a deploy to another
21
+ * datacenter or another account. One rule, no special cases to remember.
22
+ *
23
+ * In practice the token is simply left out of `cloud.config.ts` (it is a
24
+ * secret), so it comes from `HCLOUD_TOKEN` — but that is a convention, not a
25
+ * different precedence.
26
+ */
27
+ import type { CloudConfig } from '@ts-cloud/core';
28
+ /** The documented defaults. These are the only place a Hetzner default lives. */
29
+ export declare const HETZNER_DEFAULTS: {
30
+ /** Falkenstein, Germany. */
31
+ readonly location: 'fsn1';
32
+ readonly image: 'ubuntu-24.04';
33
+ readonly sshUser: 'root';
34
+ readonly sshPrivateKeyPath: '~/.ssh/id_ed25519';
35
+ };
36
+ /** `~/…` → an absolute path. Hetzner key paths are user-supplied and often use `~`. */
37
+ export declare function expandHome(path: string): string;
38
+ /**
39
+ * The Hetzner API token, or undefined when none is set.
40
+ *
41
+ * Never defaulted: a missing token must fail loudly at the call site rather
42
+ * than silently targeting the wrong account. Callers that need one should use
43
+ * `requireHetznerApiToken`.
44
+ */
45
+ export declare function resolveHetznerApiToken(explicit?: string, config?: CloudConfig): string | undefined;
46
+ /** Datacenter location slug, e.g. `fsn1`, `nbg1`, `hel1`. */
47
+ export declare function resolveHetznerLocation(config?: CloudConfig, explicit?: string): string;
48
+ /**
49
+ * Server image slug.
50
+ *
51
+ * `infrastructure.compute.image` wins over `hetzner.image`: it is the
52
+ * provider-agnostic way to pin an image (and is what a golden-image bake sets),
53
+ * so it is the more specific statement of intent.
54
+ */
55
+ export declare function resolveHetznerImage(config?: CloudConfig, explicit?: string): string;
56
+ /** SSH user for deploy commands. */
57
+ export declare function resolveHetznerSshUser(config?: CloudConfig, explicit?: string): string;
58
+ /** Absolute path to the SSH private key used for deploy commands. */
59
+ export declare function resolveHetznerSshPrivateKeyPath(config?: CloudConfig, explicit?: string): string;
60
+ /**
61
+ * Absolute path to the SSH public key uploaded to Hetzner. Defaults to the
62
+ * private key's path with `.pub`, which is where `ssh-keygen` puts it.
63
+ */
64
+ export declare function resolveHetznerSshPublicKeyPath(config?: CloudConfig, explicit?: string, privateKeyPath?: string): string;
65
+ /** Every resolved Hetzner setting, for a driver or a diagnostic to read at once. */
66
+ export interface ResolvedHetznerSettings {
67
+ apiToken?: string;
68
+ location: string;
69
+ image: string;
70
+ sshUser: string;
71
+ sshPrivateKeyPath: string;
72
+ sshPublicKeyPath: string;
73
+ }
74
+ export interface HetznerOverrides {
75
+ apiToken?: string;
76
+ location?: string;
77
+ image?: string;
78
+ sshUser?: string;
79
+ sshPrivateKeyPath?: string;
80
+ sshPublicKeyPath?: string;
81
+ }
82
+ /** Resolve the full Hetzner settings for `config`, applying `overrides` first. */
83
+ export declare function resolveHetznerSettings(config?: CloudConfig, overrides?: HetznerOverrides): ResolvedHetznerSettings;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -48,7 +48,7 @@ import {
48
48
  waitForCloudInit,
49
49
  waitForSsh,
50
50
  wrapCloudInitUserData
51
- } from "../chunk-vpyd42tp.js";
51
+ } from "../chunk-xgnxz5dz.js";
52
52
  import"../chunk-49nmy775.js";
53
53
  import"../chunk-93hjhs78.js";
54
54
  import"../chunk-qpj3edwz.js";
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  sanitizeCloudConfig,
56
56
  setMaintenance,
57
57
  startLocalDashboardServer
58
- } from "./chunk-h4pdjzq2.js";
58
+ } from "./chunk-qdhn1s7j.js";
59
59
  import {
60
60
  buildAndPushServerlessImage
61
61
  } from "./chunk-qgnyzfmx.js";
@@ -105,7 +105,7 @@ import {
105
105
  waitForCloudInit,
106
106
  waitForSsh,
107
107
  wrapCloudInitUserData
108
- } from "./chunk-vpyd42tp.js";
108
+ } from "./chunk-xgnxz5dz.js";
109
109
  import {
110
110
  ABTestManager,
111
111
  AI,