setAdmin -> setDashboardDomain
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ exports = module.exports = {
|
||||
|
||||
onActivated: onActivated,
|
||||
|
||||
setAdmin: setAdmin,
|
||||
setDashboardDomain: setDashboardDomain,
|
||||
|
||||
checkDiskSpace: checkDiskSpace,
|
||||
|
||||
@@ -352,11 +352,11 @@ function getStatus(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function setAdmin(domain, callback) {
|
||||
function setDashboardDomain(domain, callback) {
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug('setAdmin domain:%s', domain);
|
||||
debug(`setDashboardDomain: ${domain}`);
|
||||
|
||||
domains.get(domain, function (error, result) {
|
||||
if (error && error.reason === DomainsError.NOT_FOUND) return callback(new CloudronError(CloudronError.BAD_FIELD, 'No such domain'));
|
||||
|
||||
@@ -12,7 +12,7 @@ exports = module.exports = {
|
||||
getLogs: getLogs,
|
||||
getLogStream: getLogStream,
|
||||
getStatus: getStatus,
|
||||
setAdmin: setAdmin
|
||||
setDashboardDomain: setDashboardDomain
|
||||
};
|
||||
|
||||
var appstore = require('../appstore.js'),
|
||||
@@ -174,10 +174,10 @@ function getLogStream(req, res, next) {
|
||||
});
|
||||
}
|
||||
|
||||
function setAdmin(req, res, next) {
|
||||
function setDashboardDomain(req, res, next) {
|
||||
if (!req.body.domain || typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
|
||||
|
||||
cloudron.setAdmin(req.body.domain, function (error) {
|
||||
cloudron.setDashboardDomain(req.body.domain, function (error) {
|
||||
if (error && error.reason === CloudronError.BAD_FIELD) return next(new HttpError(404, error.message));
|
||||
if (error) return next(new HttpError(500, error));
|
||||
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ function initializeExpressSync() {
|
||||
// cloudron routes
|
||||
router.get ('/api/v1/cloudron/update', cloudronScope, routes.cloudron.getUpdateInfo);
|
||||
router.post('/api/v1/cloudron/update', cloudronScope, routes.cloudron.update);
|
||||
router.post('/api/v1/cloudron/set_admin', cloudronScope, routes.cloudron.setAdmin);
|
||||
router.post('/api/v1/cloudron/set_dashboard_domain', cloudronScope, routes.cloudron.setDashboardDomain);
|
||||
router.post('/api/v1/cloudron/check_for_updates', cloudronScope, routes.cloudron.checkForUpdates);
|
||||
router.get ('/api/v1/cloudron/reboot', cloudronScope, routes.cloudron.isRebootRequired);
|
||||
router.post('/api/v1/cloudron/reboot', cloudronScope, routes.cloudron.reboot);
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ function provision(dnsConfig, autoconf, auditSource, callback) {
|
||||
|
||||
async.series([
|
||||
mail.addDomain.bind(null, domain),
|
||||
cloudron.setAdmin.bind(null, domain), // triggers task to setup my. dns/cert/reverseproxy
|
||||
cloudron.setDashboardDomain.bind(null, domain), // triggers task to setup my. dns/cert/reverseproxy
|
||||
autoprovision.bind(null, autoconf),
|
||||
eventlog.add.bind(null, eventlog.ACTION_PROVISION, auditSource, { })
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user