feat: add dcrouter external gateway sync

This commit is contained in:
2026-04-29 15:24:25 +00:00
parent 1f3705fa25
commit 7ee740695f
12 changed files with 643 additions and 6 deletions
+1 -1
View File
@@ -454,7 +454,7 @@ export class OneboxDatabase {
return this.certificateRepo.getAllDomains();
}
getDomainsByProvider(provider: 'cloudflare' | 'manual'): IDomain[] {
getDomainsByProvider(provider: NonNullable<IDomain['dnsProvider']>): IDomain[] {
return this.certificateRepo.getDomainsByProvider(provider);
}
@@ -43,7 +43,7 @@ export class CertificateRepository extends BaseRepository {
return rows.map((row) => this.rowToDomain(row));
}
getDomainsByProvider(provider: 'cloudflare' | 'manual'): IDomain[] {
getDomainsByProvider(provider: NonNullable<IDomain['dnsProvider']>): IDomain[] {
const rows = this.query('SELECT * FROM domains WHERE dns_provider = ? ORDER BY domain ASC', [provider]);
return rows.map((row) => this.rowToDomain(row));
}
+1
View File
@@ -6,6 +6,7 @@ const encryptedSecretPrefix = 'enc:v1:';
const secretSettingAliases = {
backupPassword: ['backup_encryption_password'],
cloudflareToken: ['cloudflareAPIKey'],
dcrouterGatewayApiToken: ['externalGatewayApiToken'],
} as const;
type TCanonicalSecretSettingKey = keyof typeof secretSettingAliases;