Use tasks api for external ldap syncer
This commit is contained in:
@@ -12,7 +12,8 @@ exports = module.exports = {
|
||||
getLogStream: getLogStream,
|
||||
setDashboardAndMailDomain: setDashboardAndMailDomain,
|
||||
prepareDashboardDomain: prepareDashboardDomain,
|
||||
renewCerts: renewCerts
|
||||
renewCerts: renewCerts,
|
||||
syncExternalLdap: syncExternalLdap
|
||||
};
|
||||
|
||||
let assert = require('assert'),
|
||||
@@ -22,6 +23,7 @@ let assert = require('assert'),
|
||||
CloudronError = cloudron.CloudronError,
|
||||
custom = require('../custom.js'),
|
||||
disks = require('../disks.js'),
|
||||
externalldap = require('../externalldap.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
updater = require('../updater.js'),
|
||||
@@ -186,3 +188,11 @@ function renewCerts(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId }));
|
||||
});
|
||||
}
|
||||
|
||||
function syncExternalLdap(req, res, next) {
|
||||
externalldap.startSyncer(function (error, taskId) {
|
||||
if (error) return next(new HttpError(500, error.message));
|
||||
|
||||
next(new HttpSuccess(202, { taskId: taskId }));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user