fix: update version to 0.5.0, add support for PEM and PFX formats, and implement certificate conversion functionality
This commit is contained in:
+15
@@ -34,6 +34,7 @@ function applyOverrides(options: Record<string, unknown>): void {
|
||||
if (options['renewalThreshold']) process.env['ACME_RENEWAL_THRESHOLD_DAYS'] = String(options['renewalThreshold']);
|
||||
if (options['logLevel']) process.env['ACME_LOG_LEVEL'] = String(options['logLevel']);
|
||||
if (options['http']) process.env['ACME_HTTP_PORT'] = String(options['http']);
|
||||
if (options['pem']) process.env['ACME_CERT_FORMAT'] = 'pem';
|
||||
if (options['keyvaultName'] && !options['keyvaultUrl'])
|
||||
process.env['ACME_KEYVAULT_URL'] = `https://${options['keyvaultName']}.vault.azure.net`;
|
||||
}
|
||||
@@ -59,6 +60,7 @@ sharedOptions(
|
||||
.command('run', { isDefault: true })
|
||||
.description('Scan DNS zones and issue or renew certificates')
|
||||
.option('--http <port>', 'Use HTTP-01 challenge on the given port instead of DNS-01')
|
||||
.option('--pem', 'Store certificate as PEM bundle instead of PFX (PKCS#12)')
|
||||
.option('--dry-run', 'Show what would be done without making changes')
|
||||
).action(async (options: Record<string, unknown>) => {
|
||||
applyOverrides(options);
|
||||
@@ -120,6 +122,7 @@ sharedOptions(
|
||||
.command('renew <domain>')
|
||||
.description('Force-renew a certificate for a specific domain, bypassing the renewal threshold')
|
||||
.option('--http <port>', 'Use HTTP-01 challenge on the given port instead of DNS-01')
|
||||
.option('--pem', 'Store certificate as PEM bundle instead of PFX (PKCS#12)')
|
||||
).action(async (domain: string, options: Record<string, unknown>) => {
|
||||
applyOverrides(options);
|
||||
const config = loadConfig();
|
||||
@@ -191,6 +194,18 @@ sharedOptions(
|
||||
}
|
||||
});
|
||||
|
||||
sharedOptions(
|
||||
program
|
||||
.command('convert <domain>')
|
||||
.description('Convert a stored certificate between PFX (PKCS#12) and PEM format')
|
||||
.option('--pem', 'Convert to PEM bundle instead of PFX (PKCS#12)')
|
||||
).action(async (domain: string, options: Record<string, unknown>) => {
|
||||
applyOverrides(options);
|
||||
const config = loadConfig();
|
||||
const provisioner = new Provisioner(config);
|
||||
await provisioner.convert(domain, config.pfx ? 'pfx' : 'pem');
|
||||
});
|
||||
|
||||
program.parseAsync(process.argv).catch((err: unknown) => {
|
||||
console.error(err instanceof Error ? err.message : String(err));
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user