move wellKnownJson to domains
after some more thought: * If app moves to another location, user has to remember to move all this config * It's not really associated with an app. It's to do with the domain info * We can put some hints in the UI if app is missing. part of #703
This commit is contained in:
@@ -16,14 +16,18 @@ var assert = require('assert'),
|
||||
database = require('./database.js'),
|
||||
safe = require('safetydance');
|
||||
|
||||
var DOMAINS_FIELDS = [ 'domain', 'zoneName', 'provider', 'configJson', 'tlsConfigJson' ].join(',');
|
||||
var DOMAINS_FIELDS = [ 'domain', 'zoneName', 'provider', 'configJson', 'tlsConfigJson', 'wellKnownJson' ].join(',');
|
||||
|
||||
function postProcess(data) {
|
||||
data.config = safe.JSON.parse(data.configJson);
|
||||
data.tlsConfig = safe.JSON.parse(data.tlsConfigJson);
|
||||
delete data.configJson;
|
||||
|
||||
data.tlsConfig = safe.JSON.parse(data.tlsConfigJson);
|
||||
delete data.tlsConfigJson;
|
||||
|
||||
data.wellKnown = safe.JSON.parse(data.wellKnownJson);
|
||||
delete data.wellKnownJson;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -86,6 +90,9 @@ function update(name, domain, callback) {
|
||||
} else if (k === 'tlsConfig') {
|
||||
fields.push('tlsConfigJson = ?');
|
||||
args.push(JSON.stringify(domain[k]));
|
||||
} else if (k === 'wellKnown') {
|
||||
fields.push('wellKnownJson = ?');
|
||||
args.push(JSON.stringify(domain[k]));
|
||||
} else {
|
||||
fields.push(k + ' = ?');
|
||||
args.push(domain[k]);
|
||||
|
||||
Reference in New Issue
Block a user