1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/forgejo_ynh.git synced 2024-09-03 18:36:26 +02:00

add ask strings for init_admin_permission

This commit is contained in:
Emmanuel Averty 2023-06-25 18:48:03 +02:00 committed by grosmanal
parent ba6c846a25
commit 03643d342e
4 changed files with 12 additions and 7 deletions

View file

@ -39,8 +39,10 @@ ram.runtime = "2G"
default = "visitors" default = "visitors"
[install.init_admin_permission] [install.init_admin_permission]
help.en = "Users of this group should have access to Forgejo admin page (but the won't : see application description in yunohost admin)" ask.en = "Which group will have access to forgejo admin page (broken feature : see appliction description)"
help.fr = "Les utilisateurs de ce groupe devrait avoir accès à la page d'administration de Forgejo (mais cela ne fonctionne pas : voir la description de l'application dans l'administration de yunohost" ask.fr = "Quel groupe aura accès à l'administration de forgejo (ne fonctionne pas : voir la description de l'application)"
help.en = "Users of this group should have access to Forgejo admin page"
help.fr = "Les utilisateurs de ce groupe devrait avoir accès à la page d'administration de Forgejo"
type = "group" type = "group"
default = "admins" default = "admins"

View file

@ -3,3 +3,9 @@
#================================================= #=================================================
# SET ALL CONSTANTS # SET ALL CONSTANTS
#================================================= #=================================================
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
}

View file

@ -97,10 +97,7 @@ ynh_add_fail2ban_config --logpath "/var/log/$app/forgejo.log" --failregex ".*Fai
# LDAP CONFIGURATION # LDAP CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding LDAP configuration..." --weight=1 ynh_script_progression --message="Adding LDAP configuration..." --weight=1
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
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -36,7 +36,7 @@ pushd "$install_dir"
ynh_exec_as $app ./forgejo admin auth delete --id $old_login_source_id ynh_exec_as $app ./forgejo admin auth delete --id $old_login_source_id
# Create new login source # Create new login source
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" set_forgejo_login_source
fi fi
popd popd