diff --git a/README.md b/README.md index 5e7bc67..acb3068 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,7 @@ Set of games from Framagames --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/framagames_ynh/tree/testing). diff --git a/conf/nginx.conf b/conf/nginx.conf index 0f61dcc..5a2a7b1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -19,11 +19,11 @@ location __PATH__/ { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; } # Include SSOWAT user panel. diff --git a/manifest.json b/manifest.json index 0bddc70..8677126 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Set of games Framagames from Framasoft", "fr": "Ensemble de jeux Framagames venant de Framasoft" }, - "version": "1.0~ynh2", + "version": "1.0~ynh3", "url": "https://framagit.org/framasoft/framagames", "license": "free", "maintainer": { @@ -14,7 +14,7 @@ "email": "polytan02@mcgva.org" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index ecd263f..aae521c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +YNH_PHP_VERSION="7.3" + # dependencies used by the app pkg_dependencies="" diff --git a/scripts/backup b/scripts/backup index aeebfa9..ea50559 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -14,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= diff --git a/scripts/install b/scripts/install index 3531e3e..ea4f2b5 100644 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -63,17 +59,17 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." +ynh_script_progression --message="Configuring PHP-FPM..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -92,17 +88,18 @@ chown -hR www-data:www-data $final_path #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 60a2caf..cbdd8f5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -32,20 +32,19 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." +ynh_script_progression --message="Removing PHP-FPM configuration..." -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 0095e89..362c4d8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -14,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -78,7 +73,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 1b2de3d..2ec70fe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,18 +68,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -98,17 +86,17 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -122,22 +110,10 @@ ynh_script_progression --message="Securing files and directories..." chmod 775 -R $final_path chown -hR www-data:www-data $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload