Skip to content

Commit

Permalink
Merge pull request #4339 from hove-io/gormun_v2
Browse files Browse the repository at this point in the history
Use Gormun v2 for journeys and route_schedules APIs
  • Loading branch information
azime authored Jan 10, 2025
2 parents ae36953 + e525aed commit 48ab415
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docker/apache/jormungandr.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docker/run_jormungandr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ 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
}

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
;;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 48ab415

Please sign in to comment.