fix(domains): removes MX+TXT record from @.json

This commit is contained in:
Akshay Nair
2024-01-08 21:40:01 +05:30
parent be2b3f7e18
commit 736f62c1de
2 changed files with 5 additions and 9 deletions
+1 -3
View File
@@ -6,8 +6,6 @@
"email": "phenax5@gmail.com"
},
"record": {
"URL": "http://www.is-a.dev",
"MX": ["mail.is-a.dev"],
"TXT": ["v=spf1 ip4:51.161.54.164 include:mail.is-a.dev ~all"]
"URL": "http://www.is-a.dev"
}
}
+4 -6
View File
@@ -59,6 +59,9 @@ const recordToEmailMx = ({ name, address, priority }) => ({
const getHostKey = host =>
`${host.name.toLowerCase()}##${host.type.toLowerCase()}##${host.address.toLowerCase()}`;
const isReserved = (domain) =>
domain.name.startsWith('*') || !VALID_RECORD_TYPES.includes(domain.type)
const diffRecords = (oldRecords, newRecords) => {
const isMatchingRecord = (a, b) => getHostKey(a) === getHostKey(b);
@@ -84,13 +87,9 @@ const executeBatch = (batches) => batches.reduce((promise, batch, index) => {
});
}, Promise.resolve());
const isReserved = (domain) =>
domain.name.startsWith('*') ||
!VALID_RECORD_TYPES.includes(domain.type)
const getDomainService = ({ cpanel }) => {
const fetchZoneRecords = R.compose(
then(R.filter(R.complement(isReserved))),
then(R.reject(isReserved)),
then(R.map(zoneToRecord)),
cpanel.zone.fetch
);
@@ -134,7 +133,6 @@ const getDomainService = ({ cpanel }) => {
batchLazyTasks(BATCH_SIZE),
R.filter(Boolean),
R.map(R.cond([
// [R.propEq('name', 'www'), R.always(null)], // Ignore www
[R.propEq('type', 'URL'), addRedirection],
[R.T, addZoneRecord],
])),