From 9b713b904d73688d335fe3429727d92c945bca25 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Sep 2020 22:24:17 +0200 Subject: [PATCH 01/12] php as variable --- conf/freshrss.cron | 2 +- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- manifest.json | 2 +- scripts/_common.sh | 8 +++--- scripts/backup | 11 ++++---- scripts/change_url | 14 ++++------ scripts/install | 64 +++++++++++++++++++--------------------------- scripts/remove | 22 +++++++--------- scripts/restore | 22 ++++++++-------- scripts/upgrade | 33 ++++++++++++------------ 11 files changed, 80 insertions(+), 102 deletions(-) diff --git a/conf/freshrss.cron b/conf/freshrss.cron index 659ed47..1946736 100644 --- a/conf/freshrss.cron +++ b/conf/freshrss.cron @@ -1 +1 @@ -*/10 * * * * __APP__ /usr/bin/php7.0 __FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 +*/10 * * * * __APP__ /usr/bin/php${YNH_PHP_VERSION}__FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 diff --git a/conf/nginx.conf b/conf/nginx.conf index 4cc8174..42b044f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location __PATH__/ { try_files $uri $uri/ /index.php?$args; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 2052aa6..9b2ecce 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 b8f3cc5..df80e6c 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "plopoyop@gmail.com" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index b1610b5..2d5cb36 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,11 +4,9 @@ # COMMON VARIABLES #================================================= -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - pkg_dependencies="php5-gd" -else - pkg_dependencies="php-gd php-zip php-dom php-mbstring php-gmp php-sqlite3 php-curl php-intl php-xml" -fi +pkg_dependencies="php${YNH_PHP_VERSION}-gd php-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" + +YNH_PHP_VERSION="7.3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index f957038..dffd82b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,32 +28,31 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --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 THE MYSQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql diff --git a/scripts/change_url b/scripts/change_url index 40f2601..3494afb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,11 +21,10 @@ new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME - #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -46,7 +45,6 @@ if [ -z $admin ]; then ynh_app_setting_set $app admin $admin fi - #================================================= # CHECK PATHS SYNTAX #================================================= @@ -77,7 +75,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF FILE #================================================= -ynh_print_info --message="Updating nginx web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -107,19 +105,17 @@ fi $final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name -#================================================= - - #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." + ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Change of URL completed for $app" +ynh_script_progression --message="Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index a271d72..c569af4 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -41,28 +41,24 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info --message="Storing installation settings..." +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=admin --value=$admin ynh_app_setting_set --app=$app --key=language --value=$language -#================================================= -# STANDARD MODIFICATIONS -#================================================= - #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_print_info --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -72,11 +68,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Setting up source files..." - -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src +ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -85,17 +77,15 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -### `ynh_add_nginx_config` will use the file conf/nginx.conf - -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app @@ -103,26 +93,31 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --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 #================================================= # SPECIFIC SETUP #================================================= -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_app_addaccess -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_user_create -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_user_delete +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_app_addaccess" +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_user_create" +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_user_delete" + +#================================================= # SETUPING FRESHRSS #================================================= -ynh_print_info --message="FreshRSS setup script..." +ynh_script_progression --message="FreshRSS setup script..." $final_path/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name -# Add users -ynh_print_info --message="Creating users..." +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Creating users..." + for myuser in $(ynh_user_list) do user_token=$(ynh_string_random) @@ -132,7 +127,7 @@ done #================================================= # SETUP A CRON #================================================= -ynh_print_info --message="Setting up cron..." +ynh_script_progression --message="Setting up cron..." cron_path="/etc/cron.d/$app" ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" @@ -140,9 +135,6 @@ ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file= cp ../conf/freshrss.cron "$cron_path" chmod 644 "$cron_path" -#================================================= - - #================================================= # GENERIC FINALIZATION #================================================= @@ -151,25 +143,22 @@ chmod 644 "$cron_path" # Set permissions to app files chown -R root: $final_path -chown -R $app: $final_path/data/ -chown -R $app: $final_path/extensions/ - +chown -R $app: $final_path/{data,extensions} #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." #skip api directory ynh_app_setting_set --app="$app" --key=skipped_uris --value="/api/,/scripts/api.js" ynh_app_setting_delete --app="$app" --key=unprotected_regex ynh_app_setting_delete --app="$app" --key=unprotected_uris - #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -177,4 +166,5 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" --last + diff --git a/scripts/remove b/scripts/remove index 4b189f5..7cfaeaa 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -21,14 +21,10 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# STANDARD REMOVE -#================================================= - #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Removing the MySQL database..." +ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -36,7 +32,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -44,7 +40,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -52,7 +48,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -60,9 +56,9 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --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 #================================================= @@ -79,7 +75,7 @@ ynh_secure_remove "/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_print_info --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app @@ -88,4 +84,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_print_info --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index a582fe5..db3a0d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,7 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading settings..." +ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -32,7 +32,7 @@ db_user=$db_name #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_print_info --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -44,21 +44,21 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Restoring nginx configuration..." +ynh_script_progression --message="Restoring NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_print_info --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -76,14 +76,14 @@ chown -R $app: $final_path/extensions/ # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -91,7 +91,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the MySQL database..." db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd @@ -108,13 +108,13 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_print_info --message="Reloading nginx web server and php-fpm..." +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 #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 886e5c9..259ec5f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -33,7 +33,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." # If db_name doesn't exist, create it if [ -z "$db_name" ]; then @@ -59,7 +59,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -82,7 +82,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src # into tmp dir @@ -92,7 +92,7 @@ ynh_setup_source "$tmp_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -100,14 +100,14 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create $app @@ -115,7 +115,7 @@ ynh_system_user_create $app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -141,14 +141,14 @@ ynh_secure_remove "$final_path" cp -rp "$tmp_path" "$final_path" #update hook for multi instance -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_app_addaccess -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_user_create -ynh_replace_string "APPNAMETOCHANGE" $app ../hooks/post_user_delete +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_app_addaccess" +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_user_create" +ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_user_delete" #================================================= # CRON SETUP #================================================= -ynh_print_info --message="Setting up cron..." +ynh_script_progression --message="Setting up cron..." cron_path="/etc/cron.d/$app" ynh_replace_string "__FINALPATH__" $final_path ../conf/freshrss.cron @@ -169,8 +169,7 @@ fi # Set permissions on app files chown -R root: $final_path chmod 755 $final_path -chown -R $app: $final_path/data/ -chown -R $app: $final_path/extensions/ +chown -R $app: $final_path/{data,extensions} # reconfigure application with latest parameters $final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name @@ -178,7 +177,7 @@ $final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --en #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Upgrading SSOwat configuration..." +ynh_script_progression --message="Upgrading SSOwat configuration..." ynh_app_setting_set --app="$app" --key=skipped_uris --value="/api/,/scripts/api.js" ynh_app_setting_delete --app="$app" --key=unprotected_regex @@ -187,7 +186,7 @@ ynh_app_setting_delete --app="$app" --key=unprotected_uris #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -195,4 +194,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" From df47834de776828ca6a7c6569f615497a7d57a2a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Sep 2020 22:39:46 +0200 Subject: [PATCH 02/12] fix php --- manifest.json | 4 ++-- scripts/_common.sh | 2 +- scripts/backup | 1 + scripts/install | 4 +++- scripts/remove | 6 +++--- scripts/restore | 1 + scripts/upgrade | 10 ++++++---- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index df80e6c..3424552 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "freshrss", "packaging_format": 1, "description": { - "en": "An RSS aggregator with a nice and mobile-friendly design", - "fr": "Un agrégateur de flux RSS avec une interface adaptée au mobile" + "en": "RSS aggregator with a nice and mobile-friendly design", + "fr": "Agrégateur de flux RSS avec une interface adaptée au mobile" }, "version": "1.16.2~ynh1", "url": "http://freshrss.org/", diff --git a/scripts/_common.sh b/scripts/_common.sh index 2d5cb36..b318225 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -pkg_dependencies="php${YNH_PHP_VERSION}-gd php-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" +pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" YNH_PHP_VERSION="7.3" diff --git a/scripts/backup b/scripts/backup index dffd82b..6daad65 100755 --- 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) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/install b/scripts/install index c569af4..62a5d24 100755 --- a/scripts/install +++ b/scripts/install @@ -130,8 +130,10 @@ done ynh_script_progression --message="Setting up cron..." cron_path="/etc/cron.d/$app" + ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron" + cp ../conf/freshrss.cron "$cron_path" chmod 644 "$cron_path" @@ -158,7 +160,7 @@ ynh_app_setting_delete --app="$app" --key=unprotected_uris #================================================= # 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 7cfaeaa..ab7d762 100755 --- a/scripts/remove +++ b/scripts/remove @@ -40,7 +40,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing $app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -48,9 +48,9 @@ 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 #================================================= diff --git a/scripts/restore b/scripts/restore index db3a0d9..57ac880 100644 --- a/scripts/restore +++ b/scripts/restore @@ -28,6 +28,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED diff --git a/scripts/upgrade b/scripts/upgrade index 259ec5f..9e9492d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,7 +117,7 @@ ynh_system_user_create $app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -151,8 +151,10 @@ ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --targ ynh_script_progression --message="Setting up cron..." cron_path="/etc/cron.d/$app" -ynh_replace_string "__FINALPATH__" $final_path ../conf/freshrss.cron -ynh_replace_string "__APP__" $app ../conf/freshrss.cron + +ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" +ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron" + cp ../conf/freshrss.cron "$cron_path" chmod 644 "$cron_path" @@ -186,7 +188,7 @@ ynh_app_setting_delete --app="$app" --key=unprotected_uris #================================================= # 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 From 18ce926e7eb35cba89eb0e4d4f705c6a19368796 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 5 Sep 2020 14:52:02 +0200 Subject: [PATCH 03/12] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 7494fa0..de1d544 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=b89554865459520d7d90a5a666f09f6987f41de6 + #upgrade=1 from_commit=b89554865459520d7d90a5a666f09f6987f41de6 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. From c861955c1d8b8932208b0d425fb5a32a14cd2127 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 1 Oct 2020 22:19:32 +0200 Subject: [PATCH 04/12] Upgrade to v.1.17.0 --- README.md | 2 +- conf/app.src | 4 ++-- conf/freshrss.cron | 2 +- manifest.json | 2 +- scripts/_common.sh | 4 ++-- scripts/install | 10 ++-------- scripts/remove | 8 -------- scripts/restore | 11 +++-------- scripts/upgrade | 12 +++--------- 9 files changed, 15 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index ce829ab..dd1a91e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to An efficient but powerful RSS aggregator with a nice and mobile-friendly design, as well as extension and themes support. -**Shipped version:** 1.16.2 +**Shipped version:** 1.17.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 779967c..f17562a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.16.2.tar.gz -SOURCE_SUM=6b8d87f0e594b4ef33ca3a9f94db3033d9307ae71190a2bfc4fadad432a50776 +SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.17.0.tar.gz +SOURCE_SUM=57c52a15c5f4739e53db606ad652cd446a244676d2a19b2871fe6bee00b75524 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/freshrss.cron b/conf/freshrss.cron index 1946736..1e1616c 100644 --- a/conf/freshrss.cron +++ b/conf/freshrss.cron @@ -1 +1 @@ -*/10 * * * * __APP__ /usr/bin/php${YNH_PHP_VERSION}__FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 +*/10 * * * * __APP__ /usr/bin/php7.3 __FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 diff --git a/manifest.json b/manifest.json index 3424552..eb4f200 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "RSS aggregator with a nice and mobile-friendly design", "fr": "Agrégateur de flux RSS avec une interface adaptée au mobile" }, - "version": "1.16.2~ynh1", + "version": "1.17.0~ynh1", "url": "http://freshrss.org/", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index b318225..d34fc87 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" - YNH_PHP_VERSION="7.3" +pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 62a5d24..ac56b25 100755 --- a/scripts/install +++ b/scripts/install @@ -48,13 +48,6 @@ 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=language --value=$language -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -96,7 +89,8 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP diff --git a/scripts/remove b/scripts/remove index ab7d762..f699b50 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,14 +29,6 @@ ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 57ac880..84a5af5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -76,19 +76,14 @@ chown -R $app: $final_path/extensions/ #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=10 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" + #================================================= # SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9e9492d..30024a5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -97,20 +98,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create $app +ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION @@ -118,7 +112,7 @@ ynh_system_user_create $app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE From b1bf235f72476ea68d2c8f0b0157428ae0c3570d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 1 Oct 2020 22:42:21 +0200 Subject: [PATCH 05/12] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d34fc87..9835ad9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" #================================================= # PERSONAL HELPERS From bee2a79b90d721d29a5b4978276fcf76174098ad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Oct 2020 08:35:32 +0200 Subject: [PATCH 06/12] Update restore --- scripts/restore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index 84a5af5..1b4f74c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -76,12 +76,10 @@ chown -R $app: $final_path/extensions/ #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=10 +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" - #================================================= # SPECIFIC RESTORATION #================================================= From b598fbc9842382f2c408c23646563b64c08d9a83 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 18:49:57 +0200 Subject: [PATCH 07/12] Fix --- check_process | 2 +- conf/freshrss.cron | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index de1d544..7494fa0 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ setup_private=0 setup_public=0 upgrade=1 - #upgrade=1 from_commit=b89554865459520d7d90a5a666f09f6987f41de6 + upgrade=1 from_commit=b89554865459520d7d90a5a666f09f6987f41de6 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. diff --git a/conf/freshrss.cron b/conf/freshrss.cron index 1e1616c..d028b31 100644 --- a/conf/freshrss.cron +++ b/conf/freshrss.cron @@ -1 +1 @@ -*/10 * * * * __APP__ /usr/bin/php7.3 __FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 +*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/app/actualize_script.php >/tmp/__APP__.log 2>&1 From 81f623543dea3c9c3af179fcf3a92039a422e27d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 22:21:30 +0200 Subject: [PATCH 08/12] Replace PHP version in cron --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index ac56b25..ea889c6 100755 --- a/scripts/install +++ b/scripts/install @@ -127,6 +127,7 @@ cron_path="/etc/cron.d/$app" ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file="../conf/freshrss.cron" cp ../conf/freshrss.cron "$cron_path" chmod 644 "$cron_path" diff --git a/scripts/upgrade b/scripts/upgrade index 30024a5..68f91f9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,6 +148,7 @@ cron_path="/etc/cron.d/$app" ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron" ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file="../conf/freshrss.cron" cp ../conf/freshrss.cron "$cron_path" chmod 644 "$cron_path" From 1098ad08529c5d979bebdb94fbd5a8c5007e30c4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 22:26:50 +0200 Subject: [PATCH 09/12] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 7494fa0..e2d9c94 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=b89554865459520d7d90a5a666f09f6987f41de6 + upgrade=1 from_commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf 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. @@ -24,6 +24,6 @@ # If the level 5 (Package linter) is forced to 1. Please add justifications here. Level 5=auto ;;; Upgrade options - ; commit=b89554865459520d7d90a5a666f09f6987f41de6 - name=Tue Jan 29 21:28:14 2019 +0100 update README + ; commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf + name=30 août 2020. Merge pull request #103 from ericgaspar/patch-1 manifest_arg=domain=DOMAIN&path=PATH&admin=USER From f9d4fb3e2ef6e8a2e7c17cc7757fe71f4a16df80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:48:05 +0100 Subject: [PATCH 10/12] Update scripts/restore Co-authored-by: yalh76 --- scripts/restore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/restore b/scripts/restore index 1b4f74c..1c5a04c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,6 +80,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_add_fpm_config --phpversion=$phpversion --package="$extra_php_dependencies" #================================================= # SPECIFIC RESTORATION #================================================= From 220e16dbabc14458e27708fc4ddfe79cbe7db59b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 8 Nov 2020 10:27:32 +0100 Subject: [PATCH 11/12] Add mysql php extention #105 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9835ad9..dae184e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" #================================================= # PERSONAL HELPERS From 665c6a8f2bf2a8860818166b14481dfda374889c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 13 Nov 2020 14:55:16 +0100 Subject: [PATCH 12/12] Cleaning up --- README.md | 2 +- conf/nginx.conf | 3 +-- scripts/install | 2 +- scripts/restore | 3 ++- scripts/upgrade | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dd1a91e..c53153d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ API (mini) How To: * Into your user profile: Settings > profil * Setup an API password * Check the API is working: https://exemple.tld/rss/api/greader.php -* Setup your client with: username: ynh user, password: the password you just setup, url https://exemple.tld/rss/api/greader.php +* Setup your client with: username: ynh user, password: the password you just setup, URL https://exemple.tld/rss/api/greader.php ## Documentation diff --git a/conf/nginx.conf b/conf/nginx.conf index 42b044f..f1cc745 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,8 +5,8 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } -### Example PHP configuration (remove it if not used) index index.html index.php; + try_files $uri $uri/ /index.php?$args; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; @@ -18,5 +18,4 @@ location __PATH__/ { fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } -### End of PHP configuration part } diff --git a/scripts/install b/scripts/install index ea889c6..9f66a19 100755 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 1c5a04c..fa75827 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,8 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --phpversion=$phpversion --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" + #================================================= # SPECIFIC RESTORATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 68f91f9..c50675e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -112,7 +112,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE