better error messages
This commit is contained in:
+2
-2
@@ -51,7 +51,7 @@ async function initSecrets() {
|
||||
let value = await get(exports.ACME_ACCOUNT_KEY);
|
||||
if (!value) {
|
||||
const accountKeyPem = safe.child_process.execSync('openssl genrsa 4096');
|
||||
if (!accountKeyPem) throw new BoxError(BoxError.OPENSSL_ERROR, safe.error);
|
||||
if (!accountKeyPem) throw new BoxError(BoxError.OPENSSL_ERROR, `Could not generate acme account key: ${safe.error.message}`);
|
||||
await set(exports.ACME_ACCOUNT_KEY, accountKeyPem);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ async function initSecrets() {
|
||||
safe.fs.unlinkSync(`${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key.pub`);
|
||||
safe.fs.unlinkSync(`${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key`);
|
||||
}
|
||||
if (!safe.child_process.execSync(`ssh-keygen -m PEM -t rsa -f "${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key" -q -N ""`)) throw new BoxError(BoxError.OPENSSL_ERROR, safe.error);
|
||||
if (!safe.child_process.execSync(`ssh-keygen -m PEM -t rsa -f "${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key" -q -N ""`)) throw new BoxError(BoxError.OPENSSL_ERROR, `Could not generate sftp ssh keys: ${safe.error.message}`);
|
||||
const publicKey = safe.fs.readFileSync(`${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key.pub`);
|
||||
await set(exports.SFTP_PUBLIC_KEY, publicKey);
|
||||
const privateKey = safe.fs.readFileSync(`${paths.SFTP_KEYS_DIR}/ssh_host_rsa_key`);
|
||||
|
||||
Reference in New Issue
Block a user