From 9594df3f8a06771aeab960ca48702aeedfc59628 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 14 Dec 2020 13:15:15 +0100 Subject: [PATCH] Fix linter warnings --- check_process | 12 ------------ conf/nginx.conf | 16 ++++++++-------- manifest.json | 10 +++++----- scripts/_common.sh | 2 +- scripts/install | 25 +++++++++++-------------- scripts/upgrade | 8 -------- 6 files changed, 25 insertions(+), 48 deletions(-) diff --git a/check_process b/check_process index a20cdd5..a2325ff 100644 --- a/check_process +++ b/check_process @@ -17,20 +17,8 @@ upgrade=1 from_commit=2016c3a3a972dc74d1ae1ec74ff80987eb753ce9 backup_restore=1 multi_instance=1 - incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - Level 4=1 - Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Upgrade options ; commit=2016c3a3a972dc74d1ae1ec74ff80987eb753ce9 name=21 Nov 2017 diff --git a/conf/nginx.conf b/conf/nginx.conf index 43ea818..0902a65 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -23,13 +23,13 @@ location __PATH__/ { } # Add headers to serve security related headers - more_set_headers Strict-Transport-Security "max-age=15768000;"; - more_set_headers X-Content-Type-Options nosniff; - more_set_headers X-Frame-Options "SAMEORIGIN"; - more_set_headers "X-XSS-Protection 1; mode=block"; - more_set_headers X-Robots-Tag none; - more_set_headers X-Download-Options noopen; - more_set_headers X-Permitted-Cross-Domain-Policies none; + more_set_headers 'Strict-Transport-Security: max-age=15768000'; + more_set_headers 'X-Content-Type-Options: nosniff'; + more_set_headers 'X-Frame-Options: SAMEORIGIN'; + more_set_headers 'X-XSS-Protection: 1, mode=block'; + more_set_headers 'X-Robots-Tag: none'; + more_set_headers 'X-Download-Options: noopen'; + more_set_headers 'X-Permitted-Cross-Domain-Policies: none'; location ~^/(tmp|config|\.ht)/{ deny all; @@ -41,7 +41,7 @@ location __PATH__/ { # cacher. rewrite ^/([^/]*)/favicon\.ico$ __PATH__/spip.php?page=favicon.ico last; expires 1w; - more_set_headers Cache-Control public; + more_set_headers 'Cache-Control: public'; } location ~ [^/]\.php(/|$) { diff --git a/manifest.json b/manifest.json index 4aad6af..e332656 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "spip", "packaging_format": 1, "description": { - "en": "A CMS with a focus on collaborative edition and multilingualism", - "fr": "Un CMS conçu pour l'édition collaborative et le multilinguisme" + "en": "CMS with a focus on collaborative edition and multilingualism", + "fr": "CMS conçu pour l'édition collaborative et le multilinguisme" }, - "version": "3.2.7~ynh3", + "version": "3.2.7~ynh4", "url": "http://www.spip.net/", "license": "GPL-3.0-or-later", "maintainer": { @@ -14,7 +14,7 @@ "email": "cyp@rouquin.me" }, "requirements": { - "yunohost": ">= 3.2.2" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ @@ -64,7 +64,7 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public SPIP site ?", + "en": "Is it a public SPIP site?", "fr": "Est-ce un site public ?" }, "default": true diff --git a/scripts/_common.sh b/scripts/_common.sh index eb4d86a..b39e34f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -242,7 +242,7 @@ ynh_handle_app_migration () { # TODO Handle multi instance apps... # Check that there is not already an app installed for this id. - (yunohost app list --installed -f "$new_app" | grep -q -w "$new_app") \ + yunohost app list | grep -q 'id: $appname' \ && ynh_die "$new_app is already installed" #================================================= diff --git a/scripts/install b/scripts/install index 3143e52..f722aa9 100644 --- a/scripts/install +++ b/scripts/install @@ -36,21 +36,18 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info "Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" -# Normalize the url path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Register (book) web path ynh_webpath_register $app $domain $path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info "Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url @@ -62,7 +59,7 @@ ynh_app_setting_set $app users_status $users_status #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_print_info "Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid $app) ynh_app_setting_set $app db_name $db_name @@ -72,14 +69,14 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd) #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info "Setting up source files..." +ynh_script_progression --message="Setting up source files..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src @@ -88,7 +85,7 @@ ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info "Configuring nginx web server..." +ynh_script_progression --message="Configuring nginx web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -96,7 +93,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info "Configuring system user..." +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create $app @@ -104,7 +101,7 @@ ynh_system_user_create $app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info "Configuring php-fpm..." +ynh_script_progression --message="Configuring php-fpm..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -181,7 +178,7 @@ ynh_store_file_checksum "$final_path/config/connect.php" #================================================= # SETUP SSOWAT #================================================= -ynh_print_info "Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." # Make app public if necessary if [ $is_public -eq 1 ]; then @@ -192,7 +189,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info "Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." systemctl reload nginx @@ -200,4 +197,4 @@ systemctl reload nginx # END OF SCRIPT #================================================= -ynh_print_info "Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/upgrade b/scripts/upgrade index 713e1bc..b6ef621 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,13 +102,6 @@ if [ $migration_process -eq 1 ]; then db_name=$(ynh_app_setting_get $app db_name) fi -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -200,7 +193,6 @@ if [ $is_public -eq 0 ]; then ynh_app_setting_delete $app skipped_uris fi - #================================================= # MODIFY A CONFIG FILE #=================================================