envpkt 0.6.3 → 0.6.4
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/cli.js +9 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3055,13 +3055,17 @@ const runSeal = async (options) => {
|
|
|
3055
3055
|
console.log("");
|
|
3056
3056
|
const values = await (async () => {
|
|
3057
3057
|
if (options.reseal && alreadySealed.length > 0) {
|
|
3058
|
-
const identityPath = config.identity?.key_file ? resolve(configDir, expandPath(config.identity.key_file)) :
|
|
3058
|
+
const identityPath = config.identity?.key_file ? resolve(configDir, expandPath(config.identity.key_file)) : (() => {
|
|
3059
|
+
const defaultPath = resolveKeyPath();
|
|
3060
|
+
return existsSync(defaultPath) ? defaultPath : void 0;
|
|
3061
|
+
})();
|
|
3059
3062
|
if (!identityPath) {
|
|
3060
|
-
console.error(`${RED}Error:${RESET} identity
|
|
3063
|
+
console.error(`${RED}Error:${RESET} No identity key found for --reseal (needed to decrypt existing secrets)`);
|
|
3061
3064
|
console.error("");
|
|
3062
|
-
console.error(`${DIM}
|
|
3063
|
-
console.error(`${DIM}
|
|
3064
|
-
console.error(`${DIM}
|
|
3065
|
+
console.error(`${DIM}Looked in:${RESET}`);
|
|
3066
|
+
console.error(`${DIM} 1. identity.key_file in envpkt.toml${RESET}`);
|
|
3067
|
+
console.error(`${DIM} 2. ENVPKT_AGE_KEY_FILE env var${RESET}`);
|
|
3068
|
+
console.error(`${DIM} 3. ~/.envpkt/age-key.txt${RESET}`);
|
|
3065
3069
|
process.exit(2);
|
|
3066
3070
|
}
|
|
3067
3071
|
const decrypted = unsealSecrets(Object.fromEntries(alreadySealed.map((k) => [k, allSecretEntries[k]])), identityPath).fold((err) => {
|