ldap plugin for current version 2.5.2
-
@q16marvin Beat me to it ! Good find - that's exactly the version. Glad it works for you - doesn't for me sadly
-
@q16marvin thanks for noting that, I've fixed the install instructions in the readme
-
i found a bug in script, if checkbox is set:
it tries to add ldap user to group "registered" and everytime it tries to create the group again. and thats let the server restarting:
2023-04-28T12:48:50.475Z [4567/3263] - [32minfo[39m: [GROUP] joinRegisteredGroup 2023-04-28T12:48:50.475Z [4567/3263] - [32minfo[39m: [GROUP] creating registered group registered 2023-04-28T12:48:50.476Z [4567/3263] - [32minfo[39m: [GROUP] join registered group 2023-04-28T12:48:50.481Z [4567/3263] - [31merror[39m: uncaughtException: [[error:group-already-exists]] Error: [[error:group-already-exists]] at Groups.create (/root/nodebb/src/groups/create.js:24:10) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {"date":"Fri Apr 28 2023 12:48:50 GMT+0000 (Koordinierte Weltzeit)","error":{},"exception":true,"os":{"loadavg":[0.12,0.19,0.11],"uptime":3426.95},"process":{"argv":["/usr/bin/node","/root/nodebb/app.js"],"cwd":"/root/nodebb","execPath":"/usr/bin/node","gid":0,"memoryUsage":{"arrayBuffers":19242735,"external":21458138,"heapTotal":91611136,"heapUsed":86136800,"rss":162127872},"pid":3263,"uid":0,"version":"v18.16.0"},"stack":"Error: [[error:group-already-exists]]\n at Groups.create (/root/nodebb/src/groups/create.js:24:10)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","trace":[{"column":10,"file":"/root/nodebb/src/groups/create.js","function":"Groups.create","line":24,"method":"create","native":false},{"column":5,"file":"node:internal/process/task_queues","function":"process.processTicksAndRejections","line":95,"method":"processTicksAndRejections","native":false}]} 2023-04-28T12:48:50.481Z [4567/3263] - [31merror[39m: Error: [[error:group-already-exists]] at Groups.create (/root/nodebb/src/groups/create.js:24:10) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2023-04-28T12:48:50.482Z [4567/3263] - [32minfo[39m: [app] Shutdown (SIGTERM/SIGINT) Initialised. 2023-04-28T12:48:50.484Z [4567/3263] - [32minfo[39m: [app] Web server closed to connections. 2023-04-28T12:48:50.489Z [4567/3263] - [32minfo[39m: [app] Live analytics saved. 2023-04-28T12:48:50.494Z [4567/3263] - [32minfo[39m: [app] Database connection closed. 2023-04-28T12:48:50.494Z [4567/3263] - [32minfo[39m: [app] Shutdown complete.
if think at this place in source:
Who can do such Bugfix?
-
@q16marvin open an issue on the GitHub page please
-
@q16marvin Same issues for me after activating the plugin. It would be nice to be able to to choose between LDAP / Windows AD and Local for authentication.
-
Hi,
i have a little Change, that will also leave User when NOT in ldap group:
groupJoin: (ldapGroup, ldapId, uid, callback) => { winston.verbose("[LDAP] groupJoin " + ldapGroup.cn + " for user " + ldapId + " uid " + uid) nodebb_ldap.createGroup(ldapGroup, (err, groupId) => { if (err) { return callback(err); } let members = ldapGroup.uniqueMember; if (!Array.isArray(members)) { members = [members]; } winston.verbose("[LDAP] groupJoin members " + members && typeof members) let found = false if (members) { members.forEach(member => { if (member && member.indexOf(ldapId) != -1) { found = true } }); } if (found) { const groupsToJoin = [groupId]; if ((master_config.admin_groups || '').split(',').includes(ldapGroup.cn)) { winston.verbose("[LDAP] joins admin group") groupsToJoin.push('administrators'); } if ((master_config.moderator_groups || '').split(',').includes(ldapGroup.cn)) { groupsToJoin.push('Global Moderators'); } return groups.join(groupsToJoin, uid, callback); } else { const groupsToUnJoin = [groupId]; winston.verbose("[LDAP] unjoins group" + ldapGroup.cn + " uid " + uid); return groups.leave(groupsToUnJoin, uid, callback); //callback(); } } ); },
thats realy cool for use maybe someone else will help it