From 83887521fcf2501d6f92267523deaf93c92d4698 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 31 Jul 2018 00:07:59 +0200 Subject: [PATCH 1/4] [enh] Upgrade cheky version to 4.1 See https://www.cheky.net/changelog#v4_1 And https://www.cheky.net/actualites#version-4-1 --- conf/app.src | 4 ++-- manifest.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index c4a4f39..e0e3b89 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Blount/Cheky/archive/3.8.1.tar.gz -SOURCE_SUM=b9170bc075c73f3e18638ed992541a4c562dd5447e6e4085a8798277184785dc +SOURCE_URL=https://github.com/Blount/Cheky/archive/4.1.tar.gz +SOURCE_SUM=320ea86a73c3e54809fd560959ac893df87a5dd663ff2176469c41e80b1d2434 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 05f9221..7480cc8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,12 +6,12 @@ "en": "Cheky package for YunoHost.", "fr": "Application Cheky pour YunoHost." }, - "version": "3.8.1~ynh2", + "version": "4.1~ynh2", "url": "https://www.cheky.net", "license": "GPL-3.0-or-later", "maintainer": { "name": "Gofannon", - "email": "gofanon@riseup.net", + "email": "gofannon@riseup.net", "url": "" }, "previous_maintainers": [ From f3d71c011094f6075947034d21aa8c2c1d11d4f8 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 31 Jul 2018 00:16:42 +0200 Subject: [PATCH 2/4] [enh] fix nginx 'alias_traversal' --- conf/nginx.conf | 15 +++++---------- manifest.json | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9a23ebc..8ae6307 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,13 +1,15 @@ -location __PATH__ { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { # Path to source alias __FINALPATH__/ ; + # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - # Example PHP configuration (remove if not used) +### Example PHP configuration (remove it if not used) index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file @@ -18,20 +20,13 @@ location __PATH__ { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock; - # If you don't use a dedicated fpm config for your app, - # use a general fpm pool. - # This is to be used INSTEAD of line above - # Don't forget to adjust scripts install/upgrade/remove/backup accordingly - # - #fastcgi_pass unix:/var/run/php5-fpm.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; } - # PHP configuration end +### End of PHP configuration part # Very important security restriction # See https://forum.cheky.net/information-sur-message-avertissement-securite-t553-p1.html#p2127 diff --git a/manifest.json b/manifest.json index 7480cc8..3482dc5 100644 --- a/manifest.json +++ b/manifest.json @@ -27,7 +27,7 @@ } ], "requirements": { - "yunohost": ">> 2.6.4" + "yunohost": ">> 2.7.14" }, "multi_instance": true, "services": [ From ed85238753b00e840d279cfab0009a87b2576b94 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 31 Jul 2018 00:18:07 +0200 Subject: [PATCH 3/4] [enh] Remove not needed 'logrotate' --- scripts/backup | 4 +--- scripts/install | 7 ------- scripts/remove | 7 ------- scripts/restore | 6 ------ scripts/upgrade | 7 ------- 5 files changed, 1 insertion(+), 30 deletions(-) diff --git a/scripts/backup b/scripts/backup index 22f64d7..2974172 100644 --- a/scripts/backup +++ b/scripts/backup @@ -61,11 +61,9 @@ ynh_mysql_dump_db "$db_name" > db.sql #================================================= # SPECIFIC BACKUP #================================================= -# BACKUP LOGROTATE +# ... #================================================= -ynh_backup "/etc/logrotate.d/$app" - #================================================= # BACKUP THE CRON FILE #================================================= diff --git a/scripts/install b/scripts/install index 8cfa207..5e9e3ef 100644 --- a/scripts/install +++ b/scripts/install @@ -154,13 +154,6 @@ chown -R root: $final_path # Only path that needs to be writable by cheky chown -R $app: $final_path/var -#================================================= -# SETUP LOGROTATE -#================================================= - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index 1cb9537..ddc4547 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,13 +50,6 @@ ynh_remove_nginx_config # Remove the dedicated php-fpm config ynh_remove_fpm_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # CLOSE A PORT #================================================= diff --git a/scripts/restore b/scripts/restore index 232f668..53e5956 100644 --- a/scripts/restore +++ b/scripts/restore @@ -92,12 +92,6 @@ ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" ynh_restore_file "/etc/cron.d/$app" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file "/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 46365fd..751fa31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,13 +108,6 @@ ynh_add_fpm_config # Recalculate and store the config file checksum into the app settings #ynh_store_file_checksum "$final_path/CONFIG_FILE" -#================================================= -# SETUP LOGROTATE -#================================================= - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # GENERIC FINALIZATION #================================================= From c29a054ee77af329750fb13fba68cd8c3362201f Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 31 Jul 2018 00:24:00 +0200 Subject: [PATCH 4/4] [enh] Cleaning scripts according to example_ynh --- scripts/backup | 7 +------ scripts/install | 10 ++++++---- scripts/restore | 7 +------ scripts/upgrade | 4 ---- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/scripts/backup b/scripts/backup index 2974172..b28bec4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,12 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get the _common.sh file if it's not in the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi -source _common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index 5e9e3ef..057dac0 100644 --- a/scripts/install +++ b/scripts/install @@ -143,6 +143,12 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd) # Installation with curl ynh_local_curl "/index.php?mod=install" "password=$password" "confirmPassword=$password" "type=db" "db[host]=localhost" "db[user]=$db_name" "db[password]=$db_pwd" "db[dbname]=$db_name" +# Remove the public access +if [ $is_public -eq 0 ] +then + ynh_app_setting_delete $app skipped_uris +fi + #================================================= # GENERIC FINALIZATION #================================================= @@ -158,10 +164,6 @@ chown -R $app: $final_path/var # SETUP SSOWAT #================================================= -if [ $is_public -eq 0 ] -then # Remove the public access - ynh_app_setting_delete $app skipped_uris -fi # Make app public if necessary if [ $is_public -eq 1 ] then diff --git a/scripts/restore b/scripts/restore index 53e5956..d205235 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,12 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get the _common.sh file if it's not in the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi -source _common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 751fa31..a3aa52c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,10 +123,6 @@ chown -R $app: $final_path/var # SETUP SSOWAT #================================================= -if [ $is_public -eq 0 ] -then # Remove the public access - ynh_app_setting_delete $app skipped_uris -fi # Make app public if necessary if [ $is_public -eq 1 ] then