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 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 a9f26e9..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 @@ -127,6 +127,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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d590ee6..9a3280e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,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" --keep="$final_path/config/database.yml $final_path/config/configuration.yml" + 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" @@ -109,6 +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_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version #=================================================