From d70965a5e81d73813d1a761f5e3e0a00f11ef772 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 1 Apr 2020 17:49:20 +0200 Subject: [PATCH 1/2] Add admin creation during install --- README.md | 3 ++- check_process | 1 + manifest.json | 9 +++++++++ scripts/install | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8fcdd8..6c4d888 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ Wekan is an open-source kanban board (task manager and organizer) ## Configuration -As LDAP authentification is enabled by default, wekan admins correspond to the permission `Wekan Admin`. To add an admin account, you can: +As LDAP authentification is enabled by default, wekan admins correspond to the permission `Wekan Admin`. The user you choose during installation is member of this group. +To add an admin account, you can: - [with the webadmin] go to Users > Groups and permissions > Add the user to the permission `Wekan Admin` - [or with the command line] `yunohost user permission update wekan.admin -a the_user_to_add` diff --git a/check_process b/check_process index 8a7cdfd..1919bb5 100644 --- a/check_process +++ b/check_process @@ -2,6 +2,7 @@ ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) + admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 diff --git a/manifest.json b/manifest.json index 328a406..602a836 100644 --- a/manifest.json +++ b/manifest.json @@ -46,6 +46,15 @@ "example": "/wekan", "default": "/wekan" }, + { + "name": "admin", + "type": "user", + "ask": { + "en": "Choose an admin user", + "fr": "Choisissez l’administrateur" + }, + "example": "johndoe" + }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index f7dafd1..68792c0 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ ynh_print_info --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH +admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -199,6 +200,8 @@ ynh_print_info --message="Configuring SSOwat..." ynh_permission_create --permission="admin" +yunohost user permission update $app.admin --add $admin + # Make app public if necessary if [ $is_public -eq 1 ] then From 9dc0525a37ecda513565b7616a44d6a25fbb1630 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 1 Apr 2020 18:13:46 +0200 Subject: [PATCH 2/2] Update scripts/install Co-Authored-By: Alexandre Aubin --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 68792c0..a02a7dd 100755 --- a/scripts/install +++ b/scripts/install @@ -198,9 +198,7 @@ fi #================================================= ynh_print_info --message="Configuring SSOwat..." -ynh_permission_create --permission="admin" - -yunohost user permission update $app.admin --add $admin +ynh_permission_create --permission="admin" --allowed "$admin" # Make app public if necessary if [ $is_public -eq 1 ]