mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-14 20:17:19 +00:00
Fixes root domain pointing
This commit is contained in:
1 parent
3d41724a5b
commit
112f8ce91c
2 files changed
+6
-4
No files matched your search
+3
-1
@@ -5,5 +5,7 @@
|
|||||||
"username": "phenax",
|
"username": "phenax",
|
||||||
"email": "phenax5@gmail.com"
|
"email": "phenax5@gmail.com"
|
||||||
},
|
},
|
||||||
"record": {}
|
"record": {
|
||||||
|
"URL": "https://www.is-a.dev"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ const { then, log, print, lazyTask, batchLazyTasks } = require('./helpers');
|
|||||||
const BATCH_SIZE = 1;
|
const BATCH_SIZE = 1;
|
||||||
|
|
||||||
const recordToRedirection = ({ name, address }) => ({
|
const recordToRedirection = ({ name, address }) => ({
|
||||||
domain: `${name}.${DOMAIN_DOMAIN}`,
|
domain: name === '@' ? DOMAIN_DOMAIN : `${name}.${DOMAIN_DOMAIN}`,
|
||||||
redirect: address,
|
redirect: address,
|
||||||
type: 'permanent',
|
type: 'permanent',
|
||||||
redirect_wildcard: 1,
|
redirect_wildcard: 1,
|
||||||
@@ -20,7 +20,7 @@ const recordToZone = ({ name, type, address, id }) => ({
|
|||||||
...(type === 'CNAME' ? { cname: address } : {}),
|
...(type === 'CNAME' ? { cname: address } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const cleanName = name => `${name}`.replace(new RegExp(`\\.${DOMAIN_DOMAIN}\\.?$`), '').toLowerCase();
|
const cleanName = name => name === DOMAIN_DOMAIN ? '@' : `${name}`.replace(new RegExp(`\\.${DOMAIN_DOMAIN}\\.?$`), '').toLowerCase();
|
||||||
|
|
||||||
const zoneToRecord = ({ name, type, cname, address, record, line: id }) => ({
|
const zoneToRecord = ({ name, type, cname, address, record, line: id }) => ({
|
||||||
id,
|
id,
|
||||||
@@ -42,7 +42,7 @@ const diffRecords = (oldRecords, newRecords) => {
|
|||||||
|
|
||||||
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));
|
.filter(r => !['www'].includes(r.name));
|
||||||
|
|
||||||
return { add, remove };
|
return { add, remove };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user