cf-envsync 0.3.3 → 0.3.5
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/index.js +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13110,7 +13110,15 @@ function decryptValue(token, password) {
|
|
|
13110
13110
|
function decryptEnvMap(envMap, password) {
|
|
13111
13111
|
const result = {};
|
|
13112
13112
|
for (const [key, value] of Object.entries(envMap)) {
|
|
13113
|
-
|
|
13113
|
+
if (isEnvsyncEncrypted(value)) {
|
|
13114
|
+
try {
|
|
13115
|
+
result[key] = decryptValue(value, password);
|
|
13116
|
+
} catch {
|
|
13117
|
+
throw new Error(`Failed to decrypt ${key}: wrong password or corrupted data. ` + `Check ENVSYNC_PASSWORD or .env.password`);
|
|
13118
|
+
}
|
|
13119
|
+
} else {
|
|
13120
|
+
result[key] = value;
|
|
13121
|
+
}
|
|
13114
13122
|
}
|
|
13115
13123
|
return result;
|
|
13116
13124
|
}
|
|
@@ -13663,7 +13671,7 @@ var init_push = __esm(() => {
|
|
|
13663
13671
|
continue;
|
|
13664
13672
|
}
|
|
13665
13673
|
}
|
|
13666
|
-
const result = await pushSecrets(workerName, secretsToPush, environment,
|
|
13674
|
+
const result = await pushSecrets(workerName, secretsToPush, environment, app.absolutePath);
|
|
13667
13675
|
if (result.success) {
|
|
13668
13676
|
consola.success(` Pushed ${keyCount} secrets to ${workerName}`);
|
|
13669
13677
|
} else {
|
|
@@ -13740,7 +13748,7 @@ var init_pull = __esm(() => {
|
|
|
13740
13748
|
continue;
|
|
13741
13749
|
}
|
|
13742
13750
|
consola.start(`Pulling secret keys for ${app.name} from ${workerName} (${environment})...`);
|
|
13743
|
-
const remoteKeys = await listSecrets(workerName, environment,
|
|
13751
|
+
const remoteKeys = await listSecrets(workerName, environment, app.absolutePath);
|
|
13744
13752
|
if (remoteKeys.length === 0) {
|
|
13745
13753
|
consola.warn(` No secrets found for ${workerName}. Skipping.`);
|
|
13746
13754
|
continue;
|
|
@@ -14076,7 +14084,7 @@ var init_diff = __esm(() => {
|
|
|
14076
14084
|
consola.start(`Diffing ${app.name}: .env vs ${workerName} (${env1})...`);
|
|
14077
14085
|
const [resolved, remoteKeys] = await Promise.all([
|
|
14078
14086
|
resolveAppEnv(config, app, env1),
|
|
14079
|
-
listSecrets(workerName, env1,
|
|
14087
|
+
listSecrets(workerName, env1, app.absolutePath)
|
|
14080
14088
|
]);
|
|
14081
14089
|
const localKeys = new Set(Object.keys(resolved.map));
|
|
14082
14090
|
const remoteKeySet = new Set(remoteKeys);
|