forgejo_ynh/scripts/_common.sh

11 lines
770 B
Bash
Raw Normal View History

#!/bin/bash
2023-01-05 14:48:22 +01:00
#=================================================
# SET ALL CONSTANTS
2023-01-05 14:48:22 +01:00
#=================================================
function set_forgejo_login_source() {
pushd "$install_dir"
ynh_exec_as $app ./forgejo admin auth add-ldap-simple --security-protocol "Unencrypted" --name "YunoHost LDAP" --host "localhost" --port "389" --skip-tls-verify --user-search-base "ou=users,dc=yunohost,dc=org" --user-dn "uid=%s,ou=Users,dc=yunohost,dc=org" --user-filter "(&(objectclass=posixAccount)(uid=%s)(permission=cn=$app.main,ou=permission,dc=yunohost,dc=org))" --admin-filter "(permission=cn=forgejo.admin,ou=permission,dc=yunohost,dc=org)" --username-attribute "uid" --firstname-attribute "givenName" --surname-attribute "sn" --email-attribute "mail"
popd
}