From 774eef21cd6852ffa42906b10bb5fc7a92aab919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 5 Feb 2021 23:27:28 +0100 Subject: [PATCH] Testing (#4) * New permissions * Update check_process --- README.md | 2 +- README_fr.md | 2 +- check_process | 8 ++++---- conf/php-fpm.conf | 7 ++----- manifest.json | 4 ++-- pull_request_template.md | 4 +--- scripts/change_url | 1 + scripts/install | 10 +++++----- scripts/remove | 4 ++-- scripts/upgrade | 19 +------------------ 10 files changed, 20 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 2ef8201..f3b6fa6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PrivateBin for YunoHost [![Integration level](https://dash.yunohost.org/integration/privatebin.svg)](https://dash.yunohost.org/appci/app/privatebin) ![](https://ci-apps.yunohost.org/ci/badges/privatebin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/privatebin.maintain.svg) -[![Install PrivateBin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=privatebin) +[![Install PrivateBin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=privatebin) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 0918436..a74c0c1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # PrivateBin pour YunoHost [![Niveau d'intégration](https://dash.yunohost.org/integration/privatebin.svg)](https://dash.yunohost.org/appci/app/privatebin) ![](https://ci-apps.yunohost.org/ci/badges/privatebin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/privatebin.maintain.svg) -[![Installer PrivateBin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=privatebin) +[![Installer PrivateBin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=privatebin) *[Read this readme in english.](./README.md)* diff --git a/check_process b/check_process index 32cd1e9..cd93ce5 100644 --- a/check_process +++ b/check_process @@ -8,10 +8,10 @@ setup_sub_dir=1 setup_root=1 setup_nourl=0 - setup_private=1 + setup_private=0 setup_public=1 upgrade=1 - upgrade=1 from_commit=42913fc917c98766b0cbba47a3b40148dffaac58 + upgrade=1 from_commit=8ce6cac57048e5df294269989c2432d67bef4c5c backup_restore=1 multi_instance=1 incorrect_path=1 @@ -21,6 +21,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=42913fc917c98766b0cbba47a3b40148dffaac58 - name=Refactoring + ; commit=8ce6cac57048e5df294269989c2432d67bef4c5c + name=Testing (#1) manifest_arg=domain=DOMAIN&path=PATH&is_public=1& diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 61b251f..37344f6 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -419,8 +419,8 @@ chdir = __FINALPATH__ ;php_admin_value[memory_limit] = 32M ; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M +php_admin_value[upload_max_filesize] = 30M +php_admin_value[post_max_size] = 30M ; php_admin_flag[mail.add_x_header] = Off ; Other common parameters @@ -428,6 +428,3 @@ chdir = __FINALPATH__ ; php_admin_value[max_input_time] = 300 ; php_admin_value[memory_limit] = 256M ; php_admin_flag[short_open_tag] = On - -php_admin_value[upload_max_filesize] = 30M -php_admin_value[post_max_size] = 30M diff --git a/manifest.json b/manifest.json index c55a692..f3b92d6 100644 --- a/manifest.json +++ b/manifest.json @@ -14,12 +14,12 @@ "email": "julien.malik@paraiso.me" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "arguments": { "install" : [ diff --git a/pull_request_template.md b/pull_request_template.md index 1b38eac..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/privatebin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/privatebin_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/change_url b/scripts/change_url index 0017e2c..ac2c77f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ 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) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED diff --git a/scripts/install b/scripts/install index 7087485..44b34de 100644 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -39,7 +39,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -59,7 +59,7 @@ 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..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -101,12 +101,12 @@ chmod 700 $final_path/{data,tmp} #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." --weight=1 # If app is public, add url to SSOWat conf as skipped_uris 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="/" + ynh_permission_update --permission="main" --add="visitors" else # If the app is private, viewing paste stays publicly accessible. # Modify the domain to be used in a regex diff --git a/scripts/remove b/scripts/remove index 4238aa0..5d1d855 100644 --- a/scripts/remove +++ b/scripts/remove @@ -40,7 +40,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing PHP-FPM configuration" +ynh_script_progression --message="Removing PHP-FPM configuration" --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config @@ -50,7 +50,7 @@ ynh_remove_fpm_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user" +ynh_script_progression --message="Removing the dedicated system user" --weight=2 # Delete a system user ynh_system_user_delete --username=$app diff --git a/scripts/upgrade b/scripts/upgrade index 0acb397..0a7ec94 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,7 +89,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -127,23 +127,6 @@ mkdir -p $final_path/{data,tmp} chown -R $app:root $final_path/{data,tmp} chmod 700 $final_path/{data,tmp} -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# If app is public, add url to SSOWat conf as skipped_uris -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="/" -else - # If the app is private, viewing paste stays publicly accessible. - # Modify the domain to be used in a regex - domain_regex=$(echo "$domain" | sed 's@-@.@g') - ynh_app_setting_set --app=$app --key=protected_regex --value="$domain_regex$path_url/$" - ynh_app_setting_set --app=$app --key=unprotected_regex --value="$domain_regex$path_url/.*$" -fi - #================================================= # RELOAD NGINX #=================================================