sporades 0.1.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.
Files changed (112) hide show
  1. package/Dockerfile.base +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +289 -0
  4. package/bin/sporades-host-helper.js +4001 -0
  5. package/bin/sporades.js +14198 -0
  6. package/dist/base-image.d.ts +43 -0
  7. package/dist/base-image.d.ts.map +1 -0
  8. package/dist/base-image.js +53 -0
  9. package/dist/base-image.js.map +1 -0
  10. package/dist/bundle-pipeline.d.ts +110 -0
  11. package/dist/bundle-pipeline.d.ts.map +1 -0
  12. package/dist/bundle-pipeline.js +369 -0
  13. package/dist/bundle-pipeline.js.map +1 -0
  14. package/dist/capsule-services.d.ts +94 -0
  15. package/dist/capsule-services.d.ts.map +1 -0
  16. package/dist/capsule-services.js +310 -0
  17. package/dist/capsule-services.js.map +1 -0
  18. package/dist/cli/cli-help.d.ts +16 -0
  19. package/dist/cli/cli-help.d.ts.map +1 -0
  20. package/dist/cli/cli-help.js +202 -0
  21. package/dist/cli/cli-help.js.map +1 -0
  22. package/dist/cli/cli-support.d.ts +17 -0
  23. package/dist/cli/cli-support.d.ts.map +1 -0
  24. package/dist/cli/cli-support.js +46 -0
  25. package/dist/cli/cli-support.js.map +1 -0
  26. package/dist/cli/github-autodeploy-workflow.d.ts +7 -0
  27. package/dist/cli/github-autodeploy-workflow.d.ts.map +1 -0
  28. package/dist/cli/github-autodeploy-workflow.js +185 -0
  29. package/dist/cli/github-autodeploy-workflow.js.map +1 -0
  30. package/dist/cli/host-helper-archive.d.ts +9 -0
  31. package/dist/cli/host-helper-archive.d.ts.map +1 -0
  32. package/dist/cli/host-helper-archive.js +74 -0
  33. package/dist/cli/host-helper-archive.js.map +1 -0
  34. package/dist/cli/host-helper-config.d.ts +15 -0
  35. package/dist/cli/host-helper-config.d.ts.map +1 -0
  36. package/dist/cli/host-helper-config.js +111 -0
  37. package/dist/cli/host-helper-config.js.map +1 -0
  38. package/dist/cli/host-helper-contract.d.ts +5 -0
  39. package/dist/cli/host-helper-contract.d.ts.map +1 -0
  40. package/dist/cli/host-helper-contract.js +5 -0
  41. package/dist/cli/host-helper-contract.js.map +1 -0
  42. package/dist/cli/host-helper-docker-types.d.ts +27 -0
  43. package/dist/cli/host-helper-docker-types.d.ts.map +1 -0
  44. package/dist/cli/host-helper-docker-types.js +2 -0
  45. package/dist/cli/host-helper-docker-types.js.map +1 -0
  46. package/dist/cli/host-helper-json.d.ts +6 -0
  47. package/dist/cli/host-helper-json.d.ts.map +1 -0
  48. package/dist/cli/host-helper-json.js +2 -0
  49. package/dist/cli/host-helper-json.js.map +1 -0
  50. package/dist/cli/host-helper-release-files.d.ts +4 -0
  51. package/dist/cli/host-helper-release-files.d.ts.map +1 -0
  52. package/dist/cli/host-helper-release-files.js +21 -0
  53. package/dist/cli/host-helper-release-files.js.map +1 -0
  54. package/dist/cli/host-helper-requests.d.ts +163 -0
  55. package/dist/cli/host-helper-requests.d.ts.map +1 -0
  56. package/dist/cli/host-helper-requests.js +2 -0
  57. package/dist/cli/host-helper-requests.js.map +1 -0
  58. package/dist/cli/host-helper-validation.d.ts +27 -0
  59. package/dist/cli/host-helper-validation.d.ts.map +1 -0
  60. package/dist/cli/host-helper-validation.js +256 -0
  61. package/dist/cli/host-helper-validation.js.map +1 -0
  62. package/dist/cli/host-request-builders.d.ts +143 -0
  63. package/dist/cli/host-request-builders.d.ts.map +1 -0
  64. package/dist/cli/host-request-builders.js +266 -0
  65. package/dist/cli/host-request-builders.js.map +1 -0
  66. package/dist/cli/hosted-capsule-contract.d.ts +128 -0
  67. package/dist/cli/hosted-capsule-contract.d.ts.map +1 -0
  68. package/dist/cli/hosted-capsule-contract.js +2 -0
  69. package/dist/cli/hosted-capsule-contract.js.map +1 -0
  70. package/dist/cli/sporades-host-helper.d.ts +3 -0
  71. package/dist/cli/sporades-host-helper.d.ts.map +1 -0
  72. package/dist/cli/sporades-host-helper.js +3120 -0
  73. package/dist/cli/sporades-host-helper.js.map +1 -0
  74. package/dist/cli/sporades.d.ts +3 -0
  75. package/dist/cli/sporades.d.ts.map +1 -0
  76. package/dist/cli/sporades.js +4066 -0
  77. package/dist/cli/sporades.js.map +1 -0
  78. package/dist/client.d.ts +7 -0
  79. package/dist/client.d.ts.map +1 -0
  80. package/dist/client.js +9 -0
  81. package/dist/client.js.map +1 -0
  82. package/dist/runtime-restart-policy.d.ts +29 -0
  83. package/dist/runtime-restart-policy.d.ts.map +1 -0
  84. package/dist/runtime-restart-policy.js +53 -0
  85. package/dist/runtime-restart-policy.js.map +1 -0
  86. package/dist/sealed-server-env.d.ts +56 -0
  87. package/dist/sealed-server-env.d.ts.map +1 -0
  88. package/dist/sealed-server-env.js +170 -0
  89. package/dist/sealed-server-env.js.map +1 -0
  90. package/dist/server-runtime-source.d.ts +1262 -0
  91. package/dist/server-runtime-source.d.ts.map +1 -0
  92. package/dist/server-runtime-source.js +6397 -0
  93. package/dist/server-runtime-source.js.map +1 -0
  94. package/dist/server.d.ts +58 -0
  95. package/dist/server.d.ts.map +1 -0
  96. package/dist/server.js +183 -0
  97. package/dist/server.js.map +1 -0
  98. package/dist/templates/client-runtime-template.d.ts +2 -0
  99. package/dist/templates/client-runtime-template.d.ts.map +1 -0
  100. package/dist/templates/client-runtime-template.js +438 -0
  101. package/dist/templates/client-runtime-template.js.map +1 -0
  102. package/dist/templates/scaffold-template.d.ts +19 -0
  103. package/dist/templates/scaffold-template.d.ts.map +1 -0
  104. package/dist/templates/scaffold-template.js +1201 -0
  105. package/dist/templates/scaffold-template.js.map +1 -0
  106. package/dist/templates/server-bundle-template.d.ts +8 -0
  107. package/dist/templates/server-bundle-template.d.ts.map +1 -0
  108. package/dist/templates/server-bundle-template.js +162 -0
  109. package/dist/templates/server-bundle-template.js.map +1 -0
  110. package/package.json +44 -0
  111. package/src/types/client.d.ts +161 -0
  112. package/src/types/server.d.ts +300 -0
