feat: initialize azure-acme-provisioner project with core functionality
- Add package.json for project metadata and dependencies - Implement CLI in src/cli.ts for managing SSL/TLS certificates - Create Azure Functions host configuration in src/function/host.json - Set up timer function in src/function/index.ts for scheduled certificate management - Define configuration loading and error handling in src/lib/config.ts - Implement DNS zone scanning and challenge management in src/lib/dns.ts - Develop ACME client for certificate issuance in src/lib/acme.ts - Create KeyVault store for managing secrets and certificates in src/lib/keyvault.ts - Implement provisioning logic in src/lib/provisioner.ts for issuing and renewing certificates - Add TypeScript configuration files for building the project
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"version": "2.0",
|
||||
"logging": {
|
||||
"applicationInsights": {
|
||||
"samplingSettings": {
|
||||
"isEnabled": true,
|
||||
"excludedTypes": "Request"
|
||||
}
|
||||
},
|
||||
"logLevel": {
|
||||
"default": "Information",
|
||||
"Host.Results": "Error",
|
||||
"Function": "Information",
|
||||
"Host.Aggregator": "Trace"
|
||||
}
|
||||
},
|
||||
"extensionBundle": {
|
||||
"id": "Microsoft.Azure.Functions.ExtensionBundle",
|
||||
"version": "[4.*, 5.0.0)"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { app, InvocationContext, Timer } from '@azure/functions';
|
||||
import { loadConfig } from '../lib/config.js';
|
||||
import { Provisioner } from '../lib/provisioner.js';
|
||||
|
||||
app.timer('acmeProvisioner', {
|
||||
schedule: '0 0 2 * * *',
|
||||
useMonitor: true,
|
||||
handler: async (_timer: Timer, context: InvocationContext): Promise<void> => {
|
||||
context.log('Azure ACME Provisioner starting');
|
||||
const config = loadConfig();
|
||||
const provisioner = new Provisioner(config, context.log.bind(context));
|
||||
const result = await provisioner.run();
|
||||
context.log('Provisioning complete', result);
|
||||
if (result.errors.length > 0) {
|
||||
throw new Error(`${result.errors.length} domain(s) failed — see logs for details`);
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user