Skip to content

Commit

Permalink
Merge pull request #250 from HSLdevcom/DT-6286
Browse files Browse the repository at this point in the history
Update tampere citybike api
  • Loading branch information
optionsome authored Apr 8, 2024
2 parents e8522ae + b0446c1 commit 67d7adc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
32 changes: 4 additions & 28 deletions external.conf
Original file line number Diff line number Diff line change
Expand Up @@ -368,43 +368,19 @@ location /out/stables.donkey.bike/ {
proxy_ssl_server_name on;
}

#giravolta (seatcode) citybike api for tampere
#for example https://tampere-api.giravolta.io/api-opendata/gbfs/2_3/system_information get sent to
#https://api.giravolta.io/api-opendata/gbfs/2_3/system_information with correct authentication header
#replace urls in the discovery call with proxy address
location = /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs {
proxy_pass https://api.giravolta.io/api-opendata/gbfs/2_3/gbfs;
# citybike api for tampere https://gbfs.urbansharing.com/tampere.onurbansharing.com/gbfs.json
location = /out/gbfs.urbansharing.com/ {
proxy_pass https://gbfs.urbansharing.com/;
include allowed-ips.conf;
proxy_cache ext_cache;
proxy_cache_valid any 30s;
proxy_cache_lock on;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
#Default caching would use the $proxy_host so we need custom rule to use request host
proxy_cache_key $scheme$host$request_uri;
proxy_set_header Authorization GIRAVOLTA_TAMPERE_AUTH;
sub_filter 'https://api.giravolta.io' 'http://digitransit-proxy:8080/out/tampere-api.giravolta.io';
sub_filter_once off;
sub_filter_types *;
}

#giravolta api calls for tampere
location /out/tampere-api.giravolta.io/ {
proxy_pass https://api.giravolta.io/;
include allowed-ips.conf;
proxy_cache ext_cache;
proxy_cache_valid any 30s;
proxy_cache_lock on;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
#Default caching would use the $proxy_host so we need custom rule to use request host
proxy_cache_key $scheme$host$request_uri;
proxy_set_header Authorization GIRAVOLTA_TAMPERE_AUTH;
proxy_ssl_server_name on;
}


#giravolta (seatcode) citybike api for vantaa
#for example https://vantaa-api.giravolta.io/api-opendata/gbfs/2_3/system_information get sent to
#https://api.giravolta.io/api-opendata/gbfs/2_3/system_information with correct authentication header
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test
-e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \
-e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" -e ROVANIEMI_BASIC_AUTH="\"test\"" \
-e KOUVOLA_BASIC_AUTH="\"test\"" -e KAJAANI_BASIC_AUTH="\"test\"" -e OULU_RT_BASIC_AUTH="\"test\"" \
-e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \
-e KOTKA_BASIC_AUTH="\"test\"" \
-e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" -e VARELY_RT_BASIC_AUTH="\"test\"" \
-e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \
-e PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" -e RAASEPORI_RT_BASIC_AUTH="\"test\"" \
Expand Down

0 comments on commit 67d7adc

Please sign in to comment.