diff --git a/check_process b/check_process index 692db47..c81570d 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,8 @@ ;; Complete test ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -14,8 +14,6 @@ upgrade=1 from_commit=f75d58cb32c51a0981333ea88974dc3199324e65 backup_restore=1 multi_instance=1 - incorrect_path=1 - port_already_use=0 change_url=1 ;;; Levels Level 5=auto diff --git a/conf/nginx.conf b/conf/nginx.conf index dabfbf9..99858c5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,7 +22,7 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param REMOTE_USER $remote_user; - fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; } diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 6505dc6..9ec5826 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index b41b677..d042a79 100644 --- a/manifest.json +++ b/manifest.json @@ -14,12 +14,12 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.1.0" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ "nginx", - "php5-fpm", + "php7.3-fpm", "mysql" ], "arguments": { @@ -27,29 +27,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Wallabag", - "fr": "Choisissez un domaine pour Wallabag" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Wallabag", - "fr": "Choisissez un chemin pour Wallabag" - }, "example": "/wallabag", "default": "/wallabag" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose the Wallabag administrator", - "fr": "Choisissez l'administrateur de Wallabag" - }, "example": "homer" } ] diff --git a/scripts/_common.sh b/scripts/_common.sh index f58d4bf..f4fd644 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="php$YNH_DEFAULT_PHP_VERSION-cli php$YNH_DEFAULT_PHP_VERSION-mysql php$YNH_DEFAULT_PHP_VERSION-json php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-tidy php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-gettext php$YNH_DEFAULT_PHP_VERSION-redis" @@ -26,16 +28,3 @@ function set_permissions { #================================================= # EXPERIMENTAL HELPERS #================================================= - -# Execute a command as another user -# usage: exec_as USER COMMAND [ARG ...] -ynh_exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} diff --git a/scripts/backup b/scripts/backup index f55f3f3..6bb4055 100644 --- a/scripts/backup +++ b/scripts/backup @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # STANDARD BACKUP STEPS @@ -51,7 +52,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP MYSQL DB diff --git a/scripts/install b/scripts/install index ab4ea3c..d1a79d2 100644 --- a/scripts/install +++ b/scripts/install @@ -170,6 +170,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring SSOwat..." + ynh_permission_update --permission="main" --add="visitors" #================================================= diff --git a/scripts/restore b/scripts/restore index 1654db7..0e82394 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name @@ -110,7 +111,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Reloading nginx web server and php-fpm..." -ynh_systemd_action --service_name=php7.0-fpm --action=reload +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 779a2dc..c09821e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,6 +54,13 @@ if [ -z "$path_url" ]; then ynh_app_setting_set --app=$app --key=path --value=$path_url fi +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,22 +75,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# Migrate legacy permissions to new system -#================================================= -if ynh_legacy_permissions_exists -then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CHECK THE PATH -#================================================= - -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -206,13 +197,6 @@ set_permissions ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_create" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_delete" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -ynh_app_setting_set "$app" unprotected_uris "/" - #================================================= # RELOAD NGINX #=================================================