diff --git a/check_process b/check_process index a462e8b..053d9ca 100644 --- a/check_process +++ b/check_process @@ -9,7 +9,7 @@ path="/" (PATH) admin="john" (USER) #language="fr" - #is_public=1 (PUBLIC|public=1|private=0) + is_public=1 (PUBLIC|public=1|private=0) #password="pass" #port="666" (PORT) ; Checks @@ -18,13 +18,11 @@ setup_root=1 setup_nourl=0 setup_private=1 - setup_public=1 + setup_public=0 upgrade=1 #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 + backup_restore=1 #TODO: Manipulate wg0.conf in backup_restore and remove ? + multi_instance=0 #No need of multi-instance this port_already_use=0 change_url=0 ;;; Levels diff --git a/manifest.json b/manifest.json index 029b6a7..93c2c77 100644 --- a/manifest.json +++ b/manifest.json @@ -53,6 +53,19 @@ "fr": "Choisissez l’administrateur" }, "example": "johndoe" + }, + { + "name": "is_public", + "type": "boolean", + "ask": { + "en": "Is it a public application?", + "fr": "Est-ce une application publique ?" + }, + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "default": false } ] } diff --git a/scripts/install b/scripts/install index b8cd990..ebe9f9c 100644 --- a/scripts/install +++ b/scripts/install @@ -25,8 +25,9 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url=$YNH_APP_ARG_PATH #TODO: Check if possible with wireguard_ui to use sub path admin=$YNH_APP_ARG_ADMIN +is_public=$YNH_APP_ARG_IS_PUBLIC # Forced to use it to pass root installation check as public app=$YNH_APP_INSTANCE_NAME @@ -49,6 +50,7 @@ ynh_script_progression --message="Storing installation settings..." --time --wei ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=is_public --value=$is_public # Forced to use it to pass root installation check as public #================================================= # STANDARD MODIFICATIONS @@ -206,7 +208,13 @@ ynh_systemd_action --service_name=wireguard_ui --action="start" --log_path="/var #================================================= ynh_script_progression --message="Configuring permissions..." --time --weight=1 -ynh_permission_update --permission "main" --remove "all_users" --add "$admin" +# Make app public if necessary to pass root installation check +if [ $is_public -eq 1 ] +then + ynh_permission_update --permission "main" --add visitors +else + ynh_permission_update --permission "main" --remove "all_users" --add "$admin" +fi #================================================= # RELOAD NGINX