@lamalibre/create-lamaste 4.5.0 → 4.7.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 (178) hide show
  1. package/package.json +2 -2
  2. package/scripts/bundle-vendor.js +20 -3
  3. package/scripts/lamaste-priv +56 -5
  4. package/scripts/pin-release.js +98 -0
  5. package/src/index.js +8 -1
  6. package/src/lib/env.js +19 -0
  7. package/src/lib/service-config.js +7 -0
  8. package/src/tasks/redeploy.js +8 -0
  9. package/vendor/docs/00-introduction/how-it-works.md +2 -2
  10. package/vendor/docs/00-introduction/quickstart.md +5 -5
  11. package/vendor/docs/00-introduction/what-is-lamaste.md +5 -5
  12. package/vendor/docs/01-concepts/authentication.md +6 -2
  13. package/vendor/docs/01-concepts/authorization.md +4 -0
  14. package/vendor/docs/01-concepts/certificates.md +3 -3
  15. package/vendor/docs/01-concepts/dns-and-domains.md +9 -0
  16. package/vendor/docs/01-concepts/mtls.md +2 -2
  17. package/vendor/docs/01-concepts/security-model.md +28 -3
  18. package/vendor/docs/01-concepts/tickets.md +2 -2
  19. package/vendor/docs/01-concepts/tunneling.md +4 -4
  20. package/vendor/docs/02-guides/agent-setup.md +5 -5
  21. package/vendor/docs/02-guides/certificate-management.md +2 -2
  22. package/vendor/docs/02-guides/cloud-provisioning.md +3 -3
  23. package/vendor/docs/02-guides/desktop-app-setup.md +10 -10
  24. package/vendor/docs/02-guides/installation.md +3 -3
  25. package/vendor/docs/02-guides/managing-users.md +5 -11
  26. package/vendor/docs/02-guides/onboarding.md +2 -2
  27. package/vendor/docs/02-guides/second-domain.md +82 -0
  28. package/vendor/docs/02-guides/standalone-plugin-with-tickets.md +2 -2
  29. package/vendor/docs/02-guides/static-sites.md +4 -0
  30. package/vendor/docs/03-architecture/installer-flow.md +2 -2
  31. package/vendor/docs/03-architecture/installer.md +4 -4
  32. package/vendor/docs/03-architecture/management-flow.md +1 -1
  33. package/vendor/docs/03-architecture/nginx-configuration.md +80 -12
  34. package/vendor/docs/03-architecture/overview.md +5 -5
  35. package/vendor/docs/03-architecture/panel-client.md +6 -6
  36. package/vendor/docs/03-architecture/panel-server.md +2 -2
  37. package/vendor/docs/03-architecture/state-management.md +3 -3
  38. package/vendor/docs/03-architecture/system-overview.md +1 -1
  39. package/vendor/docs/04-api-reference/agent-hosted-plugins.md +116 -37
  40. package/vendor/docs/04-api-reference/app-host.md +3 -3
  41. package/vendor/docs/04-api-reference/domains.md +192 -0
  42. package/vendor/docs/04-api-reference/gatekeeper.md +54 -8
  43. package/vendor/docs/04-api-reference/lifecycle-hooks.md +4 -4
  44. package/vendor/docs/04-api-reference/onboarding.md +1 -1
  45. package/vendor/docs/04-api-reference/overview.md +9 -0
  46. package/vendor/docs/04-api-reference/registry-and-oidc.md +26 -13
  47. package/vendor/docs/04-api-reference/sites.md +9 -0
  48. package/vendor/docs/04-api-reference/tunnels.md +35 -28
  49. package/vendor/docs/04-api-reference/users.md +41 -29
  50. package/vendor/docs/05-operations/backup-and-restore.md +1 -1
  51. package/vendor/docs/05-operations/uninstalling.md +1 -1
  52. package/vendor/docs/05-operations/upgrades.md +15 -6
  53. package/vendor/docs/06-reference/config-files.md +19 -15
  54. package/vendor/docs/06-reference/glossary.md +3 -3
  55. package/vendor/docs/06-reference/installer-flags.md +13 -13
  56. package/vendor/docs/06-reference/ports-and-services.md +1 -1
  57. package/vendor/docs/06-reference/troubleshooting.md +8 -8
  58. package/vendor/docs/_index.json +105 -19
  59. package/vendor/docs/external-members-design.md +816 -0
  60. package/vendor/docs/gatekeeper-design.md +8 -8
  61. package/vendor/docs/identity-directory-design.md +3 -3
  62. package/vendor/docs/multi-domain-relay-design.md +836 -0
  63. package/vendor/docs/package.json +1 -1
  64. package/vendor/docs/todo/lib-cli-desktop-refactor.md +27 -27
  65. package/vendor/gatekeeper/dist/index.d.ts +3 -3
  66. package/vendor/gatekeeper/dist/index.d.ts.map +1 -1
  67. package/vendor/gatekeeper/dist/index.js +2 -2
  68. package/vendor/gatekeeper/dist/index.js.map +1 -1
  69. package/vendor/gatekeeper/dist/lib/authz.d.ts +9 -0
  70. package/vendor/gatekeeper/dist/lib/authz.d.ts.map +1 -1
  71. package/vendor/gatekeeper/dist/lib/authz.js +31 -0
  72. package/vendor/gatekeeper/dist/lib/authz.js.map +1 -1
  73. package/vendor/gatekeeper/dist/lib/constants.d.ts +5 -2
  74. package/vendor/gatekeeper/dist/lib/constants.d.ts.map +1 -1
  75. package/vendor/gatekeeper/dist/lib/constants.js +5 -2
  76. package/vendor/gatekeeper/dist/lib/constants.js.map +1 -1
  77. package/vendor/gatekeeper/dist/lib/grants.d.ts.map +1 -1
  78. package/vendor/gatekeeper/dist/lib/grants.js +20 -13
  79. package/vendor/gatekeeper/dist/lib/grants.js.map +1 -1
  80. package/vendor/gatekeeper/dist/lib/migrations/gatekeeper/0004_unconsume_access_grants.sql +8 -0
  81. package/vendor/gatekeeper/dist/lib/secret.d.ts +6 -0
  82. package/vendor/gatekeeper/dist/lib/secret.d.ts.map +1 -0
  83. package/vendor/gatekeeper/dist/lib/secret.js +12 -0
  84. package/vendor/gatekeeper/dist/lib/secret.js.map +1 -0
  85. package/vendor/gatekeeper/dist/lib/templates.d.ts +20 -0
  86. package/vendor/gatekeeper/dist/lib/templates.d.ts.map +1 -1
  87. package/vendor/gatekeeper/dist/lib/templates.js +80 -14
  88. package/vendor/gatekeeper/dist/lib/templates.js.map +1 -1
  89. package/vendor/gatekeeper/dist/lib/tunnels.d.ts +3 -6
  90. package/vendor/gatekeeper/dist/lib/tunnels.d.ts.map +1 -1
  91. package/vendor/gatekeeper/dist/lib/tunnels.js +4 -16
  92. package/vendor/gatekeeper/dist/lib/tunnels.js.map +1 -1
  93. package/vendor/gatekeeper/dist/lib/types.d.ts +0 -19
  94. package/vendor/gatekeeper/dist/lib/types.d.ts.map +1 -1
  95. package/vendor/gatekeeper/dist/server/index.d.ts +6 -1
  96. package/vendor/gatekeeper/dist/server/index.d.ts.map +1 -1
  97. package/vendor/gatekeeper/dist/server/index.js +56 -11
  98. package/vendor/gatekeeper/dist/server/index.js.map +1 -1
  99. package/vendor/gatekeeper/dist/server/routes/authz.d.ts.map +1 -1
  100. package/vendor/gatekeeper/dist/server/routes/authz.js +325 -55
  101. package/vendor/gatekeeper/dist/server/routes/authz.js.map +1 -1
  102. package/vendor/gatekeeper/dist/server/routes/diagnostic.d.ts.map +1 -1
  103. package/vendor/gatekeeper/dist/server/routes/diagnostic.js +5 -2
  104. package/vendor/gatekeeper/dist/server/routes/diagnostic.js.map +1 -1
  105. package/vendor/gatekeeper/package.json +2 -2
  106. package/vendor/server/bin/lamaste-server.js +7 -0
  107. package/vendor/server/package.json +2 -2
  108. package/vendor/server/src/commands/domains.js +214 -0
  109. package/vendor/server/src/commands/plugin-identity.js +2 -16
  110. package/vendor/server/src/commands/plugin-web-surface.js +269 -0
  111. package/vendor/server/src/commands/plugins.js +175 -14
  112. package/vendor/server/src/commands/registry-credential.js +10 -3
  113. package/vendor/server/src/commands/sites.js +18 -1
  114. package/vendor/server/src/commands/status.js +19 -0
  115. package/vendor/server/src/commands/tunnels.js +4 -1
  116. package/vendor/server/src/commands/users.js +8 -19
  117. package/vendor/server/src/domains.js +92 -0
  118. package/vendor/server/src/fail.js +21 -0
  119. package/vendor/server/src/oidc-client-grants.js +63 -0
  120. package/vendor/server/src/panel-api.js +15 -0
  121. package/vendor/server/src/plugin-approval.js +80 -1
  122. package/vendor/server/src/plugin-web-surface.js +307 -0
  123. package/vendor/server-ui/dist/assets/index-B8Tv_ocF.js +84 -0
  124. package/vendor/server-ui/dist/assets/index-Cb-ADsbB.css +1 -0
  125. package/vendor/server-ui/dist/index.html +2 -2
  126. package/vendor/serverd/package.json +2 -2
  127. package/vendor/serverd/src/index.js +50 -19
  128. package/vendor/serverd/src/lib/app-error.js +24 -0
  129. package/vendor/serverd/src/lib/audience.js +12 -3
  130. package/vendor/serverd/src/lib/authelia.js +341 -35
  131. package/vendor/serverd/src/lib/chisel-runtime.js +18 -6
  132. package/vendor/serverd/src/lib/chisel.js +10 -2
  133. package/vendor/serverd/src/lib/directory.js +67 -52
  134. package/vendor/serverd/src/lib/domains.js +1792 -0
  135. package/vendor/serverd/src/lib/gatekeeper-client.js +34 -7
  136. package/vendor/serverd/src/lib/hook-pipelines.js +8 -3
  137. package/vendor/serverd/src/lib/identity-sync.js +35 -0
  138. package/vendor/serverd/src/lib/migrations/state/0015_plugin_web_surface.sql +14 -0
  139. package/vendor/serverd/src/lib/migrations/state/0016_domains.sql +53 -0
  140. package/vendor/serverd/src/lib/migrations/state/0017_membership_kind.sql +15 -0
  141. package/vendor/serverd/src/lib/migrations/state/0018_domain_group_keys.sql +23 -0
  142. package/vendor/serverd/src/lib/nginx.js +576 -131
  143. package/vendor/serverd/src/lib/owned-groups.js +326 -0
  144. package/vendor/serverd/src/lib/plugin-domain.js +86 -0
  145. package/vendor/serverd/src/lib/plugin-hooks.js +40 -11
  146. package/vendor/serverd/src/lib/plugin-lifecycle.js +129 -5
  147. package/vendor/serverd/src/lib/plugin-oidc.js +144 -42
  148. package/vendor/serverd/src/lib/plugin-packages.js +74 -2
  149. package/vendor/serverd/src/lib/plugins.js +82 -9
  150. package/vendor/serverd/src/lib/registry-credential.js +39 -6
  151. package/vendor/serverd/src/lib/services.js +9 -1
  152. package/vendor/serverd/src/lib/state.js +29 -0
  153. package/vendor/serverd/src/lib/tunnel-deps.js +2 -4
  154. package/vendor/serverd/src/lib/user-surface.js +77 -31
  155. package/vendor/serverd/src/lib/users-lock.js +23 -0
  156. package/vendor/serverd/src/lib/vhost-reconcile.js +151 -41
  157. package/vendor/serverd/src/lib/web-surface.js +783 -0
  158. package/vendor/serverd/src/middleware/user-access-session.js +11 -4
  159. package/vendor/serverd/src/routes/invite.js +15 -5
  160. package/vendor/serverd/src/routes/management/domains.js +154 -0
  161. package/vendor/serverd/src/routes/management/gatekeeper-proxy.js +44 -8
  162. package/vendor/serverd/src/routes/management/identity.js +21 -7
  163. package/vendor/serverd/src/routes/management/invitations.js +33 -4
  164. package/vendor/serverd/src/routes/management/plugin-web-surface.js +151 -0
  165. package/vendor/serverd/src/routes/management/plugins.js +6 -2
  166. package/vendor/serverd/src/routes/management/registry-credential.js +86 -57
  167. package/vendor/serverd/src/routes/management/sites.js +188 -71
  168. package/vendor/serverd/src/routes/management/tunnels.js +37 -22
  169. package/vendor/serverd/src/routes/management/users.js +184 -64
  170. package/vendor/serverd/src/routes/management.js +4 -0
  171. package/vendor/serverd/src/routes/onboarding/dns.js +3 -17
  172. package/vendor/serverd/src/routes/onboarding/provision.js +22 -13
  173. package/vendor/serverd/src/routes/user-access.js +13 -1
  174. package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0001_groups.sql +0 -7
  175. package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0002_access_grants.sql +0 -14
  176. package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0003_access_request_log.sql +0 -9
  177. package/vendor/server-ui/dist/assets/index-D-fer5ef.css +0 -1
  178. package/vendor/server-ui/dist/assets/index-DSaDPJaw.js +0 -84
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../../../src/server/routes/diagnostic.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,IAAI,gBAAgB,CAAC;AAC9E,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CA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AAQ,CAAC;gBAClC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACrD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAAC;QAChE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamalibre/lamaste-gatekeeper",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "description": "Authorization layer for Lamaste — groups, grants, and tunnel access control",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@fastify/rate-limit": "^10.3.0",
35
- "@lamalibre/lamaste": "^4.5.0",
35
+ "@lamalibre/lamaste": "4.7.0",
36
36
  "fastify": "^5.3.3",
