From f76f3ae7eb78ddd53e0c75cfdf16e74c63c44a67 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Wed, 8 Jan 2025 15:09:24 +0100 Subject: [PATCH 1/2] GormunV2: Manage Journeys --- docker/apache/jormungandr.default.conf | 7 +++++++ docker/run_jormungandr.sh | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docker/apache/jormungandr.default.conf b/docker/apache/jormungandr.default.conf index 66fc891c0d..c9c174f8f3 100644 --- a/docker/apache/jormungandr.default.conf +++ b/docker/apache/jormungandr.default.conf @@ -23,6 +23,13 @@ RewriteRule ^/(.*route_schedules.*) %{ENV:GORMUNGANDR_URL}/$1 [P] ProxyPassReverse / %{ENV:GORMUNGANDR_URL}/ + RewriteCond %{ENV:GORMUNGANDR_VERSION} 2 + RewriteCond %{REQUEST_URI} ".*journeys.*" + RewriteCond %{QUERY_STRING} "from=" + RewriteCond %{QUERY_STRING} "to=" + RewriteRule ^/(.*) %{ENV:GORMUNGANDR_URL}/$1 [P] + ProxyPassReverse / %{ENV:GORMUNGANDR_URL}/ + AddOutputFilterByType DEFLATE application/json CustomLog /var/log/apache2/access.log vhost_combined_timetaken diff --git a/docker/run_jormungandr.sh b/docker/run_jormungandr.sh index df1caab960..8b22929cd4 100755 --- a/docker/run_jormungandr.sh +++ b/docker/run_jormungandr.sh @@ -10,6 +10,7 @@ Usage: ${0##*/} -m monitor-process -r max-requests -m [0|1] activate monitor-process -r max-requests before reload for jormungandr worker -g Optional: gormungandr url for route_schedules API (Example: http://gormungandr) + -v Optional: gormungandr version API : route_schedules(1), route_schedules and journeys(2) EOF } @@ -23,6 +24,8 @@ while getopts "m:r:c:g:h" opt; do ;; g) gormungandr_url=$OPTARG ;; + v) gormungandr_version=$OPTARG + ;; h|\?) show_help exit 1 @@ -50,9 +53,10 @@ fi jormungandr_cache2="name=jormungandr,items=${jormun_cache_items}" -if [[ ! -z $gormungandr_url ]] +if [[ ! -z $gormungandr_url ]] && [[ ! -z $gormungandr_version ]]; then echo "export GORMUNGANDR_URL=$gormungandr_url" >> /etc/apache2/envvars + echo "export GORMUNGANDR_VERSION=$gormungandr_version" >> /etc/apache2/envvars fi # run apache2 service apache2 start From e525aed29562e58ef93ea03f7857745b116f5661 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Wed, 8 Jan 2025 15:19:02 +0100 Subject: [PATCH 2/2] corrections --- docker/run_jormungandr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run_jormungandr.sh b/docker/run_jormungandr.sh index 8b22929cd4..848b0e8e03 100755 --- a/docker/run_jormungandr.sh +++ b/docker/run_jormungandr.sh @@ -14,7 +14,7 @@ Usage: ${0##*/} -m monitor-process -r max-requests EOF } -while getopts "m:r:c:g:h" opt; do +while getopts "m:r:c:g:v:h" opt; do case $opt in m) monitor_processes=$OPTARG ;;