@@ -0,0 +1,202 @@
1
+ const HELP_TEXT = {
2
+ create: `Usage: sporades create <name> [options]
3
+
4
+ Scaffold a new Capsule.
5
+
6
+ Options:
7
+ --framework <name> Client framework: react or preact
8
+ --template <name> Template: blank, todo, guestbook, or photo-library
9
+ --no-install Skip npm install
10
+ --no-git Skip git initialization
11
+ --json Write JSON output
12
+ --help, -h Show this help
13
+ `,
14
+ dev: `Usage: sporades dev [status|stop|reset] [options]
15
+
16
+ Start and manage a local Dev session.
17
+
18
+ Commands:
19
+ dev Start a Dev session
20
+ dev status Print Dev session status
21
+ dev stop Stop the running Dev session
22
+ dev reset Stop the Dev session and remove local Dev state
23
+
24
+ Options:
25
+ --port <number> Dev session port when starting
26
+ --public Allow non-localhost access when starting
27
+ --json Write JSON output
28
+ --help, -h Show this help
29
+ `,
30
+ auth: `Usage: sporades auth <command> [options]
31
+
32
+ Manage local auth configuration and identity simulation.
33
+
34
+ Commands:
35
+ status Print auth provider status
36
+ clients List connected Dev session clients
37
+ set google Configure Google OAuth credentials
38
+ as email Simulate a local email identity
39
+
40
+ Options:
41
+ --client-id <id> Google OAuth client ID
42
+ --client-secret <secret> Google OAuth client secret
43
+ --client-json <path> Read Google OAuth credentials JSON
44
+ --email <address> Simulated email identity
45
+ --display-name <name> Simulated display name
46
+ --picture <url> Simulated profile picture URL
47
+ --port <number> Target Dev session port
48
+ --client <target> Delivery target: current, all, or a client ID
49
+ --json Write JSON output
50
+ --help, -h Show this help
51
+ `,
52
+ security: `Usage: sporades security [options]
53
+
54
+ Inspect effective Capsule security policy.
55
+
56
+ Options:
57
+ --session <name> Session: dev, public-dev, container, or hosted
58
+ --json Write JSON output
59
+ --help, -h Show this help
60
+ `,
61
+ env: `Usage: sporades env <command> [options]
62
+
63
+ Manage Sealed Server env.
64
+
65
+ Commands:
66
+ init Create local Sealed Server env key material
67
+ import Import Server env values from a file
68
+ status Print Sealed Server env status
69
+ export Export Sealed Server env for a Host profile
70
+ reencrypt Re-encrypt local Sealed Server env material
71
+
72
+ Options:
73
+ --file <path> Input file for import or export
74
+ --host <alias> Host profile alias
75
+ --subname <name> Hosted Capsule subname
76
+ --output <path> Export output path
77
+ --sealed Treat input as an already sealed export
78
+ --json Write JSON output
79
+ --help, -h Show this help
80
+ `,
81
+ deploy: `Usage: sporades deploy [status|stop|restart|remove|reset] [options]
82
+
83
+ Start and manage a local Container session.
84
+
85
+ Commands:
86
+ deploy Start a local Container session
87
+ deploy status Print Container session status
88
+ deploy stop Stop the running Container session
89
+ deploy restart Restart the running Container session
90
+ deploy remove Remove the Container session
91
+ deploy reset Remove the Container session and local container state
92
+
93
+ Options:
94
+ --port <number> Published local port when starting
95
+ --force Replace stale or conflicting container state when starting
96
+ --json Write JSON output
97
+ --help, -h Show this help
98
+ `,
99
+ host: `Usage: sporades host <command> [options]
100
+
101
+ Manage Host profiles and Hosted Capsules.
102
+
103
+ Profile commands:
104
+ add <alias> Add a Host profile
105
+ use <alias> Set the default Host profile
106
+ current Print the selected Host profile
107
+ bootstrap Provision the remote Host server
108
+ health [subname] Check Host server or Hosted Capsule health
109
+
110
+ Capsule commands:
111
+ bind <subname> Bind this project to a Hosted Capsule
112
+ register <subname> Register a Hosted Capsule
113
+ push Push and install a Hosted Capsule release
114
+ start <subname> Start a Hosted Capsule
115
+ stop <subname> Stop a Hosted Capsule
116
+ restart <subname> Restart a Hosted Capsule
117
+ stats [subname] Print Host server or Hosted Capsule stats
118
+ logs [source] Print Hosted Capsule logs
119
+ releases <subname> List Hosted Capsule releases
120
+ rollback <subname> <release-id>
121
+ Roll back to a previous release
122
+ rotate-key <subname>
123
+ Rotate Hosted Capsule Sealed Server env keys
124
+ unregister <subname>
125
+ Unregister a Hosted Capsule
126
+ delete <subname> Delete Hosted Capsule storage
127
+
128
+ Other commands:
129
+ list List Hosted Capsules
130
+ github workflow write
131
+ Write a GitHub Actions deploy workflow
132
+ invoke <action> Invoke a low-level remote Host helper action
133
+
134
+ Options:
135
+ --host <alias> Host profile alias
136
+ --server <target> SSH target for host add
137
+ --domain <domain> Hosted domain for host add
138
+ --remote-root <path>
139
+ Remote root path for host add
140
+ --tls <mode> TLS mode: automatic or cloudflare-origin
141
+ --subname <name> Hosted Capsule subname
142
+ --lines <n>, -n <n> Log line count
143
+ --restart Restart after host push
144
+ --verify Verify release health after host push
145
+ --fallback-to-previous-release
146
+ Roll back when verified push fails
147
+ --branch <name> GitHub workflow branch
148
+ --file <path> GitHub workflow output path
149
+ --dry-run Print workflow without writing it
150
+ --force Overwrite workflow output when writing it
151
+ --json Write JSON output
152
+ --help, -h Show this help
153
+ `,
154
+ logs: `Usage: sporades logs [tail] [options]
155
+
156
+ Print Dev session logs.
157
+
158
+ Commands:
159
+ logs Print recent Dev session logs
160
+ logs tail Follow Dev session logs
161
+
162
+ Options:
163
+ --port <number> Target Dev session or local Container port
164
+ --json Write JSON output
165
+ --help, -h Show this help
166
+ `,
167
+ db: `Usage: sporades db <command> [options]
168
+
169
+ Inspect the Dev session database.
170
+
171
+ Commands:
172
+ list List database tables
173
+ dump Dump database contents
174
+ query <sql> Run a read-only SQL query
175
+
176
+ Options:
177
+ --port <number> Target Dev session or local Container port
178
+ --json Write JSON output
179
+ --help, -h Show this help
180
+ `,
181
+ default: `Usage: sporades <command> [options]
182
+
183
+ Commands:
184
+ create <name> Scaffold a new Capsule
185
+ dev Start a local Dev session
186
+ auth Manage local auth configuration and simulation
187
+ security Inspect effective Capsule security policy
188
+ env Manage Sealed Server env
189
+ deploy Start a local Container session
190
+ host Manage Host profiles and Hosted Capsules
191
+ logs Print Dev session logs
192
+ db Inspect the Dev session database
193
+
194
+ Options:
195
+ --help, -h Show help for command
196
+ --json Write JSON output when supported by the command
197
+ `,
198
+ };
199
+ export function renderCliHelp(command) {
200
+ return HELP_TEXT[command] ?? HELP_TEXT.default;
201
+ }
202
+ //# sourceMappingURL=cli-help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-help.js","sourceRoot":"","sources":["../../src/cli/cli-help.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE;;;;;;;;;;;CAWT;IACC,GAAG,EAAE;;;;;;;;;;;;;;;CAeN;IACC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBP;IACC,QAAQ,EAAE;;;;;;;;CAQX;IACC,GAAG,EAAE;;;;;;;;;;;;;;;;;;;CAmBN;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;;CAiBT;IACC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDP;IACC,IAAI,EAAE;;;;;;;;;;;;CAYP;IACC,EAAE,EAAE;;;;;;;;;;;;;CAaL;IACC,OAAO,EAAE;;;;;;;;;;;;;;;;KAgBN;CACK,CAAC;AAIX,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,SAAS,CAAC,OAAyB,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC;AACnE,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type LooseRecord = Record<string, any>;
2
+ export type CommandError = Error & {
3
+ hint?: string;
4
+ diagnostics?: unknown;
5
+ };
6
+ export type HelperError = Error & {
7
+ hint?: string;
8
+ diagnostics?: unknown;
9
+ };
10
+ export declare function errorDetails(error: unknown): LooseRecord;
11
+ export declare function commandError(message: string, hint: string, diagnostics?: unknown): CommandError;
12
+ export declare function helperError(message: string, hint: string, diagnostics?: unknown): HelperError;
13
+ export declare function readStdin(): Promise<string>;
14
+ export declare function delay(ms: number): Promise<void>;
15
+ export declare function writeResult(result: LooseRecord, failed?: boolean): void;
16
+ export declare function writeEnvelope(result: LooseRecord, failed?: boolean): void;
17
+ //# sourceMappingURL=cli-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-support.d.ts","sourceRoot":"","sources":["../../src/cli/cli-support.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAKxD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,GAAG,YAAY,CAOrG;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,GAAG,WAAW,CAOnG;AAED,wBAAgB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAU3C;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,iBAE/B;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,UAAQ,QAK9D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,UAAQ,QAEhE"}
@@ -0,0 +1,46 @@
1
+ export function errorDetails(error) {
2
+ if (error === null || error === undefined) {
3
+ return {};
4
+ }
5
+ return typeof error === "object" ? error : { message: String(error) };
6
+ }
7
+ export function commandError(message, hint, diagnostics = null) {
8
+ const error = new Error(message);
9
+ error.hint = hint;
10
+ if (diagnostics) {
11
+ error.diagnostics = diagnostics;
12
+ }
13
+ return error;
14
+ }
15
+ export function helperError(message, hint, diagnostics = null) {
16
+ const error = new Error(message);
17
+ error.hint = hint;
18
+ if (diagnostics) {
19
+ error.diagnostics = diagnostics;
20
+ }
21
+ return error;
22
+ }
23
+ export function readStdin() {
24
+ return new Promise((resolve, reject) => {
25
+ let stdin = "";
26
+ process.stdin.setEncoding("utf8");
27
+ process.stdin.on("data", (chunk) => {
28
+ stdin += chunk;
29
+ });
30
+ process.stdin.on("end", () => resolve(stdin));
31
+ process.stdin.on("error", reject);
32
+ });
33
+ }
34
+ export function delay(ms) {
35
+ return new Promise((resolve) => setTimeout(resolve, ms));
36
+ }
37
+ export function writeResult(result, failed = false) {
38
+ process.stdout.write(`${JSON.stringify(result)}\n`);
39
+ if (failed) {
40
+ process.exitCode = 1;
41
+ }
42
+ }
43
+ export function writeEnvelope(result, failed = false) {
44
+ writeResult(result, failed);
45
+ }
46
+ //# sourceMappingURL=cli-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-support.js","sourceRoot":"","sources":["../../src/cli/cli-support.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAqB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,IAAY,EAAE,cAAuB,IAAI;IACrF,MAAM,KAAK,GAAiB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/C,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;IAClC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,IAAY,EAAE,cAAuB,IAAI;IACpF,MAAM,KAAK,GAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,WAAW,GAAG,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declare function createGithubAutodeployWorkflow({ hostAlias, subname, branch }: GithubAutodeployWorkflowOptions): string;
7
+ //# sourceMappingURL=github-autodeploy-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-autodeploy-workflow.d.ts","sourceRoot":"","sources":["../../src/cli/github-autodeploy-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,+BAA+B,UAuL7G"}
@@ -0,0 +1,185 @@
1
+ export function createGithubAutodeployWorkflow({ hostAlias, subname, branch }) {
2
+ return `name: Sporades Autodeploy
3
+
4
+ on:
5
+ push:
6
+ branches: [${JSON.stringify(branch)}]
7
+ pull_request:
8
+ branches: [${JSON.stringify(branch)}]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+ pull-requests: write
14
+
15
+ env:
16
+ SPORADES_HOST_ALIAS: ${hostAlias}
17
+ SPORADES_HOST_SUBNAME: ${subname}
18
+ SPORADES_HOST_SERVER: \${{ vars.SPORADES_HOST_SERVER }}
19
+ SPORADES_HOST_DOMAIN: \${{ vars.SPORADES_HOST_DOMAIN }}
20
+ SPORADES_HOST_REMOTE_ROOT: \${{ vars.SPORADES_HOST_REMOTE_ROOT }}
21
+ SPORADES_AUTODEPLOY_SUMMARY: \${{ runner.temp }}/sporades-autodeploy-summary.md
22
+
23
+ jobs:
24
+ deploy:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - name: Check out repository
28
+ uses: actions/checkout@v4
29
+
30
+ - name: Set up Node.js
31
+ uses: actions/setup-node@v4
32
+ with:
33
+ node-version: 22
34
+
35
+ - name: Install dependencies
36
+ run: |
37
+ if [ -f package-lock.json ]; then
38
+ npm ci
39
+ else
40
+ npm install
41
+ fi
42
+
43
+ - name: Run project tests
44
+ run: |
45
+ if node -e "const p = require('./package.json'); process.exit(p.scripts && p.scripts.test ? 0 : 1)"; then
46
+ npm test
47
+ else
48
+ echo "No npm test script declared; skipping project tests."
49
+ fi
50
+
51
+ - name: Configure Host SSH key
52
+ run: |
53
+ mkdir -p ~/.ssh
54
+ printf '%s\\n' "\${{ secrets.SPORADES_HOST_SSH_PRIVATE_KEY }}" > ~/.ssh/sporades_host_key
55
+ chmod 600 ~/.ssh/sporades_host_key
56
+ cat >> ~/.ssh/config <<'SSH_CONFIG'
57
+ Host *
58
+ IdentityFile ~/.ssh/sporades_host_key
59
+ IdentitiesOnly yes
60
+ StrictHostKeyChecking accept-new
61
+ SSH_CONFIG
62
+
63
+ - name: Configure Sporades Host profile
64
+ run: |
65
+ npx sporades host add "$SPORADES_HOST_ALIAS" \\
66
+ --server "$SPORADES_HOST_SERVER" \\
67
+ --domain "$SPORADES_HOST_DOMAIN" \\
68
+ --remote-root "$SPORADES_HOST_REMOTE_ROOT" \\
69
+ --json
70
+
71
+ - name: Sporades release preflight
72
+ run: |
73
+ npx sporades host current --host "$SPORADES_HOST_ALIAS" --json
74
+ npx sporades host health --host "$SPORADES_HOST_ALIAS" --json
75
+
76
+ - name: Push verified Hosted Capsule release
77
+ id: sporades_deploy
78
+ shell: bash
79
+ run: |
80
+ set +e
81
+ npx sporades host push --host "$SPORADES_HOST_ALIAS" --subname "$SPORADES_HOST_SUBNAME" --verify --json > "$RUNNER_TEMP/sporades-host-push.json"
82
+ deploy_exit=$?
83
+ set -e
84
+ node <<'NODE'
85
+ const fs = require("node:fs");
86
+
87
+ const outputPath = process.env.RUNNER_TEMP + "/sporades-host-push.json";
88
+ const raw = fs.existsSync(outputPath) ? fs.readFileSync(outputPath, "utf8") : "";
89
+ let envelope = null;
90
+ try {
91
+ envelope = JSON.parse(raw);
92
+ } catch {
93
+ envelope = null;
94
+ }
95
+
96
+ const data = envelope?.data ?? {};
97
+ const verification = data.verification ?? {};
98
+ const hostedUrl =
99
+ data.capsule?.hostedUrl ??
100
+ data.release?.hostedUrl ??
101
+ "https://" + process.env.SPORADES_HOST_SUBNAME + "." + process.env.SPORADES_HOST_DOMAIN;
102
+ const releaseId = data.release?.id ?? data.currentAttemptedRelease?.id ?? "unknown";
103
+ const verificationState =
104
+ verification?.state ??
105
+ (data.verified === true ? "verified" : data.verified === false ? "failed" : envelope?.ok ? "not reported" : "command failed");
106
+ const resultLabel = verificationState === "failed" ? "Verification failed" : envelope?.ok ? "Successful deploy" : "Command failed";
107
+ const previousReleaseId = data.previousCurrentRelease?.id ?? data.rollbackGuidance?.previousReleaseId ?? null;
108
+ const rollbackCommand =
109
+ data.rollbackGuidance?.command ??
110
+ (verificationState === "failed" && previousReleaseId
111
+ ? "sporades host rollback " + process.env.SPORADES_HOST_SUBNAME + " " + previousReleaseId + " --host " + process.env.SPORADES_HOST_ALIAS
112
+ : null);
113
+
114
+ function escapeCell(value) {
115
+ return String(value ?? "unknown").replace(/\\|/g, "\\\\|").replace(/\\r?\\n/g, " ");
116
+ }
117
+
118
+ function hostedCell(url) {
119
+ if (/^https?:\\/\\//.test(url)) {
120
+ return "[" + escapeCell(url) + "](" + url + ")";
121
+ }
122
+ return escapeCell(url);
123
+ }
124
+
125
+ const lines = [
126
+ "## Sporades autodeploy result",
127
+ "",
128
+ "| Field | Value |",
129
+ "| --- | --- |",
130
+ "| Result | " + escapeCell(resultLabel) + " |",
131
+ "| Hosted Capsule | " + hostedCell(hostedUrl) + " |",
132
+ "| Release ID | " + escapeCell(releaseId) + " |",
133
+ "| Verification | " + escapeCell(verificationState) + " |",
134
+ ];
135
+
136
+ if (!envelope) {
137
+ lines.push("", "No structured Sporades deploy output was available.");
138
+ } else if (!envelope.ok && envelope.error?.message) {
139
+ lines.push("", "Failure: " + envelope.error.message);
140
+ }
141
+
142
+ if (rollbackCommand) {
143
+ lines.push(
144
+ "",
145
+ "### Rollback guidance",
146
+ "",
147
+ "Sporades did not roll back automatically. To roll back manually, run:",
148
+ "",
149
+ " " + rollbackCommand,
150
+ );
151
+ } else if (verificationState === "failed") {
152
+ lines.push(
153
+ "",
154
+ "### Rollback guidance",
155
+ "",
156
+ "No previous release was reported, so no rollback command is available.",
157
+ );
158
+ }
159
+
160
+ const summary = lines.join("\\n") + "\\n";
161
+ fs.writeFileSync(process.env.SPORADES_AUTODEPLOY_SUMMARY, summary);
162
+ fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, summary);
163
+ NODE
164
+ exit "$deploy_exit"
165
+
166
+ - name: Publish pull request deploy result
167
+ if: always() && github.event_name == 'pull_request'
168
+ uses: actions/github-script@v7
169
+ with:
170
+ script: |
171
+ const fs = require('node:fs');
172
+ const summaryPath = process.env.SPORADES_AUTODEPLOY_SUMMARY;
173
+ const body = fs.existsSync(summaryPath)
174
+ ? fs.readFileSync(summaryPath, 'utf8')
175
+ : '## Sporades autodeploy result\\n\\nDeploy result summary was unavailable.\\n';
176
+ await github.rest.pulls.createReview({
177
+ owner: context.repo.owner,
178
+ repo: context.repo.repo,
179
+ pull_number: context.payload.pull_request.number,
180
+ event: 'COMMENT',
181
+ body
182
+ });
183
+ `;
184
+ }
185
+ //# sourceMappingURL=github-autodeploy-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-autodeploy-workflow.js","sourceRoot":"","sources":["../../src/cli/github-autodeploy-workflow.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,8BAA8B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAmC;IAC5G,OAAO;;;;iBAIQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;;iBAEtB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;;;;;;;;yBAQd,SAAS;2BACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKjC,CAAC;AACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { HostHelperRelease, HostHelperRequest as HostHelperContractRequest, HostHelperCapsuleTarget } from "./host-helper-contract.js";
2
+ type HostHelperRequest = HostHelperContractRequest & {
3
+ capsule: HostHelperCapsuleTarget;
4
+ release: HostHelperRelease;
5
+ };
6
+ export declare function validateReleaseArchive(request: HostHelperRequest): void;
7
+ export declare function removeDiscardedArchiveMetadata(directory: string): Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=host-helper-archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-helper-archive.d.ts","sourceRoot":"","sources":["../../src/cli/host-helper-archive.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAG5I,KAAK,iBAAiB,GAAG,yBAAyB,GAAG;IACnD,OAAO,EAAE,uBAAuB,CAAC;IACjC,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,QA6BhE;AAED,wBAAsB,8BAA8B,CAAC,SAAS,EAAE,MAAM,iBAWrE"}
@@ -0,0 +1,74 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { readdir, rm } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { helperError } from "./cli-support.js";
5
+ import { expectedReleaseFiles } from "./host-helper-release-files.js";
6
+ export function validateReleaseArchive(request) {
7
+ const release = request.release;
8
+ const entries = listArchiveEntries(release.remoteArchive);
9
+ const expectedFiles = expectedReleaseFiles(release);
10
+ const allNames = entries.map((entry) => normaliseArchiveEntryName(entry.name));
11
+ const runtimeEntries = entries.filter((entry) => !isDiscardableArchiveMetadata(entry.name));
12
+ const actualNames = runtimeEntries.map((entry) => normaliseArchiveEntryName(entry.name));
13
+ if (entries.some((entry) => !isSafeArchiveEntryType(entry))) {
14
+ throw helperError("Hosted Capsule release archive contains unsafe entries.", "Push again so Sporades can package regular runtime files only.");
15
+ }
16
+ if (allNames.some((name) => !isSafeArchiveEntryName(name))) {
17
+ throw helperError("Hosted Capsule release archive contains unsafe paths.", "Push again so Sporades can package runtime files without absolute or parent-relative paths.");
18
+ }
19
+ const actual = [...actualNames].sort();
20
+ const expected = [...expectedFiles].sort();
21
+ if (actual.length !== expected.length || actual.some((name, index) => name !== expected[index])) {
22
+ throw helperError("Hosted Capsule release archive contains unexpected files.", "Push again so Sporades can package only runtime files.");
23
+ }
24
+ }
25
+ export async function removeDiscardedArchiveMetadata(directory) {
26
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
27
+ const entryPath = path.join(directory, entry.name);
28
+ if (entry.name === "__MACOSX" || entry.name.startsWith("._")) {
29
+ await rm(entryPath, { recursive: entry.isDirectory(), force: true });
30
+ continue;
31
+ }
32
+ if (entry.isDirectory()) {
33
+ await removeDiscardedArchiveMetadata(entryPath);
34
+ }
35
+ }
36
+ }
37
+ function listArchiveEntries(archivePath) {
38
+ const namesResult = spawnSync("tar", ["-tzf", archivePath], { encoding: "utf8" });
39
+ const verboseResult = spawnSync("tar", ["-tvzf", archivePath], { encoding: "utf8" });
40
+ if (namesResult.error || namesResult.status !== 0 || verboseResult.error || verboseResult.status !== 0) {
41
+ throw helperError("Failed to inspect Hosted Capsule release archive.", "Upload the release again with `sporades host push` and check that tar is installed on the Host server.");
42
+ }
43
+ const names = namesResult.stdout.trim().split("\n").filter(Boolean);
44
+ const verboseLines = verboseResult.stdout.trim().split("\n").filter(Boolean);
45
+ if (names.length !== verboseLines.length) {
46
+ throw helperError("Hosted Capsule release archive could not be validated.", "Push again so Sporades can package a clean runtime archive.");
47
+ }
48
+ return names.map((name, index) => ({
49
+ name,
50
+ type: verboseLines[index]?.[0],
51
+ }));
52
+ }
53
+ function normaliseArchiveEntryName(name) {
54
+ return String(name).replace(/^\.\//, "").replace(/\/+$/, "");
55
+ }
56
+ function isDiscardableArchiveMetadata(name) {
57
+ const normalisedName = normaliseArchiveEntryName(name);
58
+ return (normalisedName === "__MACOSX" ||
59
+ normalisedName.startsWith("__MACOSX/") ||
60
+ normalisedName.split("/").some((segment) => segment.startsWith("._")));
61
+ }
62
+ function isSafeArchiveEntryType(entry) {
63
+ if (entry.type === "-") {
64
+ return true;
65
+ }
66
+ return entry.type === "d" && isDiscardableArchiveMetadata(entry.name);
67
+ }
68
+ function isSafeArchiveEntryName(name) {
69
+ if (!name || name.startsWith("/") || name.includes("\0")) {
70
+ return false;
71
+ }
72
+ return name.split("/").every((segment) => segment && segment !== "." && segment !== "..");
73
+ }
74
+ //# sourceMappingURL=host-helper-archive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-helper-archive.js","sourceRoot":"","sources":["../../src/cli/host-helper-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAOtE,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,MAAM,cAAc,GAAG,OAAO,CAAC,MA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C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { HostHelperRequest } from "./host-helper-contract.js";
2
+ export type HostHelperConfig = {
3
+ hostedCapsule: {
4
+ dockerImage: string;
5
+ dockerNetwork: string;
6
+ graceCheckMs: number;
7
+ };
8
+ logs: {
9
+ defaultLines: number;
10
+ maxLines: number;
11
+ };
12
+ };
13
+ export declare function defaultHostHelperConfig(): HostHelperConfig;
14
+ export declare function loadHostHelperConfig(request: HostHelperRequest): Promise<HostHelperConfig>;
15
+ //# sourceMappingURL=host-helper-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-helper-config.d.ts","sourceRoot":"","sources":["../../src/cli/host-helper-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AASnE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,EAAE;QACJ,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,gBAAgB,CAY1D;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+BhG"}