diff --git a/README.md b/README.md index 4751612..fd4175e 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Set of games from Framagames #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/framagames%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/framagames%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/framagames/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/framagames.svg)](https://ci-apps-arm.yunohost.org/ci/apps/framagames/) ## Links diff --git a/check_process b/check_process index bc6f52d..6a17eab 100644 --- a/check_process +++ b/check_process @@ -20,7 +20,6 @@ upgrade=1 from_commit=bd2c87a6fd4212771f9c06e7965598a5ea744ffc backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email= diff --git a/manifest.json b/manifest.json index 1500004..7e3f6eb 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "polytan02@mcgva.org" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -26,29 +26,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for your Framagames", - "fr": "Choisissez un domaine pour vos Framagames" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path to access your Framagames", - "fr": "Choisissez un chemin pour acceder à vos Framagames" - }, "example": "/framagames", "default": "/framagames" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true } ] diff --git a/scripts/install b/scripts/install index c6e0b78..bdadbdd 100644 --- a/scripts/install +++ b/scripts/install @@ -43,7 +43,14 @@ ynh_script_progression --message="Storing installation settings..." 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=is_public --value=$is_public + +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app #================================================= # STANDARD MODIFICATIONS @@ -64,14 +71,6 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -88,7 +87,7 @@ ynh_add_fpm_config ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R $app: $final_path +chown -R $app:www-data $final_path chmod -R 775 $final_path #================================================= diff --git a/scripts/restore b/scripts/restore index 56d513f..ada8d63 100755 --- a/scripts/restore +++ b/scripts/restore @@ -59,7 +59,7 @@ ynh_restore_file --origin_path="$final_path" ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R $app: $final_path +chown -R $app:www-data $final_path chmod -R 775 $final_path #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba80c7d..d9efbb8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -33,15 +32,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -54,6 +44,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -68,6 +65,14 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -91,14 +96,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -115,7 +112,7 @@ ynh_add_fpm_config ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R $app: $final_path +chown -R $app:www-data $final_path chmod -R 775 $final_path #=================================================