@infosupport/huddle-cli 0.0.0-experiment-147.88.1 → 0.0.0-experiment-147.91.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.
Files changed (2) hide show
  1. package/dist/config.js +5 -2
  2. package/package.json +1 -1
package/dist/config.js CHANGED
@@ -139,7 +139,10 @@ let tmpSeq = 0;
139
139
  * config.
140
140
  */
141
141
  function updateConfig(patch) {
142
- fs_1.default.mkdirSync(exports.CONFIG_DIR, { recursive: true });
142
+ // The config holds the operator token: owner-only. chmod as well, because
143
+ // mkdir's mode does not tighten a directory created by an older version.
144
+ fs_1.default.mkdirSync(exports.CONFIG_DIR, { recursive: true, mode: 0o700 });
145
+ fs_1.default.chmodSync(exports.CONFIG_DIR, 0o700);
143
146
  const token = acquireLock();
144
147
  if (token === null) {
145
148
  throw new Error(`Could not lock ${CONFIG_PATH} within ${LOCK_WAIT_MS}ms — another Huddle process ` +
@@ -153,7 +156,7 @@ function updateConfig(patch) {
153
156
  if (v === undefined)
154
157
  delete next[k];
155
158
  }
156
- fs_1.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`);
159
+ fs_1.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`, { mode: 0o600 });
157
160
  fs_1.default.renameSync(tmp, CONFIG_PATH);
158
161
  return next;
159
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosupport/huddle-cli",
3
- "version": "0.0.0-experiment-147.88.1",
3
+ "version": "0.0.0-experiment-147.91.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.",