diff --git a/CHANGES b/CHANGES index c76c24727..8f69aeb80 100644 --- a/CHANGES +++ b/CHANGES @@ -1644,4 +1644,5 @@ * Fix issue where CLOUDRON_APP_HOSTNAME was incorrectly set * Remove chat link from the footer of login screen * Add support for oplog tailing in mongodb +* Fix LDAP not accessible via scheduler containers diff --git a/src/apps.js b/src/apps.js index 9ee178474..da3dd5fe6 100644 --- a/src/apps.js +++ b/src/apps.js @@ -486,6 +486,7 @@ function getByContainerId(containerId, callback) { }); } +// returns the app associated with this IP (app or scheduler) function getByIpAddress(ip, callback) { assert.strictEqual(typeof ip, 'string'); assert.strictEqual(typeof callback, 'function'); @@ -493,7 +494,14 @@ function getByIpAddress(ip, callback) { docker.getContainerIdByIp(ip, function (error, containerId) { if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); - getByContainerId(containerId, callback); + docker.inspect(containerId, function (error, result) { + if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); + + const appId = safe.query(result, 'Config.Labels.appId', null); + if (!appId) return callback(new AppsError(AppsError.NOT_FOUND, 'No such app')); + + get(appId, callback); + }); }); }