gitea: Add lldap as service dependency

This commit is contained in:
Alex Palaistras 2022-09-25 13:36:31 +01:00
parent 491bed37a8
commit 9b6e002d11
2 changed files with 10 additions and 10 deletions

View File

@ -18,14 +18,14 @@ if ! test -f /var/lib/gitea/gitea.db; then
gosu git /usr/bin/gitea -c /etc/gitea/config.ini migrate gosu git /usr/bin/gitea -c /etc/gitea/config.ini migrate
# Set up LDAP authentication via local service. # Set up LDAP authentication via local service.
gosu git /usr/bin/gitea -c /etc/gitea/config.ini admin auth add-ldap --name "LDAP" \ gosu git /usr/bin/gitea -c /etc/gitea/config.ini admin auth add-ldap \
--host "${GITEA_AUTH_LDAP_HOST}" --port "${GITEA_AUTH_LDAP_PORT}" \ --name "LDAP" --host "${GITEA_AUTH_LDAP_HOST}" --port "${GITEA_AUTH_LDAP_PORT}" \
--synchronize-users --security-protocol unencrypted \ --synchronize-users --security-protocol unencrypted \
--bind-dn "uid=${GITEA_AUTH_LDAP_BIND_UID},ou=people,dc=ldap,dc=local" --bind-password "${GITEA_AUTH_LDAP_BIND_PASSWORD}" \ --bind-dn "uid=${GITEA_AUTH_LDAP_BIND_UID},ou=people,dc=ldap,dc=local" --bind-password "${GITEA_AUTH_LDAP_BIND_PASSWORD}" \
--user-search-base "ou=people,dc=ldap,dc=local" --user-filter "(&(memberof=cn=gitea_user,ou=groups,dc=ldap,dc=local)(|(uid=%[1]s)(mail=%[1]s)))" \ --user-search-base "ou=people,dc=ldap,dc=local" --user-filter "(&(memberof=cn=gitea_user,ou=groups,dc=ldap,dc=local)(|(uid=%[1]s)(mail=%[1]s)))" \
--admin-filter "(memberof=cn=gitea_admin,ou=groups,dc=ldap,dc=local)" \ --admin-filter "(memberof=cn=gitea_admin,ou=groups,dc=ldap,dc=local)" \
--username-attribute "uid" --email-attribute "mail" \ --username-attribute "uid" --email-attribute "mail" \
--firstname-attribute "givenName" --surname-attribute "sn" --avatar-attribute "jpegPhoto" --firstname-attribute "givenName" --surname-attribute "sn" --avatar-attribute "jpegPhoto"
fi fi
# Run entrypoint under specific user. # Run entrypoint under specific user.

View File

@ -1,7 +1,7 @@
[Unit] [Unit]
Description=Gitea Self-Hosted Git Service Description=Gitea Self-Hosted Git Service
Wants=container-build@%N.service container-volume@%N.service Wants=container-build@%N.service container-volume@%N.service lldap.service
After=container-build@%N.service container-volume@%N.service After=container-build@%N.service container-volume@%N.service lldap.service
[Service] [Service]
Type=notify Type=notify