From 777f66699a38127e54d0fd6b5c23ecbf1b3b801d Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 18 Mar 2026 12:50:20 +0200 Subject: [PATCH] Update HSL citybike API address, remove vantaa giravolta --- external.conf | 49 +++++++------------------------------------------ test.js | 2 +- 2 files changed, 8 insertions(+), 43 deletions(-) diff --git a/external.conf b/external.conf index 1acaf0c..0de6724 100644 --- a/external.conf +++ b/external.conf @@ -1,15 +1,3 @@ -#smoove citybike api (http://helsinki-fi.smoove.pro/api-public/stations) -location /out/helsinki-fi.smoove.pro/ { - proxy_pass http://helsinki-fi.smoove.pro/; - include allowed-ips.conf; - proxy_cache ext_cache; - proxy_cache_valid 200 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; -} - #turku smoove realtime api (http://data.foli.fi/gtfs-rt/reittiopas) location /out/data.foli.fi/ { proxy_pass http://data.foli.fi/; @@ -333,9 +321,9 @@ location /out/waltti-cloudtest-agent.frendsapp.com/ { proxy_set_header X-Api-Key FRENDS_API_KEY; } -#donkey citybike api (for example https://stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/gbfs.json) -location /out/stables.donkey.bike/ { - proxy_pass https://stables.donkey.bike/; +#hsl citybike api (https://gbfs.theta.fifteen.eu/gbfs/2.2/helsinki/en/gbfs.json) +location /out/gbfs.theta.fifteen.eu/ { + proxy_pass https://gbfs.theta.fifteen.eu/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid any 30s; @@ -346,30 +334,9 @@ location /out/stables.donkey.bike/ { 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 -#replace urls in the discovery call with proxy address -location = /out/vantaa-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { - proxy_pass https://api.giravolta.io/api-opendata/gbfs/2_3/gbfs; - 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_VANTAA_AUTH; - sub_filter 'https://api.giravolta.io' 'http://digitransit-proxy:8080/out/vantaa-api.giravolta.io'; - sub_filter_once off; - sub_filter_types *; -} - -#giravolta api calls for vantaa -location /out/vantaa-api.giravolta.io/ { - proxy_pass https://api.giravolta.io/; +#donkey citybike api (for example https://stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/gbfs.json) +location /out/stables.donkey.bike/ { + proxy_pass https://stables.donkey.bike/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid any 30s; @@ -377,9 +344,7 @@ location /out/vantaa-api.giravolta.io/ { 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_VANTAA_AUTH; + proxy_ssl_server_name on; } #Raasepori rt (https://bosse.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) diff --git a/test.js b/test.js index 8e02067..9d592f8 100644 --- a/test.js +++ b/test.js @@ -410,7 +410,7 @@ describe('otp debug UIs with path beginning with "/otp" should return 404', func describe('ext-proxy', function() { this.timeout(5000); - testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); + testCaching(null,'/out/gbfs.theta.fifteen.eu/gbfs/2.2/helsinki/en/gbfs.json',false); testCaching(null,'/out/data.foli.fi/gtfs-rt/reittiopas',false); testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); });