caas: do not special case handling of naked domains

on the caas side, adding naked domain is removed as well
This commit is contained in:
Girish Ramakrishnan
2018-01-10 20:52:59 -08:00
parent 74e79c00fc
commit 2d163c1e76
2 changed files with 3 additions and 19 deletions
+1 -8
View File
@@ -278,8 +278,7 @@ function registerSubdomain(app, overwrite, callback) {
if (error) return retryCallback(error);
// refuse to update any existing DNS record for custom domains that we did not create
// note that the appstore sets up the naked domain for non-custom domains
if (config.isCustomDomain() && values.length !== 0 && !overwrite) return retryCallback(null, new Error('DNS Record already exists'));
if (values.length !== 0 && !overwrite) return retryCallback(null, new Error('DNS Record already exists'));
domains.upsertDNSRecords(app.location, app.domain, 'A', [ ip ], function (error, changeId) {
if (error && (error.reason === DomainError.STILL_BUSY || error.reason === DomainError.EXTERNAL_ERROR)) return retryCallback(error); // try again
@@ -305,12 +304,6 @@ function unregisterSubdomain(app, location, domain, callback) {
// FIXME remove the oldConfig.domain fallback in following releases
domain = domain || config.fqdn();
// do not unregister bare domain because we show a error/cloudron info page there
if (!config.isCustomDomain() && location === '') {
debugApp(app, 'Skip unregister of empty subdomain');
return callback(null);
}
if (!app.dnsRecordId) {
debugApp(app, 'Skip unregister of record not created by cloudron');
return callback(null);
+2 -11
View File
@@ -562,17 +562,8 @@ function addDnsRecords(ip, callback) {
var dkimRecord = { subdomain: config.dkimSelector() + '._domainkey', domain: config.fqdn(), type: 'TXT', values: [ '"v=DKIM1; t=s; p=' + dkimKey + '"' ] };
var records = [ ];
if (config.isCustomDomain()) {
records.push(webadminRecord);
records.push(dkimRecord);
} else {
// for non-custom domains, we show a noapp.html page
var nakedDomainRecord = { subdomain: '', domain: config.fqdn(), type: 'A', values: [ ip ] };
records.push(nakedDomainRecord);
records.push(webadminRecord);
records.push(dkimRecord);
}
records.push(webadminRecord);
records.push(dkimRecord);
debug('addDnsRecords: %j', records);