Added SSH Pub Key implementation in Gitea

This commit is contained in:
2025-06-27 17:25:12 +02:00
parent 40edaa52ad
commit b3e82fa457
3 changed files with 20 additions and 28 deletions

View File

@@ -3,19 +3,7 @@
docker-compose -f "{{ docker_compose.directories.instance }}/docker-compose.yml" \
exec -T --user git application \
gitea admin auth add-ldap \
--name "LDAP ({{ primary_domain }})" \
--host "{{ ldap.server.domain }}" \
--port {{ ldap.server.port }} \
--security-protocol "{{ ldap.server.security | trim or 'unencrypted' }}" \
--bind-dn "{{ ldap.dn.administrator.data }}" \
--bind-password "{{ ldap.bind_credential }}" \
--user-search-base "{{ ldap.dn.users }}" \
--user-filter "{{ ldap.filters.users.login }}" \
--username-attribute "{{ ldap.attributes.user_id }}" \
--firstname-attribute "{{ ldap.attributes.firstname }}" \
--surname-attribute "{{ ldap.attributes.surname }}" \
--email-attribute "{{ ldap.attributes.mail }}" \
--synchronize-users # turns on per-login sync
{{ gitea_ldap_auth_args | join(' ') }}
args:
chdir: "{{ docker_compose.directories.instance }}"
register: ldap_manage
@@ -46,20 +34,8 @@
docker-compose -f "{{ docker_compose.directories.instance }}/docker-compose.yml" \
exec -T --user git application \
gitea admin auth update-ldap \
--id {{ ldap_source_id }} \
--name "LDAP ({{ primary_domain }})" \
--host "{{ ldap.server.domain }}" \
--port {{ ldap.server.port }} \
--security-protocol "{{ ldap.server.security | trim or 'unencrypted' }}" \
--bind-dn "{{ ldap.dn.administrator.data }}" \
--bind-password "{{ ldap.bind_credential }}" \
--user-search-base "{{ ldap.dn.users }}" \
--user-filter "(&(objectClass=inetOrgPerson)(uid=%s))" \
--username-attribute "{{ ldap.attributes.user_id }}" \
--firstname-attribute "{{ ldap.attributes.firstname }}" \
--surname-attribute "{{ ldap.attributes.surname }}" \
--email-attribute "{{ ldap.attributes.mail }}" \
--synchronize-users
--id {{ ldap_source_id }} \
{{ gitea_ldap_auth_args | join(' ') }}
args:
chdir: "{{ docker_compose.directories.instance }}"
register: ldap_manage