@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 +19 -1
- package/dist/index.js +1 -0
- package/dist/init.js +4 -2
- package/package.json +1 -1
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
|
-
|
|
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.
|
|
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:
|
|
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