From 01f092458dc14f8fad20482a8a424bf5b91cdb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 25 Jan 2024 00:21:50 +0100 Subject: [PATCH] Update login source config and add group support --- conf/login_source.sql | 71 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/conf/login_source.sql b/conf/login_source.sql index 72eb3b0..e7f9703 100644 --- a/conf/login_source.sql +++ b/conf/login_source.sql @@ -1,6 +1,69 @@ -INSERT INTO `__APP__`.`login_source` +INSERT INTO `__APP__`.`login_source` (`id`, `type`, `name`, `is_active`, `cfg`, `created_unix`, `updated_unix`) VALUES -('1', '2', 'YunoHost LDAP', '1', '{"Name":"Yunohost LDAP","Host":"localhost","Port":389,"UseSSL":false,"BindDN":"","BindPassword":"","UserBase":"ou=users,dc=yunohost,dc=org","AttributeName":"givenName","AttributeSurname":"sn","AttributeMail":"mail","Filter":"(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))","AdminFilter":"(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)","Enabled":true}', '1464014433', '1464015955') -ON DUPLICATE KEY -UPDATE cfg='{"Name":"YunoHost LDAP","Host":"localhost","Port":389,"UseSSL":false,"BindDN":"","BindPassword":"","UserBase":"ou=users,dc=yunohost,dc=org","AttributeName":"givenName","AttributeSurname":"sn","AttributeMail":"mail","Filter":"(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))","AdminFilter":"(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)","Enabled":true}'; +('1', '2', 'YunoHost LDAP', '1', + '{ + "Name": "YunoHost LDAP", + "Host": "localhost", + "Port": 389, + "SecurityProtocol": 0, + "SkipVerify": false, + "BindDN": "", + "BindPassword": "", + "UserBase": "ou=users,dc=yunohost,dc=org", + "UserDN": "", + "AttributeUsername": "uid", + "AttributeName": "givenName", + "AttributeSurname": "sn", + "AttributeMail": "mail", + "AttributesInBind": false, + "AttributeSSHPublicKey": "", + "AttributeAvatar": "", + "SearchPageSize": 0, + "Filter": "(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))", + "AdminFilter": "(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)", + "RestrictedFilter": "", + "Enabled": true, + "AllowDeactivateAll": false, + "GroupsEnabled": true, + "GroupDN": "ou=groups,dc=yunohost,dc=org", + "GroupFilter": "", + "GroupMemberUID": "memberUid", + "GroupTeamMap": "", + "GroupTeamMapRemoval": true, + "UserUID": "uid" + }', UNIX_TIMESTAMP(NOW()), UNIX_TIMESTAMP(NOW())) +ON DUPLICATE KEY +UPDATE + updated_unix=UNIX_TIMESTAMP(NOW()), + cfg='{ + "Name": "YunoHost LDAP", + "Host": "localhost", + "Port": 389, + "SecurityProtocol": 0, + "SkipVerify": false, + "BindDN": "", + "BindPassword": "", + "UserBase": "ou=users,dc=yunohost,dc=org", + "UserDN": "", + "AttributeUsername": "uid", + "AttributeName": "givenName", + "AttributeSurname": "sn", + "AttributeMail": "mail", + "AttributesInBind": false, + "AttributeSSHPublicKey": "", + "AttributeAvatar": "", + "SearchPageSize": 0, + "Filter": "(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))", + "AdminFilter": "(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)", + "RestrictedFilter": "", + "Enabled": true, + "AllowDeactivateAll": false, + "GroupsEnabled": true, + "GroupDN": "ou=groups,dc=yunohost,dc=org", + "GroupFilter": "", + "GroupMemberUID": "memberUid", + "GroupTeamMap": "", + "GroupTeamMapRemoval": true, + "UserUID": "uid" + }';