37
37
  "undici": "^7.8.0",
38
38
  "zod": "^3.24.4"
@@ -16,6 +16,7 @@
16
16
  * plugins Manage server-side plugins
17
17
  * push-install Push install: the switch, the default policy, agents' windows
18
18
  * users Users and the user directory: disable, delete, erase
19
+ * domains The relay's base domains and their members
19
20
  * tunnels Manage tunnels
20
21
  * sites Manage static sites
21
22
  * certs Certificate status and renewal
@@ -65,6 +66,7 @@ ${b('COMMANDS')}
65
66
  ${c('push-install')} Push install: on/off, default policy, open/close an agent's window
66
67
  ${c('audit')} The panel's audit log (approvals, hostings, updates, hook events)
67
68
  ${c('users')} Users and the user directory (list, disable, enable, delete, erase, directory)
69
+ ${c('domains')} The relay's base domains and their members (list, add, verify-dns, activate, remove, members)
68
70
  ${c('tunnels')} Manage tunnels (list, create, delete, toggle, bind a plugin's user surface)
69
71
  ${c('sites')} Manage static sites (list, create, delete)
70
72
  ${c('certs')} Certificate status, renewal, and agent cert listing
@@ -184,6 +186,11 @@ async function main() {
184
186
  await runUsers(args.slice(1), { json });
185
187
  break;
186
188
  }
189
+ case 'domains': {
190
+ const { runDomains } = await import('../src/commands/domains.js');
191
+ await runDomains(args.slice(1), { json });
192
+ break;
193
+ }
187
194
  case 'tunnels': {
188
195
  const { runTunnels } = await import('../src/commands/tunnels.js');
189
196
  await runTunnels(args.slice(1), { json });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamalibre/lamaste-server",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "description": "Server operations CLI for Lamaste",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@clack/prompts": "^1.8.1",
21
- "@lamalibre/lamaste": "^4.5.0",
21
+ "@lamalibre/lamaste": "4.7.0",
22
22
  "chalk": "^5.3.0",
23
23
  "execa": "^9.0.0"
24
24
  },
@@ -0,0 +1,214 @@
1
+ /**
2
+ * lamaste-server domains — the relay's base domains and their members
3
+ * (the multi-domain relay).
4
+ *
5
+ * Subcommands:
6
+ * list Domains with their state, member count and what uses them
7
+ * add <domain> Add a domain (pending until activated)
8
+ * verify-dns <domain> The records it needs, and whether they point here
9
+ * activate <domain> Issue auth.<domain>, serve its sign-in, admit its members
10
+ * remove <domain> Remove an unused, non-primary domain (its memberships end)
11
+ * members <domain> Its members, each with the kind of the membership
12
+ * members <domain> add <user> [--external]
13
+ * Make a user (directory id or username) a member —
14
+ * an external one with --external
15
+ * members <domain> kind <user> member|external
16
+ * Change the kind of a membership
17
+ * members <domain> remove <user> End a membership
18
+ *
19
+ * Also `plugins domain <name> [<domain>]` ({@link pluginDomainCmd}).
20
+ *
21
+ * Every subcommand goes through the running panel (`/api/domains`, admin
22
+ * certificate), which decides every rule. What the panel says is printed
23
+ * only as `terminalText`; `--json` emits it as it came.
24
+ */
25
+
26
+ import chalk from 'chalk';
27
+ import { panelRequest } from '../panel-api.js';
28
+ import { emit, emitComplete } from '../ndjson.js';
29
+ import { fail } from '../fail.js';
30
+ import { terminalText } from '../plugin-settings.js';
31
+ import { domainPath, domainRows, memberRequest } from '../domains.js';
32
+
33
+ /** A panel request, or exit with its refusal. */
34
+ const call = (json, ...args) => panelRequest(...args).catch((err) => fail(err.message, json, err));
35
+
36
+ /**
37
+ * @param {string[]} args
38
+ * @param {{ json: boolean }} options
39
+ */
40
+ export async function runDomains(args, { json }) {
41
+ const [sub, name, ...rest] = args;
42
+ if (sub === 'list') return listDomains({ json });
43
+ if (sub === 'members' && name) return membersCmd(name.toLowerCase(), rest, { json });
44
+ const command = DOMAIN_COMMANDS[sub];
45
+ if (!command || !name) return usage(sub ? 1 : 0);
46
+ const domain = name.toLowerCase();
47
+ const result = await call(json, ...command.request(domain), { timeoutMs: command.timeoutMs });
48
+ if (json) emitComplete(result);
49
+ else command.print(terminalText(domain), result);
50
+ }
51
+
52
+ function usage(code) {
53
+ const b = chalk.bold;
54
+ const c = chalk.cyan;
55
+ console.log(`
56
+ ${b('Usage:')} lamaste-server domains <subcommand>
57
+
58
+ ${b('Subcommands:')}
59
+ ${c('list')} Domains: state, members, what uses each
60
+ ${c('add <domain>')} Add a domain (pending until activated)
61
+ ${c('verify-dns <domain>')} The DNS records it needs, and whether they point here
62
+ ${c('activate <domain>')} Issue auth.<domain> and serve its sign-in
63
+ ${c('remove <domain>')} Remove an unused, non-primary domain
64
+ ${c('members <domain>')} Its members and external members
65
+ ${c('members <domain> add <user> [--external]')}
66
+ Make a user (directory id or username) a member
67
+ ${c('members <domain> kind <user> member|external')}
68
+ Change the kind of a membership
69
+ ${c('members <domain> remove <user>')} End a membership
70
+
71
+ Every domain has its own sign-in (auth.<domain>) and member list; a user reaches a
72
+ domain's protected hosts only as its member. An external member reaches only what
73
+ names them — restricted hosts that grant them, sites that list them, OIDC clients
74
+ granted to them — and holds no Authelia groups. The panel and tunnel. stay on the primary.
75
+ `);
76
+ process.exit(code);
77
+ }
78
+
79
+ async function listDomains({ json }) {
80
+ const { domains } = await call(json, 'GET', '/api/domains');
81
+ if (json) {
82
+ emit({ domains });
83
+ return;
84
+ }
85
+ const d = chalk.dim;
86
+ console.log('');
87
+ console.log(chalk.bold(' Domains'));
88
+ console.log(d(' ' + '─'.repeat(50)));
89
+ for (const row of domainRows(domains)) {
90
+ const state = row.state === 'pending' ? chalk.yellow(row.state) : chalk.green(row.state);
91
+ const used = row.usedBy ? d(` used by ${row.usedBy}`) : '';
92
+ const external = row.externalMembers > 0 ? `, ${row.externalMembers} external` : '';
93
+ console.log(` ${chalk.cyan(row.name)} ${state} ${row.members} member(s)${external}${used}`);
94
+ }
95
+ console.log('');
96
+ }
97
+
98
+ /** One entry per domain subcommand: its request, its time budget, how it is printed. */
99
+ const DOMAIN_COMMANDS = {
100
+ add: {
101
+ request: (name) => ['POST', '/api/domains', { name }],
102
+ timeoutMs: 30000,
103
+ print: (domain) => {
104
+ console.log(`\n ${chalk.green('✓')} ${domain} added (pending).`);
105
+ console.log(
106
+ ` Create its DNS records (${chalk.cyan(`lamaste-server domains verify-dns ${domain}`)}),`,
107
+ );
108
+ console.log(` then ${chalk.cyan(`lamaste-server domains activate ${domain}`)}\n`);
109
+ },
110
+ },
111
+ 'verify-dns': {
112
+ request: (name) => ['POST', domainPath(name, '/verify-dns'), null],
113
+ timeoutMs: 30000,
114
+ print: (domain, result) => {
115
+ const mark = result.ok ? chalk.green('✓') : chalk.yellow('!');
116
+ console.log(
117
+ `\n ${mark} ${domain}: ${result.ok ? 'its sign-in points at this relay' : 'records still missing'}`,
118
+ );
119
+ for (const r of result.records ?? []) {
120
+ const state = r.ok
121
+ ? chalk.green('in place')
122
+ : chalk.yellow(r.required ? 'missing' : 'optional, absent');
123
+ console.log(
124
+ ` ${terminalText(r.type)} ${chalk.cyan(terminalText(r.name))} → ${terminalText(r.value)} ${state}`,
125
+ );
126
+ console.log(chalk.dim(` ${terminalText(r.purpose)}`));
127
+ }
128
+ console.log('');
129
+ },
130
+ },
131
+ activate: {
132
+ request: (name) => ['POST', domainPath(name, '/activate'), null],
133
+ // Activation issues a certificate: give it time.
134
+ timeoutMs: 180000,
135
+ print: (domain) =>
136
+ console.log(`\n ${chalk.green('✓')} ${domain} is active — its sign-in is auth.${domain}\n`),
137
+ },
138
+ remove: {
139
+ request: (name) => ['DELETE', domainPath(name), null],
140
+ timeoutMs: 30000,
141
+ print: (domain) =>
142
+ console.log(`\n ${chalk.green('✓')} ${domain} removed; its memberships ended.\n`),
143
+ },
144
+ };
145
+
146
+ async function membersCmd(name, rest, { json }) {
147
+ if (rest.length === 0) {
148
+ const { members } = await call(json, 'GET', domainPath(name, '/members'));
149
+ if (json) {
150
+ emit({ members });
151
+ return;
152
+ }
153
+ console.log('');
154
+ for (const m of members) {
155
+ const status = m.status === 'active' ? '' : chalk.yellow(` (${m.status})`);
156
+ const kind = m.kind === 'external' ? chalk.magenta(' external') : '';
157
+ console.log(
158
+ ` ${chalk.cyan(terminalText(m.username ?? m.userId))}${kind}${status} ${chalk.dim(m.userId)}`,
159
+ );
160
+ }
161
+ if (members.length === 0) console.log(chalk.dim(' No members.'));
162
+ console.log('');
163
+ return;
164
+ }
165
+ const request = memberRequest(name, rest);
166
+ if (!request) return usage(1);
167
+ // The panel takes a directory id or a username.
168
+ const result = await call(json, request.method, request.path, request.body);
169
+ if (json) {
170
+ emitComplete(result);
171
+ return;
172
+ }
173
+ const who = terminalText(request.user);
174
+ const where = terminalText(name);
175
+ console.log(
176
+ request.kind === null
177
+ ? `\n ${chalk.green('✓')} ${who} is no longer a member of ${where}\n`
178
+ : `\n ${chalk.green('✓')} ${who} is now ${request.kind === 'external' ? 'an external member' : 'a member'} of ${where}\n`,
179
+ );
180
+ }
181
+
182
+ /**
183
+ * `plugins domain <name> [<domain>]`: the domain a plugin belongs to, or
184
+ * move it to another active one.
185
+ *
186
+ * @param {string[]} args
187
+ * @param {{ json: boolean }} options
188
+ */
189
+ export async function pluginDomainCmd(args, { json }) {
190
+ const [name, domain] = args;
191
+ if (!name) {
192
+ console.error('\n Usage: lamaste-server plugins domain <name> [<domain>]\n');
193
+ process.exit(1);
194
+ }
195
+ if (domain === undefined) {
196
+ const { plugin } = await call(json, 'GET', `/api/plugins/${encodeURIComponent(name)}`);
197
+ if (json) {
198
+ emit({ name, domain: plugin.domain });
199
+ return;
200
+ }
201
+ console.log(`\n ${terminalText(name)}: ${terminalText(plugin.domain)}\n`);
202
+ return;
203
+ }
204
+ const result = await call(json, 'PUT', `/api/plugins/${encodeURIComponent(name)}/domain`, {
205
+ domain: domain.toLowerCase(),
206
+ });
207
+ if (json) {
208
+ emitComplete(result);
209
+ return;
210
+ }
211
+ console.log(
212
+ `\n ${chalk.green('✓')} ${terminalText(name)} ${result.changed ? 'now belongs to' : 'already belongs to'} ${terminalText(result.domain)}\n`,
213
+ );
214
+ }
@@ -28,7 +28,8 @@
28
28
 
29
29
  import chalk from 'chalk';
30
30
  import { panelRequest } from '../panel-api.js';
31
- import { emit, emitComplete, emitError } from '../ndjson.js';
31
+ import { emit, emitComplete } from '../ndjson.js';
32
+ import { fail } from '../fail.js';
32
33
  import { identityBlockLines } from '../plugin-approval.js';
33
34
  import {
34
35
  audienceRowText,
@@ -45,21 +46,6 @@ function pluginPath(name, rest) {
45
46
  return `/api/plugins/${encodeURIComponent(name)}/${rest}`;
46
47
  }
47
48
 
48
- /**
49
- * Exit with a usage error or a refused request, as text or NDJSON (with
50
- * the refusal's `code`).
51
- *
52
- * @param {string} message
53
- * @param {boolean} json
54
- * @param {{ code?: string }} [err]
55
- * @returns {never}
56
- */
57
- function fail(message, json, err = {}) {
58
- if (json) emitError(message, false, typeof err.code === 'string' ? { code: err.code } : {});
59
- else console.error(`\n ${chalk.red(terminalText(message))}\n`);
60
- process.exit(1);
61
- }
62
-
63
49
  /** Print a change's warnings: what the panel could not complete beside it. */
64
50
  function printWarnings(warnings) {
65
51
  for (const warning of warnings ?? []) {
@@ -0,0 +1,269 @@
1
+ /**
2
+ * lamaste-server plugins web-surface — the web surface of an agent-hosted
3
+ * plugin that declares one (its manifest's `userSurface.web`): the site it
4
+ * owns, where the relay serves the static shell its server package ships
5
+ * beside its user surface's API.
6
+ *
7
+ * web-surface <name> What its installed version declares, its site,
8
+ * whether the site serves (and why not), the trees
9
+ * the relay holds, the tunnel still bound as its user
10
+ * surface, and — while it owns no site — the offer
11
+ * web-surface <name> create [--subdomain <label>] [--access-mode authenticated|restricted]
12
+ * Give it its site (default: the subdomain and access
13
+ * mode it declares)
14
+ * web-surface <name> move --tunnel <id | subdomain | fqdn>
15
+ * Hand the host of the tunnel bound as its user
16
+ * surface to its site, in one reload; the tunnel
17
+ * stays, disabled and unbound
18
+ * web-surface <name> delete [--yes]
19
+ * Delete its site, its trees and the grants on it,
20
+ * after typing the site's FQDN (--yes skips it)
21
+ *
22
+ * The plugin is named by its name or its route (as `sites list` shows a
23
+ * site's owner). Every action goes through the running panel
24
+ * (`/api/plugins/:name/web-surface[/move]`, admin certificate). What the
25
+ * panel says is printed only as `terminalText`; `--json` emits it as it
26
+ * came.
27
+ */
28
+
29
+ import chalk from 'chalk';
30
+ import * as prompts from '@clack/prompts';
31
+ import { panelRequest } from '../panel-api.js';
32
+ import { readTunnels } from '../state.js';
33
+ import { emit, emitComplete, emitError } from '../ndjson.js';
34
+ import { findHostTunnel, findPluginByNameOrRoute } from '../plugin-identity.js';
35
+ import { terminalText } from '../plugin-settings.js';
36
+ import {
37
+ createBody,
38
+ parseWebSurfaceArgs,
39
+ webSurfaceRefusalHint,
40
+ webSurfaceServedText,
41
+ webTreeRows,
42
+ } from '../plugin-web-surface.js';
43
+
44
+ /** `/api/plugins/<name>/web-surface[/<rest>]`. */
45
+ function webSurfacePath(name, rest = '') {
46
+ return `/api/plugins/${encodeURIComponent(name)}/web-surface${rest ? `/${rest}` : ''}`;
47
+ }
48
+
49
+ /**
50
+ * Exit with a usage error or a refused request, as text (with what the
51
+ * refusal asks next) or NDJSON (with the refusal's `code`).
52
+ *
53
+ * @param {string} message
54
+ * @param {boolean} json
55
+ * @param {{ code?: string }} [err]
56
+ * @param {string} [name] the plugin, for the hint
57
+ * @returns {never}
58
+ */
59
+ function fail(message, json, err = {}, name = '<name>') {
60
+ const code = typeof err.code === 'string' ? err.code : null;
61
+ if (json) {
62
+ emitError(message, false, code ? { code } : {});
63
+ } else {
64
+ console.error(`\n ${chalk.red(terminalText(message))}`);
65
+ const hint = webSurfaceRefusalHint(code, name);
66
+ if (hint) console.error(` ${chalk.dim(hint)}`);
67
+ console.error('');
68
+ }
69
+ process.exit(1);
70
+ }
71
+
72
+ /**
73
+ * A panel request; a refusal exits through `fail`, with what it asks next
74
+ * of plugin `name`.
75
+ */
76
+ async function request(json, name, method, path, body) {
77
+ try {
78
+ return await panelRequest(method, path, body);
79
+ } catch (err) {
80
+ fail(err.message, json, err, name);
81
+ }
82
+ }
83
+
84
+ /** `label:` padded, then the value. */
85
+ function row(label, value) {
86
+ console.log(` ${chalk.dim(`${label}:`.padEnd(16))}${value}`);
87
+ }
88
+
89
+ /**
90
+ * Print a web surface's status (`webSurface`) for plugin `name`: what it
91
+ * declares, its site, whether it is served, its trees, the bound tunnel and
92
+ * the offer.
93
+ */
94
+ function printWebSurface(name, view) {
95
+ const plugin = terminalText(name);
96
+ console.log('');
97
+ if (!view.declared && !view.site) {
98
+ console.log(` Plugin ${chalk.cyan(plugin)} declares no web surface and owns no site.`);
99
+ console.log('');
100
+ return;
101
+ }
102
+ console.log(chalk.bold(` Web surface of ${plugin}`));
103
+ console.log(chalk.dim(' ' + '─'.repeat(40)));
104
+ row(
105
+ 'declares',
106
+ view.declared
107
+ ? terminalText(
108
+ `${view.declared.defaultSubdomain} (${view.declared.accessMode}), the shell from ${view.declared.root}/`,
109
+ )
110
+ : chalk.yellow('nothing — its installed version declares no web surface'),
111
+ );
112
+ row(
113
+ 'site',
114
+ view.site
115
+ ? `${chalk.cyan(`https://${terminalText(view.site.fqdn)}/`)}${chalk.dim(` ${terminalText(view.site.accessMode ?? 'access mode unknown')} · id ${terminalText(view.site.id)}`)}`
116
+ : chalk.dim('none'),
117
+ );
118
+ const served = webSurfaceServedText(view, name);
119
+ row('served', served.served ? chalk.green(served.text) : chalk.yellow(served.text));
120
+ for (const [label, value] of webTreeRows(view.tree)) row(label, value);
121
+ if (view.boundTunnel) {
122
+ const host = terminalText(view.boundTunnel.fqdn ?? view.boundTunnel.id);
123
+ const others = (view.boundTunnel.routes ?? []).length > 1;
124
+ row(
125
+ 'bound tunnel',
126
+ `${chalk.cyan(host)}${chalk.dim(` id ${terminalText(view.boundTunnel.id)}${others ? ` · also serves ${terminalText(view.boundTunnel.routes.join(', '))}` : ''}`)}`,
127
+ );
128
+ }
129
+ if (view.offer) {
130
+ const offer = `${terminalText(view.offer.subdomain)} (${terminalText(view.offer.accessMode)})`;
131
+ row(
132
+ 'offer',
133
+ view.offer.available
134
+ ? `${offer} ${chalk.green('— free')}`
135
+ : `${offer} ${chalk.yellow('— taken; create with --subdomain <label>')}`,
136
+ );
137
+ }
138
+ if (!view.site && view.declared) {
139
+ console.log('');
140
+ if (view.boundTunnel) {
141
+ console.log(
142
+ chalk.dim(
143
+ ` Move the bound tunnel's host to it: lamaste-server plugins web-surface ${plugin} move --tunnel ${terminalText(view.boundTunnel.fqdn ?? view.boundTunnel.id)}`,
144
+ ),
145
+ );
146
+ } else {
147
+ console.log(
148
+ chalk.dim(
149
+ ` Give it its site: lamaste-server plugins web-surface ${plugin} create [--subdomain <label>] [--access-mode authenticated|restricted]`,
150
+ ),
151
+ );
152
+ }
153
+ }
154
+ console.log('');
155
+ }
156
+
157
+ /**
158
+ * Ask for the site's FQDN before deleting it — or refuse where nobody can
159
+ * answer (no terminal, `--json`) without `--yes`.
160
+ *
161
+ * @param {string} name
162
+ * @param {{ fqdn: string }} site
163
+ * @param {{ yes: boolean, json: boolean }} options
164
+ */
165
+ async function confirmDelete(name, site, { yes, json }) {
166
+ if (yes) return;
167
+ if (json || !process.stdin.isTTY || !process.stdout.isTTY) {
168
+ fail(
169
+ `Deleting the web surface of "${name}" (${site.fqdn}) asks for confirmation — pass --yes`,
170
+ json,
171
+ );
172
+ }
173
+ const fqdn = terminalText(site.fqdn);
174
+ console.log('');
175
+ console.log(chalk.bold.red(` Delete the web surface of ${terminalText(name)}?`));
176
+ console.log(` - ${chalk.cyan(fqdn)} stops answering: its vhost is removed`);
177
+ console.log(' - the web trees the relay holds for it are deleted');
178
+ console.log(' - the grants on the site are revoked (a restricted site loses its users)');
179
+ console.log(' - the plugin stays installed and hosted; create the site again at any time');
180
+ console.log('');
181
+ const answer = await prompts.text({ message: `Type ${fqdn} to delete it` });
182
+ if (prompts.isCancel(answer) || String(answer ?? '').trim() !== site.fqdn) {
183
+ console.log('\n Aborted — nothing was deleted.\n');
184
+ process.exit(0);
185
+ }
186
+ }
187
+
188
+ /**
189
+ * `plugins web-surface <name> [create|move|delete]`.
190
+ *
191
+ * @param {string[]} args what follows the subcommand
192
+ * @param {{ json: boolean }} options
193
+ */
194
+ export async function webSurfaceCmd(args, { json }) {
195
+ const parsed = parseWebSurfaceArgs(args);
196
+ if (!parsed.ok) fail(parsed.error, json);
197
+
198
+ const { plugins = [] } = await request(json, parsed.name, 'GET', '/api/plugins');
199
+ const named = findPluginByNameOrRoute(plugins, parsed.name);
200
+ if (named.error) fail(named.error, json, { code: 'not_found' }, parsed.name);
201
+ const { name } = named.plugin;
202
+ const plugin = terminalText(name);
203
+
204
+ if (parsed.action === 'status') {
205
+ const result = await request(json, name, 'GET', webSurfacePath(name));
206
+ if (json) emit(result);
207
+ else printWebSurface(name, result.webSurface);
208
+ return;
209
+ }
210
+
211
+ if (parsed.action === 'create') {
212
+ const result = await request(json, name, 'POST', webSurfacePath(name), createBody(parsed));
213
+ if (json) {
214
+ emitComplete({ name, ...result });
215
+ return;
216
+ }
217
+ const fqdn = terminalText(result.webSurface?.site?.fqdn ?? '');
218
+ console.log(
219
+ `\n ${chalk.green('✓')} ${plugin} has its site: ${chalk.cyan(`https://${fqdn}/`)}`,
220
+ );
221
+ printWebSurface(name, result.webSurface);
222
+ return;
223
+ }
224
+
225
+ if (parsed.action === 'move') {
226
+ const found = findHostTunnel(await readTunnels(), parsed.tunnel);
227
+ if (found.error) fail(found.error, json);
228
+ const { tunnel } = found;
229
+ const result = await request(json, name, 'POST', webSurfacePath(name, 'move'), {
230
+ tunnelId: tunnel.id,
231
+ });
232
+ if (json) {
233
+ emitComplete({ name, tunnelId: tunnel.id, ...result });
234
+ return;
235
+ }
236
+ const host = terminalText(tunnel.fqdn ?? tunnel.id);
237
+ console.log(
238
+ `\n ${chalk.green('✓')} ${chalk.cyan(host)} is the web surface of ${plugin} now — the shell from its approved tree, the API as before`,
239
+ );
240
+ console.log(
241
+ chalk.dim(
242
+ ` The tunnel ${terminalText(tunnel.id)} stays, disabled and unbound, its vhost unlinked: delete the web surface, then enable the tunnel, to roll back by hand.`,
243
+ ),
244
+ );
245
+ printWebSurface(name, result.webSurface);
246
+ return;
247
+ }
248
+
249
+ // delete
250
+ const current = await request(json, name, 'GET', webSurfacePath(name));
251
+ const site = current.webSurface?.site ?? null;
252
+ if (!site) fail(`Plugin "${name}" owns no site — there is no web surface to delete`, json);
253
+ await confirmDelete(name, site, { yes: parsed.yes, json });
254
+ const result = await request(json, name, 'DELETE', webSurfacePath(name));
255
+ if (json) {
256
+ emitComplete({ name, siteId: site.id, fqdn: site.fqdn, ...result });
257
+ return;
258
+ }
259
+ console.log(
260
+ `\n ${chalk.green('✓')} The web surface of ${plugin} is deleted: ${chalk.cyan(terminalText(site.fqdn))} no longer answers\n`,
261
+ );
262
+ if (Array.isArray(result.grantsNotRevoked) && result.grantsNotRevoked.length > 0) {
263
+ console.log(
264
+ chalk.yellow(
265
+ ` Gatekeeper kept ${result.grantsNotRevoked.length} grant(s) on the deleted site — they name a site that no longer exists; their ids are in the audit log\n`,
266
+ ),
267
+ );
268
+ }
269
+ }