@infosupport/huddle-cli 0.0.0-experiment-98.44.1 → 0.0.0-experiment-98.46.1

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/dist/firewall.js CHANGED
@@ -276,5 +276,23 @@ async function runFirewallFolder(opts) {
276
276
  console.error((0, utils_1.red)(` [!] ${e.file}: ${e.message}`));
277
277
  return;
278
278
  }
279
- throw new Error(`Unknown folder action: ${action}. Use show | set | reload.`);
279
+ if (action === 'sync') {
280
+ // Write the portal's groups back out to the folder (app → files).
281
+ const res = await (0, api_1.post)('/api/firewall-rules-folder/sync', {});
282
+ if (!res.mounted) {
283
+ console.log((0, utils_1.dim)('No firewall rules folder mounted. Set one with `huddle firewall folder set <path>` and run `huddle restart`.'));
284
+ return;
285
+ }
286
+ if (res.written === 0 && res.errors.length > 0) {
287
+ console.error((0, utils_1.red)('[!] Could not write to the folder — it may still be mounted read-only. Run `huddle restart` to remount it writable.'));
288
+ for (const e of res.errors)
289
+ console.error((0, utils_1.red)(` [!] ${e.file}: ${e.message}`));
290
+ return;
291
+ }
292
+ console.log((0, utils_1.green)(`[OK] Synced: ${res.written} group(s) written, ${res.pruned} stale file(s) removed, ${res.errors.length} error(s)`));
293
+ for (const e of res.errors)
294
+ console.error((0, utils_1.red)(` [!] ${e.file}: ${e.message}`));
295
+ return;
296
+ }
297
+ throw new Error(`Unknown folder action: ${action}. Use show | set | reload | sync.`);
280
298
  }
package/dist/index.js CHANGED
@@ -112,6 +112,7 @@ Usage:
112
112
  huddle firewall group apply <name> Apply a group (--container <id> or global)
113
113
  huddle firewall folder set <path> Set the team-managed rules folder
114
114
  huddle firewall folder reload Re-read the team-managed rules folder
115
+ huddle firewall folder sync Write the portal's groups back to the folder
115
116
  huddle experiment use <nr> Activate the experimental build of issue/PR <nr>
116
117
  and run init
117
118
  huddle experiment reset Back to the stable release
package/dist/init.js CHANGED
@@ -151,7 +151,9 @@ async function runInit(opts, images) {
151
151
  // Team-managed folders (#69). Bind the CLI config dir (~/.huddle) read-write so
152
152
  // the gateway/portal read and write the folder paths there (config.json is the
153
153
  // single source of truth), then bind each configured team folder to a FIXED
154
- // path so the gateway reads it without knowing the host path. Read-only.
154
+ // path so the gateway reads it without knowing the host path. The firewall-rules
155
+ // folder is bound read-write so the portal's "Sync to folder" can write the
156
+ // groups back out; extensions stay read-only (loaded, never written).
155
157
  const fwFolder = cfg.firewallRulesFolder?.trim();
156
158
  const extFolder = cfg.extensionsFolder?.trim();
157
159
  if (fwFolder)
@@ -172,7 +174,7 @@ async function runInit(opts, images) {
172
174
  dockerArgs.push('-v', `${hostTmpSockets}:/tmp/dc-sockets`);
173
175
  dockerArgs.push('-v', `${config_1.CONFIG_DIR}:/huddle-home:rw`, '-e', 'HUDDLE_HOME_DIR=/huddle-home');
174
176
  if (fwFolder)
175
- dockerArgs.push('-v', `${fwFolder}:/firewall-rules:ro`);
177
+ dockerArgs.push('-v', `${fwFolder}:/firewall-rules:rw`);
176
178
  if (extFolder)
177
179
  dockerArgs.push('-v', `${extFolder}:/extensions:ro`);
178
180
  dockerArgs.push(...(0, images_1.gatewayEnvArgs)(images));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosupport/huddle-cli",
3
- "version": "0.0.0-experiment-98.44.1",
3
+ "version": "0.0.0-experiment-98.46.1",
4
4
  "description": "Huddle CLI — start devcontainers and manage firewall rules",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Info Support B.V.",