From 98624f9daf438d0d9c9ddc1a1df2a84c068da6b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 21:53:09 +0200 Subject: [PATCH 1/8] fix --- scripts/install | 4 ++-- scripts/restore | 6 ++---- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 63a82c5..78ba8c0 100644 --- a/scripts/install +++ b/scripts/install @@ -138,9 +138,9 @@ 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 + #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 diff --git a/scripts/restore b/scripts/restore index 15b0de7..a4fb4e5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 #================================================= @@ -102,9 +100,9 @@ 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 + #bundle install --without development test rmagick popd ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index 5821144..aa6a0d2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,9 +138,9 @@ 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 + #bundle install --without development test rmagick ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production popd From 4fd7749396600cc58a6103ade3293d18764c0411 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 22:27:41 +0200 Subject: [PATCH 2/8] Update install --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index 78ba8c0..c9aa78d 100644 --- a/scripts/install +++ b/scripts/install @@ -129,6 +129,11 @@ ynh_add_config --template="../conf/configuration.yml.example" --destination="$fi chmod 400 "$final_path/config/configuration.yml" chown $app:$app "$final_path/config/configuration.yml" +if [[ "$path_url" != "/" ]] +then + echo Redmine::Utils::relative_url_root = "$path_url" >> "$final_path/config/environment.rb" +fi + #================================================= # BUILD APP #================================================= From 4d0250cebfe9b44c330af82e0240c48a87e8ce4e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 22:30:25 +0200 Subject: [PATCH 3/8] Fix --- scripts/install | 1 - scripts/restore | 1 - scripts/upgrade | 17 ++++++++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index c9aa78d..01dfec1 100644 --- a/scripts/install +++ b/scripts/install @@ -145,7 +145,6 @@ pushd $final_path ynh_gem install bundler passenger --no-document 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 diff --git a/scripts/restore b/scripts/restore index a4fb4e5..d324679 100644 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,6 @@ pushd $final_path ynh_gem install bundler passenger --no-document bundle config set --local without 'development test rmagick' bundle install - #bundle install --without development test rmagick popd ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index aa6a0d2..22757ea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,7 +86,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 $final_path/config/environment.rb" fi mkdir -p "$final_path/files" "$final_path/log" "$final_path/tmp" "$final_path/public/plugin_assets" @@ -117,17 +117,17 @@ 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" +# 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" +# chmod 400 "$final_path/config/configuration.yml" +# chown $app:$app "$final_path/config/configuration.yml" #================================================= # BUILD APP @@ -140,7 +140,6 @@ pushd $final_path ynh_gem install bundler passenger --no-document 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 54457c7af086b32a935f4a863d06c9575a04e940 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 22:32:10 +0200 Subject: [PATCH 4/8] 5.0.0 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 73528b3..a98717f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/redmine/redmine/archive/refs/tags/4.2.4.tar.gz -SOURCE_SUM=c6214ef1279eecfdead9104fe032ccc07fc66dda4106c3dceb475d29795fa6ac +SOURCE_URL=https://github.com/redmine/redmine/archive/refs/tags/5.0.0.tar.gz +SOURCE_SUM=57b2482e04d9b4b0866372a3b2a897e55e85f2cc958c116ded67e3ca48ac91e1 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 713381e..dc077a8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Flexible project management web application", "fr": "Gestionnaire de projet flexible sous forme d'application web" }, - "version": "4.2.4~ynh2", + "version": "5.0.0~ynh1", "url": "https://www.redmine.org/", "upstream": { "license": "GPL-2.0", From fbdb4ca0fe861c0666d9ad6dee5bb92c2837a69d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 22:40:50 +0200 Subject: [PATCH 5/8] Revert "5.0.0" This reverts commit 54457c7af086b32a935f4a863d06c9575a04e940. --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index a98717f..73528b3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/redmine/redmine/archive/refs/tags/5.0.0.tar.gz -SOURCE_SUM=57b2482e04d9b4b0866372a3b2a897e55e85f2cc958c116ded67e3ca48ac91e1 +SOURCE_URL=https://github.com/redmine/redmine/archive/refs/tags/4.2.4.tar.gz +SOURCE_SUM=c6214ef1279eecfdead9104fe032ccc07fc66dda4106c3dceb475d29795fa6ac SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index dc077a8..713381e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Flexible project management web application", "fr": "Gestionnaire de projet flexible sous forme d'application web" }, - "version": "5.0.0~ynh1", + "version": "4.2.4~ynh2", "url": "https://www.redmine.org/", "upstream": { "license": "GPL-2.0", From fa219de0bfa57228600e5a4bbeca4405ca5c5cf7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 12 Apr 2022 22:50:44 +0200 Subject: [PATCH 6/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 01dfec1..05f7097 100644 --- a/scripts/install +++ b/scripts/install @@ -131,7 +131,7 @@ chown $app:$app "$final_path/config/configuration.yml" if [[ "$path_url" != "/" ]] then - echo Redmine::Utils::relative_url_root = "$path_url" >> "$final_path/config/environment.rb" + echo "Redmine::Utils::relative_url_root = '$path_url'" >> "$final_path/config/environment.rb" fi #================================================= From 2284e264ef5ed627a7f3e6b7758911b7aaa3e4fe Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 13 Apr 2022 13:56:33 +0200 Subject: [PATCH 7/8] Set sub path --- conf/nginx.conf | 3 ++- manifest.json | 6 ++++++ scripts/install | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) 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; diff --git a/manifest.json b/manifest.json index 961f9cb..7620803 100644 --- a/manifest.json +++ b/manifest.json @@ -32,6 +32,12 @@ "name": "domain", "type": "domain" }, + { + "name": "path", + "type": "path", + "example": "/redmine", + "default": "/redmine" + }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index 3694662..3faf0dc 100644 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME From 0c38c3d7be0a09a2886b64291b0c4b4676f65754 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 13 Apr 2022 13:56:49 +0200 Subject: [PATCH 8/8] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 8874011..45932b4 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,7 @@ is_public=1 ; Checks pkg_linter=1 - setup_sub_dir=0 + setup_sub_dir=1 setup_root=1 setup_nourl=0 setup_private=1