Optimized Nextcloud for OIDC flavor login and adapted user administrator credentials

This commit is contained in:
2025-02-25 15:17:56 +01:00
parent ab258cb6dd
commit 9a9bae4f2c
47 changed files with 393 additions and 95 deletions

View File

@@ -0,0 +1,29 @@
#######################################################################
# Generic container for Application roles
#######################################################################
dn: {{ldap.dn.application_roles}}
objectClass: organizationalUnit
ou: roles
description: Container for application access profiles
{#
This template generates two LDIF entries for each application in defaults_applications:
one for the administrator role and one for the standard user role.
Please adjust the base DN (dc=example,dc=com) and other attributes as necessary.
#}
{% for app, config in defaults_applications.items() %}
dn: cn={{ app }}-administrator,{{ldap.dn.application_roles}}
objectClass: top
objectClass: organizationalRole
cn: {{ app }}-administrator
description: Administrator role for {{ app }} (automatically generated)
dn: cn={{ app }}-user,{{ldap.dn.application_roles}}
objectClass: top
objectClass: organizationalRole
cn: {{ app }}-user
description: Standard user role for {{ app }} (automatically generated)
{% endfor %}

View File

@@ -0,0 +1,41 @@
#######################################################################
# Container for Application Roles (if not already created)
#######################################################################
dn: {{ ldap.dn.application_roles }}
objectClass: organizationalUnit
ou: roles
description: Container for application access profiles
#######################################################################
# Create Admin User
#######################################################################
dn: uid={{users.administrator.username}},{{ldap.dn.users}}
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
uid: {{users.administrator.username}}
sn: Administrator
cn: Administrator
userPassword: {SSHA}CHANGE_THIS_PASSWORD
loginShell: /bin/bash
homeDirectory: /home/admin
uidNumber: {{users.administrator.uid}}
gidNumber: {{users.administrator.gid}}
#######################################################################
# Add Admin User to All Application Role Groups
#######################################################################
{# Loop over each application defined in defaults_applications #}
{% for app, config in defaults_applications.items() %}
dn: cn={{ app }}-administrator,{{ ldap.dn.application_roles }}
changetype: modify
add: roleOccupant
roleOccupant: uid={{users.administrator.username}},{{ldap.dn.users}}
dn: cn={{ app }}-user,{{ ldap.dn.application_roles }}
changetype: modify
add: roleOccupant
roleOccupant: uid={{users.administrator.username}},{{ldap.dn.users}}
{% endfor %}

View File

@@ -0,0 +1 @@
This folder contains files which are importet via ldapadd without any specific logic