From e3736efc893833c2ff06db9c485d028714645b68 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 21:49:06 +0200 Subject: [PATCH 1/7] silent warnings --- manifest.json | 4 ++-- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 5f47434..713381e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "redmine", "packaging_format": 1, "description": { - "en": "A flexible project management web application.", - "fr": "Un gestionnaire de projet flexible sous forme d'application web." + "en": "Flexible project management web application", + "fr": "Gestionnaire de projet flexible sous forme d'application web" }, "version": "4.2.4~ynh2", "url": "https://www.redmine.org/", diff --git a/scripts/install b/scripts/install index 5c5eb19..63a82c5 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_ruby --ruby_version=$ruby_version #================================================= diff --git a/scripts/restore b/scripts/restore index 6abd677..15b0de7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -78,7 +78,7 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_ruby --ruby_version=$ruby_version #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c091fa3..5821144 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,7 +109,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_ruby --ruby_version=$ruby_version #================================================= From 19c436b401e16fe87e59b3592cb52aaef7297d01 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 23:01:30 +0200 Subject: [PATCH 2/7] install in domain --- conf/nginx.conf | 3 +-- manifest.json | 6 ------ scripts/install | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0d5ce06..748b3cb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,4 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; diff --git a/manifest.json b/manifest.json index 713381e..961f9cb 100644 --- a/manifest.json +++ b/manifest.json @@ -32,12 +32,6 @@ "name": "domain", "type": "domain" }, - { - "name": "path", - "type": "path", - "example": "/red", - "default": "/red" - }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index 63a82c5..b4c8721 100644 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME From bbd2e56f6b163470a1cbe24fb3cd7f8c7a0f43b1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 23:03:05 +0200 Subject: [PATCH 3/7] Update upgrade --- scripts/upgrade | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5821144..2cd006c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,7 +65,6 @@ ynh_script_progression --message="Ensuring downward compatibility..." # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all - ynh_app_setting_delete --app=$app --key=is_public fi @@ -86,7 +85,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/database.yml $final_path/config/configuration.yml" fi mkdir -p "$final_path/files" "$final_path/log" "$final_path/tmp" "$final_path/public/plugin_assets" @@ -117,17 +116,15 @@ ynh_install_ruby --ruby_version=$ruby_version #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +# ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml" +# ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml" +# chmod 400 "$final_path/config/database.yml" +# chown $app:$app "$final_path/config/database.yml" -chmod 400 "$final_path/config/database.yml" -chown $app:$app "$final_path/config/database.yml" - -ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml" - -chmod 400 "$final_path/config/configuration.yml" -chown $app:$app "$final_path/config/configuration.yml" +# ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml" +# chmod 400 "$final_path/config/configuration.yml" +# chown $app:$app "$final_path/config/configuration.yml" #================================================= # BUILD APP @@ -144,7 +141,7 @@ pushd $final_path ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production popd -ynh_install_app_dependencies $pkg_dependencies +#ynh_install_app_dependencies $pkg_dependencies chmod 750 "$final_path/public" chmod -R o-rwx "$final_path/public" From 12e24979dd64083eeb4798d0762409837272565a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 23:04:01 +0200 Subject: [PATCH 4/7] Fix --- scripts/install | 7 ++----- scripts/upgrade | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index b4c8721..d74a0ec 100644 --- a/scripts/install +++ b/scripts/install @@ -120,12 +120,10 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml" - chmod 400 "$final_path/config/database.yml" chown $app:$app "$final_path/config/database.yml" ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml" - chmod 400 "$final_path/config/configuration.yml" chown $app:$app "$final_path/config/configuration.yml" @@ -138,15 +136,14 @@ pushd $final_path ynh_use_ruby ynh_gem update --system --no-document ynh_gem install bundler passenger --no-document - bundle config set --local without 'development test' + bundle config set --local without 'development test rmagick' bundle install - bundle install --without development test rmagick ynh_exec_warn_less bundle exec rake generate_secret_token RAILS_ENV=production ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production #ynh_exec_warn_less bundle exec rake redmine:load_default_data RAILS_ENV=production popd -ynh_install_app_dependencies $pkg_dependencies +#ynh_install_app_dependencies $pkg_dependencies chmod 750 "$final_path/public" chmod -R o-rwx "$final_path/public" diff --git a/scripts/upgrade b/scripts/upgrade index 2cd006c..9a51539 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,9 +135,8 @@ pushd $final_path ynh_use_ruby ynh_gem update --system --no-document ynh_gem install bundler passenger --no-document - bundle config set --local without 'development test' + bundle config set --local without 'development test rmagick' bundle install - bundle install --without development test rmagick ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production popd From af452dbf5bb0ecd7e39f50f1961095ba7c3cfb54 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 13 Apr 2022 07:25:01 +0200 Subject: [PATCH 5/7] Fix --- check_process | 2 +- scripts/install | 4 ++-- scripts/restore | 6 ++---- scripts/upgrade | 19 ++----------------- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/check_process b/check_process index 45932b4..8874011 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,7 @@ is_public=1 ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 diff --git a/scripts/install b/scripts/install index d74a0ec..a9f26e9 100644 --- a/scripts/install +++ b/scripts/install @@ -66,7 +66,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies -ynh_install_ruby --ruby_version=$ruby_version +ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version #================================================= # CREATE DEDICATED USER @@ -143,7 +143,7 @@ pushd $final_path #ynh_exec_warn_less bundle exec rake redmine:load_default_data RAILS_ENV=production popd -#ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies chmod 750 "$final_path/public" chmod -R o-rwx "$final_path/public" diff --git a/scripts/restore b/scripts/restore index 15b0de7..f151c5a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,7 +79,7 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies -ynh_install_ruby --ruby_version=$ruby_version +ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version #================================================= # RESTORE THE POSTGRESQL DATABASE @@ -91,8 +91,6 @@ ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name - - #================================================= # BUILD APP #================================================= @@ -107,7 +105,7 @@ pushd $final_path bundle install --without development test rmagick popd -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies chmod 750 "$final_path/public" chmod -R o-rwx "$final_path/public" diff --git a/scripts/upgrade b/scripts/upgrade index 9a51539..d590ee6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,22 +109,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies -ynh_install_ruby --ruby_version=$ruby_version - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# ADD A CONFIGURATION -#================================================= -# ynh_script_progression --message="Adding a configuration file..." - -# ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml" -# chmod 400 "$final_path/config/database.yml" -# chown $app:$app "$final_path/config/database.yml" - -# ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml" -# chmod 400 "$final_path/config/configuration.yml" -# chown $app:$app "$final_path/config/configuration.yml" +ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version #================================================= # BUILD APP @@ -140,7 +125,7 @@ pushd $final_path ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production popd -#ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies chmod 750 "$final_path/public" chmod -R o-rwx "$final_path/public" From d483d3eaa174c65060c2d6badeeeeff158a5b461 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 13 Apr 2022 08:51:29 +0200 Subject: [PATCH 6/7] Update restore --- scripts/restore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index f151c5a..bf72665 100644 --- a/scripts/restore +++ b/scripts/restore @@ -100,9 +100,8 @@ pushd $final_path ynh_use_ruby ynh_gem update --system --no-document ynh_gem install bundler passenger --no-document - bundle config set --local without 'development test' + bundle config set --local without 'development test rmagick' bundle install - bundle install --without development test rmagick popd ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies From bd12728d0dfe3b8e5985313b13f91b7cb071eeef Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 13 Apr 2022 20:53:00 +0200 Subject: [PATCH 7/7] Update nginx.conf --- conf/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 748b3cb..0d5ce06 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off;