Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Gormun v2 for journeys and route_schedules APIs #4339

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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