mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-17 12:16:12 +00:00
fix: removes restriction on root record
This commit is contained in:
2 files changed
+4
-6
No files matched your search
@@ -15,7 +15,7 @@ const toHostList = R.chain(data => {
|
|||||||
// URL redirection must contain explicit A record
|
// URL redirection must contain explicit A record
|
||||||
// Wildcard A record breaks when used with MX
|
// Wildcard A record breaks when used with MX
|
||||||
// Ref: https://github.com/is-a-dev/register/issues/2365
|
// Ref: https://github.com/is-a-dev/register/issues/2365
|
||||||
if (data.record.URL && data.record.MX) {
|
if (data.record.URL && data.record.MX || data.name === '@') {
|
||||||
data.record.A = [ DOMAIN_HOST_IP ]
|
data.record.A = [ DOMAIN_HOST_IP ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const recordToZone = ({ name, type, address, id, priority }) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cleanName = name =>
|
const cleanName = name =>
|
||||||
name === DOMAIN_DOMAIN ? '@' : `${name}`.replace(new RegExp(`\\.?${DOMAIN_DOMAIN}\\.?$`), '').toLowerCase();
|
[DOMAIN_DOMAIN, `${DOMAIN_DOMAIN}.`].includes(name) ? '@' : `${name}`.replace(new RegExp(`\\.${DOMAIN_DOMAIN}\\.?$`), '').toLowerCase();
|
||||||
|
|
||||||
const zoneToRecord = ({
|
const zoneToRecord = ({
|
||||||
name,
|
name,
|
||||||
@@ -63,8 +63,7 @@ const diffRecords = (oldRecords, newRecords) => {
|
|||||||
const isMatchingRecord = (a, b) => getHostKey(a) === getHostKey(b);
|
const isMatchingRecord = (a, b) => getHostKey(a) === getHostKey(b);
|
||||||
|
|
||||||
const remove = R.differenceWith(isMatchingRecord, oldRecords, newRecords);
|
const remove = R.differenceWith(isMatchingRecord, oldRecords, newRecords);
|
||||||
const add = R.differenceWith(isMatchingRecord, newRecords, oldRecords)
|
const add = R.differenceWith(isMatchingRecord, newRecords, oldRecords);
|
||||||
.filter(r => !['www'].includes(r.name));
|
|
||||||
|
|
||||||
return { add, remove };
|
return { add, remove };
|
||||||
};
|
};
|
||||||
@@ -86,8 +85,7 @@ const executeBatch = (batches) => batches.reduce((promise, batch, index) => {
|
|||||||
}, Promise.resolve());
|
}, Promise.resolve());
|
||||||
|
|
||||||
const isReserved = (domain) =>
|
const isReserved = (domain) =>
|
||||||
!domain.name ||
|
domain.name.startsWith('*') ||
|
||||||
domain.name.startsWith('*') ||
|
|
||||||
!VALID_RECORD_TYPES.includes(domain.type)
|
!VALID_RECORD_TYPES.includes(domain.type)
|
||||||
|
|
||||||
const getDomainService = ({ cpanel }) => {
|
const getDomainService = ({ cpanel }) => {
|
||||||
|
|||||||
Reference in new issue
Block a user