mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-04-28 18:30:24 +02:00
Compare commits
4 Commits
61eb9a3aed
...
22ce80cd23
Author | SHA1 | Date | |
---|---|---|---|
22ce80cd23 | |||
545af78e60 | |||
db7ef0e8a5 | |||
ae1d7c785f |
@ -41,6 +41,8 @@ defaults_applications:
|
|||||||
enabled: true # Activate OIDC
|
enabled: true # Activate OIDC
|
||||||
database:
|
database:
|
||||||
central_storage: True
|
central_storage: True
|
||||||
|
ldap:
|
||||||
|
enabled: False # @todo LDAP needs to get propper implemented and tested, just set values during refactoring
|
||||||
|
|
||||||
## Bluesky
|
## Bluesky
|
||||||
bluesky:
|
bluesky:
|
||||||
@ -78,7 +80,7 @@ defaults_applications:
|
|||||||
funkwhale:
|
funkwhale:
|
||||||
version: "1.4.0"
|
version: "1.4.0"
|
||||||
ldap:
|
ldap:
|
||||||
enabled: True # Enables LDAP by default
|
enabled: True # Enables LDAP by default @todo check implementation
|
||||||
database:
|
database:
|
||||||
central_storage: True
|
central_storage: True
|
||||||
|
|
||||||
@ -252,7 +254,7 @@ defaults_applications:
|
|||||||
# Available options: oidc_login, sociallogin
|
# Available options: oidc_login, sociallogin
|
||||||
# @see https://apps.nextcloud.com/apps/oidc_login
|
# @see https://apps.nextcloud.com/apps/oidc_login
|
||||||
# @see https://apps.nextcloud.com/apps/sociallogin
|
# @see https://apps.nextcloud.com/apps/sociallogin
|
||||||
flavor: "oidc_login" # Keeping on sociallogin because the other option is not implemented yet
|
flavor: "sociallogin" # Keeping on sociallogin because the other option is not implemented yet
|
||||||
force_import: False # Forces the import of the LDIF files
|
force_import: False # Forces the import of the LDIF files
|
||||||
database:
|
database:
|
||||||
central_storage: True
|
central_storage: True
|
||||||
|
@ -29,7 +29,9 @@ defaults_oidc:
|
|||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
# Helper Variables:
|
# Helper Variables:
|
||||||
|
# Keep in mind to mapp this variables if there is ever the possibility for the user to define them in the inventory
|
||||||
_ldap_dn_base: "dc={{primary_domain_sld}},dc={{primary_domain_tld}}"
|
_ldap_dn_base: "dc={{primary_domain_sld}},dc={{primary_domain_tld}}"
|
||||||
|
_ldap_server_port: "{% if applications.ldap.openldap.network.local | bool %}{{ ports.localhost.ldap.openldap }}{% else %}{{ ports.localhost.ldaps.openldap }}{% endif %}"
|
||||||
|
|
||||||
ldap:
|
ldap:
|
||||||
# Enables LDAP for all roles in play if true
|
# Enables LDAP for all roles in play if true
|
||||||
@ -46,11 +48,15 @@ ldap:
|
|||||||
groups: "ou=groups,{{_ldap_dn_base}}"
|
groups: "ou=groups,{{_ldap_dn_base}}"
|
||||||
# Dn for all application roles of the users
|
# Dn for all application roles of the users
|
||||||
application_roles: "ou=application_roles,{{_ldap_dn_base}}"
|
application_roles: "ou=application_roles,{{_ldap_dn_base}}"
|
||||||
|
attributes:
|
||||||
|
# Attribut to identify the user
|
||||||
|
user_id: "uid"
|
||||||
# Password to access dn.bind
|
# Password to access dn.bind
|
||||||
bind_credential: "{{applications.ldap.administrator_database_password}}"
|
bind_credential: "{{applications.ldap.administrator_database_password}}"
|
||||||
server:
|
server:
|
||||||
domain: "{{applications.ldap.openldap.hostname if applications.ldap.openldap.network.local | bool else domains.ldap}}" # Mapping for public or locale access
|
domain: "{{applications.ldap.openldap.hostname if applications.ldap.openldap.network.local | bool else domains.ldap}}" # Mapping for public or locale access
|
||||||
uri: "{% if applications.ldap.openldap.network.local | bool %}ldap://{{ applications.ldap.openldap.hostname }}:{{ ports.localhost.ldap.openldap }}{% else %}ldaps://{{ domains.ldap }}:{{ ports.public.ldaps.openldap }}{% endif %}"
|
port: "{{_ldap_server_port}}"
|
||||||
|
uri: "{% if applications.ldap.openldap.network.local | bool %}ldap://{{ applications.ldap.openldap.hostname }}{% else %}ldaps://{{ domains.ldap }}{% endif %}:{{ _ldap_server_port }}"
|
||||||
network:
|
network:
|
||||||
local: "{{applications.ldap.openldap.network.local}}" # Uses the application configuration to define if local network should be available or not
|
local: "{{applications.ldap.openldap.network.local}}" # Uses the application configuration to define if local network should be available or not
|
||||||
|
|
@ -161,6 +161,7 @@ OFFICE365_HD=
|
|||||||
# It is useful for cases when Greenlight is deployed behind a Network Load Balancer or proxy
|
# It is useful for cases when Greenlight is deployed behind a Network Load Balancer or proxy
|
||||||
OAUTH2_REDIRECT=
|
OAUTH2_REDIRECT=
|
||||||
|
|
||||||
|
{% if applications[application_id].ldap.enabled | bool %}
|
||||||
# LDAP Login Provider (optional)
|
# LDAP Login Provider (optional)
|
||||||
#
|
#
|
||||||
# You can enable LDAP authentication by providing values for the variables below.
|
# You can enable LDAP authentication by providing values for the variables below.
|
||||||
@ -172,23 +173,25 @@ OAUTH2_REDIRECT=
|
|||||||
# LDAP_SERVER=ldap.example.com
|
# LDAP_SERVER=ldap.example.com
|
||||||
# LDAP_PORT=389
|
# LDAP_PORT=389
|
||||||
# LDAP_METHOD=plain
|
# LDAP_METHOD=plain
|
||||||
# LDAP_UID=uid
|
# LDAP_UID={{ldap.attributes.user_id}}
|
||||||
# LDAP_BASE=dc=example,dc=com
|
# LDAP_BASE=dc=example,dc=com
|
||||||
# LDAP_AUTH=simple
|
# LDAP_AUTH=simple
|
||||||
# LDAP_BIND_DN=cn=admin,dc=example,dc=com
|
# LDAP_BIND_DN=cn=admin,dc=example,dc=com
|
||||||
# LDAP_PASSWORD=password
|
# LDAP_PASSWORD=password
|
||||||
# LDAP_ROLE_FIELD=ou
|
# LDAP_ROLE_FIELD=ou
|
||||||
# LDAP_FILTER=(&(attr1=value1)(attr2=value2))
|
# LDAP_FILTER=(&(attr1=value1)(attr2=value2))
|
||||||
LDAP_SERVER=
|
LDAP_SERVER="{{ldap.server.domain}}"
|
||||||
LDAP_PORT=
|
LDAP_PORT="{{ldap.server.port}}"
|
||||||
LDAP_METHOD=
|
LDAP_METHOD=
|
||||||
LDAP_UID=
|
LDAP_UID={{ldap.attributes.user_id}}
|
||||||
LDAP_BASE=
|
LDAP_BASE="{{ldap.dn.root}}"
|
||||||
LDAP_BIND_DN=
|
LDAP_BIND_DN="{{ldap.dn.administrator}}"
|
||||||
LDAP_AUTH=
|
LDAP_AUTH=password
|
||||||
LDAP_PASSWORD=
|
LDAP_PASSWORD="{{ldap.bind_credential}}"
|
||||||
LDAP_ROLE_FIELD=
|
LDAP_ROLE_FIELD=
|
||||||
LDAP_FILTER=
|
LDAP_FILTER=
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# ====================================
|
# ====================================
|
||||||
# GREENLIGHT CONFIGURATION
|
# GREENLIGHT CONFIGURATION
|
||||||
# ====================================
|
# ====================================
|
||||||
|
@ -1923,7 +1923,7 @@
|
|||||||
"subComponents": {},
|
"subComponents": {},
|
||||||
"config": {
|
"config": {
|
||||||
"ldap.attribute": [
|
"ldap.attribute": [
|
||||||
"uid"
|
"{{ldap.attributes.user_id}}"
|
||||||
],
|
],
|
||||||
"is.mandatory.in.ldap": [
|
"is.mandatory.in.ldap": [
|
||||||
"true"
|
"true"
|
||||||
@ -2008,7 +2008,7 @@
|
|||||||
"-1"
|
"-1"
|
||||||
],
|
],
|
||||||
"usernameLDAPAttribute": [
|
"usernameLDAPAttribute": [
|
||||||
"uid"
|
"{{ldap.attributes.user_id}}"
|
||||||
],
|
],
|
||||||
"bindDn": [
|
"bindDn": [
|
||||||
"{{ldap.dn.administrator}}"
|
"{{ldap.dn.administrator}}"
|
||||||
@ -2020,7 +2020,7 @@
|
|||||||
"other"
|
"other"
|
||||||
],
|
],
|
||||||
"uuidLDAPAttribute": [
|
"uuidLDAPAttribute": [
|
||||||
"uid"
|
"{{ldap.attributes.user_id}}"
|
||||||
],
|
],
|
||||||
"allowKerberosAuthentication": [
|
"allowKerberosAuthentication": [
|
||||||
"false"
|
"false"
|
||||||
@ -2053,7 +2053,7 @@
|
|||||||
"person, inetOrgPerson, nextcloudUser"
|
"person, inetOrgPerson, nextcloudUser"
|
||||||
],
|
],
|
||||||
"rdnLDAPAttribute": [
|
"rdnLDAPAttribute": [
|
||||||
"uid"
|
"{{ldap.attributes.user_id}}"
|
||||||
],
|
],
|
||||||
"editMode": [
|
"editMode": [
|
||||||
"WRITABLE"
|
"WRITABLE"
|
||||||
|
@ -64,13 +64,13 @@ EOF
|
|||||||
|
|
||||||
### Show all Entries
|
### Show all Entries
|
||||||
```bash
|
```bash
|
||||||
docker exec --env LDAP_ADMIN_PASSWORD="$LDAP_ADMIN_PASSWORD" -it openldap bash -c "ldapsearch -LLL -o ldif-wrap=no -x -D 'cn=administrator,dc=veen,dc=world' -w \"\$LDAP_ADMIN_PASSWORD\" -b 'dc=veen,dc=world'";
|
docker exec --env LDAP_ADMIN_PASSWORD="$LDAP_ADMIN_PASSWORD" LDAP_DN_BASE="$LDAP_DN_BASE" -it openldap bash -c "ldapsearch -LLL -o ldif-wrap=no -x -D \"cn=administrator,\$LDAP_DN_BASE\" -w \"\$LDAP_ADMIN_PASSWORD\" -b \"\$LDAP_DN_BASE\"";
|
||||||
```
|
```
|
||||||
|
|
||||||
### Delete Groups and Subgroup
|
### Delete Groups and Subgroup
|
||||||
To delete the group inclusive all subgroups use:
|
To delete the group inclusive all subgroups use:
|
||||||
```bash
|
```bash
|
||||||
docker exec --env LDAP_ADMIN_PASSWORD="$LDAP_ADMIN_PASSWORD" -it openldap bash -c "ldapsearch -LLL -o ldif-wrap=no -x -D 'cn=administrator,dc=veen,dc=world' -w \"\$LDAP_ADMIN_PASSWORD\" -b 'ou=applications,ou=groups,dc=veen,dc=world' dn | sed -n 's/^dn: //p' | tac | while read -r dn; do echo \"Deleting \$dn\"; ldapdelete -x -D 'cn=administrator,dc=veen,dc=world' -w \"\$LDAP_ADMIN_PASSWORD\" \"\$dn\"; done"
|
docker exec --env LDAP_ADMIN_PASSWORD="$LDAP_ADMIN_PASSWORD" -it openldap bash -c "ldapsearch -LLL -o ldif-wrap=no -x -D \"cn=administrator,\$LDAP_DN_BASE\" -w \"\$LDAP_ADMIN_PASSWORD\" -b \"ou=applications,ou=groups,\$LDAP_DN_BASE\" dn | sed -n 's/^dn: //p' | tac | while read -r dn; do echo \"Deleting \$dn\"; ldapdelete -x -D \"cn=administrator,\$LDAP_DN_BASE\" -w \"\$LDAP_ADMIN_PASSWORD\" \"\$dn\"; done"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ description: Container for application access profiles
|
|||||||
#######################################################################
|
#######################################################################
|
||||||
# Create Admin User
|
# Create Admin User
|
||||||
#######################################################################
|
#######################################################################
|
||||||
dn: uid={{users.administrator.username}},{{ldap.dn.users}}
|
dn: {{ldap.attributes.user_id}}={{users.administrator.username}},{{ldap.dn.users}}
|
||||||
objectClass: top
|
objectClass: top
|
||||||
objectClass: inetOrgPerson
|
objectClass: inetOrgPerson
|
||||||
objectClass: posixAccount
|
objectClass: posixAccount
|
||||||
uid: {{users.administrator.username}}
|
{{ldap.attributes.user_id}}: {{users.administrator.username}}
|
||||||
sn: Administrator
|
sn: Administrator
|
||||||
cn: Administrator
|
cn: Administrator
|
||||||
userPassword: {SSHA}CHANGE_THIS_PASSWORD
|
userPassword: {SSHA}CHANGE_THIS_PASSWORD
|
||||||
@ -31,11 +31,11 @@ gidNumber: {{users.administrator.gid}}
|
|||||||
dn: cn={{ app }}-administrator,{{ ldap.dn.application_roles }}
|
dn: cn={{ app }}-administrator,{{ ldap.dn.application_roles }}
|
||||||
changetype: modify
|
changetype: modify
|
||||||
add: roleOccupant
|
add: roleOccupant
|
||||||
roleOccupant: uid={{users.administrator.username}},{{ldap.dn.users}}
|
roleOccupant: {{ldap.attributes.user_id}}={{users.administrator.username}},{{ldap.dn.users}}
|
||||||
|
|
||||||
dn: cn={{ app }}-user,{{ ldap.dn.application_roles }}
|
dn: cn={{ app }}-user,{{ ldap.dn.application_roles }}
|
||||||
changetype: modify
|
changetype: modify
|
||||||
add: roleOccupant
|
add: roleOccupant
|
||||||
roleOccupant: uid={{users.administrator.username}},{{ldap.dn.users}}
|
roleOccupant: {{ldap.attributes.user_id}}={{users.administrator.username}},{{ldap.dn.users}}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -94,6 +94,11 @@ docker-compose exec -it -u www-data application /var/www/html/occ
|
|||||||
```
|
```
|
||||||
### User Administration
|
### User Administration
|
||||||
|
|
||||||
|
#### Create user via CLI
|
||||||
|
```bash
|
||||||
|
docker compose exec -it -u www-data application php occ user:add {{username}}
|
||||||
|
```
|
||||||
|
|
||||||
#### Make user admin via cli
|
#### Make user admin via cli
|
||||||
```bash
|
```bash
|
||||||
docker compose exec -it -u www-data application php occ group:adduser admin {{username}}
|
docker compose exec -it -u www-data application php occ group:adduser admin {{username}}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
- name: Flush all handlers immediately so that occ can be used
|
- name: Flush all handlers immediately so that occ can be used
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
- name: enable oidc_login plugin
|
- name: disable oidc_login plugin
|
||||||
command: "docker exec -u www-data {{nextcloud_application_container_name}} {{nextcloud_docker_path}}occ app:disable oidc_login"
|
command: "docker exec -u www-data {{nextcloud_application_container_name}} {{nextcloud_docker_path}}occ app:disable oidc_login"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when:
|
when:
|
||||||
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
- name: Configure Sociallogin
|
- name: Configure Sociallogin
|
||||||
loop: "{{ nextcloud_sociallogin_configuration}}"
|
loop: "{{ nextcloud_sociallogin_configuration}}"
|
||||||
|
# The | to_json function is necessary to escape custom_providers correct.
|
||||||
command: >
|
command: >
|
||||||
docker exec -u www-data {{ nextcloud_application_container_name }}
|
docker exec -u www-data {{ nextcloud_application_container_name }}
|
||||||
php occ config:app:set {{ item.appid }} {{ item.configkey }} --value "{{ item.configvalue }}"
|
php occ config:app:set {{ item.appid }} {{ item.configkey }} --value '{{ item.configvalue | to_json if item.configvalue is mapping else item.configvalue }}'
|
@ -14,7 +14,7 @@ return array (
|
|||||||
'oidc_login_client_secret' => '{{oidc.client.secret}}',
|
'oidc_login_client_secret' => '{{oidc.client.secret}}',
|
||||||
|
|
||||||
// Automatically redirect the login page to the provider
|
// Automatically redirect the login page to the provider
|
||||||
'oidc_login_auto_redirect' => false,
|
'oidc_login_auto_redirect' => true,
|
||||||
|
|
||||||
// Redirect to this page after logging out the user
|
// Redirect to this page after logging out the user
|
||||||
'oidc_login_logout_url' => 'https://{{domains[application_id]}}',
|
'oidc_login_logout_url' => 'https://{{domains[application_id]}}',
|
||||||
@ -23,7 +23,7 @@ return array (
|
|||||||
// logout endpoint of the OIDC provider after logout
|
// logout endpoint of the OIDC provider after logout
|
||||||
// in Nextcloud. After successfull logout the OIDC
|
// in Nextcloud. After successfull logout the OIDC
|
||||||
// provider will redirect back to 'oidc_login_logout_url' (MUST be set).
|
// provider will redirect back to 'oidc_login_logout_url' (MUST be set).
|
||||||
'oidc_login_end_session_redirect' => false,
|
'oidc_login_end_session_redirect' => true,
|
||||||
|
|
||||||
// Quota to assign if no quota is specified in the OIDC response (bytes)
|
// Quota to assign if no quota is specified in the OIDC response (bytes)
|
||||||
//
|
//
|
||||||
@ -38,7 +38,7 @@ return array (
|
|||||||
'oidc_login_hide_password_form' => true,
|
'oidc_login_hide_password_form' => true,
|
||||||
|
|
||||||
// Use ID Token instead of UserInfo
|
// Use ID Token instead of UserInfo
|
||||||
'oidc_login_use_id_token' => false,
|
'oidc_login_use_id_token' => true,
|
||||||
|
|
||||||
// Attribute map for OIDC response. Available keys are:
|
// Attribute map for OIDC response. Available keys are:
|
||||||
// * id: Unique identifier for username
|
// * id: Unique identifier for username
|
||||||
@ -98,9 +98,9 @@ return array (
|
|||||||
'mail' => 'email',
|
'mail' => 'email',
|
||||||
# 'quota' => 'nextcloudQuota', # Not implemented yet
|
# 'quota' => 'nextcloudQuota', # Not implemented yet
|
||||||
# 'home' => 'homeDirectory', # Not implemented yet
|
# 'home' => 'homeDirectory', # Not implemented yet
|
||||||
'ldap_uid' => 'uid',
|
'ldap_uid' => '{{ldap.attributes.user_id}}',
|
||||||
# 'groups' => 'ownCloudGroups', # Not implemented yet
|
# 'groups' => 'ownCloudGroups', # Not implemented yet
|
||||||
'login_filter' => 'realm_access_roles',
|
# 'login_filter' => 'realm_access_roles',
|
||||||
// 'photoURL' => 'picture',
|
// 'photoURL' => 'picture',
|
||||||
// 'is_admin' => 'ownCloudAdmin',
|
// 'is_admin' => 'ownCloudAdmin',
|
||||||
),
|
),
|
||||||
|
@ -107,7 +107,7 @@ nextcloud_ldap_configuration:
|
|||||||
-
|
-
|
||||||
appid: "user_ldap"
|
appid: "user_ldap"
|
||||||
configkey: "s01ldap_login_filter"
|
configkey: "s01ldap_login_filter"
|
||||||
configvalue: "(&(|(objectclass=inetOrgPerson))(uid=%uid))"
|
configvalue: "(&(|(objectclass=inetOrgPerson))({{ldap.attributes.user_id}}=%{{ldap.attributes.user_id}}))"
|
||||||
-
|
-
|
||||||
appid: "user_ldap"
|
appid: "user_ldap"
|
||||||
configkey: "s01ldap_login_filter_mode"
|
configkey: "s01ldap_login_filter_mode"
|
||||||
@ -175,4 +175,4 @@ nextcloud_ldap_configuration:
|
|||||||
-
|
-
|
||||||
appid: "user_ldap"
|
appid: "user_ldap"
|
||||||
configkey: "s01ldap_expert_username_attr"
|
configkey: "s01ldap_expert_username_attr"
|
||||||
configvalue: "uid"
|
configvalue: "{{ldap.attributes.user_id}}"
|
@ -23,7 +23,21 @@ nextcloud_sociallogin_configuration:
|
|||||||
# In this case, it sets up a Keycloak provider with details like URLs for authorization,
|
# In this case, it sets up a Keycloak provider with details like URLs for authorization,
|
||||||
# token retrieval, user info, and logout, as well as the client ID and secret.
|
# token retrieval, user info, and logout, as well as the client ID and secret.
|
||||||
configkey: "custom_providers"
|
configkey: "custom_providers"
|
||||||
configvalue: '{"custom_oidc":[{"name":"{{domains.keycloak}}","title":"keycloak","style":"keycloak","authorizeUrl":"{{oidc.client.authorize_url}}","tokenUrl":"{{oidc.client.toke_url}}","displayNameClaim":"","userInfoUrl":"{{oidc.client.user_info_url}}","logoutUrl":"{{oidc.client.logout_url}}","clientId":"{{oidc.client.id}}","clientSecret":"{{oidc.client.secret}}","scope":"openid","groupsClaim":"","style":"","defaultGroup":""}]}'
|
configvalue:
|
||||||
|
custom_oidc:
|
||||||
|
- name: "{{ domains.keycloak }}"
|
||||||
|
title: "keycloak"
|
||||||
|
style: "keycloak"
|
||||||
|
authorizeUrl: "{{ oidc.client.authorize_url }}"
|
||||||
|
tokenUrl: "{{ oidc.client.toke_url }}"
|
||||||
|
displayNameClaim: ""
|
||||||
|
userInfoUrl: "{{ oidc.client.user_info_url }}"
|
||||||
|
logoutUrl: "{{ oidc.client.logout_url }}"
|
||||||
|
clientId: "{{ oidc.client.id }}"
|
||||||
|
clientSecret: "{{ oidc.client.secret }}"
|
||||||
|
scope: "openid"
|
||||||
|
groupsClaim: ""
|
||||||
|
defaultGroup: ""
|
||||||
-
|
-
|
||||||
appid: "sociallogin"
|
appid: "sociallogin"
|
||||||
configkey: "disable_notify_admins"
|
configkey: "disable_notify_admins"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user