update: the domain service2
This commit is contained in:
@@ -19,6 +19,7 @@ import { DomainRepository } from "../repositories/domain.repository";
|
|||||||
export class DomainsService {
|
export class DomainsService {
|
||||||
private readonly logger = new Logger(DomainsService.name);
|
private readonly logger = new Logger(DomainsService.name);
|
||||||
private readonly businessDomain = "danakcorp.com";
|
private readonly businessDomain = "danakcorp.com";
|
||||||
|
private readonly dkimSelectorName = "default._domainkey";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly domainRepository: DomainRepository,
|
private readonly domainRepository: DomainRepository,
|
||||||
@@ -139,8 +140,11 @@ export class DomainsService {
|
|||||||
domain.dkimPrivateKey = dkimKeys.privateKey;
|
domain.dkimPrivateKey = dkimKeys.privateKey;
|
||||||
domain.dkimPublicKey = dkimKeys.publicKey;
|
domain.dkimPublicKey = dkimKeys.publicKey;
|
||||||
|
|
||||||
|
// const dkimNameParts = dkimKeys.dnsTxt.name.split(".");
|
||||||
|
// const dkimSelector = dkimNameParts.slice(0, 2).join("."); // Takes first two parts: "default._domainkey"
|
||||||
|
|
||||||
// Create DKIM DNS record
|
// Create DKIM DNS record
|
||||||
await this.dnsService.createDKIMRecord(domain, selector, dkimKeys.dnsTxt.name, dkimKeys.dnsTxt.value, dkimKeys.wildduckId);
|
await this.dnsService.createDKIMRecord(domain, selector, this.dkimSelectorName, dkimKeys.dnsTxt.value, dkimKeys.wildduckId);
|
||||||
|
|
||||||
this.logger.log(`DKIM automatically enabled for domain ${domain.name}`);
|
this.logger.log(`DKIM automatically enabled for domain ${domain.name}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user