diff --git a/setup/start/systemd/box.service b/setup/start/systemd/box.service index 2fa28a692..c4afcb9c2 100644 --- a/setup/start/systemd/box.service +++ b/setup/start/systemd/box.service @@ -14,7 +14,7 @@ WorkingDirectory=/home/yellowtent/box Restart=always ExecStart=/home/yellowtent/box/box.js ; we run commands like df which will parse properly only with correct locale -Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box:*,connect-lastmile,-box:ldap,-box:externalldap" "BOX_ENV=cloudron" "NODE_ENV=production" "LC_ALL=C" +Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box:*,connect-lastmile,-box:ldap" "BOX_ENV=cloudron" "NODE_ENV=production" "LC_ALL=C" ; kill apptask processes as well KillMode=control-group ; Do not kill this process on OOM. Children inherit this score. Do not set it to -1000 so that MemoryMax can keep working diff --git a/src/externalldap.js b/src/externalldap.js index 78eb3ffb3..ab0cdf150 100644 --- a/src/externalldap.js +++ b/src/externalldap.js @@ -105,8 +105,6 @@ async function clientSearch(client, dn, searchOptions) { assert.strictEqual(typeof dn, 'string'); assert.strictEqual(typeof searchOptions, 'object'); - debug(`clientSearch: Get objects at ${dn} with options ${JSON.stringify(searchOptions)}`); - // basic validation to not crash try { ldap.parseDN(dn); } catch (e) { throw new BoxError(BoxError.BAD_FIELD, 'invalid DN'); } @@ -163,8 +161,6 @@ async function ldapUserSearch(externalLdapConfig, options) { searchOptions.filter = new ldap.AndFilter({ filters: [ extraFilter, searchOptions.filter ] }); } - debug(`Listing users at ${externalLdapConfig.baseDn} with filter ${searchOptions.filter.toString()}`); - const client = await getClient(externalLdapConfig, { bind: true }); const result = await clientSearch(client, externalLdapConfig.baseDn, searchOptions); client.unbind(); @@ -187,8 +183,6 @@ async function ldapGroupSearch(externalLdapConfig, options) { searchOptions.filter = new ldap.AndFilter({ filters: [ extraFilter, searchOptions.filter ] }); } - debug(`Listing groups at ${externalLdapConfig.groupBaseDn} with filter ${searchOptions.filter.toString()}`); - const client = await getClient(externalLdapConfig, { bind: true }); const result = await clientSearch(client, externalLdapConfig.groupBaseDn, searchOptions); client.unbind(); @@ -239,21 +233,6 @@ async function testConfig(config) { return null; } -// eslint-disable-next-line no-unused-vars -async function search(identifier) { - assert.strictEqual(typeof identifier, 'string'); - - const externalLdapConfig = await settings.getExternalLdapConfig(); - if (externalLdapConfig.provider === 'noop') throw new BoxError(BoxError.BAD_STATE, 'not enabled'); - - const ldapUsers = await ldapUserSearch(externalLdapConfig, { filter: `${externalLdapConfig.usernameField}=${identifier}` }); - - // translate ldap properties to ours - let users = ldapUsers.map(function (u) { return translateUser(externalLdapConfig, u); }); - - return users; -} - async function maybeCreateUser(identifier) { assert.strictEqual(typeof identifier, 'string');