From 1a7c83ddc390bdc5ebc63709db152c826316ce09 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 9 Apr 2020 16:09:57 +0300 Subject: [PATCH 001/328] Remove unused vayla external endpoint --- external.conf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/external.conf b/external.conf index c5602ce..a65e5c4 100644 --- a/external.conf +++ b/external.conf @@ -46,18 +46,6 @@ location /out/92.62.36.215/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -# Old Livi GTFS-RT for easier migration -location /out/beta.vayla.fi/ { - proxy_pass https://beta.vayla.fi/; - 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; -} - #new livi gtfs rt (https://tyokalu.navici.com/joukkoliikenne/manual-gtfsrt/api/gtfsrt/alerts) location /out/tyokalu.navici.com/ { proxy_pass https://tyokalu.navici.com/; @@ -255,3 +243,15 @@ location /out/poland.nextbike.net/ { 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; } + +#Oulu bike stations (https://poland.nextbike.net/maps/nextbike-official.json?domains=fo) +location /out/poland.nextbike.net/ { + proxy_pass https://poland.nextbike.net/; + 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; +} From f1283df5023686e34114d03017a11822a8f68b50 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 9 Apr 2020 16:12:51 +0300 Subject: [PATCH 002/328] Add external endpoint for vilkku bikes --- external.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external.conf b/external.conf index a65e5c4..29a70d3 100644 --- a/external.conf +++ b/external.conf @@ -255,3 +255,15 @@ location /out/poland.nextbike.net/ { 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; } + +#Vilkku (Kuopio) bike stations (https://kaupunkipyorat.kuopio.fi/tkhs-export-map.html?format=xml) +location /out/kaupunkipyorat.kuopio.fi/ { + proxy_pass https://kaupunkipyorat.kuopio.fi/; + 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; +} From da436189ce1584b65154b0d0a5f69c1666fe6ca3 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 9 Apr 2020 16:13:30 +0300 Subject: [PATCH 003/328] Remove duplicate external endpoint left over from a merge probably --- external.conf | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/external.conf b/external.conf index 29a70d3..bdd3603 100644 --- a/external.conf +++ b/external.conf @@ -244,18 +244,6 @@ location /out/poland.nextbike.net/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#Oulu bike stations (https://poland.nextbike.net/maps/nextbike-official.json?domains=fo) -location /out/poland.nextbike.net/ { - proxy_pass https://poland.nextbike.net/; - 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; -} - #Vilkku (Kuopio) bike stations (https://kaupunkipyorat.kuopio.fi/tkhs-export-map.html?format=xml) location /out/kaupunkipyorat.kuopio.fi/ { proxy_pass https://kaupunkipyorat.kuopio.fi/; From bbff9ddf0f0ecfba373898a18c5ac86ca19c4d17 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 11 May 2020 10:35:52 +0300 Subject: [PATCH 004/328] Upgrade nginx version to 1.18 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 38db3e5..3d681f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.16-alpine +FROM nginx:1.18-alpine MAINTAINER Reittiopas version: 0.1 ENV INSTALL_DIR="/opt/nginx" From bc8fcadce1b18165e04d673d014246a2892d4f7a Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 5 Jun 2020 10:42:39 +0300 Subject: [PATCH 005/328] Add new domains for digitransit-ui-hsl-next --- nginx.conf | 2 +- test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 98e5553..1e79011 100644 --- a/nginx.conf +++ b/nginx.conf @@ -226,7 +226,7 @@ http { } server { - server_name next-dev.digitransit.fi; + server_name next-dev.digitransit.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 506d294..2f43721 100644 --- a/test.js +++ b/test.js @@ -174,6 +174,8 @@ describe('hsl ui', function() { testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); testProxying('next-dev.digitransit.fi','/','digitransit-ui-hsl-next:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); + testProxying('uusi.reittiopas.fi','/','digitransit-ui-hsl-next:8080', true); + testProxying('uusi.reittiopas.hsl.fi','/','digitransit-ui-hsl-next:8080', true); testRedirect('vyohykereittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa'); }); From 6d5bccb8bedf6bef2bf20f33b19fd61f20378660 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 9 Jun 2020 19:41:34 +0300 Subject: [PATCH 006/328] Add external endpoint for hameenlinna APIs --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index bdd3603..0b262a9 100644 --- a/external.conf +++ b/external.conf @@ -255,3 +255,16 @@ location /out/kaupunkipyorat.kuopio.fi/ { 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; } + +#hameenlinna gtfs rt (https://hameenlinna.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/hameenlinna.mattersoft.fi/ { + proxy_pass https://hameenlinna.mattersoft.fi/; + 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; + proxy_set_header Authorization HAMEENLINNA_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index bb42d2a..b16fc65 100755 --- a/run.sh +++ b/run.sh @@ -24,6 +24,7 @@ sed -i "s/MATKAHUOLTO_SATAKUNTA_BASIC_AUTH/${MATKAHUOLTO_SATAKUNTA_BASIC_AUTH}/" sed -i "s/MATKAHUOLTO_VAKKA_BASIC_AUTH/${MATKAHUOLTO_VAKKA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MATKAHUOLTO_VANTAA_BASIC_AUTH/${MATKAHUOLTO_VANTAA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MATKAHUOLTO_VARSINAIS_BASIC_AUTH/${MATKAHUOLTO_VARSINAIS_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf diff --git a/test.sh b/test.sh index e638fbc..730e2b6 100755 --- a/test.sh +++ b/test.sh @@ -23,7 +23,7 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_LAPPI_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_POHJANMAA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ - hsldevcom/digitransit-proxy:integrationtest` + -e HAMEENLINNA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 5083bb78fc2272dfdcba5b445c59e90b660eee55 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Wed, 17 Jun 2020 13:49:37 +0300 Subject: [PATCH 007/328] next-hsl --- common.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common.conf b/common.conf index cf31deb..26fc169 100644 --- a/common.conf +++ b/common.conf @@ -163,6 +163,19 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +location /map/v1/next-hsl-map/ { + proxy_pass http://hsl-map-server-next:8080; + # proxy_cache tiles; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache_revalidate on; + # proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header X-Cache-Status $upstream_cache_status; +} + location /map/v1/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; From a8fa120cac4f60fdf008f82626e9ac927007c372 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Wed, 17 Jun 2020 14:16:21 +0300 Subject: [PATCH 008/328] rewrite hsl map --- common.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common.conf b/common.conf index 26fc169..c2375e5 100644 --- a/common.conf +++ b/common.conf @@ -163,7 +163,8 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -location /map/v1/next-hsl-map/ { +location /map/v1/next-/ { + rewrite /map/v1/{.*}hsl-map proxy_pass http://hsl-map-server-next:8080; # proxy_cache tiles; # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; @@ -173,7 +174,7 @@ location /map/v1/next-hsl-map/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; - add_header X-Cache-Status $upstream_cache_status; + # add_header X-Cache-Status $upstream_cache_status; } location /map/v1/ { From ebf44218ce6f1598a997af70de4bdb65ee9cb249 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Wed, 17 Jun 2020 14:28:51 +0300 Subject: [PATCH 009/328] rewrite --- common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.conf b/common.conf index c2375e5..42043b2 100644 --- a/common.conf +++ b/common.conf @@ -164,7 +164,7 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { } location /map/v1/next-/ { - rewrite /map/v1/{.*}hsl-map + rewrite /map/v1/next-(.*) /map/v1/$1 break; proxy_pass http://hsl-map-server-next:8080; # proxy_cache tiles; # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; From e5f1d95b1e56e8da1642ba55ff95f418fcf6c97c Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 18 Jun 2020 07:22:49 +0300 Subject: [PATCH 010/328] tweaking and test --- common.conf | 2 +- test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common.conf b/common.conf index 42043b2..7f77640 100644 --- a/common.conf +++ b/common.conf @@ -163,7 +163,7 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -location /map/v1/next-/ { +location /map/v1/next- { rewrite /map/v1/next-(.*) /map/v1/$1 break; proxy_pass http://hsl-map-server-next:8080; # proxy_cache tiles; diff --git a/test.js b/test.js index 2f43721..2bf8945 100644 --- a/test.js +++ b/test.js @@ -146,6 +146,7 @@ describe('api.digitransit.fi', function() { describe('hsl ui', function() { testRedirect('www.beta.reittiopas.fi','/kissa','http://beta.reittiopas.fi/kissa'); + testRedirect('api.digitransit.fi','/map/v1/hsl-map-next/index.json','/map/v1/hsl-map/index.json'); testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('beta.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); From b68aba97e9a7c16a9548ef81d02c5fc4dd6db0a9 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 18 Jun 2020 09:16:01 +0300 Subject: [PATCH 011/328] test tuning --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index 2bf8945..78255ad 100644 --- a/test.js +++ b/test.js @@ -119,6 +119,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server-next:8080/map/v1/hsl-map/index.json'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); @@ -145,8 +146,7 @@ describe('api.digitransit.fi', function() { }); describe('hsl ui', function() { - testRedirect('www.beta.reittiopas.fi','/kissa','http://beta.reittiopas.fi/kissa'); - testRedirect('api.digitransit.fi','/map/v1/hsl-map-next/index.json','/map/v1/hsl-map/index.json'); + testRedirect('www.beta.reittiopas.fi','/kissa','http://beta.reittiopas.fi/kissa') testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('beta.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); From 8400ff7843248c545f94051569fca47a2e33f863 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 18 Jun 2020 09:51:34 +0300 Subject: [PATCH 012/328] test --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 78255ad..49a346f 100644 --- a/test.js +++ b/test.js @@ -119,7 +119,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server-next:8080/map/v1/hsl-map/index.json'); + testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 1c741c6346fe601304c6ce502b69945ded3af5d9 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 18 Jun 2020 09:55:06 +0300 Subject: [PATCH 013/328] test --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 49a346f..62e6208 100644 --- a/test.js +++ b/test.js @@ -119,7 +119,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server-next:8080'); + testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 353d2e2c4c3c46016c2a47567245057a7c787ff2 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 18 Jun 2020 10:45:21 +0300 Subject: [PATCH 014/328] test again --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 62e6208..2530327 100644 --- a/test.js +++ b/test.js @@ -119,7 +119,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v1/hsl-map-next/index.json','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 022f2bcef9186d5607fed93d8d9b0fcaefa23de9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 12 Aug 2020 11:25:05 +0300 Subject: [PATCH 015/328] allow emitter page loading from external iframe --- nginx.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1e79011..c5b41b4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -251,6 +251,20 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } + location /local-storage-emitter { + proxy_pass http://digitransit-ui-hsl-next:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + if ($request_method = 'GET') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; + } + } + location / { proxy_pass http://digitransit-ui-hsl-next:8080; proxy_redirect off; From 4ecaa9c152388065f1eb50586bd5e50ecc6f79ed Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 19 Aug 2020 15:03:52 +0300 Subject: [PATCH 016/328] try hiding x frame header --- nginx.conf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index c5b41b4..0aff4b3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -252,17 +252,12 @@ http { } location /local-storage-emitter { + proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-hsl-next:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; - } } location / { From 366efcf38ec8079f7131f0f1ecb718c8cb257488 Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Thu, 20 Aug 2020 13:59:19 +0300 Subject: [PATCH 017/328] fix: Vilkku (Kuopio) bike stations' proxy_cache_valid --- external.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 0b262a9..f078cf5 100644 --- a/external.conf +++ b/external.conf @@ -249,7 +249,7 @@ location /out/kaupunkipyorat.kuopio.fi/ { proxy_pass https://kaupunkipyorat.kuopio.fi/; include allowed-ips.conf; proxy_cache ext_cache; - proxy_cache_valid 200 30s; + proxy_cache_valid any 60s; proxy_cache_lock on; add_header X-Proxy-Cache $upstream_cache_status; proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; From 74d85cb67fce8bff6dee3ddeb67d50ee388212c0 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 29 Sep 2020 11:37:43 +0300 Subject: [PATCH 018/328] Use next routing and routing data for waltti next endpoints --- common.conf | 6 +++--- test.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common.conf b/common.conf index 7f77640..3ea2702 100644 --- a/common.conf +++ b/common.conf @@ -259,8 +259,8 @@ location /routing/v1/routers/next-hsl { } location /routing/v1/routers/next-waltti { - rewrite /routing/v1/routers/next-waltti(.*) /otp/routers/waltti$1 break; - proxy_pass http://opentripplanner-waltti:8080/; + rewrite /routing/v1/routers/next-waltti(.*) /otp/routers/default$1 break; + proxy_pass http://opentripplanner-next-waltti:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -310,7 +310,7 @@ location /routing-data/v2/next-hsl { location /routing-data/v2/next-waltti { rewrite /routing-data/v2/next-waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-waltti:8080/; + proxy_pass http://opentripplanner-data-con-next-waltti:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/test.js b/test.js index 2530327..c29e5c6 100644 --- a/test.js +++ b/test.js @@ -125,7 +125,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-finland','opentripplanner-finland:8080'); testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-hsl','opentripplanner-hsl:8080'); - testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-waltti:8080'); + testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-next-waltti:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); @@ -134,7 +134,7 @@ describe('api.digitransit.fi', function() { testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v2/next-hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-hsl/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-next-waltti:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v2/next-finland/router-finland.zip','opentripplanner-data-con-finland:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-finland/router-config.json', 'access-control-allow-origin', '*'); From 7e0328ee2abc5172375d8e2ff2702ded709a09a3 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 29 Sep 2020 13:07:54 +0300 Subject: [PATCH 019/328] Add waltti opas domains to waltti ui --- nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 0aff4b3..74ba43b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -191,7 +191,8 @@ http { dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-salo.digitransit.fi salo.digitransit.fi reittiopas.salo.fi; + dev-salo.digitransit.fi salo.digitransit.fi reittiopas.salo.fi + dev-opas.waltti.fi opas.waltti.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From f1db27c5984c9622336376257a89d84cf9e417dd Mon Sep 17 00:00:00 2001 From: Ristomatti Karppanen Date: Thu, 8 Oct 2020 11:49:34 +0300 Subject: [PATCH 020/328] Update Docker tagging logic --- .travis.yml | 1 + travis-build.sh | 43 +++++++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index c50357d..4d96bea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ sudo: required branches: only: - master + - force-build - /20(1[7-9]|2[0-9])[0-1][0-9][0-3][0-9]/ services: docker diff --git a/travis-build.sh b/travis-build.sh index 6ceaa5c..565f566 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -7,10 +7,20 @@ set -o errexit -o nounset -o xtrace ORG=${ORG:-hsldevcom} -DOCKER_TAG=${TRAVIS_COMMIT:-latest} -DOCKER_IMAGE=$ORG/digitransit-proxy:$DOCKER_TAG -LATEST_IMAGE=$ORG/digitransit-proxy:latest -PROD_IMAGE=$ORG/digitransit-proxy:prod +DOCKER_IMAGE=$ORG/digitransit-proxy +DOCKER_TAG="latest" + + +if [ "$TRAVIS_TAG" ]; then + DOCKER_TAG="prod" +elif [ "$TRAVIS_BRANCH" != "master" ]; then + DOCKER_TAG=$TRAVIS_BRANCH +fi + +DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-${TRAVIS_COMMIT:0:7} +DOCKER_IMAGE_LATEST=$DOCKER_IMAGE:latest +DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG +DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then @@ -18,26 +28,23 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then if [ "$TRAVIS_TAG" ];then echo "processing release $TRAVIS_TAG" #release do not rebuild, just tag - docker pull $DOCKER_IMAGE - docker tag ${DOCKER_IMAGE} ${PROD_IMAGE} - docker push ${PROD_IMAGE} + docker pull $DOCKER_IMAGE_LATEST + docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG + docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG_LONG + docker push $DOCKER_IMAGE_TAG + docker push $DOCKER_IMAGE_TAG_LONG else ./test.sh - docker build --tag=$DOCKER_IMAGE -f Dockerfile . - docker push ${DOCKER_IMAGE} - echo "processing $TRAVIS_BRANCH build $TRAVIS_COMMIT" - if [ "$TRAVIS_BRANCH" = "master" ]; then - docker tag ${DOCKER_IMAGE} ${LATEST_IMAGE} - docker push ${LATEST_IMAGE} - else - docker tag ${DOCKER_IMAGE} $ORG/digitransit-proxy:$TRAVIS_BRANCH - docker push $ORG/digitransit-proxy:$TRAVIS_BRANCH - fi + docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . + echo "Pushing $DOCKER_TAG image" + docker push $DOCKER_IMAGE_TAG_LONG + docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG + docker push $DOCKER_IMAGE_TAG fi else echo "processing pr $TRAVIS_PULL_REQUEST" ./test.sh - docker build --tag=$DOCKER_IMAGE -f Dockerfile . + docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . fi echo Build completed \ No newline at end of file From 45c87ca2033f86c4544c12faf1555bd54ce2ec3f Mon Sep 17 00:00:00 2001 From: Ristomatti Karppanen Date: Thu, 8 Oct 2020 15:57:40 +0300 Subject: [PATCH 021/328] travis-build.sh changed to look like the template from other repos --- travis-build.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/travis-build.sh b/travis-build.sh index 565f566..a0c79c8 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -23,6 +23,13 @@ DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG +if [ -z $TRAVIS_TAG ]; then + # Build image + echo "Building digitransit-proxy" + ./test.sh + docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . +fi + if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then docker login -u ${DOCKER_USER} -p ${DOCKER_AUTH} if [ "$TRAVIS_TAG" ];then @@ -41,10 +48,6 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG docker push $DOCKER_IMAGE_TAG fi -else - echo "processing pr $TRAVIS_PULL_REQUEST" - ./test.sh - docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . fi echo Build completed \ No newline at end of file From 571a67da7b9f541fd51d5cd29f817b5e469b15ca Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 9 Oct 2020 07:48:49 +0300 Subject: [PATCH 022/328] chore: simplify more --- travis-build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/travis-build.sh b/travis-build.sh index a0c79c8..9f0e8d0 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -41,8 +41,6 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then docker push $DOCKER_IMAGE_TAG docker push $DOCKER_IMAGE_TAG_LONG else - ./test.sh - docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . echo "Pushing $DOCKER_TAG image" docker push $DOCKER_IMAGE_TAG_LONG docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG @@ -50,4 +48,4 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then fi fi -echo Build completed \ No newline at end of file +echo Build completed From a111632fed09511627c2cad2bb3f052ff211ef4b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 20 Oct 2020 16:42:18 +0300 Subject: [PATCH 023/328] hsl.fi redirect from next ui root path --- nginx.conf | 4 ++++ run.sh | 2 +- test.js | 9 ++++++--- test.sh | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 74ba43b..f5849c6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -261,6 +261,10 @@ http { proxy_set_header X-Forwarded-Host $host; } + location = / { + return 302 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + } + location / { proxy_pass http://digitransit-ui-hsl-next:8080; proxy_redirect off; diff --git a/run.sh b/run.sh index b16fc65..ce46861 100755 --- a/run.sh +++ b/run.sh @@ -25,7 +25,7 @@ sed -i "s/MATKAHUOLTO_VAKKA_BASIC_AUTH/${MATKAHUOLTO_VAKKA_BASIC_AUTH}/" /etc/ng sed -i "s/MATKAHUOLTO_VANTAA_BASIC_AUTH/${MATKAHUOLTO_VANTAA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MATKAHUOLTO_VARSINAIS_BASIC_AUTH/${MATKAHUOLTO_VARSINAIS_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf - +sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf #start nginx diff --git a/test.js b/test.js index c29e5c6..400ac81 100644 --- a/test.js +++ b/test.js @@ -173,10 +173,13 @@ describe('hsl ui', function() { //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); - testProxying('next-dev.digitransit.fi','/','digitransit-ui-hsl-next:8080', true); + testRedirect('next-dev.digitransit.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); + testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-next:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); - testProxying('uusi.reittiopas.fi','/','digitransit-ui-hsl-next:8080', true); - testProxying('uusi.reittiopas.hsl.fi','/','digitransit-ui-hsl-next:8080', true); + testRedirect('uusi.reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); + testProxying('uusi.reittiopas.fi','/kissa','digitransit-ui-hsl-next:8080', true); + testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); + testProxying('uusi.reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); testRedirect('vyohykereittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa'); }); diff --git a/test.sh b/test.sh index 730e2b6..0b11e9b 100755 --- a/test.sh +++ b/test.sh @@ -23,7 +23,7 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_LAPPI_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_POHJANMAA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ - -e HAMEENLINNA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 0680f713311b7d45058d9b50fd861df4ce744885 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 22 Oct 2020 12:20:10 +0300 Subject: [PATCH 024/328] Add vanha.reittiopas.hsl.fi domain support --- nginx.conf | 2 +- test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f5849c6..d114ee8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -67,7 +67,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi vanha.reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 400ac81..7416373 100644 --- a/test.js +++ b/test.js @@ -167,6 +167,8 @@ describe('hsl ui', function() { testCaching('reittiopas.hsl.fi','/sw.js', true); + testProxying('vanha.reittiopas.hsl.fi','/','digitransit-ui-hsl:8080', true); + testRedirect('reittiopas.hsl.fi','/uudetvyohykkeet','https://reittiopas.hsl.fi', true); testRedirect('reittiopas.hsl.fi','/uudetvyöhykkeet','https://reittiopas.hsl.fi', true); From 1469ad4744347cfc8c06912b66e5a18bac55da55 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 22 Oct 2020 12:23:47 +0300 Subject: [PATCH 025/328] Remove support for some old domains/endpoints --- nginx.conf | 6 +----- test.js | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/nginx.conf b/nginx.conf index d114ee8..609dacd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -92,10 +92,6 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } - location ~ ^/uudetvy { - return 301 https://reittiopas.hsl.fi; - } - location / { proxy_pass http://digitransit-ui-hsl:8080; proxy_redirect off; @@ -106,7 +102,7 @@ http { } server { - server_name beta.reittiopas.fi www.reittiopas.fi m.reittiopas.fi reittiopas.fi vyohykereittiopas.hsl.fi; + server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi; listen 8080; location = /sw.js { diff --git a/test.js b/test.js index 7416373..39978d8 100644 --- a/test.js +++ b/test.js @@ -146,10 +146,7 @@ describe('api.digitransit.fi', function() { }); describe('hsl ui', function() { - testRedirect('www.beta.reittiopas.fi','/kissa','http://beta.reittiopas.fi/kissa') - testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); - testRedirect('beta.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa'); @@ -169,9 +166,6 @@ describe('hsl ui', function() { testProxying('vanha.reittiopas.hsl.fi','/','digitransit-ui-hsl:8080', true); - testRedirect('reittiopas.hsl.fi','/uudetvyohykkeet','https://reittiopas.hsl.fi', true); - testRedirect('reittiopas.hsl.fi','/uudetvyöhykkeet','https://reittiopas.hsl.fi', true); - //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); @@ -182,8 +176,6 @@ describe('hsl ui', function() { testProxying('uusi.reittiopas.fi','/kissa','digitransit-ui-hsl-next:8080', true); testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('uusi.reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); - - testRedirect('vyohykereittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa'); }); describe('matka ui', function() { From 1c44a96723266107811a6c3f9d411016d61c7947 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 22 Oct 2020 12:29:13 +0300 Subject: [PATCH 026/328] Change next ui root redirect type to permanent --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 609dacd..fb35788 100644 --- a/nginx.conf +++ b/nginx.conf @@ -258,7 +258,7 @@ http { } location = / { - return 302 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; } location / { From e5367905d0e4fe186dc6456037f3f0dd6d537e96 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 22 Oct 2020 15:00:24 +0300 Subject: [PATCH 027/328] Don't index vanha reittiopas --- nginx.conf | 39 ++++++++++++++++++++++++++++++++++++++- test.js | 1 + 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index fb35788..e732a09 100644 --- a/nginx.conf +++ b/nginx.conf @@ -67,7 +67,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi vanha.reittiopas.hsl.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -101,6 +101,43 @@ http { } } + server { + server_name vanha.reittiopas.hsl.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + + location = /sw.js { + proxy_pass http://digitransit-ui-hsl:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location / { + proxy_pass http://digitransit-ui-hsl:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + } + } + server { server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi; listen 8080; diff --git a/test.js b/test.js index 39978d8..6dbb862 100644 --- a/test.js +++ b/test.js @@ -165,6 +165,7 @@ describe('hsl ui', function() { testCaching('reittiopas.hsl.fi','/sw.js', true); testProxying('vanha.reittiopas.hsl.fi','/','digitransit-ui-hsl:8080', true); + testResponseHeader('vanha.reittiopas.hsl.fi','/kissa', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); From e7f78a9a5ff01e57e36f643f875108b9af4c4475 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 23 Oct 2020 17:05:38 +0300 Subject: [PATCH 028/328] Redirect from uusi.reittiopas.fi to uusi.reittiopas.hsl.fi --- nginx.conf | 32 +++++++++++++++++++++++++++++++- test.js | 4 ++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index e732a09..fb6870c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -260,7 +260,7 @@ http { } server { - server_name next-dev.digitransit.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; + server_name next-dev.digitransit.fi uusi.reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -307,6 +307,36 @@ http { } } + server { + server_name uusi.reittiopas.fi; + listen 8080; + + location = /sw.js { + proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location = /appcache/manifest.appcache { + proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; + default_type text/cache-manifest; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location / { + return 301 https://uusi.reittiopas.hsl.fi$request_uri; + } + } + server { server_name sentry-analytics.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 6dbb862..3758c9f 100644 --- a/test.js +++ b/test.js @@ -173,10 +173,10 @@ describe('hsl ui', function() { testRedirect('next-dev.digitransit.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-next:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); - testRedirect('uusi.reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); - testProxying('uusi.reittiopas.fi','/kissa','digitransit-ui-hsl-next:8080', true); testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('uusi.reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); + + testRedirect('uusi.reittiopas.fi','/kissa','https://uusi.reittiopas.hsl.fi/kissa'); }); describe('matka ui', function() { From 0be681ffef4c5854a7230374c8e62f1fa78b5dc1 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 9 Nov 2020 15:00:51 +0200 Subject: [PATCH 029/328] Use next-dev for reittiopas.hsl.fi and hide dev.reittiopas.fi from search engines --- nginx.conf | 39 ++------------------------------------- test.js | 4 +++- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/nginx.conf b/nginx.conf index fb6870c..f5feb04 100644 --- a/nginx.conf +++ b/nginx.conf @@ -67,42 +67,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - location = /sw.js { - proxy_pass http://digitransit-ui-hsl:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - - location / { - proxy_pass http://digitransit-ui-hsl:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - } - } - - server { - server_name vanha.reittiopas.hsl.fi; + server_name vanha.reittiopas.hsl.fi dev.reittiopas.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -260,7 +225,7 @@ http { } server { - server_name next-dev.digitransit.fi uusi.reittiopas.hsl.fi; + server_name next-dev.digitransit.fi uusi.reittiopas.hsl.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 3758c9f..ef8aa22 100644 --- a/test.js +++ b/test.js @@ -159,8 +159,10 @@ describe('hsl ui', function() { }); testProxying('dev.reittiopas.fi','/','digitransit-ui-hsl:8080', true); + testResponseHeader('dev.reittiopas.fi','/kissa', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); - testProxying('reittiopas.hsl.fi','/','digitransit-ui-hsl:8080', true); + testRedirect('reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); + testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); From b5bcc3daed3511f9c55e3864d0e1a5e32d90fe3b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 9 Nov 2020 15:07:12 +0200 Subject: [PATCH 030/328] Add root redirect to hsl.fi from domains that otherwise redirect to reittiopas.hsl.fi --- nginx.conf | 3 +++ test.js | 1 + 2 files changed, 4 insertions(+) diff --git a/nginx.conf b/nginx.conf index f5feb04..97f2225 100644 --- a/nginx.conf +++ b/nginx.conf @@ -128,6 +128,9 @@ http { 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; } + location = / { + return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + } location / { return 301 https://reittiopas.hsl.fi$request_uri; } diff --git a/test.js b/test.js index ef8aa22..c433214 100644 --- a/test.js +++ b/test.js @@ -147,6 +147,7 @@ describe('api.digitransit.fi', function() { describe('hsl ui', function() { testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); + testRedirect('reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true'); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa'); From 089c55e946d5fa26131f67f75bbf808a8b082ae1 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 16 Nov 2020 09:32:56 +0200 Subject: [PATCH 031/328] Redirect to reittiopas.hsl.fi from uusi reittiopas URLs --- nginx.conf | 34 ++-------------------------------- test.js | 4 ++-- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/nginx.conf b/nginx.conf index 97f2225..0144157 100644 --- a/nginx.conf +++ b/nginx.conf @@ -104,7 +104,7 @@ http { } server { - server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi; + server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; listen 8080; location = /sw.js { @@ -228,7 +228,7 @@ http { } server { - server_name next-dev.digitransit.fi uusi.reittiopas.hsl.fi reittiopas.hsl.fi; + server_name next-dev.digitransit.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -275,36 +275,6 @@ http { } } - server { - server_name uusi.reittiopas.fi; - listen 8080; - - location = /sw.js { - proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - location = /appcache/manifest.appcache { - proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; - default_type text/cache-manifest; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - location / { - return 301 https://uusi.reittiopas.hsl.fi$request_uri; - } - } - server { server_name sentry-analytics.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index c433214..1a1c0e6 100644 --- a/test.js +++ b/test.js @@ -177,9 +177,9 @@ describe('hsl ui', function() { testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-next:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); - testProxying('uusi.reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); + testRedirect('uusi.reittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); - testRedirect('uusi.reittiopas.fi','/kissa','https://uusi.reittiopas.hsl.fi/kissa'); + testRedirect('uusi.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); }); describe('matka ui', function() { From 27f335ae5930a85e3cc18ce4471423d832abba6c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 16 Nov 2020 15:16:57 +0200 Subject: [PATCH 032/328] Don't index old URLs for reittiopas --- nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nginx.conf b/nginx.conf index 0144157..e1bbd6f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -107,6 +107,9 @@ http { server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; listen 8080; + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + location = /sw.js { proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; proxy_set_header Host serviceworker.blob.core.windows.net; From c4a0eae17b47f9683744e50981a18e9f42e43911 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 16 Nov 2020 15:20:39 +0200 Subject: [PATCH 033/328] Add test --- test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test.js b/test.js index 1a1c0e6..4c49efa 100644 --- a/test.js +++ b/test.js @@ -149,6 +149,7 @@ describe('hsl ui', function() { testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true'); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); + testResponseHeader('www.reittiopas.fi','/', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa'); From fc23e3aaafee2a4f37a9212be98da801f9c93435 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 18 Nov 2020 13:42:36 +0200 Subject: [PATCH 034/328] Lappeenranta citybike data source --- external.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external.conf b/external.conf index f078cf5..23606a6 100644 --- a/external.conf +++ b/external.conf @@ -268,3 +268,15 @@ location /out/hameenlinna.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization HAMEENLINNA_BASIC_AUTH; } + +#lappeenranta citybike api (https://geoserver.joensuu.fi/www/digitransit/kaupunkipyoraparkit_lpr.geojson) +location /out/geoserver.joensuu.fi/www/digitransit/ { + proxy_pass https://geoserver.joensuu.fi/www/digitransit/; + include allowed-ips.conf; + proxy_cache ext_cache; + proxy_cache_valid any 3600s; + 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; +} From 0bbd9294f7656d9e02e12c53ba62d22ff275fc4c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 14:27:30 +0200 Subject: [PATCH 035/328] Add next-dev waltti domains --- nginx.conf | 26 +++++++++++++------------- test.js | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/nginx.conf b/nginx.conf index e1bbd6f..100159d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -182,19 +182,19 @@ http { } server { - server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - dev-joensuu.digitransit.fi joensuu.digitransit.fi - dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi - dev-lahti.digitransit.fi lahti.digitransit.fi - dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - dev-oulu.digitransit.fi oulu.digitransit.fi - dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi - dev-kouvola.digitransit.fi kouvola.digitransit.fi - dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi + next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + next-dev-kotka.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi + next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi + next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi + next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi + next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi + next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi + next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-salo.digitransit.fi salo.digitransit.fi reittiopas.salo.fi dev-opas.waltti.fi opas.waltti.fi; listen 8080; diff --git a/test.js b/test.js index 4c49efa..ee3cefe 100644 --- a/test.js +++ b/test.js @@ -206,6 +206,8 @@ describe('waltti ui', function() { cities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); + testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); }); From f68a0ef2a8bb7db801c31e9ff4f53d9a8f300627 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 14:28:46 +0200 Subject: [PATCH 036/328] Remove support for salo domains --- nginx.conf | 1 - test.js | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 100159d..f238c3e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -195,7 +195,6 @@ http { next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-salo.digitransit.fi salo.digitransit.fi reittiopas.salo.fi dev-opas.waltti.fi opas.waltti.fi; listen 8080; diff --git a/test.js b/test.js index ee3cefe..8f73665 100644 --- a/test.js +++ b/test.js @@ -201,7 +201,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const cities = ['hameenlinna', 'jyvaskyla', 'joensuu', 'kotka', 'kuopio', 'lahti', - 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi', 'salo']; + 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi']; cities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); @@ -228,9 +228,6 @@ describe('waltti ui', function() { testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); - testRedirect('reittiopas.salo.fi','/kissa','https://reittiopas.salo.fi/kissa'); - testProxying('reittiopas.salo.fi','/','digitransit-ui-waltti:8080', true); - it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From a7c9933a5a5ed1176f83783de61dad55c8e64903 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 14:33:39 +0200 Subject: [PATCH 037/328] Add next-dev-opas.waltti.fi domain support --- nginx.conf | 2 +- test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f238c3e..d53b6af 100644 --- a/nginx.conf +++ b/nginx.conf @@ -195,7 +195,7 @@ http { next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi; + next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 8f73665..da46fc2 100644 --- a/test.js +++ b/test.js @@ -228,6 +228,12 @@ describe('waltti ui', function() { testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); + testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); + testProxying('opas.waltti.fi','/','digitransit-ui-waltti:8080', true); + + testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); + testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti:8080', true); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 6ebd327f38b57a9fce5aa7c4203c809425d6db52 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 14:59:22 +0200 Subject: [PATCH 038/328] Add github actions --- .github/workflows/dev-pipeline.yml | 64 +++++++++++++++++++ .github/workflows/prod-pipeline.yml | 25 ++++++++ .../workflows/scripts/build_and_push_dev.sh | 23 +++++++ .github/workflows/scripts/push_prod.sh | 24 +++++++ 4 files changed, 136 insertions(+) create mode 100644 .github/workflows/dev-pipeline.yml create mode 100644 .github/workflows/prod-pipeline.yml create mode 100755 .github/workflows/scripts/build_and_push_dev.sh create mode 100755 .github/workflows/scripts/push_prod.sh diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml new file mode 100644 index 0000000..8649ba6 --- /dev/null +++ b/.github/workflows/dev-pipeline.yml @@ -0,0 +1,64 @@ +name: Process master push or pr +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + install: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Cache node modules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies + run: yarn + test: + needs: install + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Cache node modules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies + run: yarn + - name: Run tests + run: yarn test + docker-push: + if: github.ref == 'refs/heads/master' + needs: + - test + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build docker image from master and push it + run: ./.github/workflows/scripts/build_and_push_dev.sh + env: + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }} + DOCKER_BASE_TAG: latest diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml new file mode 100644 index 0000000..13cbe54 --- /dev/null +++ b/.github/workflows/prod-pipeline.yml @@ -0,0 +1,25 @@ +name: Build prod from release +on: + release: + types: + - published +jobs: + prod-push: + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Check Tag + id: check-tag + run: | + if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9]$ ]]; then + echo ::set-output name=match::true + fi + - name: Push latest image as prod + if: steps.check-tag.outputs.match == 'true' + run: ./.github/workflows/scripts/push_prod.sh + env: + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }} + DOCKER_BASE_TAG: prod + DOCKER_DEV_TAG: latest diff --git a/.github/workflows/scripts/build_and_push_dev.sh b/.github/workflows/scripts/build_and_push_dev.sh new file mode 100755 index 0000000..57d0aa5 --- /dev/null +++ b/.github/workflows/scripts/build_and_push_dev.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +DOCKER_IMAGE="hsldevcom/digitransit-proxy" +DOCKER_TAG=${DOCKER_BASE_TAG:-latest} + +COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA") + +DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-$COMMIT_HASH +DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG +DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG + +# Build image +echo "Building digitransit-proxy" +docker build --tag=$DOCKER_IMAGE_TAG_LONG . + +docker login -u $DOCKER_USER -p $DOCKER_AUTH +echo "Pushing $DOCKER_TAG image" +docker push $DOCKER_IMAGE_TAG_LONG +docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG +docker push $DOCKER_IMAGE_TAG + +echo Build completed diff --git a/.github/workflows/scripts/push_prod.sh b/.github/workflows/scripts/push_prod.sh new file mode 100755 index 0000000..8d323b6 --- /dev/null +++ b/.github/workflows/scripts/push_prod.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +DOCKER_IMAGE="hsldevcom/digitransit-proxy" +DOCKER_TAG=${DOCKER_BASE_TAG:-prod} +DOCKER_DEV_TAG=${DOCKER_DEV_TAG:-latest} + +COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA") + +DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-$COMMIT_HASH +DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG +DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG +DOCKER_IMAGE_DEV=$DOCKER_IMAGE:$DOCKER_DEV_TAG + +docker login -u $DOCKER_USER -p $DOCKER_AUTH + +echo "processing prod release" +docker pull $DOCKER_IMAGE_DEV +docker tag $DOCKER_IMAGE_DEV $DOCKER_IMAGE_TAG +docker tag $DOCKER_IMAGE_DEV $DOCKER_IMAGE_TAG_LONG +docker push $DOCKER_IMAGE_TAG +docker push $DOCKER_IMAGE_TAG_LONG + +echo Build completed From e148d9facdc39f3ae391753c1a95a43e10d6f5ae Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 15:01:09 +0200 Subject: [PATCH 039/328] Remove travis --- .travis.yml | 16 ---------------- README.md | 2 +- travis-build.sh | 51 ------------------------------------------------- 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 .travis.yml delete mode 100755 travis-build.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d96bea..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: required -branches: - only: - - master - - force-build - - /20(1[7-9]|2[0-9])[0-1][0-9][0-3][0-9]/ - -services: docker - -language: node_js - -node_js: '10' - -install: true - -script: yarn install && ./travis-build.sh \ No newline at end of file diff --git a/README.md b/README.md index 1fa42fa..da72960 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # digitransit-proxy -[![Build Status](https://travis-ci.org/HSLdevcom/digitransit-proxy.svg?branch=master)](https://travis-ci.org/HSLdevcom/digitransit-proxy) +[![Build](https://github.com/hsldevcom/digitransit-proxy/workflows/Process%20master%20push%20or%20pr/badge.svg?branch=master)](https://github.com/HSLdevcom/digitransit-proxy/actions) # Local testing in Docker Requires docker + node diff --git a/travis-build.sh b/travis-build.sh deleted file mode 100755 index 9f0e8d0..0000000 --- a/travis-build.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Set these environment variables -#DOCKER_TAG= -#DOCKER_USER= -#DOCKER_AUTH= - -set -o errexit -o nounset -o xtrace - -ORG=${ORG:-hsldevcom} -DOCKER_IMAGE=$ORG/digitransit-proxy -DOCKER_TAG="latest" - - -if [ "$TRAVIS_TAG" ]; then - DOCKER_TAG="prod" -elif [ "$TRAVIS_BRANCH" != "master" ]; then - DOCKER_TAG=$TRAVIS_BRANCH -fi - -DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-${TRAVIS_COMMIT:0:7} -DOCKER_IMAGE_LATEST=$DOCKER_IMAGE:latest -DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG -DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG - - -if [ -z $TRAVIS_TAG ]; then - # Build image - echo "Building digitransit-proxy" - ./test.sh - docker build --tag=$DOCKER_IMAGE_TAG_LONG -f Dockerfile . -fi - -if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - docker login -u ${DOCKER_USER} -p ${DOCKER_AUTH} - if [ "$TRAVIS_TAG" ];then - echo "processing release $TRAVIS_TAG" - #release do not rebuild, just tag - docker pull $DOCKER_IMAGE_LATEST - docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG - docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG_LONG - docker push $DOCKER_IMAGE_TAG - docker push $DOCKER_IMAGE_TAG_LONG - else - echo "Pushing $DOCKER_TAG image" - docker push $DOCKER_IMAGE_TAG_LONG - docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG - docker push $DOCKER_IMAGE_TAG - fi -fi - -echo Build completed From 2ae241579d714e4c2a392d149e8dc08bcc5235cc Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Dec 2020 15:12:22 +0200 Subject: [PATCH 040/328] Use own ui instance for the waltti next domains --- nginx.conf | 76 ++++++++++++++++++++++++++++++++++++++++++++---------- test.js | 4 +-- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/nginx.conf b/nginx.conf index d53b6af..da5e1e8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -182,20 +182,20 @@ http { } server { - server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi - next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - next-dev-kotka.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi - next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi - next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi - next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi - next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi - next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi; + server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + dev-joensuu.digitransit.fi joensuu.digitransit.fi + dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + dev-kotka.digitransit.fi kotka.digitransit.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-lahti.digitransit.fi lahti.digitransit.fi + dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + dev-oulu.digitransit.fi oulu.digitransit.fi + dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi + dev-kouvola.digitransit.fi kouvola.digitransit.fi + dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + dev-opas.waltti.fi opas.waltti.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -229,6 +229,54 @@ http { } } + server { + server_name next-dev-hameenlinna.digitransit.fi + next-dev-joensuu.digitransit.fi + next-dev-jyvaskyla.digitransit.fi + next-dev-kotka.digitransit.fi + next-dev-kuopio.digitransit.fi + next-dev-lahti.digitransit.fi + next-dev-lappeenranta.digitransit.fi + next-dev-mikkeli.digitransit.fi + next-dev-oulu.digitransit.fi + next-dev-turku.digitransit.fi + next-dev-tampere.digitransit.fi + next-dev-kouvola.digitransit.fi + next-dev-rovaniemi.digitransit.fi + next-dev-opas.waltti.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location = /sw.js { + proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location / { + proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + } + } + server { server_name next-dev.digitransit.fi reittiopas.hsl.fi; listen 8080; diff --git a/test.js b/test.js index da46fc2..dfcdf18 100644 --- a/test.js +++ b/test.js @@ -207,7 +207,7 @@ describe('waltti ui', function() { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); }); @@ -232,7 +232,7 @@ describe('waltti ui', function() { testProxying('opas.waltti.fi','/','digitransit-ui-waltti:8080', true); testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); - testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti:8080', true); + testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ From 024ab50062d180437846d59bba159576521c573a Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 8 Dec 2020 16:33:26 +0200 Subject: [PATCH 041/328] Add waltt-next ui api endpoint --- common.conf | 9 +++++++++ test.js | 1 + 2 files changed, 10 insertions(+) diff --git a/common.conf b/common.conf index 3ea2702..d6bad1b 100644 --- a/common.conf +++ b/common.conf @@ -364,6 +364,15 @@ location /ui/v1/hsl-next/ { # proxy_set_header X-Forwarded-Host $host; } +location /ui/v1/waltti-next/ { + rewrite /ui/v1/hsl-next/(.*) /$1 break; + proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + location /timetables/v1/hsl/ { rewrite /timetables/v1/hsl/(.*) /hsl/$1 break; proxy_pass http://hsl-timetable-container:8080; diff --git a/test.js b/test.js index dfcdf18..0f542fd 100644 --- a/test.js +++ b/test.js @@ -142,6 +142,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/ui/v1/waltti/sw.js','digitransit-ui-waltti:8080'); testProxying('api.digitransit.fi','/ui/v1/hsl/sw.js','digitransit-ui-hsl:8080'); testProxying('api.digitransit.fi','/ui/v1/hsl-next/sw.js','digitransit-ui-hsl-next:8080'); + testProxying('api.digitransit.fi','/ui/v1/waltti-next/sw.js','digitransit-ui-waltti-next:8080'); testProxying('api.digitransit.fi','/timetables/v1/hsl/stops/1010105.pdf','hsl-timetable-container:8080'); }); From e470a285531ba6dd52ae432aa35afc3679f7f5ec Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 8 Dec 2020 16:34:44 +0200 Subject: [PATCH 042/328] Reduce complexity of dev ci pipeline --- .github/workflows/dev-pipeline.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 8649ba6..aab7324 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -7,27 +7,7 @@ on: branches: - master jobs: - install: - runs-on: ubuntu-18.04 - strategy: - matrix: - node-version: [10.x] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Cache node modules - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Install dependencies - run: yarn test: - needs: install runs-on: ubuntu-18.04 strategy: matrix: @@ -39,11 +19,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: Cache node modules - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies run: yarn - name: Run tests From 1ff01403f7c0e20b3fd4314353c36032453322f0 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 8 Dec 2020 16:36:27 +0200 Subject: [PATCH 043/328] Fix typo --- common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.conf b/common.conf index d6bad1b..6a0f204 100644 --- a/common.conf +++ b/common.conf @@ -365,7 +365,7 @@ location /ui/v1/hsl-next/ { } location /ui/v1/waltti-next/ { - rewrite /ui/v1/hsl-next/(.*) /$1 break; + rewrite /ui/v1/waltti-next/(.*) /$1 break; proxy_pass http://digitransit-ui-waltti-next:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; From 96a2b3fbfd823f6b39a206619246e287af470660 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 9 Dec 2020 09:19:30 +0200 Subject: [PATCH 044/328] Update lappeenranta citybike api url --- external.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external.conf b/external.conf index 23606a6..c2e5d9f 100644 --- a/external.conf +++ b/external.conf @@ -269,9 +269,9 @@ location /out/hameenlinna.mattersoft.fi/ { proxy_set_header Authorization HAMEENLINNA_BASIC_AUTH; } -#lappeenranta citybike api (https://geoserver.joensuu.fi/www/digitransit/kaupunkipyoraparkit_lpr.geojson) -location /out/geoserver.joensuu.fi/www/digitransit/ { - proxy_pass https://geoserver.joensuu.fi/www/digitransit/; +#lappeenranta citybike api (https://ckan.saita.fi/geojson/kaupunkipyoraparkit_lpr.geojson) +location /out/ckan.saita.fi/geojson/ { + proxy_pass https://ckan.saita.fi/geojson/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid any 3600s; From f966def293003c8bbf3678565443c5a7c6ec6028 Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Mon, 15 Feb 2021 14:52:17 +0200 Subject: [PATCH 045/328] added linjasto2021 --- nginx.conf | 3 +- package-lock.json | 102 +++++++++++++++++++++++----------------------- test.js | 2 +- 3 files changed, 54 insertions(+), 53 deletions(-) diff --git a/nginx.conf b/nginx.conf index da5e1e8..5a21ad1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -195,7 +195,8 @@ http { dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi; + dev-opas.waltti.fi opas.waltti.fi + dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/package-lock.json b/package-lock.json index 77811ff..574d727 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", "dev": true, "requires": { - "assertion-error": "1.0.2", - "deep-eql": "0.1.3", - "type-detect": "1.0.0" + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" }, "dependencies": { "assertion-error": { @@ -52,11 +52,11 @@ "integrity": "sha1-VGDYA24fGhKwtbXL1Snm3B0x60s=", "dev": true, "requires": { - "cookiejar": "2.0.6", + "cookiejar": "2.0.x", "is-ip": "1.0.0", - "methods": "1.1.2", - "qs": "6.5.0", - "superagent": "2.3.0" + "methods": "^1.1.2", + "qs": "^6.2.0", + "superagent": "^2.0.0" }, "dependencies": { "async": { @@ -71,7 +71,7 @@ "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "component-emitter": { @@ -119,9 +119,9 @@ "integrity": "sha1-BaxrwiIntD5EYfSIFhVUaZ1Pi14=", "dev": true, "requires": { - "async": "1.5.2", - "combined-stream": "1.0.5", - "mime-types": "2.1.16" + "async": "^1.5.2", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.10" } }, "formidable": { @@ -142,7 +142,7 @@ "integrity": "sha1-K7aVn3l8zW+f3IEnWLy8h8TFkHQ=", "dev": true, "requires": { - "ip-regex": "1.0.3" + "ip-regex": "^1.0.0" } }, "isarray": { @@ -169,7 +169,7 @@ "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", "dev": true, "requires": { - "mime-db": "1.29.0" + "mime-db": "~1.29.0" } }, "ms": { @@ -196,13 +196,13 @@ "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" } }, "string_decoder": { @@ -211,7 +211,7 @@ "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "superagent": { @@ -220,16 +220,16 @@ "integrity": "sha1-cDUpoHFOV+EjlZ3e+84ZOy5Q0RU=", "dev": true, "requires": { - "component-emitter": "1.2.1", - "cookiejar": "2.0.6", - "debug": "2.6.8", - "extend": "3.0.1", + "component-emitter": "^1.2.0", + "cookiejar": "^2.0.6", + "debug": "^2.2.0", + "extend": "^3.0.0", "form-data": "1.0.0-rc4", - "formidable": "1.1.1", - "methods": "1.1.2", - "mime": "1.6.0", - "qs": "6.5.0", - "readable-stream": "2.3.3" + "formidable": "^1.0.17", + "methods": "^1.1.1", + "mime": "^1.3.4", + "qs": "^6.1.0", + "readable-stream": "^2.0.5" }, "dependencies": { "mime": { @@ -291,7 +291,7 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -307,7 +307,7 @@ "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "dev": true, "requires": { - "graceful-readlink": "1.0.1" + "graceful-readlink": ">= 1.0.0" } }, "concat-map": { @@ -349,12 +349,12 @@ "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-readlink": { @@ -381,8 +381,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "json3": { @@ -397,8 +397,8 @@ "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", "dev": true, "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" } }, "lodash._basecopy": { @@ -431,9 +431,9 @@ "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", "dev": true, "requires": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" + "lodash._baseassign": "^3.0.0", + "lodash._basecreate": "^3.0.0", + "lodash._isiterateecall": "^3.0.0" } }, "lodash.isarguments": { @@ -454,9 +454,9 @@ "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", "dev": true, "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" } }, "minimatch": { @@ -465,7 +465,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -495,7 +495,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "path-is-absolute": { @@ -510,7 +510,7 @@ "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } }, "wrappy": { diff --git a/test.js b/test.js index 0f542fd..80e0600 100644 --- a/test.js +++ b/test.js @@ -202,7 +202,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const cities = ['hameenlinna', 'jyvaskyla', 'joensuu', 'kotka', 'kuopio', 'lahti', - 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi']; + 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi', 'linjasto2021']; cities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); From 24e9880a63b544956c95a5eea95f3a6ce07f9f78 Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Mon, 15 Feb 2021 15:13:31 +0200 Subject: [PATCH 046/328] added lonjasto2021 for routing --- common.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common.conf b/common.conf index 6a0f204..500853a 100644 --- a/common.conf +++ b/common.conf @@ -268,6 +268,16 @@ location /routing/v1/routers/next-waltti { proxy_read_timeout 11500ms; } +location /routing/v1/routers/linjasto2021-waltti { + rewrite /routing/v1/routers/linjasto2021-waltti(.*) /otp/routers/default$1 break; + proxy_pass http://opentripplanner-linjasto2021-waltti:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-hsl:8080/; @@ -318,6 +328,16 @@ location /routing-data/v2/next-waltti { include cors.conf; } +location /routing-data/v2/linjasto2021-waltti { + rewrite /routing-data/v2/linjasto2021-waltti/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-linjasto2021-waltti:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + location /routing-data/v2/next-finland { rewrite /routing-data/v2/next-finland/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-finland:8080/; From 8df4f74c6be064ac0ffcc2d8a4e0faa62de4bde5 Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Tue, 16 Feb 2021 14:13:52 +0200 Subject: [PATCH 047/328] fix: added linjasto2021 map --- common.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common.conf b/common.conf index 500853a..ac68de8 100644 --- a/common.conf +++ b/common.conf @@ -177,6 +177,20 @@ location /map/v1/next- { # add_header X-Cache-Status $upstream_cache_status; } +location /map/v1/linjasto2021- { + rewrite /map/v1/linjasto2021-(.*) /map/v1/$1 break; + proxy_pass http://hsl-map-server-linjasto2021:8080; + # proxy_cache tiles; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache_revalidate on; + # proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + # add_header X-Cache-Status $upstream_cache_status; +} + location /map/v1/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; From d1ac6d5f4c434af1f46f1d09caacf6a0529ec959 Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Tue, 16 Feb 2021 15:34:04 +0200 Subject: [PATCH 048/328] added lmj.mattersoft.fi --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index c2e5d9f..4652c1d 100644 --- a/external.conf +++ b/external.conf @@ -123,6 +123,19 @@ location /out/tre.mattersoft.fi/ { proxy_set_header Authorization NEW_LISSU_BASIC_AUTH; } +#lmj gtfs rt new (https://lmj.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) +location /out/lmj.mattersoft.fi/ { + proxy_pass https://lmj.mattersoft.fi/; + 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; + proxy_set_header Authorization LMJ_BASIC_AUTH; +} + #lahti gtfs rt (https://lsl.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) location /out/lsl.mattersoft.fi/ { proxy_pass https://lsl.mattersoft.fi/; diff --git a/run.sh b/run.sh index ce46861..2ccfb5f 100755 --- a/run.sh +++ b/run.sh @@ -26,6 +26,7 @@ sed -i "s/MATKAHUOLTO_VANTAA_BASIC_AUTH/${MATKAHUOLTO_VANTAA_BASIC_AUTH}/" /etc/ sed -i "s/MATKAHUOLTO_VARSINAIS_BASIC_AUTH/${MATKAHUOLTO_VARSINAIS_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf +sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx diff --git a/test.sh b/test.sh index 0b11e9b..0c9b161 100755 --- a/test.sh +++ b/test.sh @@ -23,7 +23,8 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_LAPPI_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_POHJANMAA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ - -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi hsldevcom/digitransit-proxy:integrationtest` + -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ + -e LMJ_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 0fd3eaba3b221646d390460488689fb30e8403af Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 17 Feb 2021 12:42:23 +0200 Subject: [PATCH 049/328] Remove yleisviestipalvelu endpoint --- nginx.conf | 36 ------------------------------------ test.js | 9 --------- 2 files changed, 45 deletions(-) diff --git a/nginx.conf b/nginx.conf index da5e1e8..87c9319 100644 --- a/nginx.conf +++ b/nginx.conf @@ -42,7 +42,6 @@ http { proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; - proxy_cache_path /opt/nginx/yleisviesti levels=1:2 keys_zone=yleisviesti:10m max_size=200m inactive=1m use_temp_path=off; # hide server version from response server_tokens off; @@ -345,41 +344,6 @@ http { } } - server { - server_name dev-yleisviesti.digitransit.fi yleisviesti.hsl.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - location = / { - proxy_pass http://yleisviestipalvelu:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_cache yleisviesti; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host"; - 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; - } - - location / { - proxy_pass http://yleisviestipalvelu:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - } - } - server { server_name digitransit.fi www.digitransit.fi dev-site.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 0f542fd..9d96d3f 100644 --- a/test.js +++ b/test.js @@ -248,15 +248,6 @@ describe('sentry-analytics', function() { testRedirect('sentry-analytics.digitransit.fi','/kissa','https://sentry-analytics.digitransit.fi/kissa'); }); -describe('yleisviestipalvelu', function() { - testCaching('yleisviesti.hsl.fi','/', true); - testProxying('yleisviesti.hsl.fi','/','yleisviestipalvelu:8080', true); - testRedirect('yleisviesti.hsl.fi','/kissa','https://yleisviesti.hsl.fi/kissa'); - testCaching('dev-yleisviesti.digitransit.fi','/', true); - testProxying('dev-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); - testRedirect('dev-yleisviesti.digitransit.fi','/kissa','https://dev-yleisviesti.digitransit.fi/kissa'); -}); - describe('digitransit', function() { testProxying('digitransit.fi','/','digitransit-site:8080', true); }); From f9d49df71d15d127cafa939e3d45b7b713639aff Mon Sep 17 00:00:00 2001 From: Kimmo Hujanen Date: Fri, 19 Feb 2021 13:15:26 +0200 Subject: [PATCH 050/328] fix: testing --- test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test.js b/test.js index 80e0600..5d726fa 100644 --- a/test.js +++ b/test.js @@ -202,7 +202,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const cities = ['hameenlinna', 'jyvaskyla', 'joensuu', 'kotka', 'kuopio', 'lahti', - 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi', 'linjasto2021']; + 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi']; cities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); @@ -235,6 +235,9 @@ describe('waltti ui', function() { testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); + testRedirect('linjasto2021.digitransit.fi','/kissa','https://linjasto2021.digitransit.fi/kissa'); + testProxying('linjasto2021.digitransit.fi','/','digitransit-ui-waltti:8080', true); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From ae35d5b224dbbfed0ee5d2dc3dcb6323d889b05b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 25 Mar 2021 13:30:14 +0200 Subject: [PATCH 051/328] Add own ui for linjasto2021 --- common.conf | 9 +++++++++ nginx.conf | 38 ++++++++++++++++++++++++++++++++++++-- test.js | 8 +++++--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/common.conf b/common.conf index ac68de8..c2bf1bc 100644 --- a/common.conf +++ b/common.conf @@ -407,6 +407,15 @@ location /ui/v1/waltti-next/ { # proxy_set_header X-Forwarded-Host $host; } +location /ui/v1/linjasto2021/ { + rewrite /ui/v1/linjasto2021/(.*) /$1 break; + proxy_pass http://digitransit-ui-linjasto2021:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + location /timetables/v1/hsl/ { rewrite /timetables/v1/hsl/(.*) /hsl/$1 break; proxy_pass http://hsl-timetable-container:8080; diff --git a/nginx.conf b/nginx.conf index 794cd24..a97c82f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -194,8 +194,7 @@ http { dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi - dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; + dev-opas.waltti.fi opas.waltti.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -229,6 +228,41 @@ http { } } + server { + server_name dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location = /sw.js { + proxy_pass http://digitransit-ui-linjasto2021:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location / { + proxy_pass http://digitransit-ui-linjasto2021:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + } + } + server { server_name next-dev-hameenlinna.digitransit.fi next-dev-joensuu.digitransit.fi diff --git a/test.js b/test.js index 2f16eab..8984d3a 100644 --- a/test.js +++ b/test.js @@ -235,9 +235,6 @@ describe('waltti ui', function() { testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); - testRedirect('linjasto2021.digitransit.fi','/kissa','https://linjasto2021.digitransit.fi/kissa'); - testProxying('linjasto2021.digitransit.fi','/','digitransit-ui-waltti:8080', true); - it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; @@ -246,6 +243,11 @@ describe('waltti ui', function() { }); }); +describe('linjasto2021 ui', function() { + testRedirect('linjasto2021.digitransit.fi','/kissa','https://linjasto2021.digitransit.fi/kissa'); + testProxying('linjasto2021.digitransit.fi','/','digitransit-ui-linjasto2021:8080', true); +}); + describe('sentry-analytics', function() { testProxying('sentry-analytics.digitransit.fi','/','digitransit-sentry-analytics:8080', true); testRedirect('sentry-analytics.digitransit.fi','/kissa','https://sentry-analytics.digitransit.fi/kissa'); From 470cf2b678fe475291af827320a65407d81bda61 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Mar 2021 13:14:37 +0300 Subject: [PATCH 052/328] feat: error page redirection --- nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nginx.conf b/nginx.conf index a97c82f..d5b3825 100644 --- a/nginx.conf +++ b/nginx.conf @@ -390,6 +390,12 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; + } + location / { proxy_pass http://digitransit-site:8080; proxy_redirect off; From 82834f081aba4e6dd9d3df3fe641b325673c721c Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Mar 2021 13:53:48 +0300 Subject: [PATCH 053/328] fix: less indentation --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index d5b3825..9d9186e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -392,8 +392,8 @@ http { error_page 500 502 503 504 /502.html; location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; - internal; + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; } location / { From 7c11f55cfbf995caf7225a25a00e5ca747fe21cb Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Mar 2021 14:58:12 +0300 Subject: [PATCH 054/328] feat: added error page redirection for next and prod --- nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nginx.conf b/nginx.conf index 9d9186e..f4003e9 100644 --- a/nginx.conf +++ b/nginx.conf @@ -322,6 +322,12 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; + } + location = /sw.js { proxy_pass http://digitransit-ui-hsl-next:8080; proxy_redirect off; From c352b4b9ee33dc99dac485ec05ce81b6153c7a4d Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 22 Apr 2021 10:59:17 +0300 Subject: [PATCH 055/328] Remove unused realtime APIs --- common.conf | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/common.conf b/common.conf index c2bf1bc..a7a002c 100644 --- a/common.conf +++ b/common.conf @@ -90,21 +90,6 @@ location /realtime/trip-updates/v2/hsl { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -location /realtime/trip-updates-for-google/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/trip-updates-for-google/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - location /realtime/vehicle-positions/v2/hsl { proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions/v2/hsl; proxy_redirect off; @@ -113,22 +98,6 @@ location /realtime/vehicle-positions/v2/hsl { # proxy_set_header X-Forwarded-Host $host; } -location /realtime/vehicle-positions-bustram/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions-bustram/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - -location /realtime/vehicle-positions-trainmetro/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions-trainmetro/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - #"alias" for navigator-server location /realtime/vehicle-positions/v1/ { rewrite /realtime/vehicle-positions/v1/(.*) /$1 break; From 9da4e033d687855ef80252af083c28dce00943bf Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 14 May 2021 15:45:55 +0300 Subject: [PATCH 056/328] Add external endpoint for Mikkeli --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 4652c1d..f19fdca 100644 --- a/external.conf +++ b/external.conf @@ -293,3 +293,16 @@ location /out/ckan.saita.fi/geojson/ { 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; } + +#mikkeli gtfs rt (https://mikkeli.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/mikkeli.mattersoft.fi/ { + proxy_pass https://mikkeli.mattersoft.fi/; + 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; + proxy_set_header Authorization MIKKELI_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index 2ccfb5f..786cd57 100755 --- a/run.sh +++ b/run.sh @@ -27,6 +27,7 @@ sed -i "s/MATKAHUOLTO_VARSINAIS_BASIC_AUTH/${MATKAHUOLTO_VARSINAIS_BASIC_AUTH}/" sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx diff --git a/test.sh b/test.sh index 0c9b161..50b1a56 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,7 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ - -e LMJ_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 7cecb240b1ffe12d6dd49c259cd1cdc072752621 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 18 May 2021 14:25:08 +0300 Subject: [PATCH 057/328] Add external endpoint for vaasa rt APIs --- external.conf | 13 +++++++++++++ run.sh | 2 +- test.sh | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/external.conf b/external.conf index f19fdca..a791495 100644 --- a/external.conf +++ b/external.conf @@ -306,3 +306,16 @@ location /out/mikkeli.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization MIKKELI_BASIC_AUTH; } + +#vaasa gtfs rt (https://lifti.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/lifti.mattersoft.fi/ { + proxy_pass https://lifti.mattersoft.fi/; + 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; + proxy_set_header Authorization VAASA_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index 786cd57..409d454 100755 --- a/run.sh +++ b/run.sh @@ -28,7 +28,7 @@ sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf - +sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 50b1a56..46755ee 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,8 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ - -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ + -e VAASA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From b75932785b6719c3a955c479b7efaa348fac2794 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 27 May 2021 22:04:05 +0300 Subject: [PATCH 058/328] Use new UI for a few waltti cities --- nginx.conf | 15 +++++---------- test.js | 26 +++++++++++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/nginx.conf b/nginx.conf index f4003e9..07ef639 100644 --- a/nginx.conf +++ b/nginx.conf @@ -183,15 +183,10 @@ http { server { server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi - dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-mikkeli.digitransit.fi mikkeli.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi - dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-opas.waltti.fi opas.waltti.fi; @@ -266,15 +261,15 @@ http { server { server_name next-dev-hameenlinna.digitransit.fi next-dev-joensuu.digitransit.fi - next-dev-jyvaskyla.digitransit.fi + next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi next-dev-kotka.digitransit.fi - next-dev-kuopio.digitransit.fi + next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi next-dev-lahti.digitransit.fi next-dev-lappeenranta.digitransit.fi - next-dev-mikkeli.digitransit.fi + next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi next-dev-oulu.digitransit.fi - next-dev-turku.digitransit.fi - next-dev-tampere.digitransit.fi + next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi; diff --git a/test.js b/test.js index 8984d3a..81081c4 100644 --- a/test.js +++ b/test.js @@ -201,10 +201,12 @@ describe('matka ui', function() { }); describe('waltti ui', function() { - const cities = ['hameenlinna', 'jyvaskyla', 'joensuu', 'kotka', 'kuopio', 'lahti', - 'lappeenranta', 'mikkeli', 'oulu', 'turku', 'tampere', 'kouvola', 'rovaniemi']; + const legacyUICities = ['hameenlinna', 'joensuu', 'kotka', 'lahti', + 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi']; - cities.forEach(function(city) { + const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere']; + + legacyUICities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); @@ -213,20 +215,26 @@ describe('waltti ui', function() { testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); }); + newUICities.forEach(function(city) { + testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); + testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); + testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + }); + testRedirect('reittiopas.foli.fi','/kissa','https://reittiopas.foli.fi/kissa'); - testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti:8080', true); + testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('reittiopas.hameenlinna.fi','/kissa','https://reittiopas.hameenlinna.fi/kissa'); testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti:8080', true); - testRedirect('pilottirepa.tampere.fi','/kissa','https://pilottirepa.tampere.fi/kissa'); - testProxying('pilottirepa.tampere.fi','/','digitransit-ui-waltti:8080', true); - testRedirect('repa.tampere.fi','/kissa','https://repa.tampere.fi/kissa'); - testProxying('repa.tampere.fi','/','digitransit-ui-waltti:8080', true); + testProxying('repa.tampere.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('reittiopas.tampere.fi','/kissa','https://reittiopas.tampere.fi/kissa'); - testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti:8080', true); + testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-next:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); From 62eb0f77c56f54ddf9516f223d7cd3b35f8b82e5 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 28 May 2021 13:27:08 +0300 Subject: [PATCH 059/328] Add vaasa UI --- nginx.conf | 6 ++++-- test.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 07ef639..404cbcf 100644 --- a/nginx.conf +++ b/nginx.conf @@ -189,7 +189,8 @@ http { dev-oulu.digitransit.fi oulu.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi; + dev-opas.waltti.fi opas.waltti.fi + dev-vaasa.digitransit.fi vaasa.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -272,7 +273,8 @@ http { next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi - next-dev-opas.waltti.fi; + next-dev-opas.waltti.fi + next-dev-vaasa.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 81081c4..512df21 100644 --- a/test.js +++ b/test.js @@ -202,7 +202,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const legacyUICities = ['hameenlinna', 'joensuu', 'kotka', 'lahti', - 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi']; + 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi', 'vaasa']; const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere']; From a2138c3b92f1dc19b6212644c2d976d974e2f303 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 28 May 2021 13:46:10 +0300 Subject: [PATCH 060/328] DT-4675: Add city bikes to Tampere's instance Tampere city bike instance --- external.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index a791495..e8af0d6 100644 --- a/external.conf +++ b/external.conf @@ -149,7 +149,7 @@ location /out/lsl.mattersoft.fi/ { proxy_set_header Authorization LAHTI_BASIC_AUTH; } -#Vantaa scooter stations (https://en-api.sharingos.com/v1/open_api/index.ashx?t=station_list) +#Vantaa citybike stations (https://en-api.sharingos.com/v1/open_api/index.ashx?t=station_list) location /out/en-api.sharingos.com/ { proxy_pass https://en-api.sharingos.com/; include allowed-ips.conf; @@ -161,6 +161,18 @@ location /out/en-api.sharingos.com/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +#Tampere citybike stations (http://pre-openapi.sharingos.com/open_api/index.ashx?t=station_list) +location /out/pre-openapi.sharingos.com/ { + proxy_pass https://pre-openapi.sharingos.com/; + 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; +} + #Matkahuolto kainuu gtfs (https://minfoapi.matkahuolto.fi/gtfs/kainuu-fi/gtfs.zip ) location /out/minfoapi.matkahuolto.fi/gtfs/kainuu-fi/ { proxy_pass https://minfoapi.matkahuolto.fi/gtfs/kainuu-fi/; From c8b3a2e9bb916c70461e575d47bcf5364b67e2f8 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 28 May 2021 13:48:02 +0300 Subject: [PATCH 061/328] Always use new ui for vaasa --- nginx.conf | 5 ++--- test.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 404cbcf..735a6d3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -189,8 +189,7 @@ http { dev-oulu.digitransit.fi oulu.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi - dev-vaasa.digitransit.fi vaasa.digitransit.fi; + dev-opas.waltti.fi opas.waltti.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -274,7 +273,7 @@ http { next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi - next-dev-vaasa.digitransit.fi; + next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 512df21..cb4f653 100644 --- a/test.js +++ b/test.js @@ -202,9 +202,9 @@ describe('matka ui', function() { describe('waltti ui', function() { const legacyUICities = ['hameenlinna', 'joensuu', 'kotka', 'lahti', - 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi', 'vaasa']; + 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi']; - const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere']; + const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa']; legacyUICities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); From e5d8bb33ecf5604ce160019bfe06b871469265ee Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 28 May 2021 14:19:07 +0300 Subject: [PATCH 062/328] Remove s from http. --- external.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external.conf b/external.conf index e8af0d6..e795129 100644 --- a/external.conf +++ b/external.conf @@ -163,7 +163,7 @@ location /out/en-api.sharingos.com/ { #Tampere citybike stations (http://pre-openapi.sharingos.com/open_api/index.ashx?t=station_list) location /out/pre-openapi.sharingos.com/ { - proxy_pass https://pre-openapi.sharingos.com/; + proxy_pass http://pre-openapi.sharingos.com/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; From 7627f0ad0ca64b81321dbbeb41cd04900148bbb9 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 31 May 2021 11:56:19 +0300 Subject: [PATCH 063/328] Don't use HSL error page for site --- nginx.conf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index 735a6d3..b67ffe4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -392,12 +392,6 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - error_page 500 502 503 504 /502.html; - location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; - internal; - } - location / { proxy_pass http://digitransit-site:8080; proxy_redirect off; From 77c0251dcb8f9aef7d68c8c093ed3d680eaedb24 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 4 Jun 2021 12:59:52 +0300 Subject: [PATCH 064/328] Migrate to new ui Hameenlinna, Joensuu and Oulu --- nginx.conf | 11 ++++------- test.js | 7 +++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/nginx.conf b/nginx.conf index b67ffe4..33d16a4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -181,12 +181,9 @@ http { } server { - server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - dev-joensuu.digitransit.fi joensuu.digitransit.fi - dev-kotka.digitransit.fi kotka.digitransit.fi + server_name dev-kotka.digitransit.fi kotka.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-oulu.digitransit.fi oulu.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-opas.waltti.fi opas.waltti.fi; @@ -259,15 +256,15 @@ http { } server { - server_name next-dev-hameenlinna.digitransit.fi - next-dev-joensuu.digitransit.fi + server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi next-dev-kotka.digitransit.fi next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi next-dev-lahti.digitransit.fi next-dev-lappeenranta.digitransit.fi next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi + next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi diff --git a/test.js b/test.js index cb4f653..2767ffd 100644 --- a/test.js +++ b/test.js @@ -201,10 +201,9 @@ describe('matka ui', function() { }); describe('waltti ui', function() { - const legacyUICities = ['hameenlinna', 'joensuu', 'kotka', 'lahti', - 'lappeenranta', 'oulu', 'kouvola', 'rovaniemi']; + const legacyUICities = ['kotka', 'lahti', 'lappeenranta', 'kouvola', 'rovaniemi']; - const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa']; + const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', 'joensuu', 'oulu']; legacyUICities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); @@ -228,7 +227,7 @@ describe('waltti ui', function() { testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('reittiopas.hameenlinna.fi','/kissa','https://reittiopas.hameenlinna.fi/kissa'); - testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti:8080', true); + testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('repa.tampere.fi','/kissa','https://repa.tampere.fi/kissa'); testProxying('repa.tampere.fi','/','digitransit-ui-waltti-next:8080', true); From 6fcdd32f24359f3a61ac4566b31633700165cbcd Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Jun 2021 09:29:12 +0300 Subject: [PATCH 065/328] Update list of cities that get ui update --- nginx.conf | 17 +++++++---------- test.js | 7 +++++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nginx.conf b/nginx.conf index 33d16a4..49ce589 100644 --- a/nginx.conf +++ b/nginx.conf @@ -181,11 +181,8 @@ http { } server { - server_name dev-kotka.digitransit.fi kotka.digitransit.fi - dev-lahti.digitransit.fi lahti.digitransit.fi - dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-kouvola.digitransit.fi kouvola.digitransit.fi - dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + server_name dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + dev-oulu.digitransit.fi oulu.digitransit.fi dev-opas.waltti.fi opas.waltti.fi; listen 8080; @@ -259,15 +256,15 @@ http { server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - next-dev-kotka.digitransit.fi + next-dev-kotka.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi - next-dev-lahti.digitransit.fi - next-dev-lappeenranta.digitransit.fi + next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi + next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi + next-dev-oulu.digitransit.fi next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi - next-dev-kouvola.digitransit.fi + next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; diff --git a/test.js b/test.js index 2767ffd..d26117c 100644 --- a/test.js +++ b/test.js @@ -201,9 +201,12 @@ describe('matka ui', function() { }); describe('waltti ui', function() { - const legacyUICities = ['kotka', 'lahti', 'lappeenranta', 'kouvola', 'rovaniemi']; + const legacyUICities = ['oulu', 'rovaniemi']; - const newUICities = ['jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', 'joensuu', 'oulu']; + const newUICities = [ + 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', + 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola' + ]; legacyUICities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); From be016d424896172d7e73ce888311d5d3c8a74b1b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 8 Jun 2021 09:52:21 +0300 Subject: [PATCH 066/328] Add salo realtime external endpoint --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index a791495..61e6430 100644 --- a/external.conf +++ b/external.conf @@ -319,3 +319,16 @@ location /out/lifti.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization VAASA_BASIC_AUTH; } + +#salo gtfs rt (https://paikku.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/paikku.mattersoft.fi/ { + proxy_pass https://paikku.mattersoft.fi/; + 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; + proxy_set_header Authorization SALO_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index 409d454..6f1357d 100755 --- a/run.sh +++ b/run.sh @@ -29,6 +29,7 @@ sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 46755ee..653822e 100755 --- a/test.sh +++ b/test.sh @@ -25,7 +25,7 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ - -e VAASA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From aa9b0746df1de44d65fb663243a8b1cd03517f37 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 8 Jun 2021 10:47:24 +0300 Subject: [PATCH 067/328] Increase sleep before tests --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 653822e..af9b1b0 100755 --- a/test.sh +++ b/test.sh @@ -35,7 +35,7 @@ echo starting echo server... node test_server.js & PID=$! -sleep 5 +sleep 10 mocha STATUS=$? From 25c7f40d1aca75269cc181c9168e5dfb498e3049 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 11 Jun 2021 09:57:44 +0300 Subject: [PATCH 068/328] Change beta.matka.fi redirect to dev.digitransit.fi --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 49ce589..548d58c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -177,7 +177,7 @@ http { server_name beta.matka.fi; listen 8080; - return 301 https://www.liikennevirasto.fi/uutinen/-/asset_publisher/SHHdKcU2jahL/content/matka-fi-osoite-muuttuu; + return 301 https://dev.digitransit.fi; } server { From 67cda1881545b07ba78e907acb75d9edbee7b557 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 21 Jun 2021 10:06:32 +0300 Subject: [PATCH 069/328] Use new ui for waltti opas and oulu --- nginx.conf | 8 +++----- test.js | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/nginx.conf b/nginx.conf index 548d58c..ef0f184 100644 --- a/nginx.conf +++ b/nginx.conf @@ -181,9 +181,7 @@ http { } server { - server_name dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-oulu.digitransit.fi oulu.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi; + server_name dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -261,12 +259,12 @@ http { next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi + next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi - next-dev-opas.waltti.fi + next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index d26117c..e2f9595 100644 --- a/test.js +++ b/test.js @@ -201,11 +201,11 @@ describe('matka ui', function() { }); describe('waltti ui', function() { - const legacyUICities = ['oulu', 'rovaniemi']; + const legacyUICities = ['rovaniemi']; const newUICities = [ 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', - 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola' + 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu' ]; legacyUICities.forEach(function(city) { @@ -240,7 +240,7 @@ describe('waltti ui', function() { testCaching('reittiopas.tampere.fi','/sw.js', true); testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); - testProxying('opas.waltti.fi','/','digitransit-ui-waltti:8080', true); + testProxying('opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); From c3aab180dcf817e17f41f7ba3e3f501959123813 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 9 Aug 2021 20:36:58 +0300 Subject: [PATCH 070/328] Change tampere citybike external URL --- external.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external.conf b/external.conf index e795129..f0c557f 100644 --- a/external.conf +++ b/external.conf @@ -161,9 +161,9 @@ location /out/en-api.sharingos.com/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#Tampere citybike stations (http://pre-openapi.sharingos.com/open_api/index.ashx?t=station_list) -location /out/pre-openapi.sharingos.com/ { - proxy_pass http://pre-openapi.sharingos.com/; +#Tampere citybike stations (https://en-admin.sharingos.com/GBFS/1048/en/station_status.json, free_bike_status.json, system_regions.json and system_information.json) +location /out/en-admin.sharingos.com/ { + proxy_pass https://en-admin.sharingos.com/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; From fcafd9abc99f55e1d3b47fa7b39a0b42e2b721a8 Mon Sep 17 00:00:00 2001 From: Aleksi Siitari Date: Wed, 11 Aug 2021 10:16:03 +0300 Subject: [PATCH 071/328] add new location matka-fonts --- common.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common.conf b/common.conf index a7a002c..2913987 100644 --- a/common.conf +++ b/common.conf @@ -404,3 +404,14 @@ location /fonts/ { add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; } + +location /matka-fonts/ { + rewrite /matka-fonts/(.*) /$1 break; + proxy_pass https://matkafonts.blob.core.windows.net; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; +} From 6e89db2aa876d1e12a29068697ef95effde7af73 Mon Sep 17 00:00:00 2001 From: Aleksi Siitari Date: Wed, 11 Aug 2021 12:53:03 +0300 Subject: [PATCH 072/328] fix: matka font cors policy --- common.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common.conf b/common.conf index 2913987..a365f92 100644 --- a/common.conf +++ b/common.conf @@ -412,6 +412,5 @@ location /matka-fonts/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + include cors.conf; } From d9efbf2a7b6c3cbbfa33ebd15f881cfa9a57b295 Mon Sep 17 00:00:00 2001 From: Aleksi Siitari Date: Thu, 12 Aug 2021 15:04:55 +0300 Subject: [PATCH 073/328] feat: add error pages to waltti and matka uis --- nginx.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nginx.conf b/nginx.conf index ef0f184..3264fdc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -149,6 +149,12 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + location = /sw.js { proxy_pass http://digitransit-ui-default:8080; proxy_redirect off; @@ -275,6 +281,12 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + location = /sw.js { proxy_pass http://digitransit-ui-waltti-next:8080; proxy_redirect off; From 8d186f037d43d92b67ade1151101298fe636bf53 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 17 Aug 2021 11:59:45 +0300 Subject: [PATCH 074/328] Remove linjasto2021 APIs and redirect to normal journey planner --- common.conf | 43 ------------------------------------------- nginx.conf | 28 +--------------------------- test.js | 3 +-- 3 files changed, 2 insertions(+), 72 deletions(-) diff --git a/common.conf b/common.conf index a365f92..68d5334 100644 --- a/common.conf +++ b/common.conf @@ -146,20 +146,6 @@ location /map/v1/next- { # add_header X-Cache-Status $upstream_cache_status; } -location /map/v1/linjasto2021- { - rewrite /map/v1/linjasto2021-(.*) /map/v1/$1 break; - proxy_pass http://hsl-map-server-linjasto2021:8080; - # proxy_cache tiles; - # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - # proxy_cache_revalidate on; - # proxy_cache_lock on; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # add_header X-Cache-Status $upstream_cache_status; -} - location /map/v1/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; @@ -251,16 +237,6 @@ location /routing/v1/routers/next-waltti { proxy_read_timeout 11500ms; } -location /routing/v1/routers/linjasto2021-waltti { - rewrite /routing/v1/routers/linjasto2021-waltti(.*) /otp/routers/default$1 break; - proxy_pass http://opentripplanner-linjasto2021-waltti:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-hsl:8080/; @@ -311,16 +287,6 @@ location /routing-data/v2/next-waltti { include cors.conf; } -location /routing-data/v2/linjasto2021-waltti { - rewrite /routing-data/v2/linjasto2021-waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-linjasto2021-waltti:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /routing-data/v2/next-finland { rewrite /routing-data/v2/next-finland/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-finland:8080/; @@ -376,15 +342,6 @@ location /ui/v1/waltti-next/ { # proxy_set_header X-Forwarded-Host $host; } -location /ui/v1/linjasto2021/ { - rewrite /ui/v1/linjasto2021/(.*) /$1 break; - proxy_pass http://digitransit-ui-linjasto2021:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /timetables/v1/hsl/ { rewrite /timetables/v1/hsl/(.*) /hsl/$1 break; proxy_pass http://hsl-timetable-container:8080; diff --git a/nginx.conf b/nginx.conf index 3264fdc..3b92995 100644 --- a/nginx.conf +++ b/nginx.conf @@ -225,34 +225,8 @@ http { server_name dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; listen 8080; - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - location = /sw.js { - proxy_pass http://digitransit-ui-linjasto2021:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - location / { - proxy_pass http://digitransit-ui-linjasto2021:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + return 301 https://reittiopas.tampere.fi; } } diff --git a/test.js b/test.js index e2f9595..ff30689 100644 --- a/test.js +++ b/test.js @@ -254,8 +254,7 @@ describe('waltti ui', function() { }); describe('linjasto2021 ui', function() { - testRedirect('linjasto2021.digitransit.fi','/kissa','https://linjasto2021.digitransit.fi/kissa'); - testProxying('linjasto2021.digitransit.fi','/','digitransit-ui-linjasto2021:8080', true); + testRedirect('linjasto2021.digitransit.fi','/kissa','https://reittiopas.tampere.fi'); }); describe('sentry-analytics', function() { From 04ac919c87b32494db0f898c103b95aa35d3134b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 19 Aug 2021 12:42:56 +0300 Subject: [PATCH 075/328] Add kouvola external realtime endpoint --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 61e6430..672377a 100644 --- a/external.conf +++ b/external.conf @@ -332,3 +332,16 @@ location /out/paikku.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization SALO_BASIC_AUTH; } + +#kouvola gtfs rt (https://koutsi.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/koutsi.mattersoft.fi/ { + proxy_pass https://koutsi.mattersoft.fi/; + 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; + proxy_set_header Authorization KOUVOLA_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index 6f1357d..cc304fd 100755 --- a/run.sh +++ b/run.sh @@ -30,6 +30,7 @@ sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index af9b1b0..86e3c14 100755 --- a/test.sh +++ b/test.sh @@ -25,7 +25,8 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ - -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ + -e KOUVOLA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 23e62b3ec3bcfa09cd1c778c255909adf0e090e3 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 26 Aug 2021 10:20:40 +0300 Subject: [PATCH 076/328] Upgrade nginx version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d681f8..8241977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.18-alpine +FROM nginx:1.20-alpine MAINTAINER Reittiopas version: 0.1 ENV INSTALL_DIR="/opt/nginx" From 9ea3fa45864697f1e4f0b6a2c65490b7859f2218 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 1 Sep 2021 21:49:26 +0300 Subject: [PATCH 077/328] Add external endpoint for perille.fi --- external.conf | 7 +++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 672377a..fc75ccb 100644 --- a/external.conf +++ b/external.conf @@ -345,3 +345,10 @@ location /out/koutsi.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization KOUVOLA_BASIC_AUTH; } + +#perille gtfs +location /out/gtfs.perille.fi/ { + proxy_pass https://gtfs.perille.fi/; + include allowed-ips.conf; + proxy_set_header Authorization PERILLE_BASIC_AUTH; +} diff --git a/run.sh b/run.sh index cc304fd..e1979e0 100755 --- a/run.sh +++ b/run.sh @@ -31,6 +31,7 @@ sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 86e3c14..1d22a98 100755 --- a/test.sh +++ b/test.sh @@ -26,7 +26,7 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ - -e KOUVOLA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 1f3fe093567d861237e9ad2edf480d1f24e92486 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 1 Sep 2021 21:51:29 +0300 Subject: [PATCH 078/328] Remove unused matkahuolto external endpoints --- external.conf | 84 --------------------------------------------------- run.sh | 12 -------- test.sh | 6 ---- 3 files changed, 102 deletions(-) diff --git a/external.conf b/external.conf index fc75ccb..ce1f9f8 100644 --- a/external.conf +++ b/external.conf @@ -161,90 +161,6 @@ location /out/en-api.sharingos.com/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#Matkahuolto kainuu gtfs (https://minfoapi.matkahuolto.fi/gtfs/kainuu-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/kainuu-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/kainuu-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_KAINUU_BASIC_AUTH; -} - -#Matkahuolto savo gtfs (https://minfoapi.matkahuolto.fi/gtfs/savo-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/savo-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/savo-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_SAVO_BASIC_AUTH; -} - -#Matkahuolto kanta gtfs (https://minfoapi.matkahuolto.fi/gtfs/kanta-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/kanta-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/kanta-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_KANTA_BASIC_AUTH; -} - -#Matkahuolto karjala gtfs (https://minfoapi.matkahuolto.fi/gtfs/karjala-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/karjala-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/karjala-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_KARJALA_BASIC_AUTH; -} - -#Matkahuolto keski gtfs (https://minfoapi.matkahuolto.fi/gtfs/keski-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/keski-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/keski-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_KESKI_BASIC_AUTH; -} - -#Matkahuolto kyme gtfs (https://minfoapi.matkahuolto.fi/gtfs/kyme-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/kyme-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/kyme-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_KYME_BASIC_AUTH; -} - -#Matkahuolto lappi gtfs (https://minfoapi.matkahuolto.fi/gtfs/lappi-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/lappi-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/lappi-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_LAPPI_BASIC_AUTH; -} - -#Matkahuolto pohjanmaa gtfs (https://minfoapi.matkahuolto.fi/gtfs/pohjanmaa-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/pohjanmaa-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/pohjanmaa-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_POHJANMAA_BASIC_AUTH; -} - -#Matkahuolto satakunta gtfs (https://minfoapi.matkahuolto.fi/gtfs/satakunta-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/satakunta-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/satakunta-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_SATAKUNTA_BASIC_AUTH; -} - -#Matkahuolto vakka gtfs (https://minfoapi.matkahuolto.fi/gtfs/vakka-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/vakka-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/vakka-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_VAKKA_BASIC_AUTH; -} - -#Matkahuolto vantaa gtfs (https://minfoapi.matkahuolto.fi/gtfs/vantaa-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/vantaa-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/vantaa-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_VANTAA_BASIC_AUTH; -} - -#Matkahuolto varsinais gtfs (https://minfoapi.matkahuolto.fi/gtfs/varsinais-fi/gtfs.zip ) -location /out/minfoapi.matkahuolto.fi/gtfs/varsinais-fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/gtfs/varsinais-fi/; - include allowed-ips.conf; - proxy_set_header Authorization MATKAHUOLTO_VARSINAIS_BASIC_AUTH; -} - #Oulu bike stations (https://poland.nextbike.net/maps/nextbike-official.json?domains=fo) location /out/poland.nextbike.net/ { proxy_pass https://poland.nextbike.net/; diff --git a/run.sh b/run.sh index e1979e0..8664b19 100755 --- a/run.sh +++ b/run.sh @@ -12,18 +12,6 @@ sed -i "s/LINKKI_BASIC_AUTH/${LINKKI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/NEW_LISSU_BASIC_AUTH/${NEW_LISSU_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/transitdatadev/${HSL_RT_STORAGE_NAME}/" /etc/nginx/common.conf sed -i "s/LAHTI_BASIC_AUTH/${LAHTI_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_KAINUU_BASIC_AUTH/${MATKAHUOLTO_KAINUU_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_SAVO_BASIC_AUTH/${MATKAHUOLTO_SAVO_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_KANTA_BASIC_AUTH/${MATKAHUOLTO_KANTA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_KARJALA_BASIC_AUTH/${MATKAHUOLTO_KARJALA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_KESKI_BASIC_AUTH/${MATKAHUOLTO_KESKI_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_KYME_BASIC_AUTH/${MATKAHUOLTO_KYME_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_LAPPI_BASIC_AUTH/${MATKAHUOLTO_LAPPI_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_POHJANMAA_BASIC_AUTH/${MATKAHUOLTO_POHJANMAA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_SATAKUNTA_BASIC_AUTH/${MATKAHUOLTO_SATAKUNTA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_VAKKA_BASIC_AUTH/${MATKAHUOLTO_VAKKA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_VANTAA_BASIC_AUTH/${MATKAHUOLTO_VANTAA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/MATKAHUOLTO_VARSINAIS_BASIC_AUTH/${MATKAHUOLTO_VARSINAIS_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf diff --git a/test.sh b/test.sh index 1d22a98..1a635b8 100755 --- a/test.sh +++ b/test.sh @@ -17,12 +17,6 @@ echo $ADDHOSTS CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\"" \ -e JOJO_BASIC_AUTH="\"test\"" -e LAPPEENRANTA_BASIC_AUTH="\"test\"" -e LINKKI_BASIC_AUTH="\"test\"" \ -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" -e HSL_RT_STORAGE_NAME=transitdataprod \ - -e MATKAHUOLTO_KAINUU_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_SAVO_BASIC_AUTH="\"test\"" \ - -e MATKAHUOLTO_KANTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_KARJALA_BASIC_AUTH="\"test\"" \ - -e MATKAHUOLTO_KESKI_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_KYME_BASIC_AUTH="\"test\"" \ - -e MATKAHUOLTO_LAPPI_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_POHJANMAA_BASIC_AUTH="\"test\"" \ - -e MATKAHUOLTO_SATAKUNTA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VAKKA_BASIC_AUTH="\"test\"" \ - -e MATKAHUOLTO_VANTAA_BASIC_AUTH="\"test\"" -e MATKAHUOLTO_VARSINAIS_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ From 1935a1aa70bb6c86552525cf4fe0539c098ef59b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 2 Sep 2021 10:38:46 +0300 Subject: [PATCH 079/328] Increase server_names_hash_bucket_size --- nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nginx.conf b/nginx.conf index 3b92995..9a6e350 100644 --- a/nginx.conf +++ b/nginx.conf @@ -46,6 +46,9 @@ http { # hide server version from response server_tokens off; + # to get rid of a warning about server_names_hash building + server_names_hash_bucket_size 128; + # API endpoints # These domains handle only api calls, not UI # a-,b-,c- prefixes are ment to be used with map raster image multidomain support From 99ed076739aa7fe43ab30fcf8016fc67dd1c5801 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 1 Oct 2021 09:21:25 +0300 Subject: [PATCH 080/328] Temporarily disable map api --- common.conf | 23 ++--------------------- test.js | 4 ++-- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/common.conf b/common.conf index 68d5334..0975b7c 100644 --- a/common.conf +++ b/common.conf @@ -133,30 +133,11 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { } location /map/v1/next- { - rewrite /map/v1/next-(.*) /map/v1/$1 break; - proxy_pass http://hsl-map-server-next:8080; - # proxy_cache tiles; - # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - # proxy_cache_revalidate on; - # proxy_cache_lock on; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # add_header X-Cache-Status $upstream_cache_status; + return 500; } location /map/v1/ { - proxy_pass http://hsl-map-server:8080; - proxy_cache tiles; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - proxy_cache_revalidate on; - proxy_cache_lock on; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - add_header X-Cache-Status $upstream_cache_status; + return 500; } location /graphiql/ { diff --git a/test.js b/test.js index ff30689..43c590d 100644 --- a/test.js +++ b/test.js @@ -118,8 +118,8 @@ describe('api.digitransit.fi', function() { // testCaching('api.digitransit.fi','/realtime/vehicle-positions/v1/foo',false); testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); - testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); + // testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); + // testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 3657e3a5e094a34d661f9605fe83051332a1d5dd Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 1 Oct 2021 12:29:50 +0300 Subject: [PATCH 081/328] Revert "Temporarily disable map api" This reverts commit 99ed076739aa7fe43ab30fcf8016fc67dd1c5801. --- common.conf | 23 +++++++++++++++++++++-- test.js | 4 ++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/common.conf b/common.conf index 0975b7c..68d5334 100644 --- a/common.conf +++ b/common.conf @@ -133,11 +133,30 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { } location /map/v1/next- { - return 500; + rewrite /map/v1/next-(.*) /map/v1/$1 break; + proxy_pass http://hsl-map-server-next:8080; + # proxy_cache tiles; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache_revalidate on; + # proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + # add_header X-Cache-Status $upstream_cache_status; } location /map/v1/ { - return 500; + proxy_pass http://hsl-map-server:8080; + proxy_cache tiles; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_revalidate on; + proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header X-Cache-Status $upstream_cache_status; } location /graphiql/ { diff --git a/test.js b/test.js index 43c590d..ff30689 100644 --- a/test.js +++ b/test.js @@ -118,8 +118,8 @@ describe('api.digitransit.fi', function() { // testCaching('api.digitransit.fi','/realtime/vehicle-positions/v1/foo',false); testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); - // testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - // testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); + testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 69f4af00d634c9f5a21aeceab6cc9b0b55f2c8d5 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 11 Oct 2021 13:15:35 +0300 Subject: [PATCH 082/328] Use dev.reittiopas.fi for new ui and redirect from vanha.reittiopas.hsl.fi to reittopas.hsl.fi/etusivu --- nginx.conf | 36 +++--------------------------------- test.js | 6 ++---- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/nginx.conf b/nginx.conf index 9a6e350..88911f3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -69,40 +69,10 @@ http { } server { - server_name vanha.reittiopas.hsl.fi dev.reittiopas.fi; + server_name vanha.reittiopas.hsl.fi; listen 8080; - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - # Prevent search engines from indexing the site - add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; - - location = /sw.js { - proxy_pass http://digitransit-ui-hsl:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - - location / { - proxy_pass http://digitransit-ui-hsl:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - } + return 301 https://reittiopas.hsl.fi/etusivu; } server { @@ -289,7 +259,7 @@ http { } server { - server_name next-dev.digitransit.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi next-dev.digitransit.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index ff30689..d981689 100644 --- a/test.js +++ b/test.js @@ -161,16 +161,14 @@ describe('hsl ui', function() { }); }); - testProxying('dev.reittiopas.fi','/','digitransit-ui-hsl:8080', true); - testResponseHeader('dev.reittiopas.fi','/kissa', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); + testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-next:8080', true); testRedirect('reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); - testProxying('vanha.reittiopas.hsl.fi','/','digitransit-ui-hsl:8080', true); - testResponseHeader('vanha.reittiopas.hsl.fi','/kissa', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); + testRedirect('vanha.reittiopas.hsl.fi','/','https://reittiopas.hsl.fi/etusivu'); //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); From 52f9b7be7b82037872b2a0ffd230491152f2126f Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 26 Oct 2021 10:32:31 +0300 Subject: [PATCH 083/328] Use new ui for rovaniemi --- nginx.conf | 37 +------------------------------------ test.js | 15 ++------------- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/nginx.conf b/nginx.conf index 88911f3..04ad432 100644 --- a/nginx.conf +++ b/nginx.conf @@ -159,41 +159,6 @@ http { return 301 https://dev.digitransit.fi; } - server { - server_name dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - location = /sw.js { - proxy_pass http://digitransit-ui-waltti:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - - location / { - proxy_pass http://digitransit-ui-waltti:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - } - } - server { server_name dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; listen 8080; @@ -216,7 +181,7 @@ http { next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi - next-dev-rovaniemi.digitransit.fi + next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index d981689..32cb0e6 100644 --- a/test.js +++ b/test.js @@ -199,23 +199,12 @@ describe('matka ui', function() { }); describe('waltti ui', function() { - const legacyUICities = ['rovaniemi']; - - const newUICities = [ + const walttiCities = [ 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu' ]; - legacyUICities.forEach(function(city) { - testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); - testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); - testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); - testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); - testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true); - }); - - newUICities.forEach(function(city) { + walttiCities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); From 54170534ab8b40357a827f1d38e7daf2afccad1c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 26 Oct 2021 10:34:18 +0300 Subject: [PATCH 084/328] Add rovaniemi to tested cities --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 32cb0e6..d6bfe9b 100644 --- a/test.js +++ b/test.js @@ -201,7 +201,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', - 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu' + 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu', 'rovaniemi' ]; walttiCities.forEach(function(city) { From 61718970b7062a9542a13de443da3b34e3f0e726 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 8 Nov 2021 14:04:22 +0200 Subject: [PATCH 085/328] Add v2 map endpoint --- common.conf | 13 +++++++++++++ test.js | 1 + 2 files changed, 14 insertions(+) diff --git a/common.conf b/common.conf index 68d5334..243da75 100644 --- a/common.conf +++ b/common.conf @@ -159,6 +159,19 @@ location /map/v1/ { add_header X-Cache-Status $upstream_cache_status; } +location /map/v2/ { + proxy_pass http://hsl-map-server:8080; + proxy_cache tiles; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_revalidate on; + proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header X-Cache-Status $upstream_cache_status; +} + location /graphiql/ { proxy_pass http://graphiql:8080; proxy_redirect off; diff --git a/test.js b/test.js index d6bfe9b..2a2ef20 100644 --- a/test.js +++ b/test.js @@ -120,6 +120,7 @@ describe('api.digitransit.fi', function() { //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); + testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From 91b10aa61eaad8f23358b5f00bef2ce707937928 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 16 Nov 2021 14:20:30 +0200 Subject: [PATCH 086/328] Add external endpoint for liipi test API --- external.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external.conf b/external.conf index d04ce48..caa929e 100644 --- a/external.conf +++ b/external.conf @@ -34,6 +34,18 @@ location /out/p.hsl.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +#hsl test park api https://test.liipi.hsldev.com/api/v1/facilities.json?limit=-1 +location /out/test.liipi.hsldev.com/ { + proxy_pass https://test.liipi.hsldev.com/; + 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; +} + #oulu realtime api (http://92.62.36.215/RTIX/trip-update) location /out/92.62.36.215/ { proxy_pass http://92.62.36.215/; From 8a9335c45f398823a18321a96aee7245fbfd2b12 Mon Sep 17 00:00:00 2001 From: Aleksi Date: Thu, 16 Dec 2021 13:43:56 +0200 Subject: [PATCH 087/328] allow /haku location to be rendered in iframe --- basicsettings.conf | 4 +++ nginx.conf | 67 +++++++++++++++++++--------------------------- 2 files changed, 32 insertions(+), 39 deletions(-) create mode 100644 basicsettings.conf diff --git a/basicsettings.conf b/basicsettings.conf new file mode 100644 index 0000000..d044a0e --- /dev/null +++ b/basicsettings.conf @@ -0,0 +1,4 @@ +proxy_redirect off; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Host $host; \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 04ad432..3a127dd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -103,6 +103,10 @@ http { 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; } + location = /haku { + proxy_hide_header X-Frame-Options; + include basicsettings.conf; + } location = / { return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; } @@ -130,10 +134,7 @@ http { location = /sw.js { proxy_pass http://digitransit-ui-default:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; proxy_cache_lock on; @@ -142,13 +143,14 @@ http { 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; } - + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-default:8080; + include basicsettings.conf; + } location / { proxy_pass http://digitransit-ui-default:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; } } @@ -201,10 +203,7 @@ http { location = /sw.js { proxy_pass http://digitransit-ui-waltti-next:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; proxy_cache_lock on; @@ -213,13 +212,14 @@ http { 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; } - + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-waltti-next:8080; + include basicsettings.conf; + } location / { proxy_pass http://digitransit-ui-waltti-next:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; } } @@ -242,10 +242,7 @@ http { location = /sw.js { proxy_pass http://digitransit-ui-hsl-next:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; proxy_cache_lock on; @@ -258,22 +255,20 @@ http { location /local-storage-emitter { proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-hsl-next:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-hsl-next:8080; + include basicsettings.conf; } - location = / { return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; } location / { proxy_pass http://digitransit-ui-hsl-next:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; } } @@ -290,10 +285,7 @@ http { location / { proxy_pass http://digitransit-sentry-analytics:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; } } @@ -310,10 +302,7 @@ http { location / { proxy_pass http://digitransit-site:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; + include basicsettings.conf; } } From aad18efe3d7dfac51089996bbeb9e7d0b9ee10b4 Mon Sep 17 00:00:00 2001 From: Aleksi Date: Thu, 16 Dec 2021 14:15:55 +0200 Subject: [PATCH 088/328] add tests to /haku xframe options header --- nginx.conf | 5 +---- test.js | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 3a127dd..fb3ef7a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -103,10 +103,7 @@ http { 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; } - location = /haku { - proxy_hide_header X-Frame-Options; - include basicsettings.conf; - } + location = / { return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; } diff --git a/test.js b/test.js index 2a2ef20..e066802 100644 --- a/test.js +++ b/test.js @@ -152,6 +152,8 @@ describe('hsl ui', function() { testRedirect('reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true'); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); testResponseHeader('www.reittiopas.fi','/', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); + testRedirect('reittiopas.fi','/haku','https://reittiopas.hsl.fi/haku'); + testResponseHeader('www.reittiopas.fi','/haku', 'X-Frame-Options', undefined); testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa'); @@ -230,6 +232,9 @@ describe('waltti ui', function() { testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); testProxying('opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); + testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); + testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); + testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); From 9d38f8d6d360840f842d8a820952314d2db62631 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 17 Jan 2022 18:11:54 +0200 Subject: [PATCH 089/328] Remove next-hsl and next-finland routing endpoints and add v2 --- common.conf | 70 +++++++++++++++++++++++++++++++++++++++++------------ test.js | 18 +++++++++----- 2 files changed, 67 insertions(+), 21 deletions(-) diff --git a/common.conf b/common.conf index 243da75..78752c6 100644 --- a/common.conf +++ b/common.conf @@ -220,9 +220,9 @@ location /routing/v1/routers/waltti/profile { deny all; } -location /routing/v1/routers/next-finland { - rewrite /routing/v1/routers/next-finland(.*) /otp/routers/finland$1 break; - proxy_pass http://opentripplanner-finland:8080/; +location /routing/v2/routers/finland { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -230,9 +230,29 @@ location /routing/v1/routers/next-finland { proxy_read_timeout 29500ms; } -location /routing/v1/routers/next-hsl { - rewrite /routing/v1/routers/next-hsl(.*) /otp/routers/hsl$1 break; - proxy_pass http://opentripplanner-hsl:8080/; +location /routing/v2/routers/waltti { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + +location /routing/v2/routers/waltti-alt { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + +location /routing/v2/routers/hsl { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -280,9 +300,9 @@ location /routing-data/v2/finland { include cors.conf; } -location /routing-data/v2/next-hsl { - rewrite /routing-data/v2/next-hsl/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-hsl:8080/; +location /routing-data/v3/hsl { + rewrite /routing-data/v3/hsl/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-hsl-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -290,9 +310,9 @@ location /routing-data/v2/next-hsl { include cors.conf; } -location /routing-data/v2/next-waltti { - rewrite /routing-data/v2/next-waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-next-waltti:8080/; +location /routing-data/v3/waltti { + rewrite /routing-data/v3/waltti/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-waltti-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -300,9 +320,29 @@ location /routing-data/v2/next-waltti { include cors.conf; } -location /routing-data/v2/next-finland { - rewrite /routing-data/v2/next-finland/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-finland:8080/; +location /routing-data/v3/waltti-alt { + rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + +location /routing-data/v3/finland { + rewrite /routing-data/v3/finland/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-finland-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + +location /routing-data/v2/next-waltti { + rewrite /routing-data/v2/next-waltti/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-next-waltti:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/test.js b/test.js index e066802..fc81d47 100644 --- a/test.js +++ b/test.js @@ -124,8 +124,10 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); - testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-finland','opentripplanner-finland:8080'); - testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-hsl','opentripplanner-hsl:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2/routers/finland','opentripplanner-finland-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-next-waltti:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); @@ -133,12 +135,16 @@ describe('api.digitransit.fi', function() { testResponseHeader('api.digitransit.fi','/routing-data/v2/waltti/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-con-finland:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v2/next-hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-hsl/router-config.json', 'access-control-allow-origin', '*'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-con-hsl-v3:8080'); + testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/hsl/router-config.json', 'access-control-allow-origin', '*'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-con-waltti-v3:8080'); + testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti/router-config.json', 'access-control-allow-origin', '*'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080'); + testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080'); + testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-next-waltti:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v2/next-finland/router-finland.zip','opentripplanner-data-con-finland:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-default:8080'); testProxying('api.digitransit.fi','/ui/v1/waltti/sw.js','digitransit-ui-waltti:8080'); testProxying('api.digitransit.fi','/ui/v1/hsl/sw.js','digitransit-ui-hsl:8080'); From e5cdd69584f11d8a4ad987d38c8818380e959f14 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 17 Jan 2022 18:34:45 +0200 Subject: [PATCH 090/328] Use waltti-alt as backend for next-waltti --- common.conf | 4 ++-- test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common.conf b/common.conf index 78752c6..fbb3665 100644 --- a/common.conf +++ b/common.conf @@ -262,7 +262,7 @@ location /routing/v2/routers/hsl { location /routing/v1/routers/next-waltti { rewrite /routing/v1/routers/next-waltti(.*) /otp/routers/default$1 break; - proxy_pass http://opentripplanner-next-waltti:8080/; + proxy_pass http://opentripplanner-waltti-alt-v2:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -342,7 +342,7 @@ location /routing-data/v3/finland { location /routing-data/v2/next-waltti { rewrite /routing-data/v2/next-waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-next-waltti:8080/; + proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/test.js b/test.js index fc81d47..f9a5db2 100644 --- a/test.js +++ b/test.js @@ -128,7 +128,7 @@ describe('api.digitransit.fi', function() { testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-next-waltti:8080'); + testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); @@ -143,7 +143,7 @@ describe('api.digitransit.fi', function() { testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-next-waltti:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-default:8080'); testProxying('api.digitransit.fi','/ui/v1/waltti/sw.js','digitransit-ui-waltti:8080'); From 814cabd2d3a1b82333c748fd2a34899b48221b16 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 21 Jan 2022 13:58:18 +0200 Subject: [PATCH 091/328] Refactor old UIs to use v2 uis and new to use v3 --- common.conf | 62 +++++++++++++---- nginx.conf | 193 +++++++++++++++++++++++++++++++++++++++++++++------- test.js | 40 ++++++----- 3 files changed, 238 insertions(+), 57 deletions(-) diff --git a/common.conf b/common.conf index fbb3665..4565381 100644 --- a/common.conf +++ b/common.conf @@ -352,43 +352,79 @@ location /routing-data/v2/next-waltti { location /ui/v1/finland/ { rewrite /ui/v1/finland/(.*) /$1 break; - proxy_pass http://digitransit-ui-default:8080; + proxy_pass http://digitransit-ui-matka-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; } -location /ui/v1/waltti/ { - rewrite /ui/v1/waltti/(.*) /$1 break; - proxy_pass http://digitransit-ui-waltti:8080; +location /ui/v1/hsl-next/ { + rewrite /ui/v1/hsl-next/(.*) /$1 break; + proxy_pass http://digitransit-ui-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; } -location /ui/v1/hsl/ { - rewrite /ui/v1/hsl/(.*) /$1 break; - proxy_pass http://digitransit-ui-hsl:8080; +location /ui/v1/waltti-next/ { + rewrite /ui/v1/waltti-next/(.*) /$1 break; + proxy_pass http://digitransit-ui-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; } -location /ui/v1/hsl-next/ { - rewrite /ui/v1/hsl-next/(.*) /$1 break; - proxy_pass http://digitransit-ui-hsl-next:8080; +location /ui/v2/matka/ { + rewrite /ui/v2/matka/(.*) /$1 break; + proxy_pass http://digitransit-ui-matka-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; } -location /ui/v1/waltti-next/ { - rewrite /ui/v1/waltti-next/(.*) /$1 break; - proxy_pass http://digitransit-ui-waltti-next:8080; +location /ui/v2/hsl/ { + rewrite /ui/v2/hsl/(.*) /$1 break; + proxy_pass http://digitransit-ui-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + +location /ui/v2/waltti/ { + rewrite /ui/v2/waltti/(.*) /$1 break; + proxy_pass http://digitransit-ui-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + +location /ui/v3/matka/ { + rewrite /ui/v3/matka/(.*) /$1 break; + proxy_pass http://digitransit-ui-matka-v3:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + +location /ui/v3/hsl/ { + rewrite /ui/v3/hsl/(.*) /$1 break; + proxy_pass http://digitransit-ui-hsl-v3:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + +location /ui/v3/waltti/ { + rewrite /ui/v3/waltti/(.*) /$1 break; + proxy_pass http://digitransit-ui-waltti-v3:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/nginx.conf b/nginx.conf index fb3ef7a..4c3cd54 100644 --- a/nginx.conf +++ b/nginx.conf @@ -130,7 +130,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-default:8080; + proxy_pass http://digitransit-ui-matka-v2:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -142,11 +142,50 @@ http { } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-default:8080; + proxy_pass http://digitransit-ui-matka-v2:8080; include basicsettings.conf; } location / { - proxy_pass http://digitransit-ui-default:8080; + proxy_pass http://digitransit-ui-matka-v2:8080; + include basicsettings.conf; + } + } + + server { + server_name next-dev-matka.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-matka-v3:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-matka-v3:8080; + include basicsettings.conf; + } + location / { + proxy_pass http://digitransit-ui-matka-v3:8080; include basicsettings.conf; } } @@ -168,21 +207,74 @@ http { } server { - server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi - next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - next-dev-kotka.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi - next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi - next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi - next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi - next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi - next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi - next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; + server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + dev-joensuu.digitransit.fi joensuu.digitransit.fi + dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + dev-kotka.digitransit.fi kotka.digitransit.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-lahti.digitransit.fi lahti.digitransit.fi + dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + dev-oulu.digitransit.fi oulu.digitransit.fi + dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi + dev-kouvola.digitransit.fi kouvola.digitransit.fi + dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + dev-opas.waltti.fi opas.waltti.fi + dev-vaasa.digitransit.fi vaasa.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-waltti-v2:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-waltti-v2:8080; + include basicsettings.conf; + } + location / { + proxy_pass http://digitransit-ui-waltti-v2:8080; + include basicsettings.conf; + } + } + + server { + server_name next-dev-hameenlinna.digitransit.fi + next-dev-joensuu.digitransit.fi + next-dev-jyvaskyla.digitransit.fi + next-dev-kotka.digitransit.fi + next-dev-kuopio.digitransit.fi + next-dev-lahti.digitransit.fi + next-dev-lappeenranta.digitransit.fi + next-dev-mikkeli.digitransit.fi + next-dev-oulu.digitransit.fi + next-dev-turku.digitransit.fi + next-dev-tampere.digitransit.fi + next-dev-kouvola.digitransit.fi + next-dev-rovaniemi.digitransit.fi + next-dev-opas.waltti.fi + next-dev-vaasa.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -199,7 +291,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_pass http://digitransit-ui-waltti-v3:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -211,17 +303,66 @@ http { } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_pass http://digitransit-ui-waltti-v3:8080; include basicsettings.conf; } location / { - proxy_pass http://digitransit-ui-waltti-next:8080; + proxy_pass http://digitransit-ui-waltti-v3:8080; + include basicsettings.conf; + } + } + + server { + server_name dev.reittiopas.fi reittiopas.hsl.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-hsl-v2:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location /local-storage-emitter { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-hsl-v2:8080; + include basicsettings.conf; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-hsl-v2:8080; + include basicsettings.conf; + } + location = / { + return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + } + + location / { + proxy_pass http://digitransit-ui-hsl-v2:8080; include basicsettings.conf; } } server { - server_name dev.reittiopas.fi next-dev.digitransit.fi reittiopas.hsl.fi; + server_name next-dev.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -238,7 +379,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-hsl-next:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -251,12 +392,12 @@ http { location /local-storage-emitter { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-next:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-next:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } location = / { @@ -264,7 +405,7 @@ http { } location / { - proxy_pass http://digitransit-ui-hsl-next:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } } diff --git a/test.js b/test.js index f9a5db2..26cf9b0 100644 --- a/test.js +++ b/test.js @@ -145,11 +145,15 @@ describe('api.digitransit.fi', function() { testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-default:8080'); - testProxying('api.digitransit.fi','/ui/v1/waltti/sw.js','digitransit-ui-waltti:8080'); - testProxying('api.digitransit.fi','/ui/v1/hsl/sw.js','digitransit-ui-hsl:8080'); - testProxying('api.digitransit.fi','/ui/v1/hsl-next/sw.js','digitransit-ui-hsl-next:8080'); - testProxying('api.digitransit.fi','/ui/v1/waltti-next/sw.js','digitransit-ui-waltti-next:8080'); + testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-matka-v2:8080'); + testProxying('api.digitransit.fi','/ui/v1/hsl-next/sw.js','digitransit-ui-hsl-v2:8080'); + testProxying('api.digitransit.fi','/ui/v1/waltti-next/sw.js','digitransit-ui-waltti-v2:8080'); + testProxying('api.digitransit.fi','/ui/v2/matka/sw.js','digitransit-ui-matka-v2:8080'); + testProxying('api.digitransit.fi','/ui/v2/hsl/sw.js','digitransit-ui-hsl-v2:8080'); + testProxying('api.digitransit.fi','/ui/v2/waltti/sw.js','digitransit-ui-waltti-v2:8080'); + testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); + testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); + testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); testProxying('api.digitransit.fi','/timetables/v1/hsl/stops/1010105.pdf','hsl-timetable-container:8080'); }); @@ -170,10 +174,10 @@ describe('hsl ui', function() { }); }); - testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-next:8080', true); + testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-v2:8080', true); testRedirect('reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); - testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-next:8080', true); + testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); @@ -183,7 +187,7 @@ describe('hsl ui', function() { testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); - testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-next:8080', true); + testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-v3:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testRedirect('uusi.reittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); @@ -195,7 +199,7 @@ describe('matka ui', function() { testRedirect('www.opas.matka.fi','/kissa','http://opas.matka.fi/kissa'); testRedirect('opas.matka.fi','/kissa','https://opas.matka.fi/kissa'); - testProxying('opas.matka.fi','/','digitransit-ui-default:8080', true); + testProxying('opas.matka.fi','/','digitransit-ui-matka-v2:8080', true); testCaching('opas.matka.fi','/sw.js', true); @@ -215,34 +219,34 @@ describe('waltti ui', function() { walttiCities.forEach(function(city) { testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); - testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); - testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-v2:8080', true); }); testRedirect('reittiopas.foli.fi','/kissa','https://reittiopas.foli.fi/kissa'); - testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('reittiopas.hameenlinna.fi','/kissa','https://reittiopas.hameenlinna.fi/kissa'); - testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('repa.tampere.fi','/kissa','https://repa.tampere.fi/kissa'); - testProxying('repa.tampere.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('repa.tampere.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('reittiopas.tampere.fi','/kissa','https://reittiopas.tampere.fi/kissa'); - testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-v2:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); - testProxying('opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('opas.waltti.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); - testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true); + testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ From cb340507e29d21b29bfb15e2ea049a6e9a4c1880 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 21 Jan 2022 14:07:54 +0200 Subject: [PATCH 092/328] Remove support for some old unused domains --- nginx.conf | 11 ++--------- test.js | 9 +-------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/nginx.conf b/nginx.conf index 4c3cd54..827bc5f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -69,14 +69,7 @@ http { } server { - server_name vanha.reittiopas.hsl.fi; - listen 8080; - - return 301 https://reittiopas.hsl.fi/etusivu; - } - - server { - server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; + server_name www.reittiopas.fi reittiopas.fi; listen 8080; # Prevent search engines from indexing the site @@ -113,7 +106,7 @@ http { } server { - server_name dev.digitransit.fi beta.digitransit.fi opas.matka.fi; + server_name dev.digitransit.fi opas.matka.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 26cf9b0..60c58fb 100644 --- a/test.js +++ b/test.js @@ -164,11 +164,10 @@ describe('hsl ui', function() { testResponseHeader('www.reittiopas.fi','/', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('reittiopas.fi','/haku','https://reittiopas.hsl.fi/haku'); testResponseHeader('www.reittiopas.fi','/haku', 'X-Frame-Options', undefined); - testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa'); it('https should not redirect', function(done) { - httpsGet('beta.digitransit.fi','/kissa').end((err,res)=>{ + httpsGet('reittiopas.hsl.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; done(); }); @@ -181,18 +180,12 @@ describe('hsl ui', function() { testCaching('reittiopas.hsl.fi','/sw.js', true); - testRedirect('vanha.reittiopas.hsl.fi','/','https://reittiopas.hsl.fi/etusivu'); - //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-v3:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); - testRedirect('uusi.reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); - testRedirect('uusi.reittiopas.hsl.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); - - testRedirect('uusi.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); }); describe('matka ui', function() { From a0018b6f90468bc22ec8709f3de6414058360e9c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 31 Jan 2022 13:03:08 +0200 Subject: [PATCH 093/328] Remove redirect from next-dev to hsl.fi and update hsl.fi url for tests --- nginx.conf | 3 --- test.js | 5 ++--- test.sh | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index 827bc5f..1073821 100644 --- a/nginx.conf +++ b/nginx.conf @@ -393,9 +393,6 @@ http { proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } - location = / { - return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; - } location / { proxy_pass http://digitransit-ui-hsl-v3:8080; diff --git a/test.js b/test.js index 60c58fb..7204c6d 100644 --- a/test.js +++ b/test.js @@ -159,7 +159,7 @@ describe('api.digitransit.fi', function() { describe('hsl ui', function() { testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); - testRedirect('reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true'); + testRedirect('reittiopas.fi','/','https://hsl.fi/?fromJourneyPlanner=true'); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); testResponseHeader('www.reittiopas.fi','/', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('reittiopas.fi','/haku','https://reittiopas.hsl.fi/haku'); @@ -175,7 +175,7 @@ describe('hsl ui', function() { testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-v2:8080', true); - testRedirect('reittiopas.hsl.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); + testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); @@ -183,7 +183,6 @@ describe('hsl ui', function() { //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); - testRedirect('next-dev.digitransit.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true', true); testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-v3:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); }); diff --git a/test.sh b/test.sh index 1a635b8..426bceb 100755 --- a/test.sh +++ b/test.sh @@ -17,7 +17,7 @@ echo $ADDHOSTS CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\"" \ -e JOJO_BASIC_AUTH="\"test\"" -e LAPPEENRANTA_BASIC_AUTH="\"test\"" -e LINKKI_BASIC_AUTH="\"test\"" \ -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" -e HSL_RT_STORAGE_NAME=transitdataprod \ - -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=uusi.hsl.fi \ + -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` From 66b74c01d4abefd67c2d8944c21cfa1829254a41 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 4 Feb 2022 11:16:19 +0200 Subject: [PATCH 094/328] Revert "Merge pull request #146 from HSLdevcom/remove-yleisviesti" This reverts commit 78b456e7b4471e5c984281f0747931ebfd3dfa67, reversing changes made to b2ffe1b6de9e5f13f2ca558f5e59a2d7b0c78b37. --- nginx.conf | 36 ++++++++++++++++++++++++++++++++++++ test.js | 9 +++++++++ 2 files changed, 45 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1073821..c5bdf5e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -42,6 +42,7 @@ http { proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; + proxy_cache_path /opt/nginx/yleisviesti levels=1:2 keys_zone=yleisviesti:10m max_size=200m inactive=1m use_temp_path=off; # hide server version from response server_tokens off; @@ -417,6 +418,41 @@ http { } } + server { + server_name dev-yleisviesti.digitransit.fi yleisviesti.hsl.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location = / { + proxy_pass http://yleisviestipalvelu:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_cache yleisviesti; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host"; + 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; + } + + location / { + proxy_pass http://yleisviestipalvelu:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + } + } + server { server_name digitransit.fi www.digitransit.fi dev-site.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 7204c6d..86aee75 100644 --- a/test.js +++ b/test.js @@ -257,6 +257,15 @@ describe('sentry-analytics', function() { testRedirect('sentry-analytics.digitransit.fi','/kissa','https://sentry-analytics.digitransit.fi/kissa'); }); +describe('yleisviestipalvelu', function() { + testCaching('yleisviesti.hsl.fi','/', true); + testProxying('yleisviesti.hsl.fi','/','yleisviestipalvelu:8080', true); + testRedirect('yleisviesti.hsl.fi','/kissa','https://yleisviesti.hsl.fi/kissa'); + testCaching('dev-yleisviesti.digitransit.fi','/', true); + testProxying('dev-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); + testRedirect('dev-yleisviesti.digitransit.fi','/kissa','https://dev-yleisviesti.digitransit.fi/kissa'); +}); + describe('digitransit', function() { testProxying('digitransit.fi','/','digitransit-site:8080', true); }); From 74ee4ad6d89a95aa6cb4807961c2ae43864853f7 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 4 Feb 2022 11:42:45 +0200 Subject: [PATCH 095/328] chore: configure matka-yleisviesti --- nginx.conf | 2 +- test.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index c5bdf5e..f96edd2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -419,7 +419,7 @@ http { } server { - server_name dev-yleisviesti.digitransit.fi yleisviesti.hsl.fi; + server_name dev-matka-yleisviesti.digitransit.fi matka-yleisviesti.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 86aee75..b5f9639 100644 --- a/test.js +++ b/test.js @@ -258,12 +258,12 @@ describe('sentry-analytics', function() { }); describe('yleisviestipalvelu', function() { - testCaching('yleisviesti.hsl.fi','/', true); - testProxying('yleisviesti.hsl.fi','/','yleisviestipalvelu:8080', true); - testRedirect('yleisviesti.hsl.fi','/kissa','https://yleisviesti.hsl.fi/kissa'); - testCaching('dev-yleisviesti.digitransit.fi','/', true); - testProxying('dev-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); - testRedirect('dev-yleisviesti.digitransit.fi','/kissa','https://dev-yleisviesti.digitransit.fi/kissa'); + testCaching('matka-yleisviesti.digitransit.fi','/', true); + testProxying('matka-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); + testRedirect('matka-yleisviesti.digitransit.fi','/kissa','https://matka-yleisviesti.digitransit.fi/kissa'); + testCaching('dev-matka-yleisviesti.digitransit.fi','/', true); + testProxying('dev-matka-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); + testRedirect('dev-matka-yleisviesti.digitransit.fi','/kissa','https://dev-matka-yleisviesti.digitransit.fi/kissa'); }); describe('digitransit', function() { From 6e16e8ec8309555c32e241187c85a8d7739c4d3a Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 10 Feb 2022 13:38:21 +0200 Subject: [PATCH 096/328] Add temporary test domains --- nginx.conf | 3 ++- test.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f96edd2..012cb82 100644 --- a/nginx.conf +++ b/nginx.conf @@ -56,6 +56,7 @@ http { server { server_name api.digitransit.fi dev-api.digitransit.fi + dev-next-api.digitransit.fi ""; listen 8080; @@ -307,7 +308,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi apim-test-hsl.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index b5f9639..284eb51 100644 --- a/test.js +++ b/test.js @@ -109,6 +109,7 @@ describe('api.digitransit.fi', function() { }); }); + testProxying('dev-next-api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); testProxying('api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); //testCaching('api.digitransit.fi','/geocoding/v1/foo', true); testProxying('api.digitransit.fi','/graphiql/hsl','graphiql:8080'); @@ -178,6 +179,9 @@ describe('hsl ui', function() { testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); + testRedirect('apim-test-hsl.digitransit.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); + testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-v2:8080', true); + testCaching('reittiopas.hsl.fi','/sw.js', true); //next-dev site From aef0b3460e5c824b76ffb106032c1d0355411ae6 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 11 Feb 2022 10:55:17 +0200 Subject: [PATCH 097/328] Use own ui deployment for apim test --- nginx.conf | 48 +++++++++++++++++++++++++++++++++++++++++++++++- test.js | 5 ++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 012cb82..917075b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -308,7 +308,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi apim-test-hsl.digitransit.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -402,6 +402,52 @@ http { } } + server { + server_name apim-test-hsl.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-apim-test:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location /local-storage-emitter { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-apim-test:8080; + include basicsettings.conf; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-apim-test:8080; + include basicsettings.conf; + } + + location / { + proxy_pass http://digitransit-ui-apim-test:8080; + include basicsettings.conf; + } + } + server { server_name sentry-analytics.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 284eb51..762ce82 100644 --- a/test.js +++ b/test.js @@ -178,9 +178,8 @@ describe('hsl ui', function() { testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); - - testRedirect('apim-test-hsl.digitransit.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); - testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-v2:8080', true); +; + testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-apim-test:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); From a8e8c2225b891602c64a110993d00f880c787f9e Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Mar 2022 14:11:23 +0200 Subject: [PATCH 098/328] Revert "Use own ui deployment for apim test" This reverts commit aef0b3460e5c824b76ffb106032c1d0355411ae6. --- nginx.conf | 48 +----------------------------------------------- test.js | 5 +++-- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/nginx.conf b/nginx.conf index 917075b..012cb82 100644 --- a/nginx.conf +++ b/nginx.conf @@ -308,7 +308,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi apim-test-hsl.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -402,52 +402,6 @@ http { } } - server { - server_name apim-test-hsl.digitransit.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - error_page 500 502 503 504 /502.html; - location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; - internal; - } - - location = /sw.js { - proxy_pass http://digitransit-ui-apim-test:8080; - include basicsettings.conf; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - - location /local-storage-emitter { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-apim-test:8080; - include basicsettings.conf; - } - location = /haku { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-apim-test:8080; - include basicsettings.conf; - } - - location / { - proxy_pass http://digitransit-ui-apim-test:8080; - include basicsettings.conf; - } - } - server { server_name sentry-analytics.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 762ce82..284eb51 100644 --- a/test.js +++ b/test.js @@ -178,8 +178,9 @@ describe('hsl ui', function() { testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); -; - testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-apim-test:8080', true); + + testRedirect('apim-test-hsl.digitransit.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); + testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-v2:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); From 83818c0c93c862ba3a10453ba56c56297966a8b1 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Mar 2022 14:11:27 +0200 Subject: [PATCH 099/328] Revert "Add temporary test domains" This reverts commit 6e16e8ec8309555c32e241187c85a8d7739c4d3a. --- nginx.conf | 3 +-- test.js | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index 012cb82..f96edd2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -56,7 +56,6 @@ http { server { server_name api.digitransit.fi dev-api.digitransit.fi - dev-next-api.digitransit.fi ""; listen 8080; @@ -308,7 +307,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi apim-test-hsl.digitransit.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 284eb51..b5f9639 100644 --- a/test.js +++ b/test.js @@ -109,7 +109,6 @@ describe('api.digitransit.fi', function() { }); }); - testProxying('dev-next-api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); testProxying('api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); //testCaching('api.digitransit.fi','/geocoding/v1/foo', true); testProxying('api.digitransit.fi','/graphiql/hsl','graphiql:8080'); @@ -179,9 +178,6 @@ describe('hsl ui', function() { testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); - testRedirect('apim-test-hsl.digitransit.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); - testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-v2:8080', true); - testCaching('reittiopas.hsl.fi','/sw.js', true); //next-dev site From 29f0ce6fbf63fe0912431abd56c99251a96bde78 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 7 Mar 2022 14:12:50 +0200 Subject: [PATCH 100/328] Remove old fonts endpoint --- common.conf | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/common.conf b/common.conf index 4565381..1551e5a 100644 --- a/common.conf +++ b/common.conf @@ -440,17 +440,6 @@ location /timetables/v1/hsl/ { # proxy_set_header X-Forwarded-Host $host; } -location /fonts/ { - rewrite /fonts/(.*) /fonts/$1 break; - proxy_pass https://static.hsldev.com; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; -} - location /matka-fonts/ { rewrite /matka-fonts/(.*) /$1 break; proxy_pass https://matkafonts.blob.core.windows.net; From 48cab16020f5dd60a2fafb17ec1ce6a14f2abac0 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 29 Mar 2022 12:16:20 +0300 Subject: [PATCH 101/328] Remove old lappeenranta ext and add donkey --- external.conf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/external.conf b/external.conf index caa929e..0ecc518 100644 --- a/external.conf +++ b/external.conf @@ -222,18 +222,6 @@ location /out/hameenlinna.mattersoft.fi/ { proxy_set_header Authorization HAMEENLINNA_BASIC_AUTH; } -#lappeenranta citybike api (https://ckan.saita.fi/geojson/kaupunkipyoraparkit_lpr.geojson) -location /out/ckan.saita.fi/geojson/ { - proxy_pass https://ckan.saita.fi/geojson/; - include allowed-ips.conf; - proxy_cache ext_cache; - proxy_cache_valid any 3600s; - 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; -} - #mikkeli gtfs rt (https://mikkeli.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) location /out/mikkeli.mattersoft.fi/ { proxy_pass https://mikkeli.mattersoft.fi/; @@ -292,3 +280,15 @@ location /out/gtfs.perille.fi/ { include allowed-ips.conf; proxy_set_header Authorization PERILLE_BASIC_AUTH; } + +#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; + 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; +} From d9c057ff1f3854d01a417353bc7feb348870fa67 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 31 Mar 2022 09:30:41 +0300 Subject: [PATCH 102/328] Fix ssl issue with donkey --- external.conf | 1 + test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/external.conf b/external.conf index 0ecc518..0c360fa 100644 --- a/external.conf +++ b/external.conf @@ -291,4 +291,5 @@ location /out/stables.donkey.bike/ { 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; + proxy_ssl_server_name on; } diff --git a/test.js b/test.js index b5f9639..9d6e430 100644 --- a/test.js +++ b/test.js @@ -277,4 +277,5 @@ describe('ext-proxy', function() { testCaching('api.digitransit.fi','/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false); testCaching('api.digitransit.fi','/out/92.62.36.215/RTIX/trip-updates',false); testCaching('api.digitransit.fi','/out/tyokalu.navici.com/joukkoliikenne/manual-gtfsrt/api/gtfsrt/alerts',false); + testCaching('api.digitransit.fi','/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); From 5ae188ca906c7fe4765c7b7e266997018800f635 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 2 May 2022 11:53:26 +0300 Subject: [PATCH 103/328] Add ext endpoint for tampere citybikes --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 0c360fa..23c99e2 100644 --- a/external.conf +++ b/external.conf @@ -293,3 +293,16 @@ location /out/stables.donkey.bike/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_ssl_server_name on; } + +#donkey citybike api (for example https://stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/gbfs.json) +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; + proxy_set_header Authorization GIRAVOLTA_TAMPERE_AUTH; +} diff --git a/run.sh b/run.sh index 8664b19..fa02b55 100755 --- a/run.sh +++ b/run.sh @@ -20,6 +20,7 @@ sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 426bceb..a7c7200 100755 --- a/test.sh +++ b/test.sh @@ -20,7 +20,8 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ - -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ + -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 6601bdd8c78d8ffccb22205f1a6cf2c833b48fee Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 2 May 2022 12:03:45 +0300 Subject: [PATCH 104/328] Update comment --- external.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 23c99e2..26c8b81 100644 --- a/external.conf +++ b/external.conf @@ -294,7 +294,9 @@ location /out/stables.donkey.bike/ { proxy_ssl_server_name on; } -#donkey citybike api (for example https://stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/gbfs.json) +#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 location /out/tampere-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; From 75690f0e03fc32a09a55bdac3085c31ed05f8d1b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 4 May 2022 11:20:04 +0300 Subject: [PATCH 105/328] Add ext endpoint for Kotka --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 26c8b81..b4a647a 100644 --- a/external.conf +++ b/external.conf @@ -274,6 +274,19 @@ location /out/koutsi.mattersoft.fi/ { proxy_set_header Authorization KOUVOLA_BASIC_AUTH; } +#kotka gtfs rt (https://jonnejaminne.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/jonnejaminne.mattersoft.fi/ { + proxy_pass https://jonnejaminne.mattersoft.fi/; + 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; + proxy_set_header Authorization KOTKA_BASIC_AUTH; +} + #perille gtfs location /out/gtfs.perille.fi/ { proxy_pass https://gtfs.perille.fi/; diff --git a/run.sh b/run.sh index fa02b55..37730f5 100755 --- a/run.sh +++ b/run.sh @@ -21,6 +21,7 @@ sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf +sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index a7c7200..d8cd298 100755 --- a/test.sh +++ b/test.sh @@ -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 KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From 9d9e3d622317a3091f7b33b9beb311ad1aa15a54 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 4 May 2022 15:38:47 +0300 Subject: [PATCH 106/328] Add ext API for vantaa citybikes --- external.conf | 15 +++++++++++++++ run.sh | 1 + test.sh | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index b4a647a..d07ae09 100644 --- a/external.conf +++ b/external.conf @@ -321,3 +321,18 @@ location /out/tampere-api.giravolta.io/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization GIRAVOLTA_TAMPERE_AUTH; } + +#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 +location /out/vantaa-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; + proxy_set_header Authorization GIRAVOLTA_VANTAA_AUTH; +} diff --git a/run.sh b/run.sh index 37730f5..4da9ca6 100755 --- a/run.sh +++ b/run.sh @@ -22,6 +22,7 @@ sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index d8cd298..9a16742 100755 --- a/test.sh +++ b/test.sh @@ -21,7 +21,8 @@ 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 KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ + -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` curl -v http://127.0.0.1:9000 From e8c7c51a0d4fd6566c13ca9450d859d8dbbe1880 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 4 May 2022 15:40:56 +0300 Subject: [PATCH 107/328] Remove some old citybike exts --- external.conf | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/external.conf b/external.conf index d07ae09..bfb28ee 100644 --- a/external.conf +++ b/external.conf @@ -161,42 +161,6 @@ location /out/lsl.mattersoft.fi/ { proxy_set_header Authorization LAHTI_BASIC_AUTH; } -#Vantaa citybike stations (https://en-api.sharingos.com/v1/open_api/index.ashx?t=station_list) -location /out/en-api.sharingos.com/ { - proxy_pass https://en-api.sharingos.com/; - 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; -} - -#Tampere citybike stations (https://en-admin.sharingos.com/GBFS/1048/en/station_status.json, free_bike_status.json, system_regions.json and system_information.json) -location /out/en-admin.sharingos.com/ { - proxy_pass https://en-admin.sharingos.com/; - 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; -} - -#Oulu bike stations (https://poland.nextbike.net/maps/nextbike-official.json?domains=fo) -location /out/poland.nextbike.net/ { - proxy_pass https://poland.nextbike.net/; - 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; -} - #Vilkku (Kuopio) bike stations (https://kaupunkipyorat.kuopio.fi/tkhs-export-map.html?format=xml) location /out/kaupunkipyorat.kuopio.fi/ { proxy_pass https://kaupunkipyorat.kuopio.fi/; From 486246c1d3ee4588c63c624c8c3d5149659a8729 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 5 May 2022 10:34:10 +0300 Subject: [PATCH 108/328] Try fixing cache issue by using custom rule --- external.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/external.conf b/external.conf index bfb28ee..9182f7d 100644 --- a/external.conf +++ b/external.conf @@ -283,6 +283,8 @@ location /out/tampere-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_TAMPERE_AUTH; } @@ -298,5 +300,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; } From d11b9789b86c036815fbf530e1cd6399ea4f95d8 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 18 May 2022 13:56:06 +0300 Subject: [PATCH 109/328] Redirect to hslfi test from dev root --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index f96edd2..1154793 100644 --- a/nginx.conf +++ b/nginx.conf @@ -99,7 +99,7 @@ http { } location = / { - return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + return 301 https://test.hslfi.hsldev.com/?fromJourneyPlanner=true; } location / { return 301 https://reittiopas.hsl.fi$request_uri; @@ -346,7 +346,7 @@ http { include basicsettings.conf; } location = / { - return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true; + return 301 https://test.hslfi.hsldev.com/?fromJourneyPlanner=true; } location / { From 51fb901cb893a18376f61c7a98c81c8c7c3a0234 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 18 May 2022 14:23:39 +0300 Subject: [PATCH 110/328] Update hsl test into url replacement script --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 4da9ca6..4ca45e1 100755 --- a/run.sh +++ b/run.sh @@ -13,7 +13,7 @@ sed -i "s/NEW_LISSU_BASIC_AUTH/${NEW_LISSU_BASIC_AUTH}/" /etc/nginx/external.con sed -i "s/transitdatadev/${HSL_RT_STORAGE_NAME}/" /etc/nginx/common.conf sed -i "s/LAHTI_BASIC_AUTH/${LAHTI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/dev.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf +sed -i "s/test.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf sed -i "s/LMJ_BASIC_AUTH/${LMJ_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf From 26e65d024ba0b1df02e8669c7dabac3010edbef9 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 7 Jun 2022 12:22:28 +0300 Subject: [PATCH 111/328] Add otp2 debug ui domains --- nginx.conf | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.js | 7 ++++++ 2 files changed, 75 insertions(+) diff --git a/nginx.conf b/nginx.conf index 1154793..f56adce 100644 --- a/nginx.conf +++ b/nginx.conf @@ -470,6 +470,74 @@ http { } } + server { + server_name hsl-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location / { + proxy_pass http://opentripplanner-hsl-v2:8080/; + include basicsettings.conf; + } + } + + server { + server_name waltti-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location / { + proxy_pass http://opentripplanner-waltti-v2:8080/; + include basicsettings.conf; + } + } + + server { + server_name finland-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location / { + proxy_pass http://opentripplanner-finland-v2:8080/; + include basicsettings.conf; + } + } + + server { + server_name waltti-alt-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location / { + proxy_pass http://opentripplanner-waltti-alt-v2:8080/; + include basicsettings.conf; + } + } + # generic www redirect rule, redirects www.site to site server { listen 8080; diff --git a/test.js b/test.js index 9d6e430..766d31f 100644 --- a/test.js +++ b/test.js @@ -270,6 +270,13 @@ describe('digitransit', function() { testProxying('digitransit.fi','/','digitransit-site:8080', true); }); +describe('otp debug', function() { + testProxying('hsl-debug.digitransit.fi','/','opentripplanner-hsl-v2:8080', true); + testProxying('waltti-debug.digitransit.fi','/','opentripplanner-waltti-v2:8080', true); + testProxying('finland-debug.digitransit.fi','/','opentripplanner-finland-v2:8080', true); + testProxying('waltti-alt-debug.digitransit.fi','/','opentripplanner-waltti-alt-v2:8080', true); +}); + describe('ext-proxy', function() { this.timeout(5000); testCaching('api.digitransit.fi','/out/helsinki-fi.smoove.pro/api-public/stations',false); From adf4ce2fe619b10a33cb0b366797ce0f338ff1f8 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 10 Jun 2022 13:24:09 +0300 Subject: [PATCH 112/328] feat: add node-provided cross-platform local external ip detection tool --- tools/getMyLocalIp.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/getMyLocalIp.js diff --git a/tools/getMyLocalIp.js b/tools/getMyLocalIp.js new file mode 100644 index 0000000..2d05d4c --- /dev/null +++ b/tools/getMyLocalIp.js @@ -0,0 +1,13 @@ +const os = require("os"); + +const getLocalIPv4Addr = () => + Object.values(os.networkInterfaces()).reduce( + (ip, i) => + i.reduce( + (ip, a) => ip || (!a.internal && a.family === "IPv4" && a.address), + ip + ), + null + ); + +console.log(getLocalIPv4Addr()); From 5a17d7ce8f9a478c158fef586ce3f9cb5068639f Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 10 Jun 2022 13:35:00 +0300 Subject: [PATCH 113/328] fix: ShellCheck (https://www.shellcheck.net/) linter warnings --- test.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test.sh b/test.sh index 9a16742..23fab6b 100755 --- a/test.sh +++ b/test.sh @@ -3,18 +3,18 @@ set +e #set -x docker build -t hsldevcom/digitransit-proxy:integrationtest . -PROXIED_HOSTS=`grep proxy_pass *.conf|cut -d'/' -f3|cut -d':' -f1|grep -v "\."|sort|uniq` +PROXIED_HOSTS=$(grep proxy_pass ./*.conf|cut -d'/' -f4|cut -d':' -f1|grep -v "\."|sort|uniq) -TARGETHOST=`/sbin/ip addr|grep inet|grep -v inet6|grep -v 127.0.0.1|grep -oE "([0-9.])+"|head -1` +TARGETHOST=$(/sbin/ip addr|grep inet|grep -v inet6|grep -v 127.0.0.1|grep -oE "([0-9.])+"|head -1) -echo $PROXIED_HOSTS +echo "$PROXIED_HOSTS" #construct --add-host parameters for HOST in $PROXIED_HOSTS;do ADDHOSTS="--add-host $HOST:$TARGETHOST $ADDHOSTS";done; -echo $ADDHOSTS +echo "$ADDHOSTS" -CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\"" \ +CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\"" \ -e JOJO_BASIC_AUTH="\"test\"" -e LAPPEENRANTA_BASIC_AUTH="\"test\"" -e LINKKI_BASIC_AUTH="\"test\"" \ -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" -e HSL_RT_STORAGE_NAME=transitdataprod \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ @@ -22,12 +22,12 @@ CONTAINER_ID=`docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\ -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest` + -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 -echo started proxy-container $CONTAINER_ID +echo started proxy-container "$CONTAINER_ID" echo starting echo server... node test_server.js & PID=$! @@ -37,9 +37,9 @@ sleep 10 mocha STATUS=$? -echo stopping proxy-container $CONTAINER_ID -docker stop $CONTAINER_ID -docker rm $CONTAINER_ID +echo stopping proxy-container "$CONTAINER_ID" +docker stop "$CONTAINER_ID" +docker rm "$CONTAINER_ID" kill -9 $PID From 06558b62d96ea239337810c87fb0963836ec3f6b Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 10 Jun 2022 14:00:10 +0300 Subject: [PATCH 114/328] feat: get local ip address using crossplatform tools/getMyLocalIp.js --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 23fab6b..6af645a 100755 --- a/test.sh +++ b/test.sh @@ -5,7 +5,7 @@ docker build -t hsldevcom/digitransit-proxy:integrationtest . PROXIED_HOSTS=$(grep proxy_pass ./*.conf|cut -d'/' -f4|cut -d':' -f1|grep -v "\."|sort|uniq) -TARGETHOST=$(/sbin/ip addr|grep inet|grep -v inet6|grep -v 127.0.0.1|grep -oE "([0-9.])+"|head -1) +TARGETHOST=$(node ./tools/getMyLocalIp.js) echo "$PROXIED_HOSTS" From 6a746d1e1a881e15498d2983ac1f93a7a24de2bd Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 10 Jun 2022 14:15:16 +0300 Subject: [PATCH 115/328] feat: route {dev-,}varely.digitransit.fi to digitransit-ui-waltti-v2 container --- nginx.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f56adce..b9a4ee4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -215,7 +215,9 @@ http { dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-opas.waltti.fi opas.waltti.fi - dev-vaasa.digitransit.fi vaasa.digitransit.fi; + dev-vaasa.digitransit.fi vaasa.digitransit.fi + dev-varely.digitransit.fi varely.digitransit.fi; + listen 8080; if ($http_x_forwarded_proto != "https") { From 4d103beb3453446d9362735049a1a70ed2890966 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Wed, 6 Jul 2022 16:44:32 +0300 Subject: [PATCH 116/328] fix: add routing to varely otp and mattersoft/varely --- common.conf | 20 ++++++++++++++++++++ external.conf | 13 +++++++++++++ test.sh | 3 ++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/common.conf b/common.conf index 1551e5a..e6ee733 100644 --- a/common.conf +++ b/common.conf @@ -250,6 +250,16 @@ location /routing/v2/routers/waltti-alt { proxy_read_timeout 11500ms; } +location /routing/v2/routers/varely { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -330,6 +340,16 @@ location /routing-data/v3/waltti-alt { include cors.conf; } +location /routing-data/v3/varely { + rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-varely-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + location /routing-data/v3/finland { rewrite /routing-data/v3/finland/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-finland-v3:8080/; diff --git a/external.conf b/external.conf index 9182f7d..7ef9b21 100644 --- a/external.conf +++ b/external.conf @@ -122,6 +122,19 @@ location /out/linkki.mattersoft.fi/ { proxy_set_header Authorization LINKKI_BASIC_AUTH; } +#varely (seutuplus) gtfs rt (https://varelyadmin.mattersoft.fi/feeds/102.zip) +location /out/varelyadmin.mattersoft.fi/ { + proxy_pass https://varelyadmin.mattersoft.fi/; + 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; + proxy_set_header Authorization VARELY_BASIC_AUTH; +} + #tampere gtfs rt new (https://tre.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) location /out/tre.mattersoft.fi/ { proxy_pass https://tre.mattersoft.fi/; diff --git a/test.sh b/test.sh index 6af645a..39bc11c 100755 --- a/test.sh +++ b/test.sh @@ -22,7 +22,8 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest) + -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ + hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 5b97ee76f0fec4d403d61190134bbc6ad8dd8d39 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Wed, 6 Jul 2022 16:57:54 +0300 Subject: [PATCH 117/328] fix: varely routing rewrite rule --- common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.conf b/common.conf index e6ee733..245d67f 100644 --- a/common.conf +++ b/common.conf @@ -341,7 +341,7 @@ location /routing-data/v3/waltti-alt { } location /routing-data/v3/varely { - rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; + rewrite /routing-data/v3/varely/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-varely-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; From 90f6c246c8604471ba7b1ee779ca80ad003cb900 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 7 Jul 2022 15:14:28 +0300 Subject: [PATCH 118/328] Revert "Merge pull request #196 from HSLdevcom/DT-5399_varely-routing" This reverts commit e7fcaaad73d4bfda30d86defe6565b3771158d1b, reversing changes made to 2577651fecc22be80bdadfd5271022a6a0203e02. --- common.conf | 20 -------------------- external.conf | 13 ------------- test.sh | 3 +-- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/common.conf b/common.conf index 245d67f..1551e5a 100644 --- a/common.conf +++ b/common.conf @@ -250,16 +250,6 @@ location /routing/v2/routers/waltti-alt { proxy_read_timeout 11500ms; } -location /routing/v2/routers/varely { - rewrite /routing/v2/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-varely-v2:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -340,16 +330,6 @@ location /routing-data/v3/waltti-alt { include cors.conf; } -location /routing-data/v3/varely { - rewrite /routing-data/v3/varely/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-varely-v3:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /routing-data/v3/finland { rewrite /routing-data/v3/finland/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-finland-v3:8080/; diff --git a/external.conf b/external.conf index 7ef9b21..9182f7d 100644 --- a/external.conf +++ b/external.conf @@ -122,19 +122,6 @@ location /out/linkki.mattersoft.fi/ { proxy_set_header Authorization LINKKI_BASIC_AUTH; } -#varely (seutuplus) gtfs rt (https://varelyadmin.mattersoft.fi/feeds/102.zip) -location /out/varelyadmin.mattersoft.fi/ { - proxy_pass https://varelyadmin.mattersoft.fi/; - 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; - proxy_set_header Authorization VARELY_BASIC_AUTH; -} - #tampere gtfs rt new (https://tre.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) location /out/tre.mattersoft.fi/ { proxy_pass https://tre.mattersoft.fi/; diff --git a/test.sh b/test.sh index 39bc11c..6af645a 100755 --- a/test.sh +++ b/test.sh @@ -22,8 +22,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ - hsldevcom/digitransit-proxy:integrationtest) + -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 9273a363afb8902b0c0aff8f1e82ce5c1f7d7534 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Mon, 11 Jul 2022 11:32:46 +0300 Subject: [PATCH 119/328] Added basic auth route to Mattersoft/VARELY --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 9182f7d..62621a6 100644 --- a/external.conf +++ b/external.conf @@ -122,6 +122,19 @@ location /out/linkki.mattersoft.fi/ { proxy_set_header Authorization LINKKI_BASIC_AUTH; } +#varely (seutuplus) gtfs (https://varelyadmin.mattersoft.fi/feeds/102.zip) +location /out/varelyadmin.mattersoft.fi/ { + proxy_pass https://varelyadmin.mattersoft.fi/; + 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; + proxy_set_header Authorization VARELY_BASIC_AUTH; +} + #tampere gtfs rt new (https://tre.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) location /out/tre.mattersoft.fi/ { proxy_pass https://tre.mattersoft.fi/; diff --git a/run.sh b/run.sh index 4ca45e1..50b6a7a 100755 --- a/run.sh +++ b/run.sh @@ -23,6 +23,7 @@ sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf +sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 6af645a..39bc11c 100755 --- a/test.sh +++ b/test.sh @@ -22,7 +22,8 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ - -e GIRAVOLTA_VANTAA_AUTH="\"test\"" hsldevcom/digitransit-proxy:integrationtest) + -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ + hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 09259c22f421753e04c0409d99ffaaa8eb605f13 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Mon, 11 Jul 2022 12:12:10 +0300 Subject: [PATCH 120/328] Add routing to VARELY opentripplanner and data-builder --- common.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common.conf b/common.conf index 1551e5a..2370c0d 100644 --- a/common.conf +++ b/common.conf @@ -250,6 +250,16 @@ location /routing/v2/routers/waltti-alt { proxy_read_timeout 11500ms; } +location /routing/v2/routers/varely { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -320,6 +330,16 @@ location /routing-data/v3/waltti { include cors.conf; } +location /routing-data/v3/varely { + rewrite /routing-data/v3/varely/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-varely-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; From 0fcefd36da07a56653266b2ecb0a1fb38f7c6c9c Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Thu, 1 Sep 2022 14:04:08 +0300 Subject: [PATCH 121/328] Add hsl test service routing --- nginx.conf | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/nginx.conf b/nginx.conf index b9a4ee4..8b44914 100644 --- a/nginx.conf +++ b/nginx.conf @@ -403,6 +403,53 @@ http { } } + # test service for dedicated project (eg. for node-migration) + server { + server_name test.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-hsl-v2-test:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + + location /local-storage-emitter { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-hsl-v2-test:8080; + include basicsettings.conf; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitrdigitransit-ui-hsl-v2-test:8080; + include basicsettings.conf; + } + + location / { + proxy_pass http://digitransit-ui-hsl-v2-test:8080; + include basicsettings.conf; + } + } + server { server_name sentry-analytics.digitransit.fi; listen 8080; From 1b4b0fcc9f97ae98ec279d911e0ac4d3f3bdb739 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 1 Sep 2022 15:08:04 +0300 Subject: [PATCH 122/328] Fix typo --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 8b44914..9e179f6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -440,7 +440,7 @@ http { } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitrdigitransit-ui-hsl-v2-test:8080; + proxy_pass http://digitransit-ui-hsl-v2-test:8080; include basicsettings.conf; } From 5825b8a2f06fcd24e88c18194ff437f2ce58c745 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 2 Sep 2022 11:56:45 +0300 Subject: [PATCH 123/328] Add hsl test service routing for browser assets --- common.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.conf b/common.conf index 2370c0d..8110a9e 100644 --- a/common.conf +++ b/common.conf @@ -415,6 +415,15 @@ location /ui/v2/hsl/ { # proxy_set_header X-Forwarded-Host $host; } +location /ui/v2-test/hsl/ { + rewrite /ui/v2/hsl/(.*) /$1 break; + proxy_pass http://digitransit-ui-hsl-v2-test:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} + location /ui/v2/waltti/ { rewrite /ui/v2/waltti/(.*) /$1 break; proxy_pass http://digitransit-ui-waltti-v2:8080; From 2cd6ed7024100fefddbf1f4fdcc7d17f00b042eb Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Fri, 2 Sep 2022 14:38:26 +0300 Subject: [PATCH 124/328] Fix rewrite path regexp for v2-test/hsl --- common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.conf b/common.conf index 8110a9e..4bddab2 100644 --- a/common.conf +++ b/common.conf @@ -416,7 +416,7 @@ location /ui/v2/hsl/ { } location /ui/v2-test/hsl/ { - rewrite /ui/v2/hsl/(.*) /$1 break; + rewrite /ui/v2-test/hsl/(.*) /$1 break; proxy_pass http://digitransit-ui-hsl-v2-test:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; From 6cd24c065608c2c510dd934a515252d62d471afb Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 15 Sep 2022 11:35:48 +0300 Subject: [PATCH 125/328] Remove deprecated next-waltti and next-map endpoints --- common.conf | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/common.conf b/common.conf index 4bddab2..42bd36d 100644 --- a/common.conf +++ b/common.conf @@ -132,20 +132,6 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -location /map/v1/next- { - rewrite /map/v1/next-(.*) /map/v1/$1 break; - proxy_pass http://hsl-map-server-next:8080; - # proxy_cache tiles; - # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - # proxy_cache_revalidate on; - # proxy_cache_lock on; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # add_header X-Cache-Status $upstream_cache_status; -} - location /map/v1/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; @@ -270,16 +256,6 @@ location /routing/v2/routers/hsl { proxy_read_timeout 11500ms; } -location /routing/v1/routers/next-waltti { - rewrite /routing/v1/routers/next-waltti(.*) /otp/routers/default$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-hsl:8080/; @@ -360,16 +336,6 @@ location /routing-data/v3/finland { include cors.conf; } -location /routing-data/v2/next-waltti { - rewrite /routing-data/v2/next-waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /ui/v1/finland/ { rewrite /ui/v1/finland/(.*) /$1 break; proxy_pass http://digitransit-ui-matka-v2:8080; From f973b0da9b73d2d659bec52e5fe28971e401243c Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 15 Sep 2022 11:43:07 +0300 Subject: [PATCH 126/328] Remove tests for deprecated endpoints --- test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test.js b/test.js index 766d31f..7142e2a 100644 --- a/test.js +++ b/test.js @@ -119,7 +119,6 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); @@ -128,7 +127,6 @@ describe('api.digitransit.fi', function() { testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v1/routers/next-waltti','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); @@ -143,8 +141,6 @@ describe('api.digitransit.fi', function() { testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v2/next-waltti/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-matka-v2:8080'); testProxying('api.digitransit.fi','/ui/v1/hsl-next/sw.js','digitransit-ui-hsl-v2:8080'); testProxying('api.digitransit.fi','/ui/v1/waltti-next/sw.js','digitransit-ui-waltti-v2:8080'); From be2ba6fd44ede438e6f138a926b48968a916b8aa Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 15 Sep 2022 12:34:51 +0300 Subject: [PATCH 127/328] Move varely and opas.waltti.fi to use v3 ui --- nginx.conf | 9 ++++----- test.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index 9e179f6..e5b66e4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -214,9 +214,7 @@ http { dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi opas.waltti.fi - dev-vaasa.digitransit.fi vaasa.digitransit.fi - dev-varely.digitransit.fi varely.digitransit.fi; + dev-vaasa.digitransit.fi vaasa.digitransit.fi; listen 8080; @@ -269,8 +267,9 @@ http { next-dev-tampere.digitransit.fi next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi - next-dev-opas.waltti.fi - next-dev-vaasa.digitransit.fi; + next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi + next-dev-vaasa.digitransit.fi + dev-varely.digitransit.fi varely.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 7142e2a..8dde1c7 100644 --- a/test.js +++ b/test.js @@ -228,7 +228,7 @@ describe('waltti ui', function() { testCaching('reittiopas.tampere.fi','/sw.js', true); testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); - testProxying('opas.waltti.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying('opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); From 866eb6f628e46a9bd2b9a5de2f9a38cb0a1f1dfa Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 15 Sep 2022 12:34:59 +0300 Subject: [PATCH 128/328] Modify release check so it allow tags with postfixes --- .github/workflows/prod-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index 13cbe54..e332e89 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -12,7 +12,7 @@ jobs: - name: Check Tag id: check-tag run: | - if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9]$ ]]; then + if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9] ]]; then echo ::set-output name=match::true fi - name: Push latest image as prod From 13a1d83188f97e58825b5957cab69d957bd32792 Mon Sep 17 00:00:00 2001 From: Joona Ojapalo Date: Mon, 19 Sep 2022 21:19:24 +0300 Subject: [PATCH 129/328] Add reittiopas.seutuplus.fi routing to digitransit-ui service container --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index e5b66e4..a5d7b72 100644 --- a/nginx.conf +++ b/nginx.conf @@ -269,7 +269,7 @@ http { next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi next-dev-vaasa.digitransit.fi - dev-varely.digitransit.fi varely.digitransit.fi; + dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 7f1922470bc3abf9da2dafda05f11b5e8d3775a8 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 23 Sep 2022 13:34:56 +0300 Subject: [PATCH 130/328] fix: modify gbfs discovery response urls to go through the proxy This makes updater requests travel via the proxy where they get authorization. Also, responses get cached. responses get cached --- external.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/external.conf b/external.conf index 62621a6..600f3d6 100644 --- a/external.conf +++ b/external.conf @@ -287,6 +287,24 @@ location /out/stables.donkey.bike/ { #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/; + 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/tampere-api.giravolta.io'; + sub_filter_once off; +} + +#giravolta api calls for tampere location /out/tampere-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; @@ -301,9 +319,28 @@ location /out/tampere-api.giravolta.io/ { proxy_set_header Authorization GIRAVOLTA_TAMPERE_AUTH; } + #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/; + 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/vantaa-api.giravolta.io'; + sub_filter_once off; +} + +#giravolta api calls for vantaa location /out/vantaa-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; From a1401d144d68ee728ab55e914aa208762a49200d Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 23 Sep 2022 13:53:22 +0300 Subject: [PATCH 131/328] Set correct proxy path --- external.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external.conf b/external.conf index 600f3d6..8c8e0a5 100644 --- a/external.conf +++ b/external.conf @@ -300,7 +300,7 @@ location /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { #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/tampere-api.giravolta.io'; + sub_filter 'https://api.giravolta.io' 'http://digitransit-proxy:8080/out/tampere-api.giravolta.io'; sub_filter_once off; } @@ -336,7 +336,7 @@ location /out/vantaa-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { #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/vantaa-api.giravolta.io'; + sub_filter 'https://api.giravolta.io' 'http://digitransit-proxy:8080/out/vantaa-api.giravolta.io'; sub_filter_once off; } From c379ad817cb3da336a9d8abb99d7dcb22543ac62 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 26 Sep 2022 09:29:12 +0300 Subject: [PATCH 132/328] Add json postfix to discovery path --- external.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external.conf b/external.conf index 8c8e0a5..b8fbcde 100644 --- a/external.conf +++ b/external.conf @@ -288,7 +288,7 @@ location /out/stables.donkey.bike/ { #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 { +location /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs.json { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; @@ -324,7 +324,7 @@ location /out/tampere-api.giravolta.io/ { #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 { +location /out/vantaa-api.giravolta.io/api-opendata/gbfs/2_3/gbfs.json { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; From 881495a6b6a92ca1e5a118395c852e152bf106c9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 26 Sep 2022 10:04:53 +0300 Subject: [PATCH 133/328] Revert "Add json postfix to discovery path" This reverts commit c379ad817cb3da336a9d8abb99d7dcb22543ac62. --- external.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external.conf b/external.conf index b8fbcde..8c8e0a5 100644 --- a/external.conf +++ b/external.conf @@ -288,7 +288,7 @@ location /out/stables.donkey.bike/ { #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.json { +location /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; @@ -324,7 +324,7 @@ location /out/tampere-api.giravolta.io/ { #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.json { +location /out/vantaa-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; From 17b43d3c938b1d24690d888e1308b595d81ea1b2 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 26 Sep 2022 12:30:16 +0300 Subject: [PATCH 134/328] Match exact path --- external.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/external.conf b/external.conf index 8c8e0a5..0f1235b 100644 --- a/external.conf +++ b/external.conf @@ -288,8 +288,8 @@ location /out/stables.donkey.bike/ { #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/; +location = /out/tampere-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; @@ -324,8 +324,8 @@ location /out/tampere-api.giravolta.io/ { #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/; +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; From 426c4390b490dd03a6a145181dead6496f6c688f Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 26 Sep 2022 13:12:51 +0300 Subject: [PATCH 135/328] Apply string replacement to all response types --- external.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/external.conf b/external.conf index 0f1235b..7042ddc 100644 --- a/external.conf +++ b/external.conf @@ -302,6 +302,7 @@ location = /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { 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 @@ -338,6 +339,7 @@ location = /out/vantaa-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { 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 From 62c98c62cb73d0261dc888a0d484d18ff30d5e1a Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 27 Sep 2022 14:49:23 +0300 Subject: [PATCH 136/328] Add a path under digitransit.fi for domain validation --- nginx.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nginx.conf b/nginx.conf index a5d7b72..6850010 100644 --- a/nginx.conf +++ b/nginx.conf @@ -512,6 +512,14 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + # This is used by the certificate authority to validate we own the domain + location = /.well-known/pki-validation/fileauth.txt { + proxy_pass https://dnsvalidationstorage.blob.core.windows.net/dnsfiles/fileauth.txt; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From 1e22967317f7b36bae9a7ff6136b158a84b6b681 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Mon, 3 Oct 2022 14:31:45 +0300 Subject: [PATCH 137/328] Rovaniemi real time proxy DT-5539 --- external.conf | 13 +++++++++++++ run.sh | 1 + 2 files changed, 14 insertions(+) diff --git a/external.conf b/external.conf index 7042ddc..b5b53ce 100644 --- a/external.conf +++ b/external.conf @@ -264,6 +264,19 @@ location /out/jonnejaminne.mattersoft.fi/ { proxy_set_header Authorization KOTKA_BASIC_AUTH; } +#rovaniemi gtfs rt (https://linkkari.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/linkkari.mattersoft.fi/ { + proxy_pass https://linkkari.mattersoft.fi/; + 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; + proxy_set_header Authorization ROVANIEMI_BASIC_AUTH; +} + #perille gtfs location /out/gtfs.perille.fi/ { proxy_pass https://gtfs.perille.fi/; diff --git a/run.sh b/run.sh index 50b6a7a..051d22c 100755 --- a/run.sh +++ b/run.sh @@ -22,6 +22,7 @@ sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/ROVANIEMI_BASIC_AUTH/${ROVANIEMI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf From 5fb1c0bbec0dee5f99897d8e3e899863fdbdd694 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 3 Oct 2022 15:09:32 +0300 Subject: [PATCH 138/328] Revert "Merge pull request #206 from HSLdevcom/dns-validation-path" This reverts commit 29abca7e86edf8bde17e627581013998e8ca03a7, reversing changes made to 426c4390b490dd03a6a145181dead6496f6c688f. --- nginx.conf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/nginx.conf b/nginx.conf index 6850010..a5d7b72 100644 --- a/nginx.conf +++ b/nginx.conf @@ -512,14 +512,6 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - # This is used by the certificate authority to validate we own the domain - location = /.well-known/pki-validation/fileauth.txt { - proxy_pass https://dnsvalidationstorage.blob.core.windows.net/dnsfiles/fileauth.txt; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From 213b43ce0a6a238d7ab704ab96b121898084e3d8 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 4 Oct 2022 11:41:33 +0300 Subject: [PATCH 139/328] Add missing dummy secret value for test script --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 39bc11c..2004561 100755 --- a/test.sh +++ b/test.sh @@ -19,7 +19,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" -e HSL_RT_STORAGE_NAME=transitdataprod \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ - -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" \ + -e VAASA_BASIC_AUTH="\"test\"" -e SALO_BASIC_AUTH="\"test\"" -e ROVANIEMI_BASIC_AUTH="\"test\"" \ -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ From 417816cf5147de4bebc0b15d1060a66eb8ff391a Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 13 Oct 2022 14:57:18 +0300 Subject: [PATCH 140/328] Restore geocoding cache --- common.conf | 8 ++++---- nginx.conf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common.conf b/common.conf index 42bd36d..249c8a1 100644 --- a/common.conf +++ b/common.conf @@ -1,10 +1,10 @@ location /geocoding/v1/ { rewrite /geocoding/v1/(.*) /v1/$1 break; proxy_pass http://pelias-api:8080/; - # proxy_cache geocoding; - # proxy_cache_valid 3d; - # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - # add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache geocoding; + proxy_cache_valid 3d; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + add_header X-Proxy-Cache $upstream_cache_status; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/nginx.conf b/nginx.conf index a5d7b72..e62e585 100644 --- a/nginx.conf +++ b/nginx.conf @@ -38,7 +38,7 @@ http { proxy_temp_path /opt/nginx/temp-cache; proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; - # proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; + proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; From 7281cabeb3a1c28d2b0054d88c112dee13a88d0d Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 14 Oct 2022 11:09:19 +0300 Subject: [PATCH 141/328] Add external endpoint for rata.digitraffic.fi --- external.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external.conf b/external.conf index b5b53ce..aeb4033 100644 --- a/external.conf +++ b/external.conf @@ -369,3 +369,15 @@ location /out/vantaa-api.giravolta.io/ { proxy_cache_key $scheme$host$request_uri; proxy_set_header Authorization GIRAVOLTA_VANTAA_AUTH; } + +#digitraffic realtime api (https://rata.digitraffic.fi/api/v1/trains/gtfs-rt-updates) +location /out/rata.digitraffic.fi/ { + proxy_pass https://rata.digitraffic.fi/; + 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; +} From f1d14eb2e6b5d4d018972e4a804a258c8cb044ba Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 31 Oct 2022 15:25:25 +0200 Subject: [PATCH 142/328] Add v3 map API --- common.conf | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++ test.js | 7 ++ 2 files changed, 221 insertions(+) diff --git a/common.conf b/common.conf index 249c8a1..f71cfff 100644 --- a/common.conf +++ b/common.conf @@ -158,6 +158,220 @@ location /map/v2/ { add_header X-Cache-Status $upstream_cache_status; } +location /map/v3/ { + rewrite /map/v3/(.*) /map/v2/$1 break; + proxy_pass http://hsl-map-server:8080; + proxy_cache tiles; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_revalidate on; + proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header X-Cache-Status $upstream_cache_status; +} + +location /map/v3/poi/hsl-ticket-sales-map/ { + rewrite /map/v3/poi/(.*) /map/v2/$1 break; + proxy_pass http://hsl-map-server:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-stops/ { + rewrite /map/v3/poi/hsl-stops/(.*) /otp/routers/hsl/vectorTiles/stops/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-stations/ { + rewrite /map/v3/poi/hsl-stations/(.*) /otp/routers/hsl/vectorTiles/stations/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-rental-stations/ { + rewrite /map/v3/poi/hsl-rental-stations/(.*) /otp/routers/hsl/vectorTiles/rentalStations/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-realtime-rental-stations/ { + rewrite /map/v3/poi/hsl-realtime-rental-stations/(.*) /otp/routers/hsl/vectorTiles/realtimeRentalStations/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-vehicle-parking/ { + rewrite /map/v3/poi/hsl-vehicle-parking/(.*) /otp/routers/hsl/vectorTiles/vehicleParking/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/hsl-vehicle-parking-groups/ { + rewrite /map/v3/poi/hsl-vehicle-parking-groups/(.*) /otp/routers/hsl/vectorTiles/vehicleParkingGroups/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-stops/ { + rewrite /map/v3/poi/waltti-stops/(.*) /otp/routers/waltti/vectorTiles/stops/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-stations/ { + rewrite /map/v3/poi/waltti-stations/(.*) /otp/routers/waltti/vectorTiles/stations/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-rental-stations/ { + rewrite /map/v3/poi/waltti-rental-stations/(.*) /otp/routers/waltti/vectorTiles/rentalStations/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-realtime-rental-stations/ { + rewrite /map/v3/poi/waltti-realtime-rental-stations/(.*) /otp/routers/waltti/vectorTiles/realtimeRentalStations/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-vehicle-parking/ { + rewrite /map/v3/poi/waltti-vehicle-parking/(.*) /otp/routers/waltti/vectorTiles/vehicleParking/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-vehicle-parking-groups/ { + rewrite /map/v3/poi/waltti-vehicle-parking-groups/(.*) /otp/routers/waltti/vectorTiles/vehicleParkingGroups/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-stops/ { + rewrite /map/v3/poi/finland-stops/(.*) /otp/routers/finland/vectorTiles/stops/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-stations/ { + rewrite /map/v3/poi/finland-stations/(.*) /otp/routers/finland/vectorTiles/stations/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-rental-stations/ { + rewrite /map/v3/poi/finland-rental-stations/(.*) /otp/routers/finland/vectorTiles/rentalStations/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-realtime-rental-stations/ { + rewrite /map/v3/poi/finland-realtime-rental-stations/(.*) /otp/routers/finland/vectorTiles/realtimeRentalStations/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-vehicle-parking/ { + rewrite /map/v3/poi/finland-vehicle-parking/(.*) /otp/routers/finland/vectorTiles/vehicleParking/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/finland-vehicle-parking-groups/ { + rewrite /map/v3/poi/finland-vehicle-parking-groups/(.*) /otp/routers/finland/vectorTiles/vehicleParkingGroups/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-alt-stops/ { + rewrite /map/v3/poi/waltti-alt-stops/(.*) /otp/routers/waltti-alt/vectorTiles/stops/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-alt-stations/ { + rewrite /map/v3/poi/waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/stations/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-alt-rental-stations/ { + rewrite /map/v3/poi/finland-waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/rentalStations/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/waltti-alt-realtime-rental-stations/ { + rewrite /map/v3/poi/waltti-alt-realtime-rental-stations/(.*) /otp/routers/waltti-alt/vectorTiles/realtimeRentalStations/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/varely-stops/ { + rewrite /map/v3/poi/varely-stops/(.*) /otp/routers/varely/vectorTiles/stops/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /map/v3/poi/varely-stations/ { + rewrite /map/v3/poi/varely-stations/(.*) /otp/routers/varely/vectorTiles/stations/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location /graphiql/ { proxy_pass http://graphiql:8080; proxy_redirect off; diff --git a/test.js b/test.js index 8dde1c7..736ed87 100644 --- a/test.js +++ b/test.js @@ -120,6 +120,13 @@ describe('api.digitransit.fi', function() { //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/hsl-ticket-sales-map/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/hsl-rental-stations/','opentripplanner-hsl-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/waltti-rental-stations/','opentripplanner-waltti-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/finland-rental-stations/','opentripplanner-finland-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/varely-stops/','opentripplanner-varely-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/poi/waltti-alt-rental-stations/','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From ac424b22d6a42d05c1a0a49635fff69db810d1c4 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 31 Oct 2022 15:42:40 +0200 Subject: [PATCH 143/328] Remove poi from path --- common.conf | 100 ++++++++++++++++++++++++++-------------------------- test.js | 12 +++---- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/common.conf b/common.conf index f71cfff..6b2e10f 100644 --- a/common.conf +++ b/common.conf @@ -172,200 +172,200 @@ location /map/v3/ { add_header X-Cache-Status $upstream_cache_status; } -location /map/v3/poi/hsl-ticket-sales-map/ { - rewrite /map/v3/poi/(.*) /map/v2/$1 break; +location /map/v3/hsl-ticket-sales-map/ { + rewrite /map/v3/(.*) /map/v2/$1 break; proxy_pass http://hsl-map-server:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-stops/ { - rewrite /map/v3/poi/hsl-stops/(.*) /otp/routers/hsl/vectorTiles/stops/$1 break; +location /map/v3/hsl-stops/ { + rewrite /map/v3/hsl-stops/(.*) /otp/routers/hsl/vectorTiles/stops/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-stations/ { - rewrite /map/v3/poi/hsl-stations/(.*) /otp/routers/hsl/vectorTiles/stations/$1 break; +location /map/v3/hsl-stations/ { + rewrite /map/v3/hsl-stations/(.*) /otp/routers/hsl/vectorTiles/stations/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-rental-stations/ { - rewrite /map/v3/poi/hsl-rental-stations/(.*) /otp/routers/hsl/vectorTiles/rentalStations/$1 break; +location /map/v3/hsl-rental-stations/ { + rewrite /map/v3/hsl-rental-stations/(.*) /otp/routers/hsl/vectorTiles/rentalStations/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-realtime-rental-stations/ { - rewrite /map/v3/poi/hsl-realtime-rental-stations/(.*) /otp/routers/hsl/vectorTiles/realtimeRentalStations/$1 break; +location /map/v3/hsl-realtime-rental-stations/ { + rewrite /map/v3/hsl-realtime-rental-stations/(.*) /otp/routers/hsl/vectorTiles/realtimeRentalStations/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-vehicle-parking/ { - rewrite /map/v3/poi/hsl-vehicle-parking/(.*) /otp/routers/hsl/vectorTiles/vehicleParking/$1 break; +location /map/v3/hsl-vehicle-parking/ { + rewrite /map/v3/hsl-vehicle-parking/(.*) /otp/routers/hsl/vectorTiles/vehicleParking/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/hsl-vehicle-parking-groups/ { - rewrite /map/v3/poi/hsl-vehicle-parking-groups/(.*) /otp/routers/hsl/vectorTiles/vehicleParkingGroups/$1 break; +location /map/v3/hsl-vehicle-parking-groups/ { + rewrite /map/v3/hsl-vehicle-parking-groups/(.*) /otp/routers/hsl/vectorTiles/vehicleParkingGroups/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-stops/ { - rewrite /map/v3/poi/waltti-stops/(.*) /otp/routers/waltti/vectorTiles/stops/$1 break; +location /map/v3/waltti-stops/ { + rewrite /map/v3/waltti-stops/(.*) /otp/routers/waltti/vectorTiles/stops/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-stations/ { - rewrite /map/v3/poi/waltti-stations/(.*) /otp/routers/waltti/vectorTiles/stations/$1 break; +location /map/v3/waltti-stations/ { + rewrite /map/v3/waltti-stations/(.*) /otp/routers/waltti/vectorTiles/stations/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-rental-stations/ { - rewrite /map/v3/poi/waltti-rental-stations/(.*) /otp/routers/waltti/vectorTiles/rentalStations/$1 break; +location /map/v3/waltti-rental-stations/ { + rewrite /map/v3/waltti-rental-stations/(.*) /otp/routers/waltti/vectorTiles/rentalStations/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-realtime-rental-stations/ { - rewrite /map/v3/poi/waltti-realtime-rental-stations/(.*) /otp/routers/waltti/vectorTiles/realtimeRentalStations/$1 break; +location /map/v3/waltti-realtime-rental-stations/ { + rewrite /map/v3/waltti-realtime-rental-stations/(.*) /otp/routers/waltti/vectorTiles/realtimeRentalStations/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-vehicle-parking/ { - rewrite /map/v3/poi/waltti-vehicle-parking/(.*) /otp/routers/waltti/vectorTiles/vehicleParking/$1 break; +location /map/v3/waltti-vehicle-parking/ { + rewrite /map/v3/waltti-vehicle-parking/(.*) /otp/routers/waltti/vectorTiles/vehicleParking/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-vehicle-parking-groups/ { - rewrite /map/v3/poi/waltti-vehicle-parking-groups/(.*) /otp/routers/waltti/vectorTiles/vehicleParkingGroups/$1 break; +location /map/v3/waltti-vehicle-parking-groups/ { + rewrite /map/v3/waltti-vehicle-parking-groups/(.*) /otp/routers/waltti/vectorTiles/vehicleParkingGroups/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-stops/ { - rewrite /map/v3/poi/finland-stops/(.*) /otp/routers/finland/vectorTiles/stops/$1 break; +location /map/v3/finland-stops/ { + rewrite /map/v3/finland-stops/(.*) /otp/routers/finland/vectorTiles/stops/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-stations/ { - rewrite /map/v3/poi/finland-stations/(.*) /otp/routers/finland/vectorTiles/stations/$1 break; +location /map/v3/finland-stations/ { + rewrite /map/v3/finland-stations/(.*) /otp/routers/finland/vectorTiles/stations/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-rental-stations/ { - rewrite /map/v3/poi/finland-rental-stations/(.*) /otp/routers/finland/vectorTiles/rentalStations/$1 break; +location /map/v3/finland-rental-stations/ { + rewrite /map/v3/finland-rental-stations/(.*) /otp/routers/finland/vectorTiles/rentalStations/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-realtime-rental-stations/ { - rewrite /map/v3/poi/finland-realtime-rental-stations/(.*) /otp/routers/finland/vectorTiles/realtimeRentalStations/$1 break; +location /map/v3/finland-realtime-rental-stations/ { + rewrite /map/v3/finland-realtime-rental-stations/(.*) /otp/routers/finland/vectorTiles/realtimeRentalStations/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-vehicle-parking/ { - rewrite /map/v3/poi/finland-vehicle-parking/(.*) /otp/routers/finland/vectorTiles/vehicleParking/$1 break; +location /map/v3/finland-vehicle-parking/ { + rewrite /map/v3/finland-vehicle-parking/(.*) /otp/routers/finland/vectorTiles/vehicleParking/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/finland-vehicle-parking-groups/ { - rewrite /map/v3/poi/finland-vehicle-parking-groups/(.*) /otp/routers/finland/vectorTiles/vehicleParkingGroups/$1 break; +location /map/v3/finland-vehicle-parking-groups/ { + rewrite /map/v3/finland-vehicle-parking-groups/(.*) /otp/routers/finland/vectorTiles/vehicleParkingGroups/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-alt-stops/ { - rewrite /map/v3/poi/waltti-alt-stops/(.*) /otp/routers/waltti-alt/vectorTiles/stops/$1 break; +location /map/v3/waltti-alt-stops/ { + rewrite /map/v3/waltti-alt-stops/(.*) /otp/routers/waltti-alt/vectorTiles/stops/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-alt-stations/ { - rewrite /map/v3/poi/waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/stations/$1 break; +location /map/v3/waltti-alt-stations/ { + rewrite /map/v3/waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/stations/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-alt-rental-stations/ { - rewrite /map/v3/poi/finland-waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/rentalStations/$1 break; +location /map/v3/waltti-alt-rental-stations/ { + rewrite /map/v3/finland-waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/rentalStations/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/waltti-alt-realtime-rental-stations/ { - rewrite /map/v3/poi/waltti-alt-realtime-rental-stations/(.*) /otp/routers/waltti-alt/vectorTiles/realtimeRentalStations/$1 break; +location /map/v3/waltti-alt-realtime-rental-stations/ { + rewrite /map/v3/waltti-alt-realtime-rental-stations/(.*) /otp/routers/waltti-alt/vectorTiles/realtimeRentalStations/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/varely-stops/ { - rewrite /map/v3/poi/varely-stops/(.*) /otp/routers/varely/vectorTiles/stops/$1 break; +location /map/v3/varely-stops/ { + rewrite /map/v3/varely-stops/(.*) /otp/routers/varely/vectorTiles/stops/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/poi/varely-stations/ { - rewrite /map/v3/poi/varely-stations/(.*) /otp/routers/varely/vectorTiles/stations/$1 break; +location /map/v3/varely-stations/ { + rewrite /map/v3/varely-stations/(.*) /otp/routers/varely/vectorTiles/stations/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; diff --git a/test.js b/test.js index 736ed87..22b364c 100644 --- a/test.js +++ b/test.js @@ -121,12 +121,12 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/hsl-ticket-sales-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/hsl-rental-stations/','opentripplanner-hsl-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/waltti-rental-stations/','opentripplanner-waltti-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/finland-rental-stations/','opentripplanner-finland-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/varely-stops/','opentripplanner-varely-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/poi/waltti-alt-rental-stations/','opentripplanner-waltti-alt-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl-ticket-sales-map/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl-rental-stations/','opentripplanner-hsl-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti-rental-stations/','opentripplanner-waltti-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/finland-rental-stations/','opentripplanner-finland-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/varely-stops/','opentripplanner-varely-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti-alt-rental-stations/','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From d355aa31586ae7a9d9b33a3e704ccf53b5df8932 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 31 Oct 2022 16:01:01 +0200 Subject: [PATCH 144/328] Change path structure so it better supports multi layers --- common.conf | 178 ++++------------------------------------------------ test.js | 12 ++-- 2 files changed, 19 insertions(+), 171 deletions(-) diff --git a/common.conf b/common.conf index 6b2e10f..ccdc8b2 100644 --- a/common.conf +++ b/common.conf @@ -172,200 +172,48 @@ location /map/v3/ { add_header X-Cache-Status $upstream_cache_status; } -location /map/v3/hsl-ticket-sales-map/ { - rewrite /map/v3/(.*) /map/v2/$1 break; - proxy_pass http://hsl-map-server:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/hsl-stops/ { - rewrite /map/v3/hsl-stops/(.*) /otp/routers/hsl/vectorTiles/stops/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/hsl-stations/ { - rewrite /map/v3/hsl-stations/(.*) /otp/routers/hsl/vectorTiles/stations/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/hsl-rental-stations/ { - rewrite /map/v3/hsl-rental-stations/(.*) /otp/routers/hsl/vectorTiles/rentalStations/$1 break; +location /map/v3/hsl/ { + rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/hsl-realtime-rental-stations/ { - rewrite /map/v3/hsl-realtime-rental-stations/(.*) /otp/routers/hsl/vectorTiles/realtimeRentalStations/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/hsl-vehicle-parking/ { - rewrite /map/v3/hsl-vehicle-parking/(.*) /otp/routers/hsl/vectorTiles/vehicleParking/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/hsl-vehicle-parking-groups/ { - rewrite /map/v3/hsl-vehicle-parking-groups/(.*) /otp/routers/hsl/vectorTiles/vehicleParkingGroups/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-stops/ { - rewrite /map/v3/waltti-stops/(.*) /otp/routers/waltti/vectorTiles/stops/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-stations/ { - rewrite /map/v3/waltti-stations/(.*) /otp/routers/waltti/vectorTiles/stations/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-rental-stations/ { - rewrite /map/v3/waltti-rental-stations/(.*) /otp/routers/waltti/vectorTiles/rentalStations/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-realtime-rental-stations/ { - rewrite /map/v3/waltti-realtime-rental-stations/(.*) /otp/routers/waltti/vectorTiles/realtimeRentalStations/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-vehicle-parking/ { - rewrite /map/v3/waltti-vehicle-parking/(.*) /otp/routers/waltti/vectorTiles/vehicleParking/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; +location /map/v3/hsl/ticket-sales-map/ { + rewrite /map/v3/hsl/ticket-sales-map/(.*) /map/v2/hsl-ticket-sales-map/$1 break; + proxy_pass http://hsl-map-server:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/waltti-vehicle-parking-groups/ { - rewrite /map/v3/waltti-vehicle-parking-groups/(.*) /otp/routers/waltti/vectorTiles/vehicleParkingGroups/$1 break; +location /map/v3/waltti/ { + rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/finland-stops/ { - rewrite /map/v3/finland-stops/(.*) /otp/routers/finland/vectorTiles/stops/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/finland-stations/ { - rewrite /map/v3/finland-stations/(.*) /otp/routers/finland/vectorTiles/stations/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/finland-rental-stations/ { - rewrite /map/v3/finland-rental-stations/(.*) /otp/routers/finland/vectorTiles/rentalStations/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/finland-realtime-rental-stations/ { - rewrite /map/v3/finland-realtime-rental-stations/(.*) /otp/routers/finland/vectorTiles/realtimeRentalStations/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/finland-vehicle-parking/ { - rewrite /map/v3/finland-vehicle-parking/(.*) /otp/routers/finland/vectorTiles/vehicleParking/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/finland-vehicle-parking-groups/ { - rewrite /map/v3/finland-vehicle-parking-groups/(.*) /otp/routers/finland/vectorTiles/vehicleParkingGroups/$1 break; +location /map/v3/finland/ { + rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/waltti-alt-stops/ { - rewrite /map/v3/waltti-alt-stops/(.*) /otp/routers/waltti-alt/vectorTiles/stops/$1 break; +location /map/v3/waltti-alt/ { + rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/waltti-alt-stations/ { - rewrite /map/v3/waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/stations/$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-alt-rental-stations/ { - rewrite /map/v3/finland-waltti-alt-stations/(.*) /otp/routers/waltti-alt/vectorTiles/rentalStations/$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/waltti-alt-realtime-rental-stations/ { - rewrite /map/v3/waltti-alt-realtime-rental-stations/(.*) /otp/routers/waltti-alt/vectorTiles/realtimeRentalStations/$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/varely-stops/ { - rewrite /map/v3/varely-stops/(.*) /otp/routers/varely/vectorTiles/stops/$1 break; - proxy_pass http://opentripplanner-varely-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location /map/v3/varely-stations/ { - rewrite /map/v3/varely-stations/(.*) /otp/routers/varely/vectorTiles/stations/$1 break; +location /map/v3/varely/ { + rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; diff --git a/test.js b/test.js index 22b364c..6c67376 100644 --- a/test.js +++ b/test.js @@ -121,12 +121,12 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl-ticket-sales-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl-rental-stations/','opentripplanner-hsl-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti-rental-stations/','opentripplanner-waltti-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/finland-rental-stations/','opentripplanner-finland-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/varely-stops/','opentripplanner-varely-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti-alt-rental-stations/','opentripplanner-waltti-alt-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl/rental-stations/','opentripplanner-hsl-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti/rental-stations/','opentripplanner-waltti-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/finland/rental-stations/','opentripplanner-finland-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/varely/stops,stations/','opentripplanner-varely-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti-alt/rental-stations/','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From bf864ede31210c85af2cbe49497f970eb6795fe4 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Wed, 2 Nov 2022 12:50:14 +0200 Subject: [PATCH 145/328] chore: add Kajaani realtime DT-5567 --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index aeb4033..71a2218 100644 --- a/external.conf +++ b/external.conf @@ -277,6 +277,19 @@ location /out/linkkari.mattersoft.fi/ { proxy_set_header Authorization ROVANIEMI_BASIC_AUTH; } +#kajaani gtfs rt (https://kajaani.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/kajaani.mattersoft.fi/ { + proxy_pass https://kajaani.mattersoft.fi/; + 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; + proxy_set_header Authorization KAJAANI_BASIC_AUTH; +} + #perille gtfs location /out/gtfs.perille.fi/ { proxy_pass https://gtfs.perille.fi/; diff --git a/run.sh b/run.sh index 051d22c..5d3443b 100755 --- a/run.sh +++ b/run.sh @@ -23,6 +23,7 @@ sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/ROVANIEMI_BASIC_AUTH/${ROVANIEMI_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/KAJAANI_BASIC_AUTH/${KAJAANI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf diff --git a/test.sh b/test.sh index 2004561..9fbb9cc 100755 --- a/test.sh +++ b/test.sh @@ -20,7 +20,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -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 PERILLE_BASIC_AUTH="\"test\"" \ + -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" -e KAJAANI_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) From 15ddedf4bc36f914cecb0a45f8e5e18f0d77d1bd Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 11 Nov 2022 12:16:32 +0200 Subject: [PATCH 146/328] Include lang in path and set accept-language header for vector tile queries --- common.conf | 105 +++++++++++++++++++++++++++++++++++++++++++++++++--- test.js | 10 ++--- 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/common.conf b/common.conf index ccdc8b2..47aa1a3 100644 --- a/common.conf +++ b/common.conf @@ -172,12 +172,31 @@ location /map/v3/ { add_header X-Cache-Status $upstream_cache_status; } -location /map/v3/hsl/ { +location /map/v3/hsl/fi/ { rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3/hsl/sv/ { + rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; +} + +location /map/v3/hsl/en/ { + rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; } location /map/v3/hsl/ticket-sales-map/ { @@ -188,36 +207,112 @@ location /map/v3/hsl/ticket-sales-map/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /map/v3/waltti/ { +location /map/v3/waltti/fi/ { rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3/waltti/sv/ { + rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; +} + +location /map/v3/waltti/en/ { + rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; +} + +location /map/v3/finland/fi/ { + rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; } -location /map/v3/finland/ { +location /map/v3/finland/sv/ { rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; } -location /map/v3/waltti-alt/ { +location /map/v3/finland/en/ { + rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; +} + +location /map/v3/waltti-alt/fi/ { + rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3/waltti-alt/sv/ { rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; +} + +location /map/v3/waltti-alt/en/ { + rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; +} + +location /map/v3/varely/fi/ { + rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3/varely/sv/ { + rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; } -location /map/v3/varely/ { +location /map/v3/varely/en/ { rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; } location /graphiql/ { diff --git a/test.js b/test.js index 6c67376..eb5804a 100644 --- a/test.js +++ b/test.js @@ -122,11 +122,11 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl/rental-stations/','opentripplanner-hsl-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti/rental-stations/','opentripplanner-waltti-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/finland/rental-stations/','opentripplanner-finland-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/varely/stops,stations/','opentripplanner-varely-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti-alt/rental-stations/','opentripplanner-waltti-alt-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl/en/rental-stations/','opentripplanner-hsl-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti/en/rental-stations/','opentripplanner-waltti-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); From f7d570e888cef4a61ad360c46e604e8242ac0b5e Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 11 Nov 2022 12:34:05 +0200 Subject: [PATCH 147/328] Fix rewrites --- common.conf | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/common.conf b/common.conf index 47aa1a3..e73f886 100644 --- a/common.conf +++ b/common.conf @@ -173,7 +173,7 @@ location /map/v3/ { } location /map/v3/hsl/fi/ { - rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; + rewrite /map/v3/hsl/fi/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -182,7 +182,7 @@ location /map/v3/hsl/fi/ { } location /map/v3/hsl/sv/ { - rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; + rewrite /map/v3/hsl/sv/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -191,7 +191,7 @@ location /map/v3/hsl/sv/ { } location /map/v3/hsl/en/ { - rewrite /map/v3/hsl/(.*) /otp/routers/hsl/vectorTiles/$1 break; + rewrite /map/v3/hsl/en/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -208,7 +208,7 @@ location /map/v3/hsl/ticket-sales-map/ { } location /map/v3/waltti/fi/ { - rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; + rewrite /map/v3/waltti/fi/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -217,7 +217,7 @@ location /map/v3/waltti/fi/ { } location /map/v3/waltti/sv/ { - rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; + rewrite /map/v3/waltti/sv/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -226,7 +226,7 @@ location /map/v3/waltti/sv/ { } location /map/v3/waltti/en/ { - rewrite /map/v3/waltti/(.*) /otp/routers/waltti/vectorTiles/$1 break; + rewrite /map/v3/waltti/en/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -235,7 +235,7 @@ location /map/v3/waltti/en/ { } location /map/v3/finland/fi/ { - rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; + rewrite /map/v3/finland/fi/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -244,7 +244,7 @@ location /map/v3/finland/fi/ { } location /map/v3/finland/sv/ { - rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; + rewrite /map/v3/finland/sv/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -253,7 +253,7 @@ location /map/v3/finland/sv/ { } location /map/v3/finland/en/ { - rewrite /map/v3/finland/(.*) /otp/routers/finland/vectorTiles/$1 break; + rewrite /map/v3/finland/en/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -262,7 +262,7 @@ location /map/v3/finland/en/ { } location /map/v3/waltti-alt/fi/ { - rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; + rewrite /map/v3/waltti-alt/fi/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -271,7 +271,7 @@ location /map/v3/waltti-alt/fi/ { } location /map/v3/waltti-alt/sv/ { - rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; + rewrite /map/v3/waltti-alt/sv/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -280,7 +280,7 @@ location /map/v3/waltti-alt/sv/ { } location /map/v3/waltti-alt/en/ { - rewrite /map/v3/waltti-alt/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; + rewrite /map/v3/waltti-alt/en/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -289,7 +289,7 @@ location /map/v3/waltti-alt/en/ { } location /map/v3/varely/fi/ { - rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; + rewrite /map/v3/varely/fi/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -298,7 +298,7 @@ location /map/v3/varely/fi/ { } location /map/v3/varely/sv/ { - rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; + rewrite /map/v3/varely/sv/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; @@ -307,7 +307,7 @@ location /map/v3/varely/sv/ { } location /map/v3/varely/en/ { - rewrite /map/v3/varely/(.*) /otp/routers/varely/vectorTiles/$1 break; + rewrite /map/v3/varely/en/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; From 03b9e68a5e18a762094c81857f399b4cf9778406 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Thu, 8 Dec 2022 15:27:45 +0200 Subject: [PATCH 148/328] Remove api subscription key from geocoding cache DT-5607 --- common.conf | 1 + nginx.conf | 5 +++++ test.js | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common.conf b/common.conf index e73f886..bf1b0e6 100644 --- a/common.conf +++ b/common.conf @@ -3,6 +3,7 @@ location /geocoding/v1/ { proxy_pass http://pelias-api:8080/; proxy_cache geocoding; proxy_cache_valid 3d; + proxy_cache_key $geo_cache_key; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; add_header X-Proxy-Cache $upstream_cache_status; proxy_redirect off; diff --git a/nginx.conf b/nginx.conf index e62e585..a271313 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,6 +9,11 @@ daemon off; http { + map $request_uri $geo_cache_key { + "~(?geocoding\/v1\/(.*)\?)digitransit-subscription-key=((.*?)\&)(?(.*))" $location$params; + default $request_uri; + } + log_format custom '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_user_agent" $host $request_time'; diff --git a/test.js b/test.js index eb5804a..3e689b1 100644 --- a/test.js +++ b/test.js @@ -110,7 +110,9 @@ describe('api.digitransit.fi', function() { }); testProxying('api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); - //testCaching('api.digitransit.fi','/geocoding/v1/foo', true); + testCaching('api.digitransit.fi','/geocoding/v1/search?digitransit-subscription-key=1234567890&text=porin%20tori', true); + testCaching('api.digitransit.fi', '/geocoding/v1/reverse?digitransit-subscription-key=1234567890&point.lat=60.199284&point.lon=24.940540&size=1', true) + testCaching('api.digitransit.fi', '/geocoding/v1/autocomplete?digitransit-subscription-key=1234567890&text=kamp&layers=address', true) testProxying('api.digitransit.fi','/graphiql/hsl','graphiql:8080'); testProxying('api.digitransit.fi','/realtime/trip-updates/v1/FOLI','siri2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/trip-updates/v1/foo', false) From 127f7d148f8fb47e8854db72608356e2c3015338 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 9 Dec 2022 10:54:06 +0200 Subject: [PATCH 149/328] Use latest stable nginx version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8241977..377b137 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.20-alpine +FROM nginx:1.22-alpine MAINTAINER Reittiopas version: 0.1 ENV INSTALL_DIR="/opt/nginx" From 4ed4d27cdde989f57a455ba5c78f1d4dfbe77eb8 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Fri, 9 Dec 2022 11:33:23 +0200 Subject: [PATCH 150/328] change map proxy cache key --- common.conf | 3 +++ nginx.conf | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common.conf b/common.conf index bf1b0e6..5443142 100644 --- a/common.conf +++ b/common.conf @@ -144,6 +144,7 @@ location /map/v1/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; + add_header X-Test $map_cache_key; } location /map/v2/ { @@ -157,6 +158,7 @@ location /map/v2/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; + add_header X-Test $map_cache_key; } location /map/v3/ { @@ -171,6 +173,7 @@ location /map/v3/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; + add_header X-Test $map_cache_key; } location /map/v3/hsl/fi/ { diff --git a/nginx.conf b/nginx.conf index a271313..2d4d9b6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,12 +8,17 @@ daemon off; # because nginx doesn't copy port to redirects but always adds :8080 http { - + # map custom proxy cache keys for geocoding and maps map $request_uri $geo_cache_key { "~(?geocoding\/v1\/(.*)\?)digitransit-subscription-key=((.*?)\&)(?(.*))" $location$params; default $request_uri; } + map $request_uri $map_cache_key { + "~(?(.*map\/.*))\?digitransit-subscription-key=((.*))" $key_part; + default $request_uri; + } + log_format custom '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_user_agent" $host $request_time'; From ec1287e5c994ea682e8be066bd5d18afcde698f3 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Fri, 9 Dec 2022 12:04:23 +0200 Subject: [PATCH 151/328] fix bad pr --- common.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.conf b/common.conf index 5443142..cc8c224 100644 --- a/common.conf +++ b/common.conf @@ -137,6 +137,7 @@ location /map/v1/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_key $map_cache_key; proxy_cache_revalidate on; proxy_cache_lock on; proxy_redirect off; @@ -144,13 +145,13 @@ location /map/v1/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; - add_header X-Test $map_cache_key; } location /map/v2/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_key $map_cache_key; proxy_cache_revalidate on; proxy_cache_lock on; proxy_redirect off; @@ -158,7 +159,6 @@ location /map/v2/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; - add_header X-Test $map_cache_key; } location /map/v3/ { @@ -166,6 +166,7 @@ location /map/v3/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_key $map_cache_key; proxy_cache_revalidate on; proxy_cache_lock on; proxy_redirect off; @@ -173,7 +174,6 @@ location /map/v3/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; - add_header X-Test $map_cache_key; } location /map/v3/hsl/fi/ { From 1c5101d8961edd067f6055b2c49db1d72f0907a6 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 15 Dec 2022 15:14:32 +0200 Subject: [PATCH 152/328] Remove couple of old unused domains --- nginx.conf | 26 -------------------------- test.js | 10 ---------- 2 files changed, 36 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2d4d9b6..ed8e0e7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -201,15 +201,6 @@ http { return 301 https://dev.digitransit.fi; } - server { - server_name dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi; - listen 8080; - - location / { - return 301 https://reittiopas.tampere.fi; - } - } - server { server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi @@ -459,23 +450,6 @@ http { } } - server { - server_name sentry-analytics.digitransit.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - location / { - proxy_pass http://digitransit-sentry-analytics:8080; - include basicsettings.conf; - } - } - server { server_name dev-matka-yleisviesti.digitransit.fi matka-yleisviesti.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 3e689b1..f34d0ec 100644 --- a/test.js +++ b/test.js @@ -252,16 +252,6 @@ describe('waltti ui', function() { }); }); }); - -describe('linjasto2021 ui', function() { - testRedirect('linjasto2021.digitransit.fi','/kissa','https://reittiopas.tampere.fi'); -}); - -describe('sentry-analytics', function() { - testProxying('sentry-analytics.digitransit.fi','/','digitransit-sentry-analytics:8080', true); - testRedirect('sentry-analytics.digitransit.fi','/kissa','https://sentry-analytics.digitransit.fi/kissa'); -}); - describe('yleisviestipalvelu', function() { testCaching('matka-yleisviesti.digitransit.fi','/', true); testProxying('matka-yleisviesti.digitransit.fi','/','yleisviestipalvelu:8080', true); From 5c4be80ff31d2b851184263e772906ed3dfbcb68 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 5 Jan 2023 12:45:24 +0200 Subject: [PATCH 153/328] Add rauma external endpoints --- external.conf | 26 ++++++++++++++++++++++++++ run.sh | 2 ++ test.sh | 1 + 3 files changed, 29 insertions(+) diff --git a/external.conf b/external.conf index 71a2218..72c3187 100644 --- a/external.conf +++ b/external.conf @@ -290,6 +290,32 @@ location /out/kajaani.mattersoft.fi/ { proxy_set_header Authorization KAJAANI_BASIC_AUTH; } +#rauma gtfs rt (https://rauma.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/rauma.mattersoft.fi/ { + proxy_pass https://rauma.mattersoft.fi/; + 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; + proxy_set_header Authorization RAUMA_RT_BASIC_AUTH; +} + +#rauma gtfs (https://raumaadmin.mattersoft.fi/feeds/233.zip) +location /out/raumaadmin.mattersoft.fi/ { + proxy_pass https://raumaadmin.mattersoft.fi/; + 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; + proxy_set_header Authorization RAUMA_STATIC_BASIC_AUTH; +} + #perille gtfs location /out/gtfs.perille.fi/ { proxy_pass https://gtfs.perille.fi/; diff --git a/run.sh b/run.sh index 5d3443b..a9a3e14 100755 --- a/run.sh +++ b/run.sh @@ -26,6 +26,8 @@ sed -i "s/ROVANIEMI_BASIC_AUTH/${ROVANIEMI_BASIC_AUTH}/" /etc/nginx/external.con sed -i "s/KAJAANI_BASIC_AUTH/${KAJAANI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 9fbb9cc..e80fd4c 100755 --- a/test.sh +++ b/test.sh @@ -23,6 +23,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e KOUVOLA_BASIC_AUTH="\"test\"" -e PERILLE_BASIC_AUTH="\"test\"" -e KAJAANI_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ + -e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 059352a04c8dce3898f31556af19c9dbf4ee4f0a Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 5 Jan 2023 13:06:33 +0200 Subject: [PATCH 154/328] Use newer ubuntu for running actions --- .github/workflows/dev-pipeline.yml | 4 ++-- .github/workflows/prod-pipeline.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index aab7324..687ad59 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -8,7 +8,7 @@ on: - master jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: matrix: node-version: [10.x] @@ -27,7 +27,7 @@ jobs: if: github.ref == 'refs/heads/master' needs: - test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index e332e89..1d88566 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -5,7 +5,7 @@ on: - published jobs: prod-push: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 From c53dabb0c34e00d62498419ba4e4e6cdbab91191 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 23 Jan 2023 10:48:37 +0200 Subject: [PATCH 155/328] Remove perille external endpoint --- external.conf | 7 ------- run.sh | 1 - test.sh | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/external.conf b/external.conf index 72c3187..14e8ca2 100644 --- a/external.conf +++ b/external.conf @@ -316,13 +316,6 @@ location /out/raumaadmin.mattersoft.fi/ { proxy_set_header Authorization RAUMA_STATIC_BASIC_AUTH; } -#perille gtfs -location /out/gtfs.perille.fi/ { - proxy_pass https://gtfs.perille.fi/; - include allowed-ips.conf; - proxy_set_header Authorization PERILLE_BASIC_AUTH; -} - #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/; diff --git a/run.sh b/run.sh index a9a3e14..900e68a 100755 --- a/run.sh +++ b/run.sh @@ -19,7 +19,6 @@ sed -i "s/MIKKELI_BASIC_AUTH/${MIKKELI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/VAASA_BASIC_AUTH/${VAASA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/SALO_BASIC_AUTH/${SALO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/KOUVOLA_BASIC_AUTH/${KOUVOLA_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/PERILLE_BASIC_AUTH/${PERILLE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_TAMPERE_AUTH/${GIRAVOLTA_TAMPERE_AUTH}/" /etc/nginx/external.conf sed -i "s/KOTKA_BASIC_AUTH/${KOTKA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/ROVANIEMI_BASIC_AUTH/${ROVANIEMI_BASIC_AUTH}/" /etc/nginx/external.conf diff --git a/test.sh b/test.sh index e80fd4c..82bdd1d 100755 --- a/test.sh +++ b/test.sh @@ -20,7 +20,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -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 PERILLE_BASIC_AUTH="\"test\"" -e KAJAANI_BASIC_AUTH="\"test\"" \ + -e KOUVOLA_BASIC_AUTH="\"test\"" -e KAJAANI_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ -e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \ From 8ff9ac653308f9d78cccd88f569c80e66fb95292 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 17 Feb 2023 14:04:12 +0200 Subject: [PATCH 156/328] Use v3 ui for tampere journey planners --- nginx.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index ed8e0e7..a383d62 100644 --- a/nginx.conf +++ b/nginx.conf @@ -212,7 +212,6 @@ http { dev-mikkeli.digitransit.fi mikkeli.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; @@ -266,6 +265,10 @@ http { next-dev-oulu.digitransit.fi next-dev-turku.digitransit.fi next-dev-tampere.digitransit.fi + dev-tampere.digitransit.fi + tampere.digitransit.fi + repa.tampere.fi + reittiopas.tampere.fi next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi From 954e42e522b321c5e284775e37781eb10bfaecd1 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Feb 2023 10:07:18 +0200 Subject: [PATCH 157/328] Update tests for tampere --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index f34d0ec..aa602e3 100644 --- a/test.js +++ b/test.js @@ -230,10 +230,10 @@ describe('waltti ui', function() { testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-v2:8080', true); testRedirect('repa.tampere.fi','/kissa','https://repa.tampere.fi/kissa'); - testProxying('repa.tampere.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying('repa.tampere.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('reittiopas.tampere.fi','/kissa','https://reittiopas.tampere.fi/kissa'); - testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-v3:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); From 9e1a9a099080a345005472e145b68ae0148c14fd Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Feb 2023 10:17:08 +0200 Subject: [PATCH 158/328] Update node version --- .github/workflows/dev-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 687ad59..354d26b 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - node-version: [10.x] + node-version: [12.x] steps: - name: Checkout uses: actions/checkout@v2 From 8d55153294b9c6317a899ea6ef8124898fff401b Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Feb 2023 10:19:56 +0200 Subject: [PATCH 159/328] Update node even more --- .github/workflows/dev-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 354d26b..bd3d937 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - node-version: [12.x] + node-version: [16.x] steps: - name: Checkout uses: actions/checkout@v2 From c2ab87feb9c98cdd433887f98227bf3418258f07 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Feb 2023 10:31:04 +0200 Subject: [PATCH 160/328] Keep dev-tampere in v2 ui --- nginx.conf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index a383d62..d4f968b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -212,6 +212,7 @@ http { dev-mikkeli.digitransit.fi mikkeli.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-tampere.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; @@ -264,11 +265,7 @@ http { next-dev-mikkeli.digitransit.fi next-dev-oulu.digitransit.fi next-dev-turku.digitransit.fi - next-dev-tampere.digitransit.fi - dev-tampere.digitransit.fi - tampere.digitransit.fi - repa.tampere.fi - reittiopas.tampere.fi + next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi From e389a0dd32ff071732cdc666bfee2fc65d5d2ffe Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Feb 2023 10:41:27 +0200 Subject: [PATCH 161/328] Fix one more tampere test, remove test for unused and broken manual-gtfs --- test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test.js b/test.js index aa602e3..6b297c1 100644 --- a/test.js +++ b/test.js @@ -210,7 +210,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna', + 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'vaasa', 'hameenlinna', 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu', 'rovaniemi' ]; @@ -278,6 +278,5 @@ describe('ext-proxy', function() { testCaching('api.digitransit.fi','/out/data.foli.fi/citybike/smoove',false); testCaching('api.digitransit.fi','/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false); testCaching('api.digitransit.fi','/out/92.62.36.215/RTIX/trip-updates',false); - testCaching('api.digitransit.fi','/out/tyokalu.navici.com/joukkoliikenne/manual-gtfsrt/api/gtfsrt/alerts',false); testCaching('api.digitransit.fi','/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); From f946b72c19204a3d2f53e8c66724e8130ee2f853 Mon Sep 17 00:00:00 2001 From: Topi Koivunen Date: Mon, 27 Feb 2023 10:48:07 +0200 Subject: [PATCH 162/328] oulu realtime proxy --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 14e8ca2..8ebb74a 100644 --- a/external.conf +++ b/external.conf @@ -58,6 +58,19 @@ location /out/92.62.36.215/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +#oulu rt (https://oulu.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/oulu.mattersoft.fi/ { + proxy_pass https://oulu.mattersoft.fi/; + 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; + proxy_set_header Authorization OULU_RT_BASIC_AUTH; +} + #new livi gtfs rt (https://tyokalu.navici.com/joukkoliikenne/manual-gtfsrt/api/gtfsrt/alerts) location /out/tyokalu.navici.com/ { proxy_pass https://tyokalu.navici.com/; diff --git a/run.sh b/run.sh index 900e68a..c351c56 100755 --- a/run.sh +++ b/run.sh @@ -27,6 +27,7 @@ sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.c sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 82bdd1d..8253635 100755 --- a/test.sh +++ b/test.sh @@ -20,7 +20,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -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 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 GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ -e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \ From 9094eba6f944234a0877c625d88bf8a3983f1d6d Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 28 Feb 2023 14:48:46 +0200 Subject: [PATCH 163/328] Move more waltti cities to otp2 --- nginx.conf | 24 ++++++++++++------------ test.js | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/nginx.conf b/nginx.conf index d4f968b..9d0a901 100644 --- a/nginx.conf +++ b/nginx.conf @@ -202,18 +202,18 @@ http { } server { - server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + server_name dev-hameenlinna.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - dev-kotka.digitransit.fi kotka.digitransit.fi + dev-kotka.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi - dev-lahti.digitransit.fi lahti.digitransit.fi + dev-lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - dev-oulu.digitransit.fi oulu.digitransit.fi - dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-oulu.digitransit.fi + dev-turku.digitransit.fi dev-tampere.digitransit.fi - dev-kouvola.digitransit.fi kouvola.digitransit.fi + dev-kouvola.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi; @@ -255,18 +255,18 @@ http { } server { - server_name next-dev-hameenlinna.digitransit.fi + server_name next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi next-dev-joensuu.digitransit.fi next-dev-jyvaskyla.digitransit.fi - next-dev-kotka.digitransit.fi + next-dev-kotka.digitransit.fi kotka.digitransit.fi next-dev-kuopio.digitransit.fi - next-dev-lahti.digitransit.fi + next-dev-lahti.digitransit.fi lahti.digitransit.fi next-dev-lappeenranta.digitransit.fi next-dev-mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi - next-dev-turku.digitransit.fi + next-dev-oulu.digitransit.fi oulu.digitransit.fi + next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi - next-dev-kouvola.digitransit.fi + next-dev-kouvola.digitransit.fi kouvola.digitransit.fi next-dev-rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi next-dev-vaasa.digitransit.fi diff --git a/test.js b/test.js index 6b297c1..33b2d21 100644 --- a/test.js +++ b/test.js @@ -210,8 +210,8 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'vaasa', 'hameenlinna', - 'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu', 'rovaniemi' + 'jyvaskyla', 'kuopio', 'mikkeli', 'vaasa', + 'joensuu', 'lappeenranta', 'rovaniemi' ]; walttiCities.forEach(function(city) { From c38a9b70d48a72f6e49217fe437f9b3bff7ad277 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 28 Feb 2023 14:53:31 +0200 Subject: [PATCH 164/328] Update city specific tests too --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index 33b2d21..cf8eef3 100644 --- a/test.js +++ b/test.js @@ -224,10 +224,10 @@ describe('waltti ui', function() { }); testRedirect('reittiopas.foli.fi','/kissa','https://reittiopas.foli.fi/kissa'); - testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying('reittiopas.foli.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('reittiopas.hameenlinna.fi','/kissa','https://reittiopas.hameenlinna.fi/kissa'); - testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying('reittiopas.hameenlinna.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('repa.tampere.fi','/kissa','https://repa.tampere.fi/kissa'); testProxying('repa.tampere.fi','/','digitransit-ui-waltti-v3:8080', true); From b482d33ac62933b54b28d7d9dc4dbe259338b792 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 7 Mar 2023 12:11:37 +0200 Subject: [PATCH 165/328] Move the rest of waltti cities to OTP2 routing --- nginx.conf | 29 ++++++++++++++--------------- test.js | 6 +++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/nginx.conf b/nginx.conf index 9d0a901..414104c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -203,20 +203,19 @@ http { server { server_name dev-hameenlinna.digitransit.fi - dev-joensuu.digitransit.fi joensuu.digitransit.fi - dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + dev-joensuu.digitransit.fi + dev-jyvaskyla.digitransit.fi dev-kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-kuopio.digitransit.fi dev-lahti.digitransit.fi - dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + dev-lappeenranta.digitransit.fi + dev-mikkeli.digitransit.fi dev-oulu.digitransit.fi dev-turku.digitransit.fi dev-tampere.digitransit.fi dev-kouvola.digitransit.fi - dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-vaasa.digitransit.fi vaasa.digitransit.fi; - + dev-rovaniemi.digitransit.fi + dev-vaasa.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -256,20 +255,20 @@ http { server { server_name next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - next-dev-joensuu.digitransit.fi - next-dev-jyvaskyla.digitransit.fi + next-dev-joensuu.digitransit.fi joensuu.digitransit.fi + next-dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi next-dev-kotka.digitransit.fi kotka.digitransit.fi - next-dev-kuopio.digitransit.fi + next-dev-kuopio.digitransit.fi kuopio.digitransit.fi next-dev-lahti.digitransit.fi lahti.digitransit.fi - next-dev-lappeenranta.digitransit.fi - next-dev-mikkeli.digitransit.fi + next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi next-dev-oulu.digitransit.fi oulu.digitransit.fi next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi - next-dev-rovaniemi.digitransit.fi + next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi - next-dev-vaasa.digitransit.fi + next-dev-vaasa.digitransit.fi vaasa.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi; listen 8080; diff --git a/test.js b/test.js index cf8eef3..fa2caa2 100644 --- a/test.js +++ b/test.js @@ -210,8 +210,8 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'jyvaskyla', 'kuopio', 'mikkeli', 'vaasa', - 'joensuu', 'lappeenranta', 'rovaniemi' + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', + 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; walttiCities.forEach(function(city) { @@ -220,7 +220,7 @@ describe('waltti ui', function() { testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); - testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-v2:8080', true); + testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); }); testRedirect('reittiopas.foli.fi','/kissa','https://reittiopas.foli.fi/kissa'); From cd846fa3f3b4165c50eca7e6c16879122bdb42f2 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 10 Mar 2023 11:06:26 +0200 Subject: [PATCH 166/328] Use v3 UI for HSL journey planner --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 414104c..f642bac 100644 --- a/nginx.conf +++ b/nginx.conf @@ -308,7 +308,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -357,7 +357,7 @@ http { } server { - server_name next-dev.digitransit.fi; + server_name next-dev.digitransit.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 9ed18e037cd352a4fdd43cf0d7a63cc26ba77f77 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 10 Mar 2023 11:08:16 +0200 Subject: [PATCH 167/328] Update hsl UI test --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index fa2caa2..b198f73 100644 --- a/test.js +++ b/test.js @@ -181,7 +181,7 @@ describe('hsl ui', function() { testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-v2:8080', true); testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); - testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true); + testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v3:8080', true); testCaching('reittiopas.hsl.fi','/sw.js', true); From 118ee06b86604e351e4136b207ac4e189a3156c3 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 10 Mar 2023 11:19:21 +0200 Subject: [PATCH 168/328] Add root redirect to hsl UI v3 --- nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx.conf b/nginx.conf index f642bac..99307c8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -396,6 +396,10 @@ http { include basicsettings.conf; } + location = / { + return 301 https://test.hslfi.hsldev.com/?fromJourneyPlanner=true; + } + location / { proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; From edd58980c135779920e443782a9c65aac60f5183 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 20 Mar 2023 15:27:57 +0200 Subject: [PATCH 169/328] Direct opas.matka.fi to v3 UI --- nginx.conf | 4 ++-- test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 99307c8..c011c21 100644 --- a/nginx.conf +++ b/nginx.conf @@ -117,7 +117,7 @@ http { } server { - server_name dev.digitransit.fi opas.matka.fi; + server_name dev.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -156,7 +156,7 @@ http { } server { - server_name next-dev-matka.digitransit.fi; + server_name next-dev-matka.digitransit.fi opas.matka.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index b198f73..74afee2 100644 --- a/test.js +++ b/test.js @@ -196,7 +196,7 @@ describe('matka ui', function() { testRedirect('www.opas.matka.fi','/kissa','http://opas.matka.fi/kissa'); testRedirect('opas.matka.fi','/kissa','https://opas.matka.fi/kissa'); - testProxying('opas.matka.fi','/','digitransit-ui-matka-v2:8080', true); + testProxying('opas.matka.fi','/','digitransit-ui-matka-v3:8080', true); testCaching('opas.matka.fi','/sw.js', true); From 0a3bb331a9aaca0a4d9e69f23c939c3f69c61c96 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 11 Apr 2023 10:32:34 +0300 Subject: [PATCH 170/328] Remove removed API endpoints from code --- common.conf | 118 ---------------------------------------------------- run.sh | 1 - test.js | 5 --- test.sh | 2 +- 4 files changed, 1 insertion(+), 125 deletions(-) diff --git a/common.conf b/common.conf index cc8c224..d7613a8 100644 --- a/common.conf +++ b/common.conf @@ -29,124 +29,6 @@ location /realtime/trip-updates/v1/FOLI { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#legacy HSL trip update endpoint that is identical to v2 now -location /realtime/trip-updates/v1/HSL { - proxy_pass https://transitdatadev.blob.core.windows.net/trip-updates/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -# used to be "alias" for hslalert, now same as v2 -location /realtime/service-alerts/v1/ { - proxy_pass https://transitdatadev.blob.core.windows.net/service-alerts/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -location /realtime/service-alerts/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/service-alerts/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -location /realtime/trip-updates/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/trip-updates/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -location /realtime/vehicle-positions/v2/hsl { - proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions/v2/hsl; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - -#"alias" for navigator-server -location /realtime/vehicle-positions/v1/ { - rewrite /realtime/vehicle-positions/v1/(.*) /$1 break; - proxy_pass http://navigator-server:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -location /realtime/raildigitraffic2gtfsrt/v1/ { - rewrite /realtime/raildigitraffic2gtfsrt/v1/(.*) /$1 break; - proxy_pass http://raildigitraffic2gtfsrt:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; - # proxy_cache common; - # proxy_cache_valid 200 30s; - # proxy_cache_lock on; - # proxy_cache_key "$host$request_uri"; - # 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; -} - -location /map/v1/ { - proxy_pass http://hsl-map-server:8080; - proxy_cache tiles; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - proxy_cache_key $map_cache_key; - proxy_cache_revalidate on; - proxy_cache_lock on; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - add_header X-Cache-Status $upstream_cache_status; -} - location /map/v2/ { proxy_pass http://hsl-map-server:8080; proxy_cache tiles; diff --git a/run.sh b/run.sh index c351c56..f22129d 100755 --- a/run.sh +++ b/run.sh @@ -10,7 +10,6 @@ sed -i "s/JOJO_BASIC_AUTH/${JOJO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/LAPPEENRANTA_BASIC_AUTH/${LAPPEENRANTA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/LINKKI_BASIC_AUTH/${LINKKI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/NEW_LISSU_BASIC_AUTH/${NEW_LISSU_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/transitdatadev/${HSL_RT_STORAGE_NAME}/" /etc/nginx/common.conf sed -i "s/LAHTI_BASIC_AUTH/${LAHTI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/HAMEENLINNA_BASIC_AUTH/${HAMEENLINNA_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/test.hslfi.hsldev.com/${NEW_HSL_FI_URL}/" /etc/nginx/nginx.conf diff --git a/test.js b/test.js index 74afee2..2c90ac1 100644 --- a/test.js +++ b/test.js @@ -116,11 +116,6 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/graphiql/hsl','graphiql:8080'); testProxying('api.digitransit.fi','/realtime/trip-updates/v1/FOLI','siri2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/trip-updates/v1/foo', false) - testProxying('api.digitransit.fi','/realtime/vehicle-positions/v1/','navigator-server:8080'); - // testCaching('api.digitransit.fi','/realtime/vehicle-positions/v1/foo',false); - testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); - //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); - testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); diff --git a/test.sh b/test.sh index 8253635..2879c47 100755 --- a/test.sh +++ b/test.sh @@ -16,7 +16,7 @@ echo "$ADDHOSTS" CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test\"" \ -e JOJO_BASIC_AUTH="\"test\"" -e LAPPEENRANTA_BASIC_AUTH="\"test\"" -e LINKKI_BASIC_AUTH="\"test\"" \ - -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" -e HSL_RT_STORAGE_NAME=transitdataprod \ + -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ -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\"" \ From 56668b86af9d80f6eb69541cee7f3ef914023787 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 18 Apr 2023 18:09:19 +0300 Subject: [PATCH 171/328] Use newer version of nginx --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 377b137..5a18723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.22-alpine +FROM nginx:1.24-alpine MAINTAINER Reittiopas version: 0.1 ENV INSTALL_DIR="/opt/nginx" From 2d4062ad927ad37c33a18189420476a3f30c6169 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 21 Apr 2023 08:30:03 +0300 Subject: [PATCH 172/328] Try hiding static folder index --- nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx.conf b/nginx.conf index c011c21..5a45d43 100644 --- a/nginx.conf +++ b/nginx.conf @@ -499,6 +499,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /static { + autoindex off; + } + location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From 3dc988f6f32722b9be7824267d0f34198f26c89b Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 21 Apr 2023 08:43:16 +0300 Subject: [PATCH 173/328] Don't cache failed giravolta requests --- external.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/external.conf b/external.conf index 8ebb74a..786de9d 100644 --- a/external.conf +++ b/external.conf @@ -350,7 +350,7 @@ location = /out/tampere-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_valid 200 302 30s; proxy_cache_lock on; add_header X-Proxy-Cache $upstream_cache_status; proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; @@ -368,7 +368,7 @@ 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_valid 200 302 30s; proxy_cache_lock on; add_header X-Proxy-Cache $upstream_cache_status; proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; @@ -387,7 +387,7 @@ 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_valid 200 302 30s; proxy_cache_lock on; add_header X-Proxy-Cache $upstream_cache_status; proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; @@ -405,7 +405,7 @@ location /out/vantaa-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; - proxy_cache_valid any 30s; + proxy_cache_valid 200 302 30s; proxy_cache_lock on; add_header X-Proxy-Cache $upstream_cache_status; proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; From 4a51d29fe03b98a845a3e7ce68b05c8b2a80f17a Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 21 Apr 2023 10:42:57 +0300 Subject: [PATCH 174/328] Update kuopio citybike api --- external.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external.conf b/external.conf index 786de9d..bfc383b 100644 --- a/external.conf +++ b/external.conf @@ -187,9 +187,9 @@ location /out/lsl.mattersoft.fi/ { proxy_set_header Authorization LAHTI_BASIC_AUTH; } -#Vilkku (Kuopio) bike stations (https://kaupunkipyorat.kuopio.fi/tkhs-export-map.html?format=xml) -location /out/kaupunkipyorat.kuopio.fi/ { - proxy_pass https://kaupunkipyorat.kuopio.fi/; +#Vilkku (Kuopio) bike stations (https://tkhskuopiostrg.blob.core.windows.net/gbfs/gbfs.json) +location /out/tkhskuopiostrg.blob.core.windows.net/ { + proxy_pass https://tkhskuopiostrg.blob.core.windows.net/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid any 60s; From 8ac4bceac7b861780c0e4783b05b4bfb29074584 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Sat, 22 Apr 2023 12:04:18 +0300 Subject: [PATCH 175/328] Turn off autoindex for whole digitransit site --- nginx.conf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5a45d43..16aae66 100644 --- a/nginx.conf +++ b/nginx.conf @@ -495,14 +495,11 @@ http { if ($http_x_forwarded_proto != "https") { return 301 https://$host$request_uri; } + autoindex off; # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /static { - autoindex off; - } - location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From f6c1e27033e23cd15d6c53675339ac7b5890d906 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Sat, 22 Apr 2023 13:41:15 +0300 Subject: [PATCH 176/328] Try autoindex only in static path but with proxy_pass --- nginx.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 16aae66..9282c93 100644 --- a/nginx.conf +++ b/nginx.conf @@ -495,11 +495,16 @@ http { if ($http_x_forwarded_proto != "https") { return 301 https://$host$request_uri; } - autoindex off; # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location = /static { + autoindex off; + proxy_pass http://digitransit-site:8080; + include basicsettings.conf; + } + location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From ec16b0052dd7e3efc9cbd1d6fb1180b9e0a5ab6b Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Sat, 22 Apr 2023 13:51:16 +0300 Subject: [PATCH 177/328] Try rewriting static path --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 9282c93..08fe752 100644 --- a/nginx.conf +++ b/nginx.conf @@ -500,8 +500,8 @@ http { add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; location = /static { - autoindex off; - proxy_pass http://digitransit-site:8080; + rewrite /static / break; + proxy_pass http://digitransit-site:8080; include basicsettings.conf; } From 29ba7a95869d6d2af96e9ae80917f79ab3fee59b Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Sat, 22 Apr 2023 14:02:11 +0300 Subject: [PATCH 178/328] Rewrite /static/ path too --- nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nginx.conf b/nginx.conf index 08fe752..076394a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -505,6 +505,12 @@ http { include basicsettings.conf; } + location = /static/ { + rewrite /static/ / break; + proxy_pass http://digitransit-site:8080; + include basicsettings.conf; + } + location / { proxy_pass http://digitransit-site:8080; include basicsettings.conf; From 41bec96aaf9f4e1323d39c438e1bbe49d29c37f5 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 24 Apr 2023 12:27:28 +0300 Subject: [PATCH 179/328] add Pori config --- nginx.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 076394a..5b98f94 100644 --- a/nginx.conf +++ b/nginx.conf @@ -215,7 +215,8 @@ http { dev-tampere.digitransit.fi dev-kouvola.digitransit.fi dev-rovaniemi.digitransit.fi - dev-vaasa.digitransit.fi; + dev-vaasa.digitransit.fi + dev-pori.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -269,6 +270,7 @@ http { next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi + next-dev-pori.digitransit.fi pori.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi; listen 8080; From a72ab7e87b0609f9b11cca8b417c6427955ae278 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Tue, 25 Apr 2023 10:54:14 +0300 Subject: [PATCH 180/328] pori external --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 1 + 3 files changed, 15 insertions(+) diff --git a/external.conf b/external.conf index bfc383b..9e5f6c9 100644 --- a/external.conf +++ b/external.conf @@ -316,6 +316,19 @@ location /out/rauma.mattersoft.fi/ { proxy_set_header Authorization RAUMA_RT_BASIC_AUTH; } +#pori gtfs rt (https://pjl.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/pjl.mattersoft.fi/ { + proxy_pass https://pjl.mattersoft.fi/; + 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; + proxy_set_header Authorization PORI_RT_BASIC_AUTH; +} + #rauma gtfs (https://raumaadmin.mattersoft.fi/feeds/233.zip) location /out/raumaadmin.mattersoft.fi/ { proxy_pass https://raumaadmin.mattersoft.fi/; diff --git a/run.sh b/run.sh index f22129d..cd2680a 100755 --- a/run.sh +++ b/run.sh @@ -27,6 +27,7 @@ sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 2879c47..3f5318d 100755 --- a/test.sh +++ b/test.sh @@ -24,6 +24,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ -e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \ + -e PORI_RT_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 393c4c860849914dfacb7203a8da9a5136b2d658 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Wed, 26 Apr 2023 14:51:06 +0300 Subject: [PATCH 181/328] Add kelareitit --- nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 5b98f94..d9d4038 100644 --- a/nginx.conf +++ b/nginx.conf @@ -156,7 +156,8 @@ http { } server { - server_name next-dev-matka.digitransit.fi opas.matka.fi; + server_name next-dev-matka.digitransit.fi opas.matka.fi + dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From f5e7fd3a9e06a024bde016224ae820554c54df12 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 28 Apr 2023 13:10:30 +0300 Subject: [PATCH 182/328] Add kela data container --- common.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common.conf b/common.conf index d7613a8..b068b80 100644 --- a/common.conf +++ b/common.conf @@ -359,6 +359,16 @@ location /routing-data/v3/varely { include cors.conf; } +location /routing-data/v3/kela { + rewrite /routing-data/v3/kela/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-kela-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; From bee6e5a953e758f67a211026f646dc42e185d906 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 4 May 2023 08:22:29 +0300 Subject: [PATCH 183/328] Add api paths for kela otp services --- common.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/common.conf b/common.conf index d7613a8..32e4ab3 100644 --- a/common.conf +++ b/common.conf @@ -201,6 +201,33 @@ location /map/v3/varely/en/ { proxy_set_header Accept-Language "en"; } +location /map/v3/kela/fi/ { + rewrite /map/v3/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3/kela/sv/ { + rewrite /map/v3/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; +} + +location /map/v3/kela/en/ { + rewrite /map/v3/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; +} + location /graphiql/ { proxy_pass http://graphiql:8080; proxy_redirect off; @@ -289,6 +316,16 @@ location /routing/v2/routers/varely { proxy_read_timeout 11500ms; } +location /routing/v2/routers/kela { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; From 4b71299f7de6a9389490be4f192320d4294d3285 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 5 May 2023 09:39:51 +0300 Subject: [PATCH 184/328] Redicect waltti and finland v2 ui to v3 ui --- nginx.conf | 77 +++--------------------------------------------------- 1 file changed, 3 insertions(+), 74 deletions(-) diff --git a/nginx.conf b/nginx.conf index d9d4038..ca0055b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -116,45 +116,6 @@ http { } } - server { - server_name dev.digitransit.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - error_page 500 502 503 504 /502.html; - location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; - internal; - } - - location = /sw.js { - proxy_pass http://digitransit-ui-matka-v2:8080; - include basicsettings.conf; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - location = /haku { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-matka-v2:8080; - include basicsettings.conf; - } - location / { - proxy_pass http://digitransit-ui-matka-v2:8080; - include basicsettings.conf; - } - } - server { server_name next-dev-matka.digitransit.fi opas.matka.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; @@ -196,10 +157,10 @@ http { } server { - server_name beta.matka.fi; + server_name beta.matka.fi dev.digitransit.fi; listen 8080; - return 301 https://dev.digitransit.fi; + return 301 https://next-dev-matka.digitransit.fi; } server { @@ -220,39 +181,7 @@ http { dev-pori.digitransit.fi; listen 8080; - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - error_page 500 502 503 504 /502.html; - location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; - internal; - } - - location = /sw.js { - proxy_pass http://digitransit-ui-waltti-v2:8080; - include basicsettings.conf; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - location = /haku { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-waltti-v2:8080; - include basicsettings.conf; - } - location / { - proxy_pass http://digitransit-ui-waltti-v2:8080; - include basicsettings.conf; - } + return 301 $scheme://next-$host$request_uri; } server { From c13f129a5cf6b537d6da2bb1b71fab25668f2e61 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 5 May 2023 11:18:37 +0300 Subject: [PATCH 185/328] Update tests --- test.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test.js b/test.js index 2c90ac1..2e996fb 100644 --- a/test.js +++ b/test.js @@ -145,12 +145,9 @@ describe('api.digitransit.fi', function() { testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/ui/v1/finland/sw.js','digitransit-ui-matka-v2:8080'); - testProxying('api.digitransit.fi','/ui/v1/hsl-next/sw.js','digitransit-ui-hsl-v2:8080'); - testProxying('api.digitransit.fi','/ui/v1/waltti-next/sw.js','digitransit-ui-waltti-v2:8080'); - testProxying('api.digitransit.fi','/ui/v2/matka/sw.js','digitransit-ui-matka-v2:8080'); - testProxying('api.digitransit.fi','/ui/v2/hsl/sw.js','digitransit-ui-hsl-v2:8080'); - testProxying('api.digitransit.fi','/ui/v2/waltti/sw.js','digitransit-ui-waltti-v2:8080'); + testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); + testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); + testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); @@ -210,8 +207,8 @@ describe('waltti ui', function() { ]; walttiCities.forEach(function(city) { - testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa'); - testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v2:8080', true); + testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); From c210250ad1ff0edb007b5b714479463caf27d3ce Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 5 May 2023 11:33:35 +0300 Subject: [PATCH 186/328] Serve dev-city.digitransit domains using v3 ui server --- nginx.conf | 56 ++++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/nginx.conf b/nginx.conf index ca0055b..e0c290a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -117,7 +117,7 @@ http { } server { - server_name next-dev-matka.digitransit.fi opas.matka.fi + server_name dev.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; @@ -157,50 +157,30 @@ http { } server { - server_name beta.matka.fi dev.digitransit.fi; + server_name beta.matka.fi listen 8080; return 301 https://next-dev-matka.digitransit.fi; } - server { - server_name dev-hameenlinna.digitransit.fi - dev-joensuu.digitransit.fi - dev-jyvaskyla.digitransit.fi - dev-kotka.digitransit.fi - dev-kuopio.digitransit.fi - dev-lahti.digitransit.fi - dev-lappeenranta.digitransit.fi - dev-mikkeli.digitransit.fi - dev-oulu.digitransit.fi - dev-turku.digitransit.fi - dev-tampere.digitransit.fi - dev-kouvola.digitransit.fi - dev-rovaniemi.digitransit.fi - dev-vaasa.digitransit.fi - dev-pori.digitransit.fi; - listen 8080; - - return 301 $scheme://next-$host$request_uri; - } server { - server_name next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - next-dev-joensuu.digitransit.fi joensuu.digitransit.fi - next-dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - next-dev-kotka.digitransit.fi kotka.digitransit.fi - next-dev-kuopio.digitransit.fi kuopio.digitransit.fi - next-dev-lahti.digitransit.fi lahti.digitransit.fi - next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - next-dev-oulu.digitransit.fi oulu.digitransit.fi - next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi - next-dev-kouvola.digitransit.fi kouvola.digitransit.fi - next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi - next-dev-vaasa.digitransit.fi vaasa.digitransit.fi - next-dev-pori.digitransit.fi pori.digitransit.fi + server_name dev-hameenlinna.digitransit.fi next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + dev-joensuu.digitransit.fi next-dev-joensuu.digitransit.fi joensuu.digitransit.fi + dev-jyvaskyla.digitransit.fi next-dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + dev-kotka.digitransit.fi next-dev-kotka.digitransit.fi kotka.digitransit.fi + dev-kuopio.digitransit.fi next-dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-lahti.digitransit.fi next-dev-lahti.digitransit.fi lahti.digitransit.fi + dev-lappeenranta.digitransit.fi next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + dev-mikkeli.digitransit.fi next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi oulu.digitransit.fi + dev-turku.digitransit.fi next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi + dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi + dev-rovaniemi.digitransit.fi next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + dev-opas.waltti.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi + dev-vaasa.digitransit.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi + dev-pori.digitransit.fi next-dev-pori.digitransit.fi pori.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi; listen 8080; From e2f75aaa7d4f00bcca0cb6f96c517bab86386bad Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 5 May 2023 11:37:00 +0300 Subject: [PATCH 187/328] Add semicolon --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index e0c290a..3fe9923 100644 --- a/nginx.conf +++ b/nginx.conf @@ -157,7 +157,7 @@ http { } server { - server_name beta.matka.fi + server_name beta.matka.fi; listen 8080; return 301 https://next-dev-matka.digitransit.fi; From 94cfaf2a6791a4fdb584ecb3c4a0bcf4538cb71e Mon Sep 17 00:00:00 2001 From: tekoiv Date: Wed, 31 May 2023 11:21:25 +0300 Subject: [PATCH 188/328] add reittiopas.osl.fi to conf --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 3fe9923..64eeeef 100644 --- a/nginx.conf +++ b/nginx.conf @@ -173,7 +173,7 @@ http { dev-lahti.digitransit.fi next-dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi oulu.digitransit.fi + dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi oulu.digitransit.fi reittiopas.osl.fi dev-turku.digitransit.fi next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi From bab2e21155b6b48e62161b53aaba5ea18b585157 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 26 Jun 2023 13:39:23 +0300 Subject: [PATCH 189/328] Matkahuolto external endpoint, remove Kela routing data endpoints --- common.conf | 20 -------------------- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/common.conf b/common.conf index e0e275e..4fa50b7 100644 --- a/common.conf +++ b/common.conf @@ -316,16 +316,6 @@ location /routing/v2/routers/varely { proxy_read_timeout 11500ms; } -location /routing/v2/routers/kela { - rewrite /routing/v2/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -396,16 +386,6 @@ location /routing-data/v3/varely { include cors.conf; } -location /routing-data/v3/kela { - rewrite /routing-data/v3/kela/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-kela-v3:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; diff --git a/external.conf b/external.conf index 9e5f6c9..7f9c73e 100644 --- a/external.conf +++ b/external.conf @@ -342,6 +342,19 @@ location /out/raumaadmin.mattersoft.fi/ { proxy_set_header Authorization RAUMA_STATIC_BASIC_AUTH; } +#matkahuolto gtfs (https:/minfoapi.matkahuolto.fi/gtfs/kokomaa-fi/gtfs.zip) +location /out/minfoapi.matkahuolto.fi/ { + proxy_pass https://minfoapi.matkahuolto.fi/; + 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; + proxy_set_header Authorization MH_BASIC_AUTH; +} + #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/; diff --git a/run.sh b/run.sh index cd2680a..1980b2a 100755 --- a/run.sh +++ b/run.sh @@ -28,6 +28,7 @@ sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index 3f5318d..52e005d 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_BASIC_AUTH="\"test\"" \ -e RAUMA_RT_BASIC_AUTH="\"test\"" -e RAUMA_STATIC_BASIC_AUTH="\"test\"" \ - -e PORI_RT_BASIC_AUTH="\"test\"" \ + -e PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 55cc4f7978c6b5dfcb4d0855a18b66ae6b91e837 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 26 Jun 2023 13:45:17 +0300 Subject: [PATCH 190/328] add routing data endpoints back --- common.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common.conf b/common.conf index 4fa50b7..e0e275e 100644 --- a/common.conf +++ b/common.conf @@ -316,6 +316,16 @@ location /routing/v2/routers/varely { proxy_read_timeout 11500ms; } +location /routing/v2/routers/kela { + rewrite /routing/v2/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -386,6 +396,16 @@ location /routing-data/v3/varely { include cors.conf; } +location /routing-data/v3/kela { + rewrite /routing-data/v3/kela/(.*) /$1 break; + proxy_pass http://opentripplanner-data-con-kela-v3:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + include cors.conf; +} + location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; From 7cac07a8677299bf506d6330955c3cdcaffea516 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 10 Jul 2023 12:28:08 +0300 Subject: [PATCH 191/328] Remove caching from Matkahuolto config --- external.conf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/external.conf b/external.conf index 7f9c73e..5b52a4e 100644 --- a/external.conf +++ b/external.conf @@ -345,13 +345,7 @@ location /out/raumaadmin.mattersoft.fi/ { #matkahuolto gtfs (https:/minfoapi.matkahuolto.fi/gtfs/kokomaa-fi/gtfs.zip) location /out/minfoapi.matkahuolto.fi/ { proxy_pass https://minfoapi.matkahuolto.fi/; - 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; + include allowed-ips.conf proxy_set_header Authorization MH_BASIC_AUTH; } From f34c8220931b6115e707536a3bea648eda83208f Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 10 Jul 2023 12:30:22 +0300 Subject: [PATCH 192/328] Missing semicolon --- external.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 5b52a4e..ef510cc 100644 --- a/external.conf +++ b/external.conf @@ -345,7 +345,7 @@ location /out/raumaadmin.mattersoft.fi/ { #matkahuolto gtfs (https:/minfoapi.matkahuolto.fi/gtfs/kokomaa-fi/gtfs.zip) location /out/minfoapi.matkahuolto.fi/ { proxy_pass https://minfoapi.matkahuolto.fi/; - include allowed-ips.conf + include allowed-ips.conf; proxy_set_header Authorization MH_BASIC_AUTH; } From 73f076ef8dc4a357675e45a2ccbaf43712417cc1 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Tue, 25 Jul 2023 11:04:39 +0300 Subject: [PATCH 193/328] Try increased proxy_read_timeout with Matkahuolto --- external.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/external.conf b/external.conf index ef510cc..c816b8d 100644 --- a/external.conf +++ b/external.conf @@ -347,6 +347,7 @@ location /out/minfoapi.matkahuolto.fi/ { proxy_pass https://minfoapi.matkahuolto.fi/; include allowed-ips.conf; proxy_set_header Authorization MH_BASIC_AUTH; + proxy_read_timeout 15000ms; } #donkey citybike api (for example https://stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/gbfs.json) From c96aa6711759b190828ddc3a6f6e160aec05320d Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 3 Aug 2023 12:26:57 +0300 Subject: [PATCH 194/328] Update actions --- .github/workflows/dev-pipeline.yml | 10 +++++----- .github/workflows/prod-pipeline.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index bd3d937..9ed1630 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -8,15 +8,15 @@ on: - master jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: node-version: [16.x] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Install dependencies @@ -27,10 +27,10 @@ jobs: if: github.ref == 'refs/heads/master' needs: - test - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build docker image from master and push it run: ./.github/workflows/scripts/build_and_push_dev.sh env: diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index 1d88566..7126282 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -5,15 +5,15 @@ on: - published jobs: prod-push: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Check Tag id: check-tag run: | if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9] ]]; then - echo ::set-output name=match::true + echo "match=true" >> $GITHUB_OUTPUT fi - name: Push latest image as prod if: steps.check-tag.outputs.match == 'true' From ebc89220ad368dc7a7210c144739f05d5a3195c9 Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 3 Aug 2023 12:34:12 +0300 Subject: [PATCH 195/328] dt-5924 proxy for lahti city bikes --- external.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external.conf b/external.conf index c816b8d..d194c99 100644 --- a/external.conf +++ b/external.conf @@ -447,3 +447,15 @@ location /out/rata.digitraffic.fi/ { 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; } + +#Mankeli (Lahti) bike stations (https://tkhslahtistorage.blob.core.windows.net/gbfs/gbfs.json) +location /out/tkhslahtistorage.blob.core.windows.net/ { + proxy_pass https://tkhslahtistorage.blob.core.windows.net/; + include allowed-ips.conf; + proxy_cache ext_cache; + proxy_cache_valid any 60s; + 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; +} From c6fcd3b165045999042f4967d60dda3c60c942f9 Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 10 Aug 2023 11:00:40 +0300 Subject: [PATCH 196/328] dt-5980 raasepori gtfs proxy config --- external.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/external.conf b/external.conf index d194c99..3892e04 100644 --- a/external.conf +++ b/external.conf @@ -459,3 +459,16 @@ location /out/tkhslahtistorage.blob.core.windows.net/ { 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; } + +#Raasepori rt (https://bosse.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) +location /out/bosse.mattersoft.fi/ { + proxy_pass https://bosse.mattersoft.fi/; + 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; + proxy_set_header Authorization RAASEPORI_RT_BASIC_AUTH; +} From fbadd1a59bd9d82cf228f37e95628b09309d039a Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 10 Aug 2023 15:14:18 +0300 Subject: [PATCH 197/328] dt-5980 raasepori run config --- run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run.sh b/run.sh index 1980b2a..b54aaf0 100755 --- a/run.sh +++ b/run.sh @@ -29,6 +29,7 @@ sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/extern sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/RAASEPORI_RT_BASIC_AUTH/${RAASEPORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx From ec7f194f641907655127c2405e3bdc28cdd3219f Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 10 Aug 2023 15:20:47 +0300 Subject: [PATCH 198/328] dt-5890 raasepori test --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 52e005d..c567f25 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_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 PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" \ -e RAASEPORI_RT_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 792f28dd5997e4df54e0fc96f524cca457703423 Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 10 Aug 2023 15:29:14 +0300 Subject: [PATCH 199/328] dt-5890 raasepori test fix --- run.sh | 2 +- test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index b54aaf0..0f076f5 100755 --- a/run.sh +++ b/run.sh @@ -27,9 +27,9 @@ sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/RAASEPORI_RT_BASIC_AUTH/${RAASEPORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf -sed -i "s/RAASEPORI_RT_BASIC_AUTH/${RAASEPORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf #start nginx nginx diff --git a/test.sh b/test.sh index c567f25..7afd066 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e GIRAVOLTA_TAMPERE_AUTH="\"test\"" -e KOTKA_BASIC_AUTH="\"test\"" \ -e GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_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\"" \ + -e PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" -e RAASEPORI_RT_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 6afd3dca8d49987fc000f7ef473960cfefdb3cd4 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 8 Sep 2023 09:08:41 +0200 Subject: [PATCH 200/328] Set Host in MH proxy pass --- external.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/external.conf b/external.conf index 3892e04..ead1c78 100644 --- a/external.conf +++ b/external.conf @@ -347,6 +347,7 @@ location /out/minfoapi.matkahuolto.fi/ { proxy_pass https://minfoapi.matkahuolto.fi/; include allowed-ips.conf; proxy_set_header Authorization MH_BASIC_AUTH; + proxy_set_header Host minfoapi.matkahuolto.fi; proxy_read_timeout 15000ms; } From cfcd8c322d87fbd1385e4a54877da7710c77364b Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 20 Sep 2023 14:10:20 +0300 Subject: [PATCH 201/328] dt-6033 raasepori config --- nginx.conf | 3 ++- test.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 64eeeef..1e9df5b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -181,7 +181,8 @@ http { dev-opas.waltti.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi dev-vaasa.digitransit.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi dev-pori.digitransit.fi next-dev-pori.digitransit.fi pori.digitransit.fi - dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi; + dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi + dev-raasepori.digitransit.fi next-dev-raasepori.digitransit.fi bosse.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { diff --git a/test.js b/test.js index 2e996fb..f02a75e 100644 --- a/test.js +++ b/test.js @@ -203,7 +203,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', - 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' + 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa','raasepori' ]; walttiCities.forEach(function(city) { @@ -237,6 +237,9 @@ describe('waltti ui', function() { testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); + testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 39eb2eed003285cd6657ab8134be9056c9b43ef0 Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 20 Sep 2023 16:20:58 +0300 Subject: [PATCH 202/328] dt-6033 raasepori test fix --- test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test.js b/test.js index f02a75e..7462b59 100644 --- a/test.js +++ b/test.js @@ -203,7 +203,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', - 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa','raasepori' + 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; walttiCities.forEach(function(city) { @@ -237,6 +237,10 @@ describe('waltti ui', function() { testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('dev-raasepori.digitransit.fi','/kissa','https://dev-raasepori.digitransit.fi/kissa'); + testProxying('dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('next-dev-raasepori.digitransit.fi','/kissa','next-dev-raasepori.digitransit.fi'); + testProxying('next-dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From f18537337910940d295010d53ae0099b7130c107 Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 20 Sep 2023 16:24:55 +0300 Subject: [PATCH 203/328] dt-6033 raasepori test fix --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 7462b59..6642553 100644 --- a/test.js +++ b/test.js @@ -239,7 +239,7 @@ describe('waltti ui', function() { testRedirect('dev-raasepori.digitransit.fi','/kissa','https://dev-raasepori.digitransit.fi/kissa'); testProxying('dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); - testRedirect('next-dev-raasepori.digitransit.fi','/kissa','next-dev-raasepori.digitransit.fi'); + testRedirect('next-dev-raasepori.digitransit.fi','/kissa','https://next-dev-raasepori.digitransit.fi/kissa'); testProxying('next-dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From ce2fd0af6cc862eccb04aba1683f734beab5d2c9 Mon Sep 17 00:00:00 2001 From: sharhio Date: Tue, 26 Sep 2023 15:27:11 +0300 Subject: [PATCH 204/328] DT-5977 varely rt proxy --- external.conf | 13 +++++++++++++ run.sh | 1 + test.sh | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/external.conf b/external.conf index ead1c78..c53550e 100644 --- a/external.conf +++ b/external.conf @@ -148,6 +148,19 @@ location /out/varelyadmin.mattersoft.fi/ { proxy_set_header Authorization VARELY_BASIC_AUTH; } +#varely (seutuplus) gtfs rt (https://varely.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) +location /out/varely.mattersoft.fi/ { + proxy_pass https://varely.mattersoft.fi/; + 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; + proxy_set_header Authorization VARELY_RT_BASIC_AUTH; +} + #tampere gtfs rt new (https://tre.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) location /out/tre.mattersoft.fi/ { proxy_pass https://tre.mattersoft.fi/; diff --git a/run.sh b/run.sh index 0f076f5..4687b4a 100755 --- a/run.sh +++ b/run.sh @@ -24,6 +24,7 @@ sed -i "s/ROVANIEMI_BASIC_AUTH/${ROVANIEMI_BASIC_AUTH}/" /etc/nginx/external.con sed -i "s/KAJAANI_BASIC_AUTH/${KAJAANI_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/GIRAVOLTA_VANTAA_AUTH/${GIRAVOLTA_VANTAA_AUTH}/" /etc/nginx/external.conf sed -i "s/VARELY_BASIC_AUTH/${VARELY_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/VARELY_RT_BASIC_AUTH/${VARELY_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_RT_BASIC_AUTH/${RAUMA_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAUMA_STATIC_BASIC_AUTH/${RAUMA_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf diff --git a/test.sh b/test.sh index 7afd066..376f363 100755 --- a/test.sh +++ b/test.sh @@ -22,7 +22,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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 GIRAVOLTA_VANTAA_AUTH="\"test\"" -e VARELY_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\"" \ hsldevcom/digitransit-proxy:integrationtest) From fdfe56bdf88428072fa8ca3fcf8f9fc1b06ab429 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 28 Sep 2023 14:00:53 +0300 Subject: [PATCH 205/328] Remove duplicate domain --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 1e9df5b..2a46662 100644 --- a/nginx.conf +++ b/nginx.conf @@ -178,7 +178,7 @@ http { dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi + dev-opas.waltti.fi next-dev-opas.waltti.fi opas.waltti.fi dev-vaasa.digitransit.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi dev-pori.digitransit.fi next-dev-pori.digitransit.fi pori.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi From e1a2dc74517befb1b69bbcb56e0980a6903b50b0 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 16 Oct 2023 11:47:27 +0300 Subject: [PATCH 206/328] Remove unreliable minfoapi proxy pass --- external.conf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/external.conf b/external.conf index c53550e..5b8d086 100644 --- a/external.conf +++ b/external.conf @@ -355,15 +355,6 @@ location /out/raumaadmin.mattersoft.fi/ { proxy_set_header Authorization RAUMA_STATIC_BASIC_AUTH; } -#matkahuolto gtfs (https:/minfoapi.matkahuolto.fi/gtfs/kokomaa-fi/gtfs.zip) -location /out/minfoapi.matkahuolto.fi/ { - proxy_pass https://minfoapi.matkahuolto.fi/; - include allowed-ips.conf; - proxy_set_header Authorization MH_BASIC_AUTH; - proxy_set_header Host minfoapi.matkahuolto.fi; - proxy_read_timeout 15000ms; -} - #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/; From 385acaf998d46a97d5263583ac146454793e46bd Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 2 Nov 2023 12:47:54 +0200 Subject: [PATCH 207/328] Remove support for beta.matka.fi --- nginx.conf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2a46662..29269c1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -156,14 +156,6 @@ http { } } - server { - server_name beta.matka.fi; - listen 8080; - - return 301 https://next-dev-matka.digitransit.fi; - } - - server { server_name dev-hameenlinna.digitransit.fi next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi dev-joensuu.digitransit.fi next-dev-joensuu.digitransit.fi joensuu.digitransit.fi From 634ba39bcfe9e0289826f6e0865a191017e0f9b4 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 3 Nov 2023 14:28:51 +0200 Subject: [PATCH 208/328] Replace old waltti opas dev domains with a new one --- nginx.conf | 2 +- test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 29269c1..1543b6b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -170,7 +170,7 @@ http { dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi dev-rovaniemi.digitransit.fi next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi - dev-opas.waltti.fi next-dev-opas.waltti.fi opas.waltti.fi + dev-waltti.digitransit.fi opas.waltti.fi dev-vaasa.digitransit.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi dev-pori.digitransit.fi next-dev-pori.digitransit.fi pori.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi diff --git a/test.js b/test.js index 6642553..368206a 100644 --- a/test.js +++ b/test.js @@ -234,8 +234,8 @@ describe('waltti ui', function() { testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); - testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa'); - testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('dev-waltti.digitransit.fi','/kissa','https://dev-waltti.digitransit.fi/kissa'); + testProxying('dev-waltti.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('dev-raasepori.digitransit.fi','/kissa','https://dev-raasepori.digitransit.fi/kissa'); testProxying('dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From f3e286b13239199894775ffe210f250a639f67cc Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 13 Nov 2023 08:23:24 +0200 Subject: [PATCH 209/328] Cancel prod ci pipeline when tag is invalid --- .github/workflows/prod-pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index 7126282..82e2a6c 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -14,6 +14,9 @@ jobs: run: | if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9] ]]; then echo "match=true" >> $GITHUB_OUTPUT + else + echo invalid release tag + exit 1 fi - name: Push latest image as prod if: steps.check-tag.outputs.match == 'true' From c9ee633b4f33ca44545516927dd1510fce7f9818 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 14 Nov 2023 15:47:54 +0200 Subject: [PATCH 210/328] Add new kela routing and map endpoints --- common.conf | 37 +++++++++++++++++++++++++++++++++++++ test.js | 2 ++ 2 files changed, 39 insertions(+) diff --git a/common.conf b/common.conf index e0e275e..cd60e5e 100644 --- a/common.conf +++ b/common.conf @@ -228,6 +228,33 @@ location /map/v3/kela/en/ { proxy_set_header Accept-Language "en"; } +location /map/v3-kela/kela/fi/ { + rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "fi"; +} + +location /map/v3-kela/kela/sv/ { + rewrite /map/v3-kela/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "sv"; +} + +location /map/v3-kela/kela/en/ { + rewrite /map/v3-kela/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Accept-Language "en"; +} + location /graphiql/ { proxy_pass http://graphiql:8080; proxy_redirect off; @@ -326,6 +353,16 @@ location /routing/v2/routers/kela { proxy_read_timeout 11500ms; } +location /routing/v2-kela/routers/kela { + rewrite /routing/v2-kela/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; diff --git a/test.js b/test.js index 368206a..04bce1e 100644 --- a/test.js +++ b/test.js @@ -124,6 +124,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080'); testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080'); testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080'); + testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); @@ -131,6 +132,7 @@ describe('api.digitransit.fi', function() { testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); From 1fdac87231c9ed3f2fc5b8569f435bcf1793eac9 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 16 Nov 2023 17:40:15 +0200 Subject: [PATCH 211/328] Remove old kela routing and map endpoints --- common.conf | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/common.conf b/common.conf index cd60e5e..0c240e3 100644 --- a/common.conf +++ b/common.conf @@ -201,33 +201,6 @@ location /map/v3/varely/en/ { proxy_set_header Accept-Language "en"; } -location /map/v3/kela/fi/ { - rewrite /map/v3/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/kela/sv/ { - rewrite /map/v3/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/kela/en/ { - rewrite /map/v3/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; -} - location /map/v3-kela/kela/fi/ { rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; proxy_pass http://opentripplanner-kela-v2:8080; @@ -343,16 +316,6 @@ location /routing/v2/routers/varely { proxy_read_timeout 11500ms; } -location /routing/v2/routers/kela { - rewrite /routing/v2/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - location /routing/v2-kela/routers/kela { rewrite /routing/v2-kela/(.*) /otp/$1 break; proxy_pass http://opentripplanner-kela-v2:8080/; From 0a37e1a89f43ff52d1dd927a59b4a2f4b33f7c15 Mon Sep 17 00:00:00 2001 From: Dvun Date: Thu, 14 Dec 2023 14:30:38 +0200 Subject: [PATCH 212/328] fix: updated for oulu new url link --- nginx.conf | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 1543b6b..99241d2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -165,7 +165,7 @@ http { dev-lahti.digitransit.fi next-dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi oulu.digitransit.fi reittiopas.osl.fi + dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi reittiopas.osl.fi dev-turku.digitransit.fi next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi @@ -393,6 +393,40 @@ http { } } + server { + server_name oulu.digitransit.fi; + listen 8080; + + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + + location = /sw.js { + proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location = /appcache/manifest.appcache { + proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; + default_type text/cache-manifest; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + + location / { + return 301 https://reittiopas.osl.fi$request_uri; + } + } + server { server_name digitransit.fi www.digitransit.fi dev-site.digitransit.fi; listen 8080; From db2323a36148295c048a25bb074b01ce81f29186 Mon Sep 17 00:00:00 2001 From: Dvun Date: Thu, 14 Dec 2023 15:53:21 +0200 Subject: [PATCH 213/328] fix: tests update --- test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test.js b/test.js index 04bce1e..c3b1ffc 100644 --- a/test.js +++ b/test.js @@ -205,7 +205,7 @@ describe('matka ui', function() { describe('waltti ui', function() { const walttiCities = [ 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', - 'mikkeli', 'oulu', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' + 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; walttiCities.forEach(function(city) { @@ -230,6 +230,9 @@ describe('waltti ui', function() { testProxying('reittiopas.tampere.fi','/','digitransit-ui-waltti-v3:8080', true); testCaching('reittiopas.tampere.fi','/sw.js', true); + testRedirect('oulu.digitransit.fi','/kissa','https://reittiopas.osl.fi/kissa'); + testProxying('reittiopas.osl.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('opas.waltti.fi','/kissa','https://opas.waltti.fi/kissa'); testProxying('opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); From e3bc53bd2ba1b03d593bb6787525fd512dfba0fa Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 19 Dec 2023 16:53:03 +0200 Subject: [PATCH 214/328] Fix too short kela timeout --- common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.conf b/common.conf index 0c240e3..b7486fc 100644 --- a/common.conf +++ b/common.conf @@ -323,7 +323,7 @@ location /routing/v2-kela/routers/kela { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; + proxy_read_timeout 29500ms; } location /routing/v2/routers/hsl { From 6122c7898cd432cb188727af9845cb566eac071e Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 29 Dec 2023 12:42:14 +0200 Subject: [PATCH 215/328] Try caching any to fix issues with 404 being returned indefinetly --- external.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/external.conf b/external.conf index 5b8d086..21bf56f 100644 --- a/external.conf +++ b/external.conf @@ -376,7 +376,7 @@ location = /out/tampere-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 200 302 30s; + 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; @@ -394,7 +394,7 @@ location /out/tampere-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; - proxy_cache_valid 200 302 30s; + 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; @@ -413,7 +413,7 @@ 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 200 302 30s; + 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; @@ -431,7 +431,7 @@ location /out/vantaa-api.giravolta.io/ { proxy_pass https://api.giravolta.io/; include allowed-ips.conf; proxy_cache ext_cache; - proxy_cache_valid 200 302 30s; + 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; @@ -446,7 +446,7 @@ location /out/rata.digitraffic.fi/ { proxy_pass https://rata.digitraffic.fi/; include allowed-ips.conf; proxy_cache ext_cache; - proxy_cache_valid 200 30s; + 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; From 983ed19ca8d8c3459f4f8dd803bba6ca4c90307d Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 26 Jan 2024 12:03:19 +0200 Subject: [PATCH 216/328] Return 404 by default if host doesn't match anything --- nginx.conf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 99241d2..2b5b397 100644 --- a/nginx.conf +++ b/nginx.conf @@ -60,13 +60,26 @@ http { # to get rid of a warning about server_names_hash building server_names_hash_bucket_size 128; + server { + listen 8080 default_server; + + # Health check + location = / { + root /opt/nginx/www; + index index.html; + } + + location / { + return 404; + } + } + # API endpoints # These domains handle only api calls, not UI # a-,b-,c- prefixes are ment to be used with map raster image multidomain support server { server_name api.digitransit.fi - dev-api.digitransit.fi - ""; + dev-api.digitransit.fi; listen 8080; include common.conf; From f57a15ce3ca864735180dfe667f0f0711df8cbd8 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 09:57:00 +0200 Subject: [PATCH 217/328] Add server_name to default_server --- nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx.conf b/nginx.conf index 2b5b397..5312f1f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -62,6 +62,7 @@ http { server { listen 8080 default_server; + server_name ""; # Health check location = / { From e7e8bd6e0ca8a65514c2db291ff7456adf994035 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 11:49:40 +0200 Subject: [PATCH 218/328] Fix ssl problem --- external.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/external.conf b/external.conf index 21bf56f..eb88176 100644 --- a/external.conf +++ b/external.conf @@ -451,6 +451,7 @@ location /out/rata.digitraffic.fi/ { 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; + proxy_ssl_server_name on; } #Mankeli (Lahti) bike stations (https://tkhslahtistorage.blob.core.windows.net/gbfs/gbfs.json) From ff2f7e6f636ff9e67fef7ece034f1253f522d013 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 12:02:12 +0200 Subject: [PATCH 219/328] Return 200 instead of index.html as it didn't work --- nginx.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5312f1f..a807ab1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -62,12 +62,10 @@ http { server { listen 8080 default_server; - server_name ""; # Health check location = / { - root /opt/nginx/www; - index index.html; + return 200; } location / { From fd4c78041af130eb27d93e1656b7d75438f33882 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 12:57:06 +0200 Subject: [PATCH 220/328] Move external to be in default_server We never actually set api.digitransit.fi host for these requests --- nginx.conf | 2 +- test.js | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nginx.conf b/nginx.conf index a807ab1..d2ce470 100644 --- a/nginx.conf +++ b/nginx.conf @@ -62,6 +62,7 @@ http { server { listen 8080 default_server; + include external.conf; # Health check location = / { @@ -82,7 +83,6 @@ http { listen 8080; include common.conf; - include external.conf; # Health check location / { diff --git a/test.js b/test.js index c3b1ffc..88a7b1d 100644 --- a/test.js +++ b/test.js @@ -6,10 +6,13 @@ const assert = chai.assert; chai.use(chaiHttp); function get(host, path) { - return chai.request('http://127.0.0.1:9000') - .get(path) - .redirects(0) - .set('host', host) + const req = chai.request('http://127.0.0.1:9000') + .get(path) + .redirects(0) + if (host) { + req.set('host', host) + } + return req } function httpsGet(host, path) { @@ -278,9 +281,9 @@ describe('otp debug', function() { describe('ext-proxy', function() { this.timeout(5000); - testCaching('api.digitransit.fi','/out/helsinki-fi.smoove.pro/api-public/stations',false); - testCaching('api.digitransit.fi','/out/data.foli.fi/citybike/smoove',false); - testCaching('api.digitransit.fi','/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false); - testCaching('api.digitransit.fi','/out/92.62.36.215/RTIX/trip-updates',false); - testCaching('api.digitransit.fi','/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); + testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); + testCaching(null,'/out/data.foli.fi/citybike/smoove',false); + testCaching(null,'/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false); + testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',false); + testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); From 07251a77c977d14ac78f22582519b859de2c9550 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 12:59:50 +0200 Subject: [PATCH 221/328] Temporarily revert default server away --- nginx.conf | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/nginx.conf b/nginx.conf index a807ab1..99241d2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -60,25 +60,13 @@ http { # to get rid of a warning about server_names_hash building server_names_hash_bucket_size 128; - server { - listen 8080 default_server; - - # Health check - location = / { - return 200; - } - - location / { - return 404; - } - } - # API endpoints # These domains handle only api calls, not UI # a-,b-,c- prefixes are ment to be used with map raster image multidomain support server { server_name api.digitransit.fi - dev-api.digitransit.fi; + dev-api.digitransit.fi + ""; listen 8080; include common.conf; From 3645a9e0c44d2b15521061dd2fb0ad247118c168 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 15 Mar 2024 16:11:30 +0200 Subject: [PATCH 222/328] Revert "Temporarily revert default server away" This reverts commit 07251a77c977d14ac78f22582519b859de2c9550. --- nginx.conf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 99241d2..a807ab1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -60,13 +60,25 @@ http { # to get rid of a warning about server_names_hash building server_names_hash_bucket_size 128; + server { + listen 8080 default_server; + + # Health check + location = / { + return 200; + } + + location / { + return 404; + } + } + # API endpoints # These domains handle only api calls, not UI # a-,b-,c- prefixes are ment to be used with map raster image multidomain support server { server_name api.digitransit.fi - dev-api.digitransit.fi - ""; + dev-api.digitransit.fi; listen 8080; include common.conf; From e8522aecf595d4a30cf8250204905f08456a62ed Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 18 Mar 2024 11:01:23 +0200 Subject: [PATCH 223/328] Remove unused ext api --- external.conf | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/external.conf b/external.conf index eb88176..09549c7 100644 --- a/external.conf +++ b/external.conf @@ -441,19 +441,6 @@ location /out/vantaa-api.giravolta.io/ { proxy_set_header Authorization GIRAVOLTA_VANTAA_AUTH; } -#digitraffic realtime api (https://rata.digitraffic.fi/api/v1/trains/gtfs-rt-updates) -location /out/rata.digitraffic.fi/ { - proxy_pass https://rata.digitraffic.fi/; - 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; - proxy_ssl_server_name on; -} - #Mankeli (Lahti) bike stations (https://tkhslahtistorage.blob.core.windows.net/gbfs/gbfs.json) location /out/tkhslahtistorage.blob.core.windows.net/ { proxy_pass https://tkhslahtistorage.blob.core.windows.net/; From b0446c1fa2e70318563e6345b4387e8431b8e3b9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 8 Apr 2024 11:38:46 +0300 Subject: [PATCH 224/328] Update tampere citybike api --- external.conf | 32 ++++---------------------------- test.sh | 2 +- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/external.conf b/external.conf index 09549c7..e619e16 100644 --- a/external.conf +++ b/external.conf @@ -368,12 +368,9 @@ 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; @@ -381,30 +378,9 @@ location = /out/tampere-api.giravolta.io/api-opendata/gbfs/2_3/gbfs { 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 diff --git a/test.sh b/test.sh index 376f363..35841f0 100755 --- a/test.sh +++ b/test.sh @@ -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\"" \ From 6bf8cb92e5086b23fb45fb2021f24fdb25d24c42 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 10 Apr 2024 10:39:49 +0300 Subject: [PATCH 225/328] Try removing proxy_ssl_server_name from tre citybike api --- external.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/external.conf b/external.conf index e619e16..ea0fd2e 100644 --- a/external.conf +++ b/external.conf @@ -378,7 +378,6 @@ location = /out/gbfs.urbansharing.com/ { 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; - proxy_ssl_server_name on; } #giravolta (seatcode) citybike api for vantaa From 7ada3b9ddc953c450d86c98d1b0ed48e00dc82bb Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 10 Apr 2024 15:50:34 +0300 Subject: [PATCH 226/328] DT-6282 new tampere test gtfsrt proxy --- external.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/external.conf b/external.conf index 5b8d086..ce98bd5 100644 --- a/external.conf +++ b/external.conf @@ -174,6 +174,19 @@ location /out/tre.mattersoft.fi/ { proxy_set_header Authorization NEW_LISSU_BASIC_AUTH; } +#tampere test gtfs rt (https://nysse.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) +location /out/nysse.mattersoft.fi/ { + proxy_pass https://nysse.mattersoft.fi/; + 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; + proxy_set_header Authorization LMJ_BASIC_AUTH; +} + #lmj gtfs rt new (https://lmj.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) location /out/lmj.mattersoft.fi/ { proxy_pass https://lmj.mattersoft.fi/; From dffde39fb567a3403bcdb4eee2883655957db3ce Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 11 Apr 2024 14:27:39 +0300 Subject: [PATCH 227/328] Remove tre city bike proxy which does not work --- external.conf | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/external.conf b/external.conf index 3f772f4..fe4fd83 100644 --- a/external.conf +++ b/external.conf @@ -381,18 +381,6 @@ location /out/stables.donkey.bike/ { proxy_ssl_server_name on; } -# 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; -} - #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 From 21e4c5a24132402053ae669969df65f68a8aaaed Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 25 Apr 2024 12:20:34 +0300 Subject: [PATCH 228/328] Set noindex headers to /haku --- nginx.conf | 1 + test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/nginx.conf b/nginx.conf index d2ce470..69a9454 100644 --- a/nginx.conf +++ b/nginx.conf @@ -214,6 +214,7 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-waltti-v3:8080; include basicsettings.conf; diff --git a/test.js b/test.js index 88a7b1d..c85a311 100644 --- a/test.js +++ b/test.js @@ -241,6 +241,7 @@ describe('waltti ui', function() { testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); + testResponseHeader('opas.waltti.fi','/haku', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('dev-waltti.digitransit.fi','/kissa','https://dev-waltti.digitransit.fi/kissa'); testProxying('dev-waltti.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From d3c7b897fa9ef8bd739cbb34eee2a1101185879a Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Sun, 28 Apr 2024 14:41:23 +0300 Subject: [PATCH 229/328] Fix header test --- test.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index c85a311..6e58010 100644 --- a/test.js +++ b/test.js @@ -94,6 +94,15 @@ function testResponseHeader(host, path, header, headerValue) { }); } +function testResponseHeaderHttps(host, path, header, headerValue) { + it('http request to ' + host + path + ' should have response header: ' + header + ' should have value: ' + headerValue, function(done) { + httpsGet(host,path).end((err,res)=>{ + expect(res.headers[header]).to.be.equal(headerValue); + done(); + }); + }); +} + describe('api.digitransit.fi', function() { it('https should not redirect', function(done) { @@ -240,8 +249,8 @@ describe('waltti ui', function() { testProxying('opas.waltti.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('opas.waltti.fi','/haku','https://opas.waltti.fi/haku'); - testResponseHeader('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); - testResponseHeader('opas.waltti.fi','/haku', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); + testResponseHeaderHttps('opas.waltti.fi','/haku', 'X-Frame-Options', undefined); + testResponseHeaderHttps('opas.waltti.fi','/haku', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('dev-waltti.digitransit.fi','/kissa','https://dev-waltti.digitransit.fi/kissa'); testProxying('dev-waltti.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From e0bec80a7f05006e7a7e4e07c3eb76375c752e55 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Mon, 29 Apr 2024 11:24:56 +0300 Subject: [PATCH 230/328] Set noindex header to all embedded searches --- nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx.conf b/nginx.conf index 69a9454..979e43e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -158,6 +158,7 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-matka-v3:8080; include basicsettings.conf; @@ -260,6 +261,7 @@ http { include basicsettings.conf; } location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-hsl-v2:8080; include basicsettings.conf; @@ -309,6 +311,7 @@ http { include basicsettings.conf; } location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; @@ -360,6 +363,7 @@ http { include basicsettings.conf; } location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-hsl-v2-test:8080; include basicsettings.conf; From 2ff0023a07fceccb3583dbd9fc91d78c26f3d7e7 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 29 May 2024 16:55:05 +0300 Subject: [PATCH 231/328] Update liipi address --- external.conf | 12 ++++++------ test.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/external.conf b/external.conf index fe4fd83..f01800b 100644 --- a/external.conf +++ b/external.conf @@ -22,9 +22,9 @@ location /out/data.foli.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#hsl park api https://p.hsl.fi/api/v1/facilities.json?limit=-1 -location /out/p.hsl.fi/ { - proxy_pass https://p.hsl.fi/; +#park api https://parking.fintraffic.fi/api/v1/facilities.json?limit=-1 +location /out/parking.fintraffic.fi/ { + proxy_pass https://parking.fintraffic.fi/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; @@ -34,9 +34,9 @@ location /out/p.hsl.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#hsl test park api https://test.liipi.hsldev.com/api/v1/facilities.json?limit=-1 -location /out/test.liipi.hsldev.com/ { - proxy_pass https://test.liipi.hsldev.com/; +#test park api https://parking-test.digitraffic.fi/api/v1/facilities.json?limit=-1 +location /out/parking-test.digitraffic.fi/ { + proxy_pass https://parking-test.digitraffic.fi/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; diff --git a/test.js b/test.js index 6e58010..838406e 100644 --- a/test.js +++ b/test.js @@ -293,7 +293,7 @@ describe('ext-proxy', function() { this.timeout(5000); testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); testCaching(null,'/out/data.foli.fi/citybike/smoove',false); - testCaching(null,'/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false); + testCaching(null,'/out/parking.fintraffic.fi/api/v1/facilities.json?limit=-1',false); testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',false); testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); From 9856d0a5b47959563c685a495aa51a41ee176426 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 29 May 2024 20:18:08 +0300 Subject: [PATCH 232/328] Correct test addres for parking api --- external.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external.conf b/external.conf index f01800b..abbd40e 100644 --- a/external.conf +++ b/external.conf @@ -34,9 +34,9 @@ location /out/parking.fintraffic.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#test park api https://parking-test.digitraffic.fi/api/v1/facilities.json?limit=-1 -location /out/parking-test.digitraffic.fi/ { - proxy_pass https://parking-test.digitraffic.fi/; +#test park api https://parking-test.fintraffic.fi/api/v1/facilities.json?limit=-1 +location /out/parking-test.fintraffic.fi/ { + proxy_pass https://parking-test.fintraffic.fi/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; From a40c4ed42f7d88cbf9deae9554d26fd0b21116b7 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 30 May 2024 06:59:33 +0300 Subject: [PATCH 233/328] Keep old parking api --- external.conf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/external.conf b/external.conf index abbd40e..efb06f5 100644 --- a/external.conf +++ b/external.conf @@ -46,6 +46,30 @@ location /out/parking-test.fintraffic.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +#hsl park api https://p.hsl.fi/api/v1/facilities.json?limit=-1 +location /out/p.hsl.fi/ { + proxy_pass https://p.hsl.fi/; + 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; +} + +#hsl test park api https://test.liipi.hsldev.com/api/v1/facilities.json?limit=-1 +location /out/test.liipi.hsldev.com/ { + proxy_pass https://test.liipi.hsldev.com/; + 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; +} + #oulu realtime api (http://92.62.36.215/RTIX/trip-update) location /out/92.62.36.215/ { proxy_pass http://92.62.36.215/; From 8f3c6cf71005da0ac2841cc869a835618c67668e Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 30 May 2024 07:00:48 +0300 Subject: [PATCH 234/328] Remove test for old parking api --- test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test.js b/test.js index 838406e..03badb4 100644 --- a/test.js +++ b/test.js @@ -293,7 +293,6 @@ describe('ext-proxy', function() { this.timeout(5000); testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); testCaching(null,'/out/data.foli.fi/citybike/smoove',false); - testCaching(null,'/out/parking.fintraffic.fi/api/v1/facilities.json?limit=-1',false); testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',false); testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); From 108546198e9286ee651cac6dfeedc5ee5fe571b9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 30 May 2024 07:11:31 +0300 Subject: [PATCH 235/328] Remove proxy for new park api digitraffic services do not like our nginx proxy --- external.conf | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/external.conf b/external.conf index efb06f5..fe4fd83 100644 --- a/external.conf +++ b/external.conf @@ -22,30 +22,6 @@ location /out/data.foli.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#park api https://parking.fintraffic.fi/api/v1/facilities.json?limit=-1 -location /out/parking.fintraffic.fi/ { - proxy_pass https://parking.fintraffic.fi/; - 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; -} - -#test park api https://parking-test.fintraffic.fi/api/v1/facilities.json?limit=-1 -location /out/parking-test.fintraffic.fi/ { - proxy_pass https://parking-test.fintraffic.fi/; - 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; -} - #hsl park api https://p.hsl.fi/api/v1/facilities.json?limit=-1 location /out/p.hsl.fi/ { proxy_pass https://p.hsl.fi/; From 724a06e867d7678607b567c5d98c00734dd75f30 Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 12 Jun 2024 11:22:22 +0300 Subject: [PATCH 236/328] DT-6312 waltti-test config --- Dockerfile | 3 +++ external.conf | 15 ++++++++++++++- nginx.conf | 41 +++++++++++++++++++++++++++++++++++++++++ run.sh | 5 +++++ test.js | 28 ++++++++++++++++++++++++++++ test.sh | 3 ++- 6 files changed, 93 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a18723..9283659 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN rm /var/log/nginx/* && chmod -R a+rwX ${INSTALL_DIR} /etc/nginx/ /var/log/ng RUN ln -sf /dev/stdout /var/log/nginx/access.log RUN ln -sf /dev/stderr /var/log/nginx/error.log +# Install apache2-utils for htpasswd +RUN apk add --no-cache apache2-utils + EXPOSE 8080 ADD run.sh /usr/local/bin/ diff --git a/external.conf b/external.conf index fe4fd83..f4f61fd 100644 --- a/external.conf +++ b/external.conf @@ -184,7 +184,7 @@ location /out/nysse.mattersoft.fi/ { 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; - proxy_set_header Authorization LMJ_BASIC_AUTH; + proxy_set_header Authorization NYSSE_BASIC_AUTH; } #lmj gtfs rt new (https://lmj.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) @@ -441,3 +441,16 @@ location /out/bosse.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization RAASEPORI_RT_BASIC_AUTH; } + +#WalttiTest gtfs (https://lmjadmin.mattersoft.fi/feeds/229.zip) +location /out/lmjadmin.mattersoft.fi/ { + proxy_pass https://lmjadmin.mattersoft.fi/; + 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; + proxy_set_header Authorization WALTTI_TEST_STATIC_BASIC_AUTH; +} diff --git a/nginx.conf b/nginx.conf index 979e43e..12bb490 100644 --- a/nginx.conf +++ b/nginx.conf @@ -541,6 +541,47 @@ http { } } + server { + server_name waltti-test.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-waltti-v3:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + location = /haku { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-waltti-v3:8080; + include basicsettings.conf; + } + location / { + proxy_pass http://digitransit-ui-waltti-v3:8080; + include basicsettings.conf; + auth_basic "waltti-test.digitransit.fi"; + auth_basic_user_file .htpasswd; + } + } + # generic www redirect rule, redirects www.site to site server { listen 8080; diff --git a/run.sh b/run.sh index 4687b4a..11f97d5 100755 --- a/run.sh +++ b/run.sh @@ -31,6 +31,11 @@ sed -i "s/OULU_RT_BASIC_AUTH/${OULU_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/RAASEPORI_RT_BASIC_AUTH/${RAASEPORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/NYSSE_BASIC_AUTH/${NYSSE_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s/WALTTI_TEST_STATIC_BASIC_AUTH/${WALTTI_TEST_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf + +#set basic auth +htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null #start nginx nginx diff --git a/test.js b/test.js index 03badb4..06ff374 100644 --- a/test.js +++ b/test.js @@ -85,6 +85,29 @@ function testRedirect(host, path, expectedUrl, secure=false) { }); } +function testCallingWithoutCredentials(host, path, secure=false) { + let fn = secure?httpsGet:get; + it('request to ' + host + path + ' 401 Unauthorized without credentials ', function(done) { + fn(host,path).end((err,res)=>{ + expect(res).to.have.status(401); + done(); + }); + }); +} + +function testWithCorrectCredentials(host, path, username, password, expectedUrl, secure=true) { + let fn = secure ? httpsGet : get; + + it('request to ' + host + path + ' should return 200 OK with correct credentials ', function(done) { + fn(host, path) + .set('Authorization', 'Basic ' + Buffer.from(username + ':' + password).toString('base64')) + .end((err, res) => { + expect(res).to.have.status(200); + done(); + }); + }); +} + function testResponseHeader(host, path, header, headerValue) { it('http request to ' + host + path + ' should have response header: ' + header + ' should have value: ' + headerValue, function(done) { get(host,path).end((err,res)=>{ @@ -296,3 +319,8 @@ describe('ext-proxy', function() { testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',false); testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false); }); + +describe('waltti-test ui', function() { + testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); + testWithCorrectCredentials('https://waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); +}); \ No newline at end of file diff --git a/test.sh b/test.sh index 35841f0..c0b61f8 100755 --- a/test.sh +++ b/test.sh @@ -18,13 +18,14 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e JOJO_BASIC_AUTH="\"test\"" -e LAPPEENRANTA_BASIC_AUTH="\"test\"" -e LINKKI_BASIC_AUTH="\"test\"" \ -e NEW_LISSU_BASIC_AUTH="\"test\"" -e LAHTI_BASIC_AUTH="\"test\"" \ -e HAMEENLINNA_BASIC_AUTH="\"test\"" -e NEW_HSL_FI_URL=hsl.fi \ - -e LMJ_BASIC_AUTH="\"test\"" -e MIKKELI_BASIC_AUTH="\"test\"" \ + -e LMJ_BASIC_AUTH="\"test\"" -e NYSSE_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 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\"" \ + -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 3dca373fb5b280de9db0b80f758fffdd5610d2b8 Mon Sep 17 00:00:00 2001 From: sharhio Date: Fri, 14 Jun 2024 13:21:45 +0300 Subject: [PATCH 237/328] test fix --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 06ff374..9b7ece8 100644 --- a/test.js +++ b/test.js @@ -322,5 +322,5 @@ describe('ext-proxy', function() { describe('waltti-test ui', function() { testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); - testWithCorrectCredentials('https://waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); + testWithCorrectCredentials('waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); }); \ No newline at end of file From 0e21fae04cef92a867c2b5eddb63b46544fc6d81 Mon Sep 17 00:00:00 2001 From: sharhio <113033056+sharhio@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:22:30 +0300 Subject: [PATCH 238/328] Update nginx.conf Co-authored-by: Joel Lappalainen --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 12bb490..3520ff2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -559,7 +559,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-waltti-v3:8080; + proxy_pass http://digitransit-ui-waltti-v3:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; From 4cf4837f2851dd89124a8518753736bd65246ff0 Mon Sep 17 00:00:00 2001 From: sharhio <113033056+sharhio@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:22:39 +0300 Subject: [PATCH 239/328] Update nginx.conf Co-authored-by: Joel Lappalainen --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 3520ff2..1a163c2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -571,7 +571,7 @@ http { } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-waltti-v3:8080; + proxy_pass http://digitransit-ui-waltti-v3:8080; include basicsettings.conf; } location / { From e0732ad31be25373a094cf21bfa16e49ae0b134e Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 17 Jun 2024 12:55:31 +0300 Subject: [PATCH 240/328] DT-6213 waltti test server points to test instead of v3 --- nginx.conf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 12bb490..0b78774 100644 --- a/nginx.conf +++ b/nginx.conf @@ -559,7 +559,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-waltti-v3:8080; + proxy_pass http://digitransit-ui-waltti-test:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -569,13 +569,18 @@ http { 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; } + location /local-storage-emitter { + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-waltti-test:8080; + include basicsettings.conf; + } location = /haku { proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-waltti-v3:8080; + proxy_pass http://digitransit-ui-waltti-test:8080; include basicsettings.conf; } location / { - proxy_pass http://digitransit-ui-waltti-v3:8080; + proxy_pass http://digitransit-ui-waltti-test:8080; include basicsettings.conf; auth_basic "waltti-test.digitransit.fi"; auth_basic_user_file .htpasswd; From 2b4addca3d9d7fe867ece32132e8c47c62b29f70 Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 17 Jun 2024 15:56:05 +0300 Subject: [PATCH 241/328] DT-6312 waltti test proxy --- common.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.conf b/common.conf index b7486fc..9aeeb4f 100644 --- a/common.conf +++ b/common.conf @@ -534,3 +534,12 @@ location /matka-fonts/ { # proxy_set_header X-Forwarded-Host $host; include cors.conf; } + +location /ui/waltti-test/waltti/ { + rewrite /ui/waltti-test/waltti/(.*) /$1 break; + proxy_pass http://digitransit-ui-waltti-test:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; +} \ No newline at end of file From 1e3ed2fca19229280205203eedb7cc68395d545c Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 17 Jun 2024 16:09:19 +0300 Subject: [PATCH 242/328] DT-6312 waltti test proxy --- common.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.conf b/common.conf index 9aeeb4f..bb368bd 100644 --- a/common.conf +++ b/common.conf @@ -535,8 +535,8 @@ location /matka-fonts/ { include cors.conf; } -location /ui/waltti-test/waltti/ { - rewrite /ui/waltti-test/waltti/(.*) /$1 break; +location /ui/v3/waltti-test/ { + rewrite /ui/v3/waltti-test/(.*) /$1 break; proxy_pass http://digitransit-ui-waltti-test:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; From ff3a86acd325bbc13dfad963e1f624fad3e1e3f3 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Sun, 28 Jul 2024 23:47:34 +0300 Subject: [PATCH 243/328] Use data server instead of con for data endpoint --- common.conf | 12 ++++++------ test.js | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common.conf b/common.conf index bb368bd..a31a6ac 100644 --- a/common.conf +++ b/common.conf @@ -368,7 +368,7 @@ location /routing-data/v2/finland { location /routing-data/v3/hsl { rewrite /routing-data/v3/hsl/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-hsl-v3:8080/; + proxy_pass http://opentripplanner-data-server-hsl-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -378,7 +378,7 @@ location /routing-data/v3/hsl { location /routing-data/v3/waltti { rewrite /routing-data/v3/waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-waltti-v3:8080/; + proxy_pass http://opentripplanner-data-server-waltti-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -388,7 +388,7 @@ location /routing-data/v3/waltti { location /routing-data/v3/varely { rewrite /routing-data/v3/varely/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-varely-v3:8080/; + proxy_pass http://opentripplanner-data-server-varely-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -398,7 +398,7 @@ location /routing-data/v3/varely { location /routing-data/v3/kela { rewrite /routing-data/v3/kela/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-kela-v3:8080/; + proxy_pass http://opentripplanner-data-server-kela-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -408,7 +408,7 @@ location /routing-data/v3/kela { location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/; + proxy_pass http://opentripplanner-data-server-waltti-alt-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -418,7 +418,7 @@ location /routing-data/v3/waltti-alt { location /routing-data/v3/finland { rewrite /routing-data/v3/finland/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-finland-v3:8080/; + proxy_pass http://opentripplanner-data-server-finland-v3:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/test.js b/test.js index 9b7ece8..b901e5a 100644 --- a/test.js +++ b/test.js @@ -174,13 +174,13 @@ describe('api.digitransit.fi', function() { testResponseHeader('api.digitransit.fi','/routing-data/v2/waltti/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-con-finland:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-con-hsl-v3:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-server-hsl-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/hsl/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-con-waltti-v3:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-server-waltti-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-server-waltti-alt-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080'); + testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-server-finland-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); From e42abe68e6fbdc973e63c92573c633d0a3eed786 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 5 Aug 2024 16:45:04 +0300 Subject: [PATCH 244/328] Remove unnecessary kela data endpoint --- common.conf | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/common.conf b/common.conf index a31a6ac..011814d 100644 --- a/common.conf +++ b/common.conf @@ -396,16 +396,6 @@ location /routing-data/v3/varely { include cors.conf; } -location /routing-data/v3/kela { - rewrite /routing-data/v3/kela/(.*) /$1 break; - proxy_pass http://opentripplanner-data-server-kela-v3:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /routing-data/v3/waltti-alt { rewrite /routing-data/v3/waltti-alt/(.*) /$1 break; proxy_pass http://opentripplanner-data-server-waltti-alt-v3:8080/; From 3c034f7c7c37d1a8ed64dc5de307cd35c18991be Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 2 Sep 2024 21:45:22 +0300 Subject: [PATCH 245/328] Use otp-data-server for otp1 as well --- common.conf | 6 +++--- test.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common.conf b/common.conf index 011814d..e8e64cf 100644 --- a/common.conf +++ b/common.conf @@ -338,7 +338,7 @@ location /routing/v2/routers/hsl { location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-hsl:8080/; + proxy_pass http://opentripplanner-data-server-hsl:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -348,7 +348,7 @@ location /routing-data/v2/hsl { location /routing-data/v2/waltti { rewrite /routing-data/v2/waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-waltti:8080/; + proxy_pass http://opentripplanner-data-server-waltti:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -358,7 +358,7 @@ location /routing-data/v2/waltti { location /routing-data/v2/finland { rewrite /routing-data/v2/finland/(.*) /$1 break; - proxy_pass http://opentripplanner-data-con-finland:8080/; + proxy_pass http://opentripplanner-data-server-finland:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/test.js b/test.js index b901e5a..0d42476 100644 --- a/test.js +++ b/test.js @@ -168,11 +168,11 @@ describe('api.digitransit.fi', function() { testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080'); - testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); + testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-server-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080'); + testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-server-waltti:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-con-finland:8080'); + testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-server-finland:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-server-hsl-v3:8080'); testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/hsl/router-config.json', 'access-control-allow-origin', '*'); From 609dd3a79943f3c189e721cb385339aa1d0f8b7a Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 19 Sep 2024 10:47:04 +0300 Subject: [PATCH 246/328] Remove test.liipi which is no longer online and prevents proxy from starting --- external.conf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/external.conf b/external.conf index f4f61fd..3bfe28d 100644 --- a/external.conf +++ b/external.conf @@ -35,16 +35,16 @@ location /out/p.hsl.fi/ { } #hsl test park api https://test.liipi.hsldev.com/api/v1/facilities.json?limit=-1 -location /out/test.liipi.hsldev.com/ { - proxy_pass https://test.liipi.hsldev.com/; - 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; -} +#location /out/test.liipi.hsldev.com/ { +# proxy_pass https://test.liipi.hsldev.com/; +# 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; +#} #oulu realtime api (http://92.62.36.215/RTIX/trip-update) location /out/92.62.36.215/ { From 12331c0edc1c8f778bf04427d5162185a4e65968 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 19 Sep 2024 12:07:01 +0300 Subject: [PATCH 247/328] Remove old liipi endpoints --- external.conf | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/external.conf b/external.conf index 3bfe28d..4aa9244 100644 --- a/external.conf +++ b/external.conf @@ -22,30 +22,6 @@ location /out/data.foli.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#hsl park api https://p.hsl.fi/api/v1/facilities.json?limit=-1 -location /out/p.hsl.fi/ { - proxy_pass https://p.hsl.fi/; - 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; -} - -#hsl test park api https://test.liipi.hsldev.com/api/v1/facilities.json?limit=-1 -#location /out/test.liipi.hsldev.com/ { -# proxy_pass https://test.liipi.hsldev.com/; -# 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; -#} - #oulu realtime api (http://92.62.36.215/RTIX/trip-update) location /out/92.62.36.215/ { proxy_pass http://92.62.36.215/; From ab5249d28c8aab5bae21cd17118c5167a73c0c6f Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 27 Aug 2024 17:02:44 +0300 Subject: [PATCH 248/328] Remove legacy hack --- run.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/run.sh b/run.sh index 11f97d5..cd8839f 100755 --- a/run.sh +++ b/run.sh @@ -1,10 +1,7 @@ #!/bin/ash set -e -#workaround for azure DNS issue -if [ -n "$MESOS_CONTAINER_NAME" ]; then - echo "search marathon.l4lb.thisdcos.directory" >> /etc/resolv.conf; -fi + sed -i "s/VILKKU_BASIC_AUTH/${VILKKU_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/JOJO_BASIC_AUTH/${JOJO_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/LAPPEENRANTA_BASIC_AUTH/${LAPPEENRANTA_BASIC_AUTH}/" /etc/nginx/external.conf From 3217d5c507028a1cd50b162c8ce501f1ae0dab2e Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 19 Sep 2024 14:40:33 +0300 Subject: [PATCH 249/328] Remove oulu realtime external endpoint and use better example for turku --- external.conf | 14 +------------- test.js | 3 +-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/external.conf b/external.conf index 4aa9244..3a37faa 100644 --- a/external.conf +++ b/external.conf @@ -10,7 +10,7 @@ location /out/helsinki-fi.smoove.pro/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#turku smoove citybike api (http://data.foli.fi/citybike/smoove) +#turku smoove realtime api (http://data.foli.fi/gtfs-rt/reittiopas) location /out/data.foli.fi/ { proxy_pass http://data.foli.fi/; include allowed-ips.conf; @@ -22,18 +22,6 @@ location /out/data.foli.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } -#oulu realtime api (http://92.62.36.215/RTIX/trip-update) -location /out/92.62.36.215/ { - proxy_pass http://92.62.36.215/; - 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; -} - #oulu rt (https://oulu.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) location /out/oulu.mattersoft.fi/ { proxy_pass https://oulu.mattersoft.fi/; diff --git a/test.js b/test.js index 0d42476..35eb729 100644 --- a/test.js +++ b/test.js @@ -315,8 +315,7 @@ describe('otp debug', function() { describe('ext-proxy', function() { this.timeout(5000); testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); - testCaching(null,'/out/data.foli.fi/citybike/smoove',false); - testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',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); }); From 03303336d9fdbfd19be50eb0e147da91d532f30b Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 23 Sep 2024 15:51:28 +0300 Subject: [PATCH 250/328] Patch tiles urls in tilejson and don't cache tilejson files Caching is avoided due to subscription keys --- common.conf | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ nginx.conf | 18 +++++++++++++++ run.sh | 1 + test.js | 1 + test.sh | 1 + 5 files changed, 87 insertions(+) diff --git a/common.conf b/common.conf index e8e64cf..6b58338 100644 --- a/common.conf +++ b/common.conf @@ -58,6 +58,17 @@ location /map/v3/ { add_header X-Cache-Status $upstream_cache_status; } +location ~ ^/map/v3/hsl/(.*)/tilejson.json$ { + rewrite /map/v3/hsl/([^\/]*)/(.*) /otp/routers/hsl/vectorTiles/$2 break; + proxy_pass http://opentripplanner-hsl-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/hsl/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3/hsl/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3/hsl/fi/ { rewrite /map/v3/hsl/fi/(.*) /otp/routers/hsl/vectorTiles/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080; @@ -93,6 +104,17 @@ location /map/v3/hsl/ticket-sales-map/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } +location ~ ^/map/v3/waltti/(.*)/tilejson.json$ { + rewrite /map/v3/waltti/([^\/]*)/(.*) /otp/routers/waltti/vectorTiles/$2 break; + proxy_pass http://opentripplanner-waltti-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/waltti/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3/waltti/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3/waltti/fi/ { rewrite /map/v3/waltti/fi/(.*) /otp/routers/waltti/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080; @@ -120,6 +142,17 @@ location /map/v3/waltti/en/ { proxy_set_header Accept-Language "en"; } +location ~ ^/map/v3/finland/(.*)/tilejson.json$ { + rewrite /map/v3/finland/([^\/]*)/(.*) /otp/routers/finland/vectorTiles/$2 break; + proxy_pass http://opentripplanner-finland-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/finland/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3/finland/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3/finland/fi/ { rewrite /map/v3/finland/fi/(.*) /otp/routers/finland/vectorTiles/$1 break; proxy_pass http://opentripplanner-finland-v2:8080; @@ -147,6 +180,17 @@ location /map/v3/finland/en/ { proxy_set_header Accept-Language "en"; } +location ~ ^/map/v3/waltti-alt/(.*)/tilejson.json$ { + rewrite /map/v3/waltti-alt/([^\/]*)/(.*) /otp/routers/waltti-alt/vectorTiles/$2 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/waltti-alt/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3/waltti-alt/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3/waltti-alt/fi/ { rewrite /map/v3/waltti-alt/fi/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; @@ -174,6 +218,17 @@ location /map/v3/waltti-alt/en/ { proxy_set_header Accept-Language "en"; } +location ~ ^/map/v3/varely/(.*)/tilejson.json$ { + rewrite /map/v3/varely/([^\/]*)/(.*) /otp/routers/varely/vectorTiles/$2 break; + proxy_pass http://opentripplanner-varely-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/varely/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3/varely/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3/varely/fi/ { rewrite /map/v3/varely/fi/(.*) /otp/routers/varely/vectorTiles/$1 break; proxy_pass http://opentripplanner-varely-v2:8080; @@ -201,6 +256,17 @@ location /map/v3/varely/en/ { proxy_set_header Accept-Language "en"; } +location ~ ^/map/v3-kela/kela/(.*)/tilejson.json$ { + rewrite /map/v3-kela/kela/([^\/]*)/(.*) /otp/routers/kela/vectorTiles/$2 break; + proxy_pass http://opentripplanner-kela-v2:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + sub_filter "https://$host/otp/routers/kela/vectorTiles/$vector_layers/{z}/{x}/{y}.pbf" "CDN_BASE_URL/map/v3-kela/kela/$map_lang/$vector_layers/{z}/{x}/{y}.pbf$subscription_key_param"; + sub_filter_types *; +} + location /map/v3-kela/kela/fi/ { rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; proxy_pass http://opentripplanner-kela-v2:8080; diff --git a/nginx.conf b/nginx.conf index 0b78774..723b2c3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -60,6 +60,24 @@ http { # to get rid of a warning about server_names_hash building server_names_hash_bucket_size 128; + # Following maps are needed for patching tilejson tiles urls in map layers + map $args $digitransit_subscription_key { + "~(^|&)digitransit-subscription-key=(?[^&]+)" $temp; + } + + map $digitransit_subscription_key $subscription_key_param { + default ?digitransit-subscription-key=$digitransit_subscription_key; + "" ""; + } + + map $request_uri $map_lang { + ~^/map/v3/(.*)/(.*)/(.*)/(.*) $2; + } + + map $request_uri $vector_layers { + ~^/map/v3/(.*)/(.*)/(.*)/(.*) $3; + } + server { listen 8080 default_server; include external.conf; diff --git a/run.sh b/run.sh index cd8839f..d8dc36c 100755 --- a/run.sh +++ b/run.sh @@ -30,6 +30,7 @@ sed -i "s/PORI_RT_BASIC_AUTH/${PORI_RT_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/NYSSE_BASIC_AUTH/${NYSSE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/WALTTI_TEST_STATIC_BASIC_AUTH/${WALTTI_TEST_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf +sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf #set basic auth htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null diff --git a/test.js b/test.js index 35eb729..156aaf2 100644 --- a/test.js +++ b/test.js @@ -156,6 +156,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl/en/rental-stations/','opentripplanner-hsl-v2:8080'); testProxying('api.digitransit.fi','/map/v3/waltti/en/rental-stations/','opentripplanner-waltti-v2:8080'); + testProxying('api.digitransit.fi','/map/v3/hsl/fi/stops,stations/tilejson.json','opentripplanner-hsl-v2:8080'); testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080'); testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080'); testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080'); diff --git a/test.sh b/test.sh index c0b61f8..ed2ec64 100755 --- a/test.sh +++ b/test.sh @@ -26,6 +26,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ + -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 28461cf7739b25df762918b31a813fda3166437c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 23 Sep 2024 16:37:04 +0300 Subject: [PATCH 251/328] Merge map translation locations into one --- common.conf | 144 +++++++--------------------------------------------- 1 file changed, 18 insertions(+), 126 deletions(-) diff --git a/common.conf b/common.conf index 6b58338..36f2b81 100644 --- a/common.conf +++ b/common.conf @@ -69,31 +69,13 @@ location ~ ^/map/v3/hsl/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3/hsl/fi/ { - rewrite /map/v3/hsl/fi/(.*) /otp/routers/hsl/vectorTiles/$1 break; +location /map/v3/hsl/ { + rewrite /map/v3/hsl/([^\/]*)/(.*) /otp/routers/hsl/vectorTiles/$2 break; proxy_pass http://opentripplanner-hsl-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/hsl/sv/ { - rewrite /map/v3/hsl/sv/(.*) /otp/routers/hsl/vectorTiles/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/hsl/en/ { - rewrite /map/v3/hsl/en/(.*) /otp/routers/hsl/vectorTiles/$1 break; - proxy_pass http://opentripplanner-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location /map/v3/hsl/ticket-sales-map/ { @@ -115,31 +97,13 @@ location ~ ^/map/v3/waltti/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3/waltti/fi/ { - rewrite /map/v3/waltti/fi/(.*) /otp/routers/waltti/vectorTiles/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/waltti/sv/ { - rewrite /map/v3/waltti/sv/(.*) /otp/routers/waltti/vectorTiles/$1 break; +location /map/v3/waltti/ { + rewrite /map/v3/waltti/([^\/]*)/(.*) /otp/routers/waltti/vectorTiles/$2 break; proxy_pass http://opentripplanner-waltti-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/waltti/en/ { - rewrite /map/v3/waltti/en/(.*) /otp/routers/waltti/vectorTiles/$1 break; - proxy_pass http://opentripplanner-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location ~ ^/map/v3/finland/(.*)/tilejson.json$ { @@ -153,31 +117,13 @@ location ~ ^/map/v3/finland/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3/finland/fi/ { - rewrite /map/v3/finland/fi/(.*) /otp/routers/finland/vectorTiles/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/finland/sv/ { - rewrite /map/v3/finland/sv/(.*) /otp/routers/finland/vectorTiles/$1 break; - proxy_pass http://opentripplanner-finland-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/finland/en/ { - rewrite /map/v3/finland/en/(.*) /otp/routers/finland/vectorTiles/$1 break; +location /map/v3/finland/ { + rewrite /map/v3/finland/([^\/]*)/(.*) /otp/routers/finland/vectorTiles/$2 break; proxy_pass http://opentripplanner-finland-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location ~ ^/map/v3/waltti-alt/(.*)/tilejson.json$ { @@ -191,31 +137,13 @@ location ~ ^/map/v3/waltti-alt/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3/waltti-alt/fi/ { - rewrite /map/v3/waltti-alt/fi/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; +location /map/v3/waltti-alt/ { + rewrite /map/v3/waltti-alt/([^\/]*)/(.*) /otp/routers/waltti-alt/vectorTiles/$2 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/waltti-alt/sv/ { - rewrite /map/v3/waltti-alt/sv/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/waltti-alt/en/ { - rewrite /map/v3/waltti-alt/en/(.*) /otp/routers/waltti-alt/vectorTiles/$1 break; - proxy_pass http://opentripplanner-waltti-alt-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location ~ ^/map/v3/varely/(.*)/tilejson.json$ { @@ -229,31 +157,13 @@ location ~ ^/map/v3/varely/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3/varely/fi/ { - rewrite /map/v3/varely/fi/(.*) /otp/routers/varely/vectorTiles/$1 break; - proxy_pass http://opentripplanner-varely-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3/varely/sv/ { - rewrite /map/v3/varely/sv/(.*) /otp/routers/varely/vectorTiles/$1 break; +location /map/v3/varely/ { + rewrite /map/v3/varely/([^\/]*)/(.*) /otp/routers/varely/vectorTiles/$2 break; proxy_pass http://opentripplanner-varely-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3/varely/en/ { - rewrite /map/v3/varely/en/(.*) /otp/routers/varely/vectorTiles/$1 break; - proxy_pass http://opentripplanner-varely-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location ~ ^/map/v3-kela/kela/(.*)/tilejson.json$ { @@ -267,31 +177,13 @@ location ~ ^/map/v3-kela/kela/(.*)/tilejson.json$ { sub_filter_types *; } -location /map/v3-kela/kela/fi/ { - rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "fi"; -} - -location /map/v3-kela/kela/sv/ { - rewrite /map/v3-kela/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break; - proxy_pass http://opentripplanner-kela-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "sv"; -} - -location /map/v3-kela/kela/en/ { - rewrite /map/v3-kela/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break; +location /map/v3-kela/kela/ { + rewrite /map/v3-kela/kela/([^\/]*)/(.*) /otp/routers/kela/vectorTiles/$2 break; proxy_pass http://opentripplanner-kela-v2:8080; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Accept-Language "en"; + proxy_set_header Accept-Language $1; } location /graphiql/ { From 67cd1b21f2cadda785c62367789a623bb9f10dbf Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 23 Sep 2024 16:53:28 +0300 Subject: [PATCH 252/328] Add todos --- common.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common.conf b/common.conf index 36f2b81..f630029 100644 --- a/common.conf +++ b/common.conf @@ -44,6 +44,7 @@ location /map/v2/ { } location /map/v3/ { + # TODO use /map/v3/ rewrite /map/v3/(.*) /map/v2/$1 break; proxy_pass http://hsl-map-server:8080; proxy_cache tiles; @@ -79,6 +80,7 @@ location /map/v3/hsl/ { } location /map/v3/hsl/ticket-sales-map/ { + #TODO use v3 or remove this location rewrite /map/v3/hsl/ticket-sales-map/(.*) /map/v2/hsl-ticket-sales-map/$1 break; proxy_pass http://hsl-map-server:8080; proxy_redirect off; From b4c2a112bf5ffb51780abf74530bc6aa6f70c82f Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 24 Sep 2024 16:32:42 +0300 Subject: [PATCH 253/328] Add new routing api endpoints --- common.conf | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/common.conf b/common.conf index f630029..4409ba2 100644 --- a/common.conf +++ b/common.conf @@ -246,6 +246,15 @@ location /routing/v2/routers/finland { proxy_read_timeout 29500ms; } +location = /routing/v2/finland/gtfs/v1 { + rewrite /routing/v2/finland/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 29500ms; +} + location /routing/v2/routers/waltti { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080/; @@ -256,6 +265,15 @@ location /routing/v2/routers/waltti { proxy_read_timeout 11500ms; } +location = /routing/v2/waltti/gtfs/v1 { + rewrite /routing/v2/waltti/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/waltti-alt { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080/; @@ -266,6 +284,15 @@ location /routing/v2/routers/waltti-alt { proxy_read_timeout 11500ms; } +location = /routing/v2/waltti-alt/gtfs/v1 { + rewrite /routing/v2/waltti-alt/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/varely { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-varely-v2:8080/; @@ -276,6 +303,15 @@ location /routing/v2/routers/varely { proxy_read_timeout 11500ms; } +location = /routing/v2/varely/gtfs/v1 { + rewrite /routing/v2/varely/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 11500ms; +} + location /routing/v2-kela/routers/kela { rewrite /routing/v2-kela/(.*) /otp/$1 break; proxy_pass http://opentripplanner-kela-v2:8080/; @@ -286,6 +322,15 @@ location /routing/v2-kela/routers/kela { proxy_read_timeout 29500ms; } +location = /routing/v2-kela/kela/gtfs/v1 { + rewrite /routing/v2-kela/kela/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 29500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -296,6 +341,15 @@ location /routing/v2/routers/hsl { proxy_read_timeout 11500ms; } +location = /routing/v2/hsl/gtfs/v1 { + rewrite /routing/v2/hsl/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 11500ms; +} + location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-server-hsl:8080/; From 181a5e3c9991d5656fec930f7e5b28653326a021 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 24 Sep 2024 16:32:53 +0300 Subject: [PATCH 254/328] Simplify and add tests --- test.js | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/test.js b/test.js index 156aaf2..fe75ebe 100644 --- a/test.js +++ b/test.js @@ -144,6 +144,24 @@ describe('api.digitransit.fi', function() { }); }); + const v1routers = ['finland', 'hsl', 'waltti']; + + v1routers.forEach(function(router) { + testProxying('api.digitransit.fi',`/routing/v1/routers/${router}/index/graphql`, `opentripplanner-${router}:8080`); + testResponseHeader('api.digitransit.fi',`/routing-data/v2/${router}/router-config.json`, 'access-control-allow-origin', '*'); + testProxying('api.digitransit.fi',`/routing-data/v2/${router}/router-config.json`,`opentripplanner-data-server-${router}:8080`); + }); + + const v2routers = ['finland', 'hsl', 'waltti', 'waltti-alt', 'varely']; + + v2routers.forEach(function(router) { + testProxying('api.digitransit.fi',`/routing/v2/routers/${router}/index/graphql`, `opentripplanner-${router}-v2:8080`); + testProxying('api.digitransit.fi',`/routing/v2/${router}/gtfs/v1`, `opentripplanner-${router}-v2:8080`); + testResponseHeader('api.digitransit.fi',`/routing-data/v3/${router}/router-config.json`, 'access-control-allow-origin', '*'); + testProxying('api.digitransit.fi',`/routing-data/v3/${router}/router-config.json`,`opentripplanner-data-server-${router}-v3:8080`); + testProxying('api.digitransit.fi',`/map/v3/${router}/en/rental-stations/`, `opentripplanner-${router}-v2:8080`); + }); + testProxying('api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); testCaching('api.digitransit.fi','/geocoding/v1/search?digitransit-subscription-key=1234567890&text=porin%20tori', true); testCaching('api.digitransit.fi', '/geocoding/v1/reverse?digitransit-subscription-key=1234567890&point.lat=60.199284&point.lon=24.940540&size=1', true) @@ -154,35 +172,8 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl/en/rental-stations/','opentripplanner-hsl-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti/en/rental-stations/','opentripplanner-waltti-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl/fi/stops,stations/tilejson.json','opentripplanner-hsl-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080'); - testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080'); testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2:8080'); - testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); - testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); - testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080'); - testProxying('dev-api.digitransit.fi','/routing/v2/routers/finland','opentripplanner-finland-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080'); - testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-server-hsl:8080'); - testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-server-waltti:8080'); - testResponseHeader('api.digitransit.fi','/routing-data/v2/waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-server-finland:8080'); - testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-server-hsl-v3:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/hsl/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-server-waltti-v3:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-server-waltti-alt-v3:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*'); - testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-server-finland-v3:8080'); - testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); From 63fa1d398dcbf735c55c44b01c6c3306e6d7c881 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 24 Sep 2024 16:51:39 +0300 Subject: [PATCH 255/328] Prevent usage of random API endpoints of otp2 --- common.conf | 12 ++++++------ test.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common.conf b/common.conf index 4409ba2..d98bf99 100644 --- a/common.conf +++ b/common.conf @@ -236,7 +236,7 @@ location /routing/v1/routers/waltti/profile { deny all; } -location /routing/v2/routers/finland { +location = /routing/v2/routers/finland/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-finland-v2:8080/; proxy_redirect off; @@ -255,7 +255,7 @@ location = /routing/v2/finland/gtfs/v1 { proxy_read_timeout 29500ms; } -location /routing/v2/routers/waltti { +location = /routing/v2/routers/waltti/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080/; proxy_redirect off; @@ -274,7 +274,7 @@ location = /routing/v2/waltti/gtfs/v1 { proxy_read_timeout 11500ms; } -location /routing/v2/routers/waltti-alt { +location = /routing/v2/routers/waltti-alt/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080/; proxy_redirect off; @@ -293,7 +293,7 @@ location = /routing/v2/waltti-alt/gtfs/v1 { proxy_read_timeout 11500ms; } -location /routing/v2/routers/varely { +location = /routing/v2/routers/varely/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-varely-v2:8080/; proxy_redirect off; @@ -312,7 +312,7 @@ location = /routing/v2/varely/gtfs/v1 { proxy_read_timeout 11500ms; } -location /routing/v2-kela/routers/kela { +location = /routing/v2-kela/routers/kela/index/graphql { rewrite /routing/v2-kela/(.*) /otp/$1 break; proxy_pass http://opentripplanner-kela-v2:8080/; proxy_redirect off; @@ -331,7 +331,7 @@ location = /routing/v2-kela/kela/gtfs/v1 { proxy_read_timeout 29500ms; } -location /routing/v2/routers/hsl { +location = /routing/v2/routers/hsl/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; proxy_redirect off; diff --git a/test.js b/test.js index fe75ebe..1677222 100644 --- a/test.js +++ b/test.js @@ -173,7 +173,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2:8080'); - testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela/index/graphql','opentripplanner-kela-v2:8080'); testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); From 6fb69f5de923e937884f46e1f462a11d47290b42 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 24 Sep 2024 17:04:05 +0300 Subject: [PATCH 256/328] Add health check endpoint --- common.conf | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ test.js | 1 + 2 files changed, 49 insertions(+) diff --git a/common.conf b/common.conf index d98bf99..ab405b0 100644 --- a/common.conf +++ b/common.conf @@ -255,6 +255,14 @@ location = /routing/v2/finland/gtfs/v1 { proxy_read_timeout 29500ms; } +location = /routing/v2/finland/health { + rewrite /routing/v2/finland/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-finland-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location = /routing/v2/routers/waltti/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-v2:8080/; @@ -274,6 +282,14 @@ location = /routing/v2/waltti/gtfs/v1 { proxy_read_timeout 11500ms; } +location = /routing/v2/waltti/health { + rewrite /routing/v2/waltti/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-waltti-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location = /routing/v2/routers/waltti-alt/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-waltti-alt-v2:8080/; @@ -293,6 +309,14 @@ location = /routing/v2/waltti-alt/gtfs/v1 { proxy_read_timeout 11500ms; } +location = /routing/v2/waltti-alt/health { + rewrite /routing/v2/waltti-alt/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-waltti-alt-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location = /routing/v2/routers/varely/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-varely-v2:8080/; @@ -312,6 +336,14 @@ location = /routing/v2/varely/gtfs/v1 { proxy_read_timeout 11500ms; } +location = /routing/v2/varely/health { + rewrite /routing/v2/varely/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-varely-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location = /routing/v2-kela/routers/kela/index/graphql { rewrite /routing/v2-kela/(.*) /otp/$1 break; proxy_pass http://opentripplanner-kela-v2:8080/; @@ -331,6 +363,14 @@ location = /routing/v2-kela/kela/gtfs/v1 { proxy_read_timeout 29500ms; } +location = /routing/v2-kela/kela/health { + rewrite /routing/v2-kela/kela/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location = /routing/v2/routers/hsl/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; @@ -350,6 +390,14 @@ location = /routing/v2/hsl/gtfs/v1 { proxy_read_timeout 11500ms; } +location = /routing/v2/hsl/health { + rewrite /routing/v2/hsl/(.*) /otp/actuators/$1 break; + proxy_pass http://opentripplanner-hsl-v2:8080/; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location /routing-data/v2/hsl { rewrite /routing-data/v2/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-server-hsl:8080/; diff --git a/test.js b/test.js index 1677222..ab02d6d 100644 --- a/test.js +++ b/test.js @@ -157,6 +157,7 @@ describe('api.digitransit.fi', function() { v2routers.forEach(function(router) { testProxying('api.digitransit.fi',`/routing/v2/routers/${router}/index/graphql`, `opentripplanner-${router}-v2:8080`); testProxying('api.digitransit.fi',`/routing/v2/${router}/gtfs/v1`, `opentripplanner-${router}-v2:8080`); + testProxying('api.digitransit.fi',`/routing/v2/${router}/health`, `opentripplanner-${router}-v2:8080`); testResponseHeader('api.digitransit.fi',`/routing-data/v3/${router}/router-config.json`, 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi',`/routing-data/v3/${router}/router-config.json`,`opentripplanner-data-server-${router}-v3:8080`); testProxying('api.digitransit.fi',`/map/v3/${router}/en/rental-stations/`, `opentripplanner-${router}-v2:8080`); From 8fb1a09eaa24550394aeb618261b89499d5bb205 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 27 Sep 2024 14:54:35 +0300 Subject: [PATCH 257/328] Remove ticket sales map from v3 --- common.conf | 9 --------- test.js | 1 - 2 files changed, 10 deletions(-) diff --git a/common.conf b/common.conf index ab405b0..524b019 100644 --- a/common.conf +++ b/common.conf @@ -79,15 +79,6 @@ location /map/v3/hsl/ { proxy_set_header Accept-Language $1; } -location /map/v3/hsl/ticket-sales-map/ { - #TODO use v3 or remove this location - rewrite /map/v3/hsl/ticket-sales-map/(.*) /map/v2/hsl-ticket-sales-map/$1 break; - proxy_pass http://hsl-map-server:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - location ~ ^/map/v3/waltti/(.*)/tilejson.json$ { rewrite /map/v3/waltti/([^\/]*)/(.*) /otp/routers/waltti/vectorTiles/$2 break; proxy_pass http://opentripplanner-waltti-v2:8080; diff --git a/test.js b/test.js index ab02d6d..d6dd8b3 100644 --- a/test.js +++ b/test.js @@ -172,7 +172,6 @@ describe('api.digitransit.fi', function() { //testCaching('api.digitransit.fi','/realtime/trip-updates/v1/foo', false) testProxying('api.digitransit.fi','/map/v2/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3/hsl-map/','hsl-map-server:8080'); - testProxying('api.digitransit.fi','/map/v3/hsl/ticket-sales-map/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela/index/graphql','opentripplanner-kela-v2:8080'); testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); From 28dd189f5b7c4dde9ec4509355495770b9d7c1e0 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 27 Sep 2024 14:57:02 +0300 Subject: [PATCH 258/328] Use v3 map from map server This automatically removes legacy map endpoints from v3 --- common.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common.conf b/common.conf index 524b019..9a0d148 100644 --- a/common.conf +++ b/common.conf @@ -44,8 +44,7 @@ location /map/v2/ { } location /map/v3/ { - # TODO use /map/v3/ - rewrite /map/v3/(.*) /map/v2/$1 break; + rewrite /map/v3/(.*) /map/v3/$1 break; proxy_pass http://hsl-map-server:8080; proxy_cache tiles; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; From cbf93c78205c54979ae92edba08c96081ab26769 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 30 Sep 2024 17:26:24 +0300 Subject: [PATCH 259/328] Remove unused ui apis --- common.conf | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/common.conf b/common.conf index 9a0d148..744fc9e 100644 --- a/common.conf +++ b/common.conf @@ -468,42 +468,6 @@ location /routing-data/v3/finland { include cors.conf; } -location /ui/v1/finland/ { - rewrite /ui/v1/finland/(.*) /$1 break; - proxy_pass http://digitransit-ui-matka-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - -location /ui/v1/hsl-next/ { - rewrite /ui/v1/hsl-next/(.*) /$1 break; - proxy_pass http://digitransit-ui-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - -location /ui/v1/waltti-next/ { - rewrite /ui/v1/waltti-next/(.*) /$1 break; - proxy_pass http://digitransit-ui-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - -location /ui/v2/matka/ { - rewrite /ui/v2/matka/(.*) /$1 break; - proxy_pass http://digitransit-ui-matka-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /ui/v2/hsl/ { rewrite /ui/v2/hsl/(.*) /$1 break; proxy_pass http://digitransit-ui-hsl-v2:8080; @@ -522,15 +486,6 @@ location /ui/v2-test/hsl/ { # proxy_set_header X-Forwarded-Host $host; } -location /ui/v2/waltti/ { - rewrite /ui/v2/waltti/(.*) /$1 break; - proxy_pass http://digitransit-ui-waltti-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /ui/v3/matka/ { rewrite /ui/v3/matka/(.*) /$1 break; proxy_pass http://digitransit-ui-matka-v3:8080; From cb40b5f42bb1859ad34d9d918d819295acea4fba Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Wed, 9 Oct 2024 11:02:14 +0300 Subject: [PATCH 260/328] Remove hsl test ui --- common.conf | 9 --------- nginx.conf | 48 ------------------------------------------------ 2 files changed, 57 deletions(-) diff --git a/common.conf b/common.conf index 744fc9e..a42b434 100644 --- a/common.conf +++ b/common.conf @@ -477,15 +477,6 @@ location /ui/v2/hsl/ { # proxy_set_header X-Forwarded-Host $host; } -location /ui/v2-test/hsl/ { - rewrite /ui/v2-test/hsl/(.*) /$1 break; - proxy_pass http://digitransit-ui-hsl-v2-test:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /ui/v3/matka/ { rewrite /ui/v3/matka/(.*) /$1 break; proxy_pass http://digitransit-ui-matka-v3:8080; diff --git a/nginx.conf b/nginx.conf index 723b2c3..e89c497 100644 --- a/nginx.conf +++ b/nginx.conf @@ -345,54 +345,6 @@ http { } } - # test service for dedicated project (eg. for node-migration) - server { - server_name test.digitransit.fi; - listen 8080; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - # Add HTTP Strict Transport Security for good measure. - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - - error_page 500 502 503 504 /502.html; - location = /502.html { - proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html; - internal; - } - - location = /sw.js { - proxy_pass http://digitransit-ui-hsl-v2-test:8080; - include basicsettings.conf; - proxy_cache sw; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - 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; - } - - location /local-storage-emitter { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v2-test:8080; - include basicsettings.conf; - } - location = /haku { - add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v2-test:8080; - include basicsettings.conf; - } - - location / { - proxy_pass http://digitransit-ui-hsl-v2-test:8080; - include basicsettings.conf; - } - } - server { server_name dev-matka-yleisviesti.digitransit.fi matka-yleisviesti.digitransit.fi; listen 8080; From eaa53c0b951255a9b7f17b63b0e3a110258aece9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 6 Nov 2024 12:22:00 +0200 Subject: [PATCH 261/328] Update github actions to v4 --- .github/workflows/dev-pipeline.yml | 6 +++--- .github/workflows/prod-pipeline.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 9ed1630..f72a2d3 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -14,9 +14,9 @@ jobs: node-version: [16.x] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install dependencies @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build docker image from master and push it run: ./.github/workflows/scripts/build_and_push_dev.sh env: diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index 82e2a6c..35e9ada 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check Tag id: check-tag run: | From f6c3ad1f35f083425521a2caf26c93ab94b9e2a4 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 29 Nov 2024 15:54:36 +0200 Subject: [PATCH 262/328] Direct next waltti planners to walttitest UI server --- nginx.conf | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/nginx.conf b/nginx.conf index e89c497..8739ddd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -188,24 +188,24 @@ http { } server { - server_name dev-hameenlinna.digitransit.fi next-dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi - dev-joensuu.digitransit.fi next-dev-joensuu.digitransit.fi joensuu.digitransit.fi - dev-jyvaskyla.digitransit.fi next-dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi - dev-kotka.digitransit.fi next-dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi next-dev-kuopio.digitransit.fi kuopio.digitransit.fi - dev-lahti.digitransit.fi next-dev-lahti.digitransit.fi lahti.digitransit.fi - dev-lappeenranta.digitransit.fi next-dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi - dev-mikkeli.digitransit.fi next-dev-mikkeli.digitransit.fi mikkeli.digitransit.fi - dev-oulu.digitransit.fi next-dev-oulu.digitransit.fi reittiopas.osl.fi - dev-turku.digitransit.fi next-dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi - dev-tampere.digitransit.fi next-dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi - dev-kouvola.digitransit.fi next-dev-kouvola.digitransit.fi kouvola.digitransit.fi - dev-rovaniemi.digitransit.fi next-dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi + server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi + dev-joensuu.digitransit.fi joensuu.digitransit.fi + dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi + dev-kotka.digitransit.fi kotka.digitransit.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-lahti.digitransit.fi lahti.digitransit.fi + dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi + dev-mikkeli.digitransit.fi mikkeli.digitransit.fi + dev-oulu.digitransit.fi reittiopas.osl.fi + dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi + dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi + dev-kouvola.digitransit.fi kouvola.digitransit.fi + dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi dev-waltti.digitransit.fi opas.waltti.fi - dev-vaasa.digitransit.fi next-dev-vaasa.digitransit.fi vaasa.digitransit.fi - dev-pori.digitransit.fi next-dev-pori.digitransit.fi pori.digitransit.fi + dev-vaasa.digitransit.fi vaasa.digitransit.fi + dev-pori.digitransit.fi pori.digitransit.fi dev-varely.digitransit.fi varely.digitransit.fi reittiopas.seutuplus.fi - dev-raasepori.digitransit.fi next-dev-raasepori.digitransit.fi bosse.digitransit.fi; + dev-raasepori.digitransit.fi bosse.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -512,7 +512,23 @@ http { } server { - server_name waltti-test.digitransit.fi; + server_name waltti-test.digitransit.fi + next-dev-hameenlinna.digitransit.fi + next-dev-joensuu.digitransit.fi + next-dev-jyvaskyla.digitransit.fi + next-dev-kotka.digitransit.fi + next-dev-kuopio.digitransit.fi + next-dev-lahti.digitransit.fi + next-dev-lappeenranta.digitransit.fi + next-dev-mikkeli.digitransit.fi + next-dev-oulu.digitransit.fi + next-dev-turku.digitransit.fi + next-dev-tampere.digitransit.fi + next-dev-kouvola.digitransit.fi + next-dev-rovaniemi.digitransit.fi + next-dev-vaasa.digitransit.fi + next-dev-pori.digitransit.fi + next-dev-raasepori.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 89113445f5d566a99d656b4f8260dbb76da3edee Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 2 Dec 2024 08:30:28 +0200 Subject: [PATCH 263/328] Update tests --- test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test.js b/test.js index d6dd8b3..b42db6b 100644 --- a/test.js +++ b/test.js @@ -237,9 +237,9 @@ describe('waltti ui', function() { walttiCities.forEach(function(city) { testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); }); @@ -273,7 +273,7 @@ describe('waltti ui', function() { testRedirect('dev-raasepori.digitransit.fi','/kissa','https://dev-raasepori.digitransit.fi/kissa'); testProxying('dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); testRedirect('next-dev-raasepori.digitransit.fi','/kissa','https://next-dev-raasepori.digitransit.fi/kissa'); - testProxying('next-dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testProxying('next-dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); @@ -314,4 +314,4 @@ describe('ext-proxy', function() { describe('waltti-test ui', function() { testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); testWithCorrectCredentials('waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); -}); \ No newline at end of file +}); From 532505cd105f8e0f37440df668d3576dcc972310 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 2 Dec 2024 16:10:29 +0200 Subject: [PATCH 264/328] Remove tests to password protected test ui server --- test.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test.js b/test.js index b42db6b..c0dc3f8 100644 --- a/test.js +++ b/test.js @@ -236,10 +236,6 @@ describe('waltti ui', function() { ]; walttiCities.forEach(function(city) { - testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); - testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa'); - testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa'); testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); }); @@ -272,8 +268,6 @@ describe('waltti ui', function() { testRedirect('dev-raasepori.digitransit.fi','/kissa','https://dev-raasepori.digitransit.fi/kissa'); testProxying('dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); - testRedirect('next-dev-raasepori.digitransit.fi','/kissa','https://next-dev-raasepori.digitransit.fi/kissa'); - testProxying('next-dev-raasepori.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); From c203a7beebc36da7551ce30e12c94b26cd493b05 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 10 Dec 2024 16:46:00 +0200 Subject: [PATCH 265/328] Use latest stable nginx version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9283659..84eeec9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.24-alpine +FROM nginx:1.26-alpine MAINTAINER Reittiopas version: 0.1 ENV INSTALL_DIR="/opt/nginx" From a4a7c3c1cdca314b5c32dea50403ac7f639e1891 Mon Sep 17 00:00:00 2001 From: sharhio Date: Tue, 7 Jan 2025 13:42:38 +0200 Subject: [PATCH 266/328] remove waltti-test auth --- nginx.conf | 4 ++-- test.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 8739ddd..8fca1e1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -568,8 +568,8 @@ http { location / { proxy_pass http://digitransit-ui-waltti-test:8080; include basicsettings.conf; - auth_basic "waltti-test.digitransit.fi"; - auth_basic_user_file .htpasswd; + # auth_basic "waltti-test.digitransit.fi"; + # auth_basic_user_file .htpasswd; } } diff --git a/test.js b/test.js index c0dc3f8..ff5ee23 100644 --- a/test.js +++ b/test.js @@ -306,6 +306,8 @@ describe('ext-proxy', function() { }); describe('waltti-test ui', function() { - testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); - testWithCorrectCredentials('waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); + // testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); + // testWithCorrectCredentials('waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); + testRedirect('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); + testProxying('waltti-test.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); }); From 19f69e0ee4fae58dc57997ac54ccb3b1b45babfa Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 14 Mar 2025 14:48:19 +0200 Subject: [PATCH 267/328] Change next-dev hsl ui server to use a new service, remove emitter paths --- nginx.conf | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/nginx.conf b/nginx.conf index 8fca1e1..24070f8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -245,7 +245,7 @@ http { } server { - server_name dev.reittiopas.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -262,7 +262,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-hsl-v2:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -273,15 +273,10 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } - location /local-storage-emitter { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v2:8080; - include basicsettings.conf; - } location = /haku { add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v2:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } location = / { @@ -289,13 +284,13 @@ http { } location / { - proxy_pass http://digitransit-ui-hsl-v2:8080; + proxy_pass http://digitransit-ui-hsl-v3:8080; include basicsettings.conf; } } server { - server_name next-dev.digitransit.fi reittiopas.hsl.fi; + server_name next-dev.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -312,7 +307,7 @@ http { } location = /sw.js { - proxy_pass http://digitransit-ui-hsl-v3:8080; + proxy_pass http://digitransit-ui-hsl-test:8080; include basicsettings.conf; proxy_cache sw; proxy_cache_valid 200 30s; @@ -323,15 +318,10 @@ http { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } - location /local-storage-emitter { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v3:8080; - include basicsettings.conf; - } location = /haku { add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-hsl-v3:8080; + proxy_pass http://digitransit-ui-hsl-test:8080; include basicsettings.conf; } @@ -340,7 +330,7 @@ http { } location / { - proxy_pass http://digitransit-ui-hsl-v3:8080; + proxy_pass http://digitransit-ui-hsl-test:8080; include basicsettings.conf; } } @@ -555,11 +545,7 @@ http { 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; } - location /local-storage-emitter { - proxy_hide_header X-Frame-Options; - proxy_pass http://digitransit-ui-waltti-test:8080; - include basicsettings.conf; - } + location = /haku { proxy_hide_header X-Frame-Options; proxy_pass http://digitransit-ui-waltti-test:8080; From bdc636b91892562da0151b444d9a2b48626299e5 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 14 Mar 2025 15:33:18 +0200 Subject: [PATCH 268/328] Update tests --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index ff5ee23..fadb13e 100644 --- a/test.js +++ b/test.js @@ -199,7 +199,7 @@ describe('hsl ui', function() { }); }); - testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-v2:8080', true); + testProxying('dev.reittiopas.fi','/etusivu','digitransit-ui-hsl-v3:8080', true); testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true); testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v3:8080', true); @@ -209,7 +209,7 @@ describe('hsl ui', function() { //next-dev site testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); - testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-v3:8080', true); + testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-test:8080', true); testCaching('next-dev.digitransit.fi','/sw.js', true); }); From f6c5b77093eec71b1232ad7c65cb3bc2408f7428 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 17 Mar 2025 12:34:50 +0200 Subject: [PATCH 269/328] Add path handling for the new hsl test ui --- common.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.conf b/common.conf index a42b434..3c9ec48 100644 --- a/common.conf +++ b/common.conf @@ -530,4 +530,13 @@ location /ui/v3/waltti-test/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; +} + +location /ui/v3/hsl-test/ { + rewrite /ui/v3/hsl-test/(.*) /$1 break; + proxy_pass http://digitransit-ui-hsl-test:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; } \ No newline at end of file From fcbfe2522a163ac698e2c418cbc56d30ef2583f8 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 17 Mar 2025 15:08:32 +0200 Subject: [PATCH 270/328] Remove deprecated v2 hsl ui endpoint --- common.conf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/common.conf b/common.conf index 3c9ec48..2483033 100644 --- a/common.conf +++ b/common.conf @@ -468,15 +468,6 @@ location /routing-data/v3/finland { include cors.conf; } -location /ui/v2/hsl/ { - rewrite /ui/v2/hsl/(.*) /$1 break; - proxy_pass http://digitransit-ui-hsl-v2:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /ui/v3/matka/ { rewrite /ui/v3/matka/(.*) /$1 break; proxy_pass http://digitransit-ui-matka-v3:8080; From 20f8a019a187bb81836cbd658c8cb7bbd1fd3002 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 21 Mar 2025 13:57:46 +0200 Subject: [PATCH 271/328] Mobility data GTFS RT endpoint --- external.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/external.conf b/external.conf index 3a37faa..81f71c8 100644 --- a/external.conf +++ b/external.conf @@ -418,3 +418,16 @@ location /out/lmjadmin.mattersoft.fi/ { proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; proxy_set_header Authorization WALTTI_TEST_STATIC_BASIC_AUTH; } + +#mobilitydata gtfs rt https://mobility-api.mobility-database.fintraffic.fi/gtfs-realtime/v2 +location /out/mobility-api.mobility-database.fintraffic.fi/ { + proxy_pass https://https://mobility-api.mobility-database.fintraffic.fi/; + 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; + proxy_set_header x-api-key MOBILITY_API_KEY; +} From 95ee53f089d811e6afef9e299756e02a915fc435 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 24 Mar 2025 12:33:09 +0200 Subject: [PATCH 272/328] Remove HSL timetable API --- common.conf | 9 --------- test.js | 1 - 2 files changed, 10 deletions(-) diff --git a/common.conf b/common.conf index 2483033..0efa261 100644 --- a/common.conf +++ b/common.conf @@ -495,15 +495,6 @@ location /ui/v3/waltti/ { # proxy_set_header X-Forwarded-Host $host; } -location /timetables/v1/hsl/ { - rewrite /timetables/v1/hsl/(.*) /hsl/$1 break; - proxy_pass http://hsl-timetable-container:8080; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; -} - location /matka-fonts/ { rewrite /matka-fonts/(.*) /$1 break; proxy_pass https://matkafonts.blob.core.windows.net; diff --git a/test.js b/test.js index fadb13e..9962dc4 100644 --- a/test.js +++ b/test.js @@ -180,7 +180,6 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080'); testProxying('api.digitransit.fi','/ui/v3/waltti/sw.js','digitransit-ui-waltti-v3:8080'); - testProxying('api.digitransit.fi','/timetables/v1/hsl/stops/1010105.pdf','hsl-timetable-container:8080'); }); describe('hsl ui', function() { From 05087ff9e6700d654e276838eb4892ee8afa7619 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Mar 2025 12:58:13 +0200 Subject: [PATCH 273/328] Add new secret to tests --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index ed2ec64..de6f56f 100755 --- a/test.sh +++ b/test.sh @@ -26,7 +26,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ - -e CDN_BASE_URL="test" \ + -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 106e7d63bf10032bf9e9f85d73d1522c6fa1acfa Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Mar 2025 13:03:56 +0200 Subject: [PATCH 274/328] Try simpler quotes --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index de6f56f..3070131 100755 --- a/test.sh +++ b/test.sh @@ -26,7 +26,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ - -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ + -e MOBILITY_API_KEY="test" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 5f5f77b35d0eb039daa57ca3b630d3361483ac49 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Mar 2025 13:09:29 +0200 Subject: [PATCH 275/328] Add new secret handling to run.sh --- run.sh | 1 + test.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index d8dc36c..152ab04 100755 --- a/run.sh +++ b/run.sh @@ -31,6 +31,7 @@ sed -i "s/MH_BASIC_AUTH/${MH_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/NYSSE_BASIC_AUTH/${NYSSE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/WALTTI_TEST_STATIC_BASIC_AUTH/${WALTTI_TEST_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf +sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf #set basic auth htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null diff --git a/test.sh b/test.sh index 3070131..de6f56f 100755 --- a/test.sh +++ b/test.sh @@ -26,7 +26,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ - -e MOBILITY_API_KEY="test" -e CDN_BASE_URL="test" \ + -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 384e0f7e9d7df32c501a4fc95e88010b9cfb233a Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Mar 2025 13:24:49 +0200 Subject: [PATCH 276/328] Try another header --- external.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external.conf b/external.conf index 81f71c8..988f17a 100644 --- a/external.conf +++ b/external.conf @@ -429,5 +429,5 @@ location /out/mobility-api.mobility-database.fintraffic.fi/ { 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; - proxy_set_header x-api-key MOBILITY_API_KEY; + proxy_set_header Authorization MOBILITY_API_KEY; } From ba814cf9f507308784a5a45a2784f53339962adc Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Mar 2025 13:28:46 +0200 Subject: [PATCH 277/328] Fix URL typo --- external.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external.conf b/external.conf index 988f17a..793c325 100644 --- a/external.conf +++ b/external.conf @@ -421,7 +421,7 @@ location /out/lmjadmin.mattersoft.fi/ { #mobilitydata gtfs rt https://mobility-api.mobility-database.fintraffic.fi/gtfs-realtime/v2 location /out/mobility-api.mobility-database.fintraffic.fi/ { - proxy_pass https://https://mobility-api.mobility-database.fintraffic.fi/; + proxy_pass https://mobility-api.mobility-database.fintraffic.fi/; include allowed-ips.conf; proxy_cache ext_cache; proxy_cache_valid 200 30s; @@ -429,5 +429,5 @@ location /out/mobility-api.mobility-database.fintraffic.fi/ { 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; - proxy_set_header Authorization MOBILITY_API_KEY; + proxy_set_header x-api-key MOBILITY_API_KEY; } From 1991e4110d8355e760e1168b7380c39e7dd02035 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 9 May 2025 14:08:22 +0300 Subject: [PATCH 278/328] Remove routing v1 and routing data v2 --- common.conf | 70 ----------------------------------------------------- test.js | 8 ------ 2 files changed, 78 deletions(-) diff --git a/common.conf b/common.conf index 0efa261..a7f8a28 100644 --- a/common.conf +++ b/common.conf @@ -186,46 +186,6 @@ location /graphiql/ { # proxy_set_header X-Forwarded-Host $host; } -location /routing/v1/routers/finland { - rewrite /routing/v1/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-finland:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 29500ms; -} - -# Disable profile routing from Finland -location /routing/v1/routers/finland/profile { - deny all; -} - -location /routing/v1/routers/hsl { - rewrite /routing/v1/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-hsl:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - -location /routing/v1/routers/waltti { - rewrite /routing/v1/(.*) /otp/$1 break; - proxy_pass http://opentripplanner-waltti:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 11500ms; -} - -# Disable profile routing from Waltti -location /routing/v1/routers/waltti/profile { - deny all; -} - location = /routing/v2/routers/finland/index/graphql { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-finland-v2:8080/; @@ -388,36 +348,6 @@ location = /routing/v2/hsl/health { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location /routing-data/v2/hsl { - rewrite /routing-data/v2/hsl/(.*) /$1 break; - proxy_pass http://opentripplanner-data-server-hsl:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - -location /routing-data/v2/waltti { - rewrite /routing-data/v2/waltti/(.*) /$1 break; - proxy_pass http://opentripplanner-data-server-waltti:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - -location /routing-data/v2/finland { - rewrite /routing-data/v2/finland/(.*) /$1 break; - proxy_pass http://opentripplanner-data-server-finland:8080/; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Host $host; - include cors.conf; -} - location /routing-data/v3/hsl { rewrite /routing-data/v3/hsl/(.*) /$1 break; proxy_pass http://opentripplanner-data-server-hsl-v3:8080/; diff --git a/test.js b/test.js index 9962dc4..267c94d 100644 --- a/test.js +++ b/test.js @@ -144,14 +144,6 @@ describe('api.digitransit.fi', function() { }); }); - const v1routers = ['finland', 'hsl', 'waltti']; - - v1routers.forEach(function(router) { - testProxying('api.digitransit.fi',`/routing/v1/routers/${router}/index/graphql`, `opentripplanner-${router}:8080`); - testResponseHeader('api.digitransit.fi',`/routing-data/v2/${router}/router-config.json`, 'access-control-allow-origin', '*'); - testProxying('api.digitransit.fi',`/routing-data/v2/${router}/router-config.json`,`opentripplanner-data-server-${router}:8080`); - }); - const v2routers = ['finland', 'hsl', 'waltti', 'waltti-alt', 'varely']; v2routers.forEach(function(router) { From 666d3f97bd24f80a211e0246f30eff221522f79f Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Wed, 14 May 2025 15:38:37 +0300 Subject: [PATCH 279/328] Rename hsl and matka dev enviorments consistently with other services --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 24070f8..bfc49a5 100644 --- a/nginx.conf +++ b/nginx.conf @@ -147,7 +147,7 @@ http { } server { - server_name dev.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi + server_name dev-matka.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; @@ -290,7 +290,7 @@ http { } server { - server_name next-dev.digitransit.fi; + server_name next-dev-hsl.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From c3df2eb4a88e98b9d1edcca1de1ad0c165bdc1f9 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 15 May 2025 12:36:46 +0300 Subject: [PATCH 280/328] Rename digirtansit site dev --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index bfc49a5..b08fbf2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -405,7 +405,7 @@ http { } server { - server_name digitransit.fi www.digitransit.fi dev-site.digitransit.fi; + server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 38d5899a4b88d73eb109a76423e18d2a6fe6a98d Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 15 May 2025 13:01:10 +0300 Subject: [PATCH 281/328] Map hsl dev to both digitransit.fi and rettiopas.fi --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index b08fbf2..bb3a74f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -245,7 +245,7 @@ http { } server { - server_name dev.reittiopas.fi reittiopas.hsl.fi; + server_name dev.reittiopas.fi reittiopas.hsl.fi dev-hsl.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -290,7 +290,7 @@ http { } server { - server_name next-dev-hsl.digitransit.fi; + server_name next-dev-hsl.digitransit.fi next-dev.reittiopas.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 13e64f26fdd592219655749fb0179a8077df40e5 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 15 May 2025 13:11:51 +0300 Subject: [PATCH 282/328] Fix tests --- test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test.js b/test.js index 9962dc4..d31893c 100644 --- a/test.js +++ b/test.js @@ -206,10 +206,10 @@ describe('hsl ui', function() { testCaching('reittiopas.hsl.fi','/sw.js', true); //next-dev site - testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa'); - testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa'); - testProxying('next-dev.digitransit.fi','/kissa','digitransit-ui-hsl-test:8080', true); - testCaching('next-dev.digitransit.fi','/sw.js', true); + testRedirect('www.next-dev-hsl.digitransit.fi','/kissa','http://next-dev-hsl.digitransit.fi/kissa'); + testRedirect('next-dev-hsl.digitransit.fi','/kissa','https://next-dev-hsl.digitransit.fi/kissa'); + testProxying('next-dev-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-test:8080', true); + testCaching('next-dev-hsl.digitransit.fi','/sw.js', true); }); describe('matka ui', function() { From 7765752dbc9195277dcbe7af7a77c090c20e3691 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Thu, 15 May 2025 14:43:54 +0300 Subject: [PATCH 283/328] Keep old next-dev.digitransit.fi for a while --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index bb3a74f..2f6556e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -290,7 +290,7 @@ http { } server { - server_name next-dev-hsl.digitransit.fi next-dev.reittiopas.fi; + server_name next-dev-hsl.digitransit.fi next-dev.reittiopas.fi next-dev.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From 3b1b567f260a7ce63f23f4584b2bd8e0cf058f40 Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 26 May 2025 10:46:01 +0300 Subject: [PATCH 284/328] DT-6888 new matka address --- nginx.conf | 2 +- test.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 2f6556e..3c35909 100644 --- a/nginx.conf +++ b/nginx.conf @@ -147,7 +147,7 @@ http { } server { - server_name dev-matka.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi + server_name dev-matka.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index ef63883..2698f61 100644 --- a/test.js +++ b/test.js @@ -220,6 +220,22 @@ describe('matka ui', function() { }); }); +describe('fintraffic ui', function() { + testRedirect('www.opas.fintraffic.fi','/kissa','http://opas.fintraffic.fi/kissa'); + testRedirect('opas.fintraffic.fi','/kissa','https://opas.fintraffic.fi/kissa'); + + testProxying('opas.fintraffic.fi','/','digitransit-ui-matka-v3:8080', true); + + testCaching('opas.fintraffic.fi','/sw.js', true); + + it('https should not redirect', function(done) { + httpsGet('opas.fintraffic.fi','/kissa').end((err,res)=>{ + expect(err).to.be.null; + done(); + }); + }); +}); + describe('waltti ui', function() { const walttiCities = [ 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', From 23bc1243a0f94854742b3692a968dcadc75d0b77 Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 26 May 2025 10:49:54 +0300 Subject: [PATCH 285/328] wrong address in test fix --- test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test.js b/test.js index 2698f61..680f05c 100644 --- a/test.js +++ b/test.js @@ -221,15 +221,15 @@ describe('matka ui', function() { }); describe('fintraffic ui', function() { - testRedirect('www.opas.fintraffic.fi','/kissa','http://opas.fintraffic.fi/kissa'); - testRedirect('opas.fintraffic.fi','/kissa','https://opas.fintraffic.fi/kissa'); + testRedirect('www.matka.fintraffic.fi','/kissa','http://matka.fintraffic.fi/kissa'); + testRedirect('matka.fintraffic.fi','/kissa','https://matka.fintraffic.fi/kissa'); - testProxying('opas.fintraffic.fi','/','digitransit-ui-matka-v3:8080', true); + testProxying('matka.fintraffic.fi','/','digitransit-ui-matka-v3:8080', true); - testCaching('opas.fintraffic.fi','/sw.js', true); + testCaching('matka.fintraffic.fi','/sw.js', true); it('https should not redirect', function(done) { - httpsGet('opas.fintraffic.fi','/kissa').end((err,res)=>{ + httpsGet('matka.fintraffic.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; done(); }); From 7e8a2d64b20f13b1c195dfc8f23f4ef93e7a551f Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 12 Aug 2025 16:11:59 +0300 Subject: [PATCH 286/328] Add more routes for debug UIs. --- nginx.conf | 23 ++++++++++++++++++++--- test.js | 5 +++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 3c35909..0a3cc3b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -434,7 +434,7 @@ http { } server { - server_name hsl-debug.digitransit.fi; + server_name dev-hsl-debug.digitransit.fi hsl-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -451,7 +451,7 @@ http { } server { - server_name waltti-debug.digitransit.fi; + server_name dev-waltti-debug.digitransit.fi waltti-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -468,7 +468,7 @@ http { } server { - server_name finland-debug.digitransit.fi; + server_name dev-finland-debug.digitransit.fi finland-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -501,6 +501,23 @@ http { } } + server { + server_name dev-varely-debug.digitransit.fi varely-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location / { + proxy_pass http://opentripplanner-varely-v2:8080/; + include basicsettings.conf; + } + } + server { server_name waltti-test.digitransit.fi next-dev-hameenlinna.digitransit.fi diff --git a/test.js b/test.js index 680f05c..06c6d89 100644 --- a/test.js +++ b/test.js @@ -299,9 +299,14 @@ describe('digitransit', function() { }); describe('otp debug', function() { + testProxying('dev-hsl-debug.digitransit.fi','/','opentripplanner-hsl-v2:8080', true); + testProxying('dev-waltti-debug.digitransit.fi','/','opentripplanner-waltti-v2:8080', true); + testProxying('dev-finland-debug.digitransit.fi','/','opentripplanner-finland-v2:8080', true); + testProxying('dev-varely-debug.digitransit.fi','/','opentripplanner-varely-v2:8080', true); testProxying('hsl-debug.digitransit.fi','/','opentripplanner-hsl-v2:8080', true); testProxying('waltti-debug.digitransit.fi','/','opentripplanner-waltti-v2:8080', true); testProxying('finland-debug.digitransit.fi','/','opentripplanner-finland-v2:8080', true); + testProxying('varely-debug.digitransit.fi','/','opentripplanner-varely-v2:8080', true); testProxying('waltti-alt-debug.digitransit.fi','/','opentripplanner-waltti-alt-v2:8080', true); }); From 73729167d55e684329848b63d53c4b37ef1702fe Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 12 Aug 2025 16:26:46 +0300 Subject: [PATCH 287/328] Return 404 when accessing /otp/actuators/ with debug UI routing. --- nginx.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/nginx.conf b/nginx.conf index 0a3cc3b..b2efade 100644 --- a/nginx.conf +++ b/nginx.conf @@ -444,6 +444,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /otp/actuators/ { + return 404; + } + location / { proxy_pass http://opentripplanner-hsl-v2:8080/; include basicsettings.conf; @@ -461,6 +465,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /otp/actuators/ { + return 404; + } + location / { proxy_pass http://opentripplanner-waltti-v2:8080/; include basicsettings.conf; @@ -478,6 +486,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /otp/actuators/ { + return 404; + } + location / { proxy_pass http://opentripplanner-finland-v2:8080/; include basicsettings.conf; @@ -495,6 +507,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /otp/actuators/ { + return 404; + } + location / { proxy_pass http://opentripplanner-waltti-alt-v2:8080/; include basicsettings.conf; @@ -512,6 +528,10 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + location /otp/actuators/ { + return 404; + } + location / { proxy_pass http://opentripplanner-varely-v2:8080/; include basicsettings.conf; From 4c8b0e1031508a2bf566171e5731e473fa418240 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Mon, 18 Aug 2025 15:35:54 +0300 Subject: [PATCH 288/328] Add auth_basic to production debug UIs and both kela debug UIs. --- nginx.conf | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++-- run.sh | 3 +- test.js | 21 ++++++-- test.sh | 1 + 4 files changed, 161 insertions(+), 10 deletions(-) diff --git a/nginx.conf b/nginx.conf index b2efade..ec4523b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -434,7 +434,7 @@ http { } server { - server_name dev-hsl-debug.digitransit.fi hsl-debug.digitransit.fi; + server_name hsl-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -451,11 +451,34 @@ http { location / { proxy_pass http://opentripplanner-hsl-v2:8080/; include basicsettings.conf; + auth_basic "hsl-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; } } server { - server_name dev-waltti-debug.digitransit.fi waltti-debug.digitransit.fi; + server_name dev-hsl-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-hsl-v2:8080/; + include basicsettings.conf; + } + } + + server { + server_name waltti-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -472,11 +495,57 @@ http { location / { proxy_pass http://opentripplanner-waltti-v2:8080/; include basicsettings.conf; + auth_basic "waltti-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; + } + } + + server { + server_name dev-waltti-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-waltti-v2:8080/; + include basicsettings.conf; + } + } + + server { + server_name finland-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-finland-v2:8080/; + include basicsettings.conf; + auth_basic "finland-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; } } server { - server_name dev-finland-debug.digitransit.fi finland-debug.digitransit.fi; + server_name dev-finland-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -518,7 +587,30 @@ http { } server { - server_name dev-varely-debug.digitransit.fi varely-debug.digitransit.fi; + server_name varely-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-varely-v2:8080/; + include basicsettings.conf; + auth_basic "varely-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; + } + } + + server { + server_name dev-varely-debug.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { @@ -538,6 +630,52 @@ http { } } + server { + server_name kela-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-kela-v2:8080/; + include basicsettings.conf; + auth_basic "kela-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; + } + } + + server { + server_name dev-kela-debug.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + location /otp/actuators/ { + return 404; + } + + location / { + proxy_pass http://opentripplanner-kela-v2:8080/; + include basicsettings.conf; + auth_basic "dev-kela-debug.digitransit.fi"; + auth_basic_user_file .htpasswd; + } + } + server { server_name waltti-test.digitransit.fi next-dev-hameenlinna.digitransit.fi diff --git a/run.sh b/run.sh index 152ab04..502b378 100755 --- a/run.sh +++ b/run.sh @@ -34,7 +34,8 @@ sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf #set basic auth -htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null +#htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null +htpasswd -c -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null #start nginx nginx diff --git a/test.js b/test.js index 06c6d89..360816d 100644 --- a/test.js +++ b/test.js @@ -298,18 +298,29 @@ describe('digitransit', function() { testProxying('digitransit.fi','/','digitransit-site:8080', true); }); -describe('otp debug', function() { +describe('otp debug uis without authentication', function() { testProxying('dev-hsl-debug.digitransit.fi','/','opentripplanner-hsl-v2:8080', true); testProxying('dev-waltti-debug.digitransit.fi','/','opentripplanner-waltti-v2:8080', true); testProxying('dev-finland-debug.digitransit.fi','/','opentripplanner-finland-v2:8080', true); testProxying('dev-varely-debug.digitransit.fi','/','opentripplanner-varely-v2:8080', true); - testProxying('hsl-debug.digitransit.fi','/','opentripplanner-hsl-v2:8080', true); - testProxying('waltti-debug.digitransit.fi','/','opentripplanner-waltti-v2:8080', true); - testProxying('finland-debug.digitransit.fi','/','opentripplanner-finland-v2:8080', true); - testProxying('varely-debug.digitransit.fi','/','opentripplanner-varely-v2:8080', true); testProxying('waltti-alt-debug.digitransit.fi','/','opentripplanner-waltti-alt-v2:8080', true); }); +describe('otp debug UIs with authentication', function() { + testCallingWithoutCredentials('hsl-debug.digitransit.fi','/',true); + testWithCorrectCredentials('hsl-debug.digitransit.fi','/','test','test','https://hsl-debug.digitransit.fi/',true); + testCallingWithoutCredentials('waltti-debug.digitransit.fi','/',true); + testWithCorrectCredentials('waltti-debug.digitransit.fi','/','test','test','https://waltti-debug.digitransit.fi/',true); + testCallingWithoutCredentials('finland-debug.digitransit.fi','/',true); + testWithCorrectCredentials('finland-debug.digitransit.fi','/','test','test','https://finland-debug.digitransit.fi/',true); + testCallingWithoutCredentials('varely-debug.digitransit.fi','/',true); + testWithCorrectCredentials('varely-debug.digitransit.fi','/','test','test','https://varely-debug.digitransit.fi/',true); + testCallingWithoutCredentials('kela-debug.digitransit.fi','/',true); + testWithCorrectCredentials('kela-debug.digitransit.fi','/','test','test','https://kela-debug.digitransit.fi/',true); + testCallingWithoutCredentials('dev-kela-debug.digitransit.fi','/',true); + testWithCorrectCredentials('dev-kela-debug.digitransit.fi','/','test','test','https://dev-kela-debug.digitransit.fi/',true); +}); + describe('ext-proxy', function() { this.timeout(5000); testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); diff --git a/test.sh b/test.sh index de6f56f..cefa3ee 100755 --- a/test.sh +++ b/test.sh @@ -26,6 +26,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ + -e DEBUG_UI_CREDENTIALS_USER="test" -e DEBUG_UI_CREDENTIALS_PASS="test" \ -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) From ef561333947e1c2ae9f7c5b4c25f07a93e497c32 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 19 Aug 2025 08:56:35 +0300 Subject: [PATCH 289/328] Change .htpasswd file creation. --- run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 502b378..abe2e29 100755 --- a/run.sh +++ b/run.sh @@ -34,8 +34,8 @@ sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf #set basic auth -#htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null -htpasswd -c -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null +htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null +htpasswd -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null #start nginx nginx From 917ef23fef2c0c508f27dd4223188a5d21069afa Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 19 Aug 2025 12:21:43 +0300 Subject: [PATCH 290/328] Remove unused waltti-test auth configurations. --- nginx.conf | 2 -- run.sh | 3 +-- test.js | 2 -- test.sh | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index ec4523b..2a01afd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -729,8 +729,6 @@ http { location / { proxy_pass http://digitransit-ui-waltti-test:8080; include basicsettings.conf; - # auth_basic "waltti-test.digitransit.fi"; - # auth_basic_user_file .htpasswd; } } diff --git a/run.sh b/run.sh index abe2e29..1978b2d 100755 --- a/run.sh +++ b/run.sh @@ -34,8 +34,7 @@ sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf #set basic auth -htpasswd -c -B -b .htpasswd $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null -htpasswd -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null +htpasswd -c -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null #start nginx nginx diff --git a/test.js b/test.js index 360816d..accf3ef 100644 --- a/test.js +++ b/test.js @@ -329,8 +329,6 @@ describe('ext-proxy', function() { }); describe('waltti-test ui', function() { - // testCallingWithoutCredentials('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); - // testWithCorrectCredentials('waltti-test.digitransit.fi','/kissa', 'test', 'test', 'https://waltti-test.digitransit.fi/kissa', true); testRedirect('waltti-test.digitransit.fi','/kissa','https://waltti-test.digitransit.fi/kissa'); testProxying('waltti-test.digitransit.fi','/','digitransit-ui-waltti-test:8080', true); }); diff --git a/test.sh b/test.sh index cefa3ee..bfd8ae1 100755 --- a/test.sh +++ b/test.sh @@ -25,7 +25,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ - -e WALTTI_TEST_CREDENTIALS_USER="test" -e WALTTI_TEST_CREDENTIALS_PASS="test" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ + -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ -e DEBUG_UI_CREDENTIALS_USER="test" -e DEBUG_UI_CREDENTIALS_PASS="test" \ -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) From 0ce9da4db3b075a75fcf6766a9ab23702765d03f Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Fri, 22 Aug 2025 16:55:47 +0300 Subject: [PATCH 291/328] Change location path. --- nginx.conf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2a01afd..0d79e50 100644 --- a/nginx.conf +++ b/nginx.conf @@ -444,7 +444,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -467,7 +467,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -488,7 +488,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -511,7 +511,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -532,7 +532,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -555,7 +555,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -576,7 +576,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -597,7 +597,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -620,7 +620,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -641,7 +641,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } @@ -664,7 +664,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp/actuators/ { + location /otp { return 404; } From 4dc1d578d399e39e1117e37533b8ee4f2dd346a7 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Fri, 22 Aug 2025 17:07:27 +0300 Subject: [PATCH 292/328] Add tests. --- test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test.js b/test.js index accf3ef..9732fa5 100644 --- a/test.js +++ b/test.js @@ -108,6 +108,17 @@ function testWithCorrectCredentials(host, path, username, password, expectedUrl, }); } +function testResponseCode(host, path, code, secure=true) { + let fn = secure ? httpsGet : get; + + it('request to ' + host + path + ' should return ' + code, function(done) { + fn(host, path).end((err, res) => { + expect(res).to.have.status(code); + done(); + }); + }); +} + function testResponseHeader(host, path, header, headerValue) { it('http request to ' + host + path + ' should have response header: ' + header + ' should have value: ' + headerValue, function(done) { get(host,path).end((err,res)=>{ @@ -321,6 +332,20 @@ describe('otp debug UIs with authentication', function() { testWithCorrectCredentials('dev-kela-debug.digitransit.fi','/','test','test','https://dev-kela-debug.digitransit.fi/',true); }); +describe('otp debug UIs with path beginning with "/otp" should return 404', function() { + testResponseCode('hsl-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('waltti-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('finland-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('varely-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('kela-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('dev-kela-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('dev-hsl-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('dev-waltti-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('dev-finland-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('dev-varely-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('waltti-alt-debug.digitransit.fi','/otp/actuators', 404, true); +}); + describe('ext-proxy', function() { this.timeout(5000); testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false); From ce4df773cf649718c06dcdab30dda700c271b855 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Mon, 25 Aug 2025 12:33:17 +0300 Subject: [PATCH 293/328] Change path. --- nginx.conf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nginx.conf b/nginx.conf index 0d79e50..720a62e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -444,7 +444,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -467,7 +467,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -488,7 +488,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -511,7 +511,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -532,7 +532,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -555,7 +555,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -576,7 +576,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -597,7 +597,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -620,7 +620,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -641,7 +641,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } @@ -664,7 +664,7 @@ http { # Add HTTP Strict Transport Security for good measure. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; - location /otp { + location /otp/actuators { return 404; } From dee25aaf5203e83a33cd7755942fcfaf8d8132ba Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Mon, 25 Aug 2025 12:50:01 +0300 Subject: [PATCH 294/328] Add tests. --- test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test.js b/test.js index 9732fa5..e8b2179 100644 --- a/test.js +++ b/test.js @@ -344,6 +344,17 @@ describe('otp debug UIs with path beginning with "/otp" should return 404', func testResponseCode('dev-finland-debug.digitransit.fi','/otp/actuators', 404, true); testResponseCode('dev-varely-debug.digitransit.fi','/otp/actuators', 404, true); testResponseCode('waltti-alt-debug.digitransit.fi','/otp/actuators', 404, true); + testResponseCode('hsl-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('waltti-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('finland-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('varely-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('kela-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('dev-kela-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('dev-hsl-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('dev-waltti-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('dev-finland-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('dev-varely-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); + testResponseCode('waltti-alt-debug.digitransit.fi','/otp/actuators/prometheus', 404, true); }); describe('ext-proxy', function() { From a43b472125b3f8c047e1d837866d98c87eed029b Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Thu, 11 Sep 2025 14:11:58 +0300 Subject: [PATCH 295/328] Add different credentials for waltti prod debug UI. --- nginx.conf | 2 +- run.sh | 1 + test.js | 2 +- test.sh | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 720a62e..2e42798 100644 --- a/nginx.conf +++ b/nginx.conf @@ -496,7 +496,7 @@ http { proxy_pass http://opentripplanner-waltti-v2:8080/; include basicsettings.conf; auth_basic "waltti-debug.digitransit.fi"; - auth_basic_user_file .htpasswd; + auth_basic_user_file .htpasswd-waltti; } } diff --git a/run.sh b/run.sh index 1978b2d..a88a8f3 100755 --- a/run.sh +++ b/run.sh @@ -35,6 +35,7 @@ sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf #set basic auth htpasswd -c -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null +htpasswd -c -B -b .htpasswd-waltti $WALTTI_TEST_CREDENTIALS_USER $WALTTI_TEST_CREDENTIALS_PASS &>/dev/null #start nginx nginx diff --git a/test.js b/test.js index e8b2179..4e12ed4 100644 --- a/test.js +++ b/test.js @@ -321,7 +321,7 @@ describe('otp debug UIs with authentication', function() { testCallingWithoutCredentials('hsl-debug.digitransit.fi','/',true); testWithCorrectCredentials('hsl-debug.digitransit.fi','/','test','test','https://hsl-debug.digitransit.fi/',true); testCallingWithoutCredentials('waltti-debug.digitransit.fi','/',true); - testWithCorrectCredentials('waltti-debug.digitransit.fi','/','test','test','https://waltti-debug.digitransit.fi/',true); + testWithCorrectCredentials('waltti-debug.digitransit.fi','/','walttitest','walttitest','https://waltti-debug.digitransit.fi/',true); testCallingWithoutCredentials('finland-debug.digitransit.fi','/',true); testWithCorrectCredentials('finland-debug.digitransit.fi','/','test','test','https://finland-debug.digitransit.fi/',true); testCallingWithoutCredentials('varely-debug.digitransit.fi','/',true); diff --git a/test.sh b/test.sh index bfd8ae1..c9e0a50 100755 --- a/test.sh +++ b/test.sh @@ -25,7 +25,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_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\"" \ - -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ + -e WALTTI_TEST_CREDENTIALS_USER="walttitest" -e WALTTI_TEST_CREDENTIALS_PASS="walttitest" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ -e DEBUG_UI_CREDENTIALS_USER="test" -e DEBUG_UI_CREDENTIALS_PASS="test" \ -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ hsldevcom/digitransit-proxy:integrationtest) From ffc97fc193483336c5e822b3801d5e0714da82a6 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 24 Oct 2025 09:48:41 +0300 Subject: [PATCH 296/328] Double geocoding cache size for key data 10M is really small cache, geocoding searches include complex polygons etc. --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 2e42798..46bdb7c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -48,7 +48,7 @@ http { proxy_temp_path /opt/nginx/temp-cache; proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; - proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; + proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:20m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; From 3570248953b3637dfec123692999a45238d6e1d4 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 29 Oct 2025 15:30:30 +0200 Subject: [PATCH 297/328] Double geocoding cache to 40m --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 46bdb7c..ea818e6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -48,7 +48,7 @@ http { proxy_temp_path /opt/nginx/temp-cache; proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; - proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:20m max_size=4g inactive=7d use_temp_path=off; + proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:40m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; From 899d257f121320968410e3f6a31a7804b8d7cad8 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 30 Oct 2025 08:25:30 +0200 Subject: [PATCH 298/328] Add waltti salespoint apis --- common.conf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/common.conf b/common.conf index a7f8a28..6ec1ab3 100644 --- a/common.conf +++ b/common.conf @@ -451,4 +451,28 @@ location /ui/v3/hsl-test/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Host $host; +} + +location = /waltti-assets/v1/tampere-salespoints { + proxy_pass https://raw.githubusercontent.com/tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/refs/heads/main/salespoints/salespoints_tampere.geojson; + proxy_redirect off; + proxy_read_timeout 15s; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location = /waltti-assets/v1/kotka-salespoints { + proxy_pass https://raw.githubusercontent.com/tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/refs/heads/main/salespoints/salespoints_kotka.json; + proxy_redirect off; + proxy_read_timeout 15s; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location = /waltti-assets/v1/oulu-salespoints { + proxy_pass https://ouka.azure-api.net/joukkoliikenne/lipunmyyntipisteet; + proxy_redirect off; + proxy_read_timeout 15s; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } \ No newline at end of file From a1c3b2fc5251231333d9dfa13629491b9d3d1c17 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Thu, 30 Oct 2025 08:57:16 +0200 Subject: [PATCH 299/328] Add salespoints tests --- test.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test.js b/test.js index 4e12ed4..241ec25 100644 --- a/test.js +++ b/test.js @@ -317,6 +317,53 @@ describe('otp debug uis without authentication', function() { testProxying('waltti-alt-debug.digitransit.fi','/','opentripplanner-waltti-alt-v2:8080', true); }); +describe('tampere salespoints endpoint', function() { + it('should return GeoJSON with CORS headers', function(done) { + get('api.digitransit.fi', '/waltti-assets/v1/tampere-salespoints') + .end((err, res) => { + expect(err).to.be.null; + expect(res).to.have.status(200); + expect(res).to.have.header('access-control-allow-origin', '*'); + + const json = parse(res.text); + expect(json).to.be.an('object'); + expect(json).to.have.property('type', 'FeatureCollection'); + done(); + }); + }); +}); + +describe('oulu salespoints endpoint', function() { + it('should return GeoJSON with CORS headers', function(done) { + get('api.digitransit.fi', '/waltti-assets/v1/oulu-salespoints') + .end((err, res) => { + expect(err).to.be.null; + expect(res).to.have.status(200); + expect(res).to.have.header('access-control-allow-origin', '*'); + + const json = parse(res.text); + expect(json).to.be.an('object'); + expect(json).to.have.property('type', 'FeatureCollection'); + done(); + }); + }); +}); + +describe('kotka salespoints endpoint', function() { + it('should return GeoJSON with CORS headers', function(done) { + get('api.digitransit.fi', '/waltti-assets/v1/kotka-salespoints') + .end((err, res) => { + expect(err).to.be.null; + expect(res).to.have.status(200); + expect(res).to.have.header('access-control-allow-origin', '*'); + const json = parse(res.text); + expect(json).to.be.an('object'); + expect(json).to.have.property('type', 'FeatureCollection'); + done(); + }); + }); +}); + describe('otp debug UIs with authentication', function() { testCallingWithoutCredentials('hsl-debug.digitransit.fi','/',true); testWithCorrectCredentials('hsl-debug.digitransit.fi','/','test','test','https://hsl-debug.digitransit.fi/',true); From 10ef4d61abfc144fa430d77a98f117bc9c8653d7 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Fri, 31 Oct 2025 12:38:38 +0200 Subject: [PATCH 300/328] Combine salespoint endpoints --- common.conf | 18 ++++++------------ test.js | 6 +++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/common.conf b/common.conf index 6ec1ab3..d6beaa2 100644 --- a/common.conf +++ b/common.conf @@ -453,24 +453,18 @@ location /ui/v3/hsl-test/ { # proxy_set_header X-Forwarded-Host $host; } -location = /waltti-assets/v1/tampere-salespoints { - proxy_pass https://raw.githubusercontent.com/tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/refs/heads/main/salespoints/salespoints_tampere.geojson; +location /waltti-assets/v1/ { + rewrite /waltti-assets/v1/(.*)$ /tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/main/$1 break; + proxy_pass https://raw.githubusercontent.com; proxy_redirect off; proxy_read_timeout 15s; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location = /waltti-assets/v1/kotka-salespoints { - proxy_pass https://raw.githubusercontent.com/tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/refs/heads/main/salespoints/salespoints_kotka.json; - proxy_redirect off; - proxy_read_timeout 15s; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} - -location = /waltti-assets/v1/oulu-salespoints { - proxy_pass https://ouka.azure-api.net/joukkoliikenne/lipunmyyntipisteet; +location /oulu-assets/v1/ { + rewrite /oulu-assets/v1/(.*)$ /joukkoliikenne/$1 break; + proxy_pass https://ouka.azure-api.net; proxy_redirect off; proxy_read_timeout 15s; proxy_set_header X-Real-IP $remote_addr; diff --git a/test.js b/test.js index 241ec25..629c833 100644 --- a/test.js +++ b/test.js @@ -319,7 +319,7 @@ describe('otp debug uis without authentication', function() { describe('tampere salespoints endpoint', function() { it('should return GeoJSON with CORS headers', function(done) { - get('api.digitransit.fi', '/waltti-assets/v1/tampere-salespoints') + get('api.digitransit.fi', '/waltti-assets/v1/salespoints/salespoints_tampere.geojson') .end((err, res) => { expect(err).to.be.null; expect(res).to.have.status(200); @@ -335,7 +335,7 @@ describe('tampere salespoints endpoint', function() { describe('oulu salespoints endpoint', function() { it('should return GeoJSON with CORS headers', function(done) { - get('api.digitransit.fi', '/waltti-assets/v1/oulu-salespoints') + get('api.digitransit.fi', '/oulu-assets/v1/lipunmyyntipisteet') .end((err, res) => { expect(err).to.be.null; expect(res).to.have.status(200); @@ -351,7 +351,7 @@ describe('oulu salespoints endpoint', function() { describe('kotka salespoints endpoint', function() { it('should return GeoJSON with CORS headers', function(done) { - get('api.digitransit.fi', '/waltti-assets/v1/kotka-salespoints') + get('api.digitransit.fi', '/waltti-assets/v1/salespoints/salespoints_kotka.json') .end((err, res) => { expect(err).to.be.null; expect(res).to.have.status(200); From 5f7c2b7fbc1e948217b5f07d83ac3b6b920aa943 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 3 Nov 2025 13:37:58 +0200 Subject: [PATCH 301/328] Increase geocoding key cache more to 100 Mb --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index ea818e6..0301b7d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -48,7 +48,7 @@ http { proxy_temp_path /opt/nginx/temp-cache; proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; - proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:40m max_size=4g inactive=7d use_temp_path=off; + proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:100m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; From 785ef7579f396b2d84ac4eae3b797f4dd2bea333 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 7 Nov 2025 08:59:39 +0200 Subject: [PATCH 302/328] New kuopio url --- nginx.conf | 2 +- test.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 0301b7d..2d7049d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi diff --git a/test.js b/test.js index 629c833..6d0fa0b 100644 --- a/test.js +++ b/test.js @@ -249,7 +249,7 @@ describe('fintraffic ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'lahti', 'lappeenranta', 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; @@ -289,6 +289,9 @@ describe('waltti ui', function() { testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('kuopio.digitransit.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); + testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From a3a7a340105ba9e79f07862908ad2a0963110d6e Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 7 Nov 2025 09:08:30 +0200 Subject: [PATCH 303/328] redirect from kuopio digitransit.fi -> reittiopas.kuopio --- nginx.conf | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 2d7049d..2062ed0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi reittiopas.kuopio.fi + dev-kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi @@ -404,6 +404,40 @@ http { } } + server { + server_name kuopio.digitransit.fi; + listen 8080; + + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + + location = /sw.js { + proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location = /appcache/manifest.appcache { + proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; + default_type text/cache-manifest; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + + location / { + return 301 https://reittiopas.kuopio.fi$request_uri; + } + } + server { server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; From 1109cf1ce5673b44c972109ff1fa74c7b002bbc9 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 7 Nov 2025 09:08:30 +0200 Subject: [PATCH 304/328] redirect kuopio.digitransit.fi -> reittiopas.kuopio.fi --- nginx.conf | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 0301b7d..2062ed0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi + dev-kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi @@ -404,6 +404,40 @@ http { } } + server { + server_name kuopio.digitransit.fi; + listen 8080; + + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + + location = /sw.js { + proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location = /appcache/manifest.appcache { + proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; + default_type text/cache-manifest; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + + location / { + return 301 https://reittiopas.kuopio.fi$request_uri; + } + } + server { server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; From 50861a39252aca17c43f2f5c4072763d9c30f3bf Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 7 Nov 2025 12:15:55 +0200 Subject: [PATCH 305/328] revert redirect --- nginx.conf | 2 +- test.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2062ed0..ab26fd7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi reittiopas.kuopio.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi diff --git a/test.js b/test.js index 6d0fa0b..629c833 100644 --- a/test.js +++ b/test.js @@ -249,7 +249,7 @@ describe('fintraffic ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'lahti', 'lappeenranta', + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; @@ -289,9 +289,6 @@ describe('waltti ui', function() { testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); - testRedirect('kuopio.digitransit.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); - testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); - it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 0bae24f1bedc28569d6325f8bc90130e4d00b867 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Fri, 7 Nov 2025 12:19:41 +0200 Subject: [PATCH 306/328] remove redirect, add test --- nginx.conf | 34 ---------------------------------- test.js | 2 ++ 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/nginx.conf b/nginx.conf index ab26fd7..2d7049d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -404,40 +404,6 @@ http { } } - server { - server_name kuopio.digitransit.fi; - listen 8080; - - # Prevent search engines from indexing the site - add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; - - location = /sw.js { - proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - location = /appcache/manifest.appcache { - proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; - default_type text/cache-manifest; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - - location / { - return 301 https://reittiopas.kuopio.fi$request_uri; - } - } - server { server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 629c833..2dda2d3 100644 --- a/test.js +++ b/test.js @@ -289,6 +289,8 @@ describe('waltti ui', function() { testRedirect('bosse.digitransit.fi','/kissa','https://bosse.digitransit.fi/kissa'); testProxying('bosse.digitransit.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('reittiopas.kuopio.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); + testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 5d5c8b2472f28ee430971a6700e608d6d078db9a Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 21 Nov 2025 14:06:48 +0200 Subject: [PATCH 307/328] Add more next devs --- nginx.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nginx.conf b/nginx.conf index 0301b7d..23bbecd 100644 --- a/nginx.conf +++ b/nginx.conf @@ -694,6 +694,8 @@ http { next-dev-vaasa.digitransit.fi next-dev-pori.digitransit.fi next-dev-raasepori.digitransit.fi; + next-dev-varely.digitransit-fi; + next-dev-waltti.digitransit.fi; listen 8080; if ($http_x_forwarded_proto != "https") { From d07a9df3a961f9f40c566c1bb52c259aff736f73 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Mon, 24 Nov 2025 10:00:14 +0200 Subject: [PATCH 308/328] update tests --- test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.js b/test.js index 2dda2d3..8e02067 100644 --- a/test.js +++ b/test.js @@ -249,7 +249,7 @@ describe('fintraffic ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'lahti', 'lappeenranta', 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; @@ -291,6 +291,8 @@ describe('waltti ui', function() { testRedirect('reittiopas.kuopio.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('kuopio.digitransit.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 27ccaee92a52d59f2136403b6ad0352c058a099d Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Nov 2025 10:29:32 +0200 Subject: [PATCH 309/328] Fix typo --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index d051be9..5eecd68 100644 --- a/nginx.conf +++ b/nginx.conf @@ -694,7 +694,7 @@ http { next-dev-vaasa.digitransit.fi next-dev-pori.digitransit.fi next-dev-raasepori.digitransit.fi; - next-dev-varely.digitransit-fi; + next-dev-varely.digitransit.fi; next-dev-waltti.digitransit.fi; listen 8080; From ca3ae8642f51f71f1f3b918f6db83325c99806ce Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Nov 2025 10:37:36 +0200 Subject: [PATCH 310/328] Fix more copypaste typos --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5eecd68..d0c6fd2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -693,8 +693,8 @@ http { next-dev-rovaniemi.digitransit.fi next-dev-vaasa.digitransit.fi next-dev-pori.digitransit.fi - next-dev-raasepori.digitransit.fi; - next-dev-varely.digitransit.fi; + next-dev-raasepori.digitransit.fi + next-dev-varely.digitransit.fi next-dev-waltti.digitransit.fi; listen 8080; From 307bb36ba00828b2bc2a763a61c7c27fbf92ee1c Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Mon, 24 Nov 2025 10:40:47 +0200 Subject: [PATCH 311/328] Revert "AB#209: redirect kuopio.digitransit.fi -> reittiopas.kuopio.fi" --- nginx.conf | 36 +----------------------------------- test.js | 4 +--- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2062ed0..2d7049d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi reittiopas.kuopio.fi + dev-kuopio.digitransit.fi kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi @@ -404,40 +404,6 @@ http { } } - server { - server_name kuopio.digitransit.fi; - listen 8080; - - # Prevent search engines from indexing the site - add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; - - location = /sw.js { - proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - location = /appcache/manifest.appcache { - proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; - default_type text/cache-manifest; - proxy_set_header Host serviceworker.blob.core.windows.net; - proxy_cache common; - proxy_cache_valid 200 5m; - 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; - } - - location / { - return 301 https://reittiopas.kuopio.fi$request_uri; - } - } - server { server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 8e02067..2dda2d3 100644 --- a/test.js +++ b/test.js @@ -249,7 +249,7 @@ describe('fintraffic ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'lahti', 'lappeenranta', + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; @@ -291,8 +291,6 @@ describe('waltti ui', function() { testRedirect('reittiopas.kuopio.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); - testRedirect('kuopio.digitransit.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); - it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From 8dfa7f5aa5a7c5dce68738dab9bb6f1939b3ad93 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Mon, 24 Nov 2025 11:57:45 +0200 Subject: [PATCH 312/328] Reapply "AB#209: redirect kuopio.digitransit.fi -> reittiopas.kuopio.fi" This reverts commit 307bb36ba00828b2bc2a763a61c7c27fbf92ee1c. --- nginx.conf | 36 +++++++++++++++++++++++++++++++++++- test.js | 4 +++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index d0c6fd2..b280fdc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -192,7 +192,7 @@ http { dev-joensuu.digitransit.fi joensuu.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi - dev-kuopio.digitransit.fi kuopio.digitransit.fi reittiopas.kuopio.fi + dev-kuopio.digitransit.fi reittiopas.kuopio.fi dev-lahti.digitransit.fi lahti.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi @@ -404,6 +404,40 @@ http { } } + server { + server_name kuopio.digitransit.fi; + listen 8080; + + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + + location = /sw.js { + proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + location = /appcache/manifest.appcache { + proxy_pass https://serviceworker.blob.core.windows.net/appcache/destroy-manifest.appcache; + default_type text/cache-manifest; + proxy_set_header Host serviceworker.blob.core.windows.net; + proxy_cache common; + proxy_cache_valid 200 5m; + 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; + } + + location / { + return 301 https://reittiopas.kuopio.fi$request_uri; + } + } + server { server_name digitransit.fi www.digitransit.fi dev.digitransit.fi; listen 8080; diff --git a/test.js b/test.js index 2dda2d3..8e02067 100644 --- a/test.js +++ b/test.js @@ -249,7 +249,7 @@ describe('fintraffic ui', function() { describe('waltti ui', function() { const walttiCities = [ - 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'kuopio', 'lahti', 'lappeenranta', + 'hameenlinna', 'joensuu', 'jyvaskyla', 'kotka', 'lahti', 'lappeenranta', 'mikkeli', 'turku', 'tampere','kouvola', 'rovaniemi','vaasa' ]; @@ -291,6 +291,8 @@ describe('waltti ui', function() { testRedirect('reittiopas.kuopio.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); testProxying('reittiopas.kuopio.fi','/','digitransit-ui-waltti-v3:8080', true); + testRedirect('kuopio.digitransit.fi','/kissa','https://reittiopas.kuopio.fi/kissa'); + it('https should not redirect', function(done) { httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{ expect(err).to.be.null; From b908ecaaf90fc0e5e04b2ca9dddae64e6d245900 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 5 Dec 2025 16:50:00 +0200 Subject: [PATCH 313/328] Remove kuopio and lahti rental external apis --- external.conf | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/external.conf b/external.conf index 793c325..5bb98f4 100644 --- a/external.conf +++ b/external.conf @@ -177,18 +177,6 @@ location /out/lsl.mattersoft.fi/ { proxy_set_header Authorization LAHTI_BASIC_AUTH; } -#Vilkku (Kuopio) bike stations (https://tkhskuopiostrg.blob.core.windows.net/gbfs/gbfs.json) -location /out/tkhskuopiostrg.blob.core.windows.net/ { - proxy_pass https://tkhskuopiostrg.blob.core.windows.net/; - include allowed-ips.conf; - proxy_cache ext_cache; - proxy_cache_valid any 60s; - 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; -} - #hameenlinna gtfs rt (https://hameenlinna.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) location /out/hameenlinna.mattersoft.fi/ { proxy_pass https://hameenlinna.mattersoft.fi/; @@ -381,18 +369,6 @@ location /out/vantaa-api.giravolta.io/ { proxy_set_header Authorization GIRAVOLTA_VANTAA_AUTH; } -#Mankeli (Lahti) bike stations (https://tkhslahtistorage.blob.core.windows.net/gbfs/gbfs.json) -location /out/tkhslahtistorage.blob.core.windows.net/ { - proxy_pass https://tkhslahtistorage.blob.core.windows.net/; - include allowed-ips.conf; - proxy_cache ext_cache; - proxy_cache_valid any 60s; - 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; -} - #Raasepori rt (https://bosse.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealert and vehicleposition) location /out/bosse.mattersoft.fi/ { proxy_pass https://bosse.mattersoft.fi/; From e20e61b99b017a8aa35b9fa319ea528fb8028cd7 Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 15 Jan 2026 12:45:28 +0200 Subject: [PATCH 314/328] point next-dev-matka to test --- common.conf | 8 ++++++++ nginx.conf | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/common.conf b/common.conf index d6beaa2..7f5f16f 100644 --- a/common.conf +++ b/common.conf @@ -453,6 +453,14 @@ location /ui/v3/hsl-test/ { # proxy_set_header X-Forwarded-Host $host; } +location /ui/v3/matka-test/ { + rewrite /ui/v3/matka-test/(.*) /$1 break; + proxy_pass http://digitransit-ui-matka-test:8080; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + location /waltti-assets/v1/ { rewrite /waltti-assets/v1/(.*)$ /tvv-lippu-ja-maksujarjestelma-oy/waltti-digitransit-config-data/main/$1 break; proxy_pass https://raw.githubusercontent.com; diff --git a/nginx.conf b/nginx.conf index b280fdc..fde7c73 100644 --- a/nginx.conf +++ b/nginx.conf @@ -147,7 +147,7 @@ http { } server { - server_name dev-matka.digitransit.fi next-dev-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi + server_name dev-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; @@ -187,6 +187,46 @@ http { } } + server { + server_name next-dev-matka.digitransit.fi; + listen 8080; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + # Add HTTP Strict Transport Security for good measure. + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; + + error_page 500 502 503 504 /502.html; + location = /502.html { + proxy_pass https://errorpages.blob.core.windows.net/html/digitransit-error-page.html; + internal; + } + + location = /sw.js { + proxy_pass http://digitransit-ui-matka-test:8080; + include basicsettings.conf; + proxy_cache sw; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + 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; + } + location = /haku { + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + proxy_hide_header X-Frame-Options; + proxy_pass http://digitransit-ui-matka-test:8080; + include basicsettings.conf; + } + location / { + proxy_pass http://digitransit-ui-matka-test:8080; + include basicsettings.conf; + } + } + server { server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi From 3bc81134da030d57766c38c483dd46775140abbe Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 15 Jan 2026 12:56:25 +0200 Subject: [PATCH 315/328] formatting --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index fde7c73..80beb3a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -187,7 +187,7 @@ http { } } - server { + server { server_name next-dev-matka.digitransit.fi; listen 8080; From 3a8678578d68bc23543570238a7aab137480fcf4 Mon Sep 17 00:00:00 2001 From: Heikki Vuorinen Date: Mon, 9 Mar 2026 12:41:09 +0200 Subject: [PATCH 316/328] new proxy endpoint for frends api --- external.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/external.conf b/external.conf index 5bb98f4..1acaf0c 100644 --- a/external.conf +++ b/external.conf @@ -320,6 +320,19 @@ location /out/raumaadmin.mattersoft.fi/ { proxy_set_header Authorization RAUMA_STATIC_BASIC_AUTH; } +#frendsapp test gtfs (zip + gtfs-rt) +location /out/waltti-cloudtest-agent.frendsapp.com/ { + proxy_pass https://waltti-cloudtest-agent.frendsapp.com/; + 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; + 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/; From 868be142767d073d08572615721740de7a35e48c Mon Sep 17 00:00:00 2001 From: Heikki Vuorinen Date: Mon, 9 Mar 2026 13:03:08 +0200 Subject: [PATCH 317/328] fix tests --- run.sh | 1 + test.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index a88a8f3..c47c36e 100755 --- a/run.sh +++ b/run.sh @@ -32,6 +32,7 @@ sed -i "s/NYSSE_BASIC_AUTH/${NYSSE_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s/WALTTI_TEST_STATIC_BASIC_AUTH/${WALTTI_TEST_STATIC_BASIC_AUTH}/" /etc/nginx/external.conf sed -i "s#CDN_BASE_URL#${CDN_BASE_URL}#" /etc/nginx/common.conf sed -i "s/MOBILITY_API_KEY/${MOBILITY_API_KEY}/" /etc/nginx/external.conf +sed -i "s/FRENDS_API_KEY/${FRENDS_API_KEY}/" /etc/nginx/external.conf #set basic auth htpasswd -c -B -b .htpasswd $DEBUG_UI_CREDENTIALS_USER $DEBUG_UI_CREDENTIALS_PASS &>/dev/null diff --git a/test.sh b/test.sh index c9e0a50..ac01d51 100755 --- a/test.sh +++ b/test.sh @@ -27,7 +27,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" -e RAASEPORI_RT_BASIC_AUTH="\"test\"" \ -e WALTTI_TEST_CREDENTIALS_USER="walttitest" -e WALTTI_TEST_CREDENTIALS_PASS="walttitest" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ -e DEBUG_UI_CREDENTIALS_USER="test" -e DEBUG_UI_CREDENTIALS_PASS="test" \ - -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" \ + -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" -e FRENDS_API_KEY="\"test\”" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 7a26c5d1bd7d161fe3d5d70f9a1a634a402c7a35 Mon Sep 17 00:00:00 2001 From: Heikki Vuorinen Date: Mon, 9 Mar 2026 13:23:13 +0200 Subject: [PATCH 318/328] remove escaped quotes --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index ac01d51..a15fa73 100755 --- a/test.sh +++ b/test.sh @@ -27,7 +27,7 @@ CONTAINER_ID=$(docker run -d -p 9000:8080 $ADDHOSTS -e VILKKU_BASIC_AUTH="\"test -e PORI_RT_BASIC_AUTH="\"test\"" -e MH_BASIC_AUTH="\"test\"" -e RAASEPORI_RT_BASIC_AUTH="\"test\"" \ -e WALTTI_TEST_CREDENTIALS_USER="walttitest" -e WALTTI_TEST_CREDENTIALS_PASS="walttitest" -e WALTTI_TEST_STATIC_BASIC_AUTH="\"test\"" \ -e DEBUG_UI_CREDENTIALS_USER="test" -e DEBUG_UI_CREDENTIALS_PASS="test" \ - -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" -e FRENDS_API_KEY="\"test\”" \ + -e MOBILITY_API_KEY="\"test\"" -e CDN_BASE_URL="test" -e FRENDS_API_KEY="test" \ hsldevcom/digitransit-proxy:integrationtest) curl -v http://127.0.0.1:9000 From 777f66699a38127e54d0fd6b5c23ecbf1b3b801d Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 18 Mar 2026 12:50:20 +0200 Subject: [PATCH 319/328] 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); }); From fbb1864a1c39c9d42b6d79b2b346d893a1ab6ef7 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 17 Apr 2026 10:32:17 +0300 Subject: [PATCH 320/328] Update github actions --- .github/workflows/dev-pipeline.yml | 6 +++--- .github/workflows/prod-pipeline.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index f72a2d3..9b355d0 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -14,9 +14,9 @@ jobs: node-version: [16.x] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - name: Install dependencies @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Build docker image from master and push it run: ./.github/workflows/scripts/build_and_push_dev.sh env: diff --git a/.github/workflows/prod-pipeline.yml b/.github/workflows/prod-pipeline.yml index 35e9ada..0699d42 100644 --- a/.github/workflows/prod-pipeline.yml +++ b/.github/workflows/prod-pipeline.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Check Tag id: check-tag run: | From 3056528b25a5cced357d54d32300a5034c891c33 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 30 Apr 2026 14:50:34 +0300 Subject: [PATCH 321/328] Add some new test domains for matka --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 80beb3a..f92790b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -147,7 +147,7 @@ http { } server { - server_name dev-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi + server_name dev-matka.digitransit.fi dev-matka.fintraffic.fi dev2-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; From 4ad5019e492442413b7198de2cd7860cbdc0883c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 30 Apr 2026 14:51:36 +0300 Subject: [PATCH 322/328] Fix domain --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f92790b..2f8ef8f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -147,7 +147,7 @@ http { } server { - server_name dev-matka.digitransit.fi dev-matka.fintraffic.fi dev2-matka.digitransit.fi opas.matka.fi matka.fintraffic.fi + server_name dev-matka.digitransit.fi dev-matka.fintraffic.fi dev2-matka.fintraffic.fi opas.matka.fi matka.fintraffic.fi dev-kelareitit.digitransit.fi kelareitit.digitransit.fi; listen 8080; From 1a6dc8f0aced99bee6c8ecaf5e94294f07a71cb9 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 30 Apr 2026 15:48:07 +0300 Subject: [PATCH 323/328] Remove unused external endpoint that no longer works --- external.conf | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/external.conf b/external.conf index 0de6724..a5c939b 100644 --- a/external.conf +++ b/external.conf @@ -23,18 +23,6 @@ location /out/oulu.mattersoft.fi/ { proxy_set_header Authorization OULU_RT_BASIC_AUTH; } -#new livi gtfs rt (https://tyokalu.navici.com/joukkoliikenne/manual-gtfsrt/api/gtfsrt/alerts) -location /out/tyokalu.navici.com/ { - proxy_pass https://tyokalu.navici.com/; - 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; -} - #kuopio gtfs rt (https://vilkku.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate) location /out/vilkku.mattersoft.fi/ { proxy_pass https://vilkku.mattersoft.fi/; From 421986a809c4fb61a91150ab5f0648ec6058559d Mon Sep 17 00:00:00 2001 From: Heikki Vuorinen Date: Tue, 2 Jun 2026 12:52:43 +0300 Subject: [PATCH 324/328] set proxy_ssl_server_name on --- external.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/external.conf b/external.conf index 5bb98f4..4704bd1 100644 --- a/external.conf +++ b/external.conf @@ -149,6 +149,7 @@ location /out/nysse.mattersoft.fi/ { 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; proxy_set_header Authorization NYSSE_BASIC_AUTH; + proxy_ssl_server_name on; } #lmj gtfs rt new (https://lmj.mattersoft.fi/api/gtfsrealtime/v1.0/feed/tripupdate, servicealerts and vehiclepositions) From b992c9312664d1b3534e92dd6cda30781181c2fa Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 16 Jun 2026 13:07:52 +0300 Subject: [PATCH 325/328] Update CI node version to 24. --- .github/workflows/dev-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 9b355d0..6008da5 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [24.x] steps: - name: Checkout uses: actions/checkout@v6 From 2c5f85e6461a3b1e78f9a5d1e14f90b272953c92 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Wed, 17 Jun 2026 15:22:07 +0300 Subject: [PATCH 326/328] add SBOM generation --- .github/workflows/dev-pipeline.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index 6008da5..d284247 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -37,3 +37,17 @@ jobs: DOCKER_USER: ${{ secrets.DOCKER_USER }} DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }} DOCKER_BASE_TAG: latest + generate-sbom: + if: github.ref == 'refs/heads/master' + needs: + - test + runs-on: ubuntu-latest + steps: + - name: Generate SBOM + run: yarn dlx -q @cyclonedx/yarn-plugin-cyclonedx@2.0.0 --output-file ${{ github.repository }}-${{ github.sha }}.json + + - name: Save SBOM artifact + uses: actions/upload-artifact@v7 + with: + name: sbom-artifact + path: ${{ github.repository }}-${{ github.sha }}.json From 28e03ee57ee097dcfb1c8f7abc5c7107491e3d54 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Wed, 17 Jun 2026 15:32:14 +0300 Subject: [PATCH 327/328] newer yarn --- .github/workflows/dev-pipeline.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/dev-pipeline.yml b/.github/workflows/dev-pipeline.yml index d284247..3be2af0 100644 --- a/.github/workflows/dev-pipeline.yml +++ b/.github/workflows/dev-pipeline.yml @@ -43,6 +43,12 @@ jobs: - test runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Enable Corepack + run: corepack enable + - name: Install Yarn + run: corepack prepare yarn@4.13.0 --activate - name: Generate SBOM run: yarn dlx -q @cyclonedx/yarn-plugin-cyclonedx@2.0.0 --output-file ${{ github.repository }}-${{ github.sha }}.json From 9e5df4378eba3e141bc4117b5dc1ee9e9fc535e8 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Wed, 17 Jun 2026 15:37:00 +0300 Subject: [PATCH 328/328] commit yarn.lock --- .gitignore | 4 +- package.json | 7 +- yarn.lock | 791 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 797 insertions(+), 5 deletions(-) create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index e212594..2bbef4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ - +.pnp.cjs +.pnp.loader.mjs +.yarn node_modules diff --git a/package.json b/package.json index 8ff8a8b..74dfcb8 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,10 @@ "node": ">=5.0", "npm": ">=3.0" }, - "dependencies": {}, "devDependencies": { - "mocha": "^3.2.0", - "chai-http": "^3.0.0", "chai": "^3.5.0", - "mime": ">=2.2.0" + "chai-http": "^3.0.0", + "mime": ">=2.2.0", + "mocha": "^3.2.0" } } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b9c3377 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,791 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"assertion-error@npm:^1.0.1": + version: 1.1.0 + resolution: "assertion-error@npm:1.1.0" + checksum: 10c0/25456b2aa333250f01143968e02e4884a34588a8538fbbf65c91a637f1dbfb8069249133cd2f4e530f10f624d206a664e7df30207830b659e9f5298b00a4099b + languageName: node + linkType: hard + +"async-function@npm:^1.0.0": + version: 1.0.0 + resolution: "async-function@npm:1.0.0" + checksum: 10c0/669a32c2cb7e45091330c680e92eaeb791bc1d4132d827591e499cd1f776ff5a873e77e5f92d0ce795a8d60f10761dec9ddfe7225a5de680f5d357f67b1aac73 + languageName: node + linkType: hard + +"async-generator-function@npm:^1.0.0": + version: 1.0.0 + resolution: "async-generator-function@npm:1.0.0" + checksum: 10c0/2c50ef856c543ad500d8d8777d347e3c1ba623b93e99c9263ecc5f965c1b12d2a140e2ab6e43c3d0b85366110696f28114649411cbcd10b452a92a2318394186 + languageName: node + linkType: hard + +"async@npm:^1.5.2": + version: 1.5.2 + resolution: "async@npm:1.5.2" + checksum: 10c0/9ee84592c393aad1047d1223004317ecc65a9a3f76101e0f4614a0818eac962e666510353400a3c9ea158df540579a293f486f3578e918c5e90a0f5ed52e8aea + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 10c0/9308baf0a7e4838a82bbfd11e01b1cb0f0cf2893bc1676c27c2a8c0e70cbae1c59120c3268517a8ae7fb6376b4639ef81ca22582611dbee4ed28df945134aaee + languageName: node + linkType: hard + +"brace-expansion@npm:^1.1.7": + version: 1.1.15 + resolution: "brace-expansion@npm:1.1.15" + dependencies: + balanced-match: "npm:^1.0.0" + concat-map: "npm:0.0.1" + checksum: 10c0/648e273f57cfa9ed67d8a77bdb15b408205465d33da9331808ee3c188d8b55674c9cdbf1f320b65bc562e485e1263360ae62ad355e128e0435891f6430e795d7 + languageName: node + linkType: hard + +"browser-stdout@npm:1.3.0": + version: 1.3.0 + resolution: "browser-stdout@npm:1.3.0" + checksum: 10c0/9b26dcac17578ec4472179b4fd66e321db5cdf55d4a05c6b8223c492103e3f6e2da1d3ba7f4a590732e07807145a2e6aae2ae8d690bc71e6286a8b90d8afb810 + languageName: node + linkType: hard + +"call-bind-apply-helpers@npm:^1.0.1, call-bind-apply-helpers@npm:^1.0.2": + version: 1.0.2 + resolution: "call-bind-apply-helpers@npm:1.0.2" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + checksum: 10c0/47bd9901d57b857590431243fea704ff18078b16890a6b3e021e12d279bbf211d039155e27d7566b374d49ee1f8189344bac9833dec7a20cdec370506361c938 + languageName: node + linkType: hard + +"call-bound@npm:^1.0.2": + version: 1.0.4 + resolution: "call-bound@npm:1.0.4" + dependencies: + call-bind-apply-helpers: "npm:^1.0.2" + get-intrinsic: "npm:^1.3.0" + checksum: 10c0/f4796a6a0941e71c766aea672f63b72bc61234c4f4964dc6d7606e3664c307e7d77845328a8f3359ce39ddb377fed67318f9ee203dea1d47e46165dcf2917644 + languageName: node + linkType: hard + +"chai-http@npm:^3.0.0": + version: 3.0.0 + resolution: "chai-http@npm:3.0.0" + dependencies: + cookiejar: "npm:2.0.x" + is-ip: "npm:1.0.0" + methods: "npm:^1.1.2" + qs: "npm:^6.2.0" + superagent: "npm:^2.0.0" + checksum: 10c0/00628f8d391a45115321c7fd410fa179d231ce453dfd4e6a9795108d97732c800c7eee537d6f5ac118211a466aef5b085a55ddd9637ab8203bc4fa6fcf5241b1 + languageName: node + linkType: hard + +"chai@npm:^3.5.0": + version: 3.5.0 + resolution: "chai@npm:3.5.0" + dependencies: + assertion-error: "npm:^1.0.1" + deep-eql: "npm:^0.1.3" + type-detect: "npm:^1.0.0" + checksum: 10c0/146a1aa2b18009281efc9bbeafd079b9223f197f7ab23e9a395eca44c17c16ae3e3e14d16f39275260caf30bca6d8e4e979f27a5a527856ebaf92e1b15c6086a + languageName: node + linkType: hard + +"combined-stream@npm:^1.0.5": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: "npm:~1.0.0" + checksum: 10c0/0dbb829577e1b1e839fa82b40c07ffaf7de8a09b935cadd355a73652ae70a88b4320db322f6634a4ad93424292fa80973ac6480986247f1734a1137debf271d5 + languageName: node + linkType: hard + +"commander@npm:2.9.0": + version: 2.9.0 + resolution: "commander@npm:2.9.0" + dependencies: + graceful-readlink: "npm:>= 1.0.0" + checksum: 10c0/56bcda1e47f453016ed25d9f300bed9e622842a5515802658adb62792fa2ff9af6ee3f9ff16e058d7b20aacc78fb3baa3e02f982414bae1fb5f198c7cb41d5ad + languageName: node + linkType: hard + +"component-emitter@npm:^1.2.0": + version: 1.3.1 + resolution: "component-emitter@npm:1.3.1" + checksum: 10c0/e4900b1b790b5e76b8d71b328da41482118c0f3523a516a41be598dc2785a07fd721098d9bf6e22d89b19f4fa4e1025160dc00317ea111633a3e4f75c2b86032 + languageName: node + linkType: hard + +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 10c0/c996b1cfdf95b6c90fee4dae37e332c8b6eb7d106430c17d538034c0ad9a1630cb194d2ab37293b1bdd4d779494beee7786d586a50bd9376fd6f7bcc2bd4c98f + languageName: node + linkType: hard + +"cookiejar@npm:2.0.x": + version: 2.0.6 + resolution: "cookiejar@npm:2.0.6" + checksum: 10c0/e62e345b74f29c396720e0592c9f6b7de6b29250867cf5abf6a7e798e4ea2efcb811210439ab6243b5dc2cde9d992133214039b08f7e474142eef441b102a58d + languageName: node + linkType: hard + +"cookiejar@npm:^2.0.6": + version: 2.1.4 + resolution: "cookiejar@npm:2.1.4" + checksum: 10c0/2dae55611c6e1678f34d93984cbd4bda58f4fe3e5247cc4993f4a305cd19c913bbaf325086ed952e892108115073a747596453d3dc1c34947f47f731818b8ad1 + languageName: node + linkType: hard + +"core-util-is@npm:~1.0.0": + version: 1.0.3 + resolution: "core-util-is@npm:1.0.3" + checksum: 10c0/90a0e40abbddfd7618f8ccd63a74d88deea94e77d0e8dbbea059fa7ebebb8fbb4e2909667fe26f3a467073de1a542ebe6ae4c73a73745ac5833786759cd906c9 + languageName: node + linkType: hard + +"debug@npm:2.6.8": + version: 2.6.8 + resolution: "debug@npm:2.6.8" + dependencies: + ms: "npm:2.0.0" + checksum: 10c0/f13340892ee005992acf7a23cac3a224c3a26f4c98beaa528f17561696206775b95ce25110ddf3b13a24cc794b4701f521bfb9f9192bc8de18b61744fef1f67d + languageName: node + linkType: hard + +"debug@npm:^2.2.0": + version: 2.6.9 + resolution: "debug@npm:2.6.9" + dependencies: + ms: "npm:2.0.0" + checksum: 10c0/121908fb839f7801180b69a7e218a40b5a0b718813b886b7d6bdb82001b931c938e2941d1e4450f33a1b1df1da653f5f7a0440c197f29fbf8a6e9d45ff6ef589 + languageName: node + linkType: hard + +"deep-eql@npm:^0.1.3": + version: 0.1.3 + resolution: "deep-eql@npm:0.1.3" + dependencies: + type-detect: "npm:0.1.1" + checksum: 10c0/c4ec35add32b2c178861847d288a42ec2524d7177a7d497dadbb25e618ae82e17ab88dfb4da7c1d637bcb79a4ef23bf1df33d47282e719c20d05ce78c3cbe874 + languageName: node + linkType: hard + +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 10c0/d758899da03392e6712f042bec80aa293bbe9e9ff1b2634baae6a360113e708b91326594c8a486d475c69d6259afb7efacdc3537bfcda1c6c648e390ce601b19 + languageName: node + linkType: hard + +"diff@npm:3.2.0": + version: 3.2.0 + resolution: "diff@npm:3.2.0" + checksum: 10c0/d42f73558e0801dd7c7cdfd46c485f12c53b5e6b023219a06e3ce0f6824e995bbc84439a7993732cca635c06d86a1e400b46e9c90144de75af64d35a0d8fac8e + languageName: node + linkType: hard + +"dunder-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "dunder-proto@npm:1.0.1" + dependencies: + call-bind-apply-helpers: "npm:^1.0.1" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.2.0" + checksum: 10c0/199f2a0c1c16593ca0a145dbf76a962f8033ce3129f01284d48c45ed4e14fea9bbacd7b3610b6cdc33486cef20385ac054948fefc6272fcce645c09468f93031 + languageName: node + linkType: hard + +"es-define-property@npm:^1.0.1": + version: 1.0.1 + resolution: "es-define-property@npm:1.0.1" + checksum: 10c0/3f54eb49c16c18707949ff25a1456728c883e81259f045003499efba399c08bad00deebf65cccde8c0e07908c1a225c9d472b7107e558f2a48e28d530e34527c + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: 10c0/0a61325670072f98d8ae3b914edab3559b6caa980f08054a3b872052640d91da01d38df55df797fcc916389d77fc92b8d5906cf028f4db46d7e3003abecbca85 + languageName: node + linkType: hard + +"es-object-atoms@npm:^1.0.0, es-object-atoms@npm:^1.1.1": + version: 1.1.2 + resolution: "es-object-atoms@npm:1.1.2" + dependencies: + es-errors: "npm:^1.3.0" + checksum: 10c0/1772861f094f739d6f41b579cfb9a18579daffeb434552a370a5fbef50a32d22227e27b63fdbb757b7ddd429d1b42fe52ccae7966d9302a2ec221b6f1b41bbc4 + languageName: node + linkType: hard + +"escape-string-regexp@npm:1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 10c0/a968ad453dd0c2724e14a4f20e177aaf32bb384ab41b674a8454afe9a41c5e6fe8903323e0a1052f56289d04bd600f81278edf140b0fcc02f5cac98d0f5b5371 + languageName: node + linkType: hard + +"extend@npm:^3.0.0": + version: 3.0.2 + resolution: "extend@npm:3.0.2" + checksum: 10c0/73bf6e27406e80aa3e85b0d1c4fd987261e628064e170ca781125c0b635a3dabad5e05adbf07595ea0cf1e6c5396cacb214af933da7cbaf24fe75ff14818e8f9 + languageName: node + linkType: hard + +"form-data@npm:1.0.0-rc4": + version: 1.0.0-rc4 + resolution: "form-data@npm:1.0.0-rc4" + dependencies: + async: "npm:^1.5.2" + combined-stream: "npm:^1.0.5" + mime-types: "npm:^2.1.10" + checksum: 10c0/d9a4f392aae0021be8c7e1df117387995c043f233b33aa24cdc4b56e145ba6df3d828b3fdb917cbd372d0d633a92420a8dadd8b5cc5aecf175016ef24a3822ec + languageName: node + linkType: hard + +"formidable@npm:^1.0.17": + version: 1.2.6 + resolution: "formidable@npm:1.2.6" + checksum: 10c0/9ebc45f434785051d4ecab28be3356c7a172a112119f5dd7aafc393ab7f6a6f3baa2446e5215ce21bf094c4c24dfb4bf483117d07961862e04ad11a25b9b577b + languageName: node + linkType: hard + +"fs.realpath@npm:^1.0.0": + version: 1.0.0 + resolution: "fs.realpath@npm:1.0.0" + checksum: 10c0/444cf1291d997165dfd4c0d58b69f0e4782bfd9149fd72faa4fe299e68e0e93d6db941660b37dd29153bf7186672ececa3b50b7e7249477b03fdf850f287c948 + languageName: node + linkType: hard + +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 10c0/d8680ee1e5fcd4c197e4ac33b2b4dce03c71f4d91717292785703db200f5c21f977c568d28061226f9b5900cbcd2c84463646134fd5337e7925e0942bc3f46d5 + languageName: node + linkType: hard + +"generator-function@npm:^2.0.0": + version: 2.0.1 + resolution: "generator-function@npm:2.0.1" + checksum: 10c0/8a9f59df0f01cfefafdb3b451b80555e5cf6d76487095db91ac461a0e682e4ff7a9dbce15f4ecec191e53586d59eece01949e05a4b4492879600bbbe8e28d6b8 + languageName: node + linkType: hard + +"get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.3.0": + version: 1.3.1 + resolution: "get-intrinsic@npm:1.3.1" + dependencies: + async-function: "npm:^1.0.0" + async-generator-function: "npm:^1.0.0" + call-bind-apply-helpers: "npm:^1.0.2" + es-define-property: "npm:^1.0.1" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.1.1" + function-bind: "npm:^1.1.2" + generator-function: "npm:^2.0.0" + get-proto: "npm:^1.0.1" + gopd: "npm:^1.2.0" + has-symbols: "npm:^1.1.0" + hasown: "npm:^2.0.2" + math-intrinsics: "npm:^1.1.0" + checksum: 10c0/9f4ab0cf7efe0fd2c8185f52e6f637e708f3a112610c88869f8f041bb9ecc2ce44bf285dfdbdc6f4f7c277a5b88d8e94a432374d97cca22f3de7fc63795deb5d + languageName: node + linkType: hard + +"get-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "get-proto@npm:1.0.1" + dependencies: + dunder-proto: "npm:^1.0.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/9224acb44603c5526955e83510b9da41baf6ae73f7398875fba50edc5e944223a89c4a72b070fcd78beb5f7bdda58ecb6294adc28f7acfc0da05f76a2399643c + languageName: node + linkType: hard + +"glob@npm:7.1.1": + version: 7.1.1 + resolution: "glob@npm:7.1.1" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^3.0.2" + once: "npm:^1.3.0" + path-is-absolute: "npm:^1.0.0" + checksum: 10c0/d41f501c68251a825724cd4aeea551a4bd8d216eb821e952f3c400066d18b744f775ad0d1649bdaaded7a5168e70d8cd308b432f0e5829d3143b28121b81f031 + languageName: node + linkType: hard + +"gopd@npm:^1.2.0": + version: 1.2.0 + resolution: "gopd@npm:1.2.0" + checksum: 10c0/50fff1e04ba2b7737c097358534eacadad1e68d24cccee3272e04e007bed008e68d2614f3987788428fd192a5ae3889d08fb2331417e4fc4a9ab366b2043cead + languageName: node + linkType: hard + +"graceful-readlink@npm:>= 1.0.0": + version: 1.0.1 + resolution: "graceful-readlink@npm:1.0.1" + checksum: 10c0/c53e703257e77f8a4495ff0d476c09aa413251acd26684f4544771b15e0ad361d1075b8f6d27b52af6942ea58155a9bbdb8125d717c70df27117460fee295a54 + languageName: node + linkType: hard + +"growl@npm:1.9.2": + version: 1.9.2 + resolution: "growl@npm:1.9.2" + checksum: 10c0/e3191e0fafb218c0d0d404198a94c32a53b21504cde9f01781907897504b7f1a63fe4038a4e197af8b0f375a64f98019213eb294be99d7fc7cf281f3ce5f6e75 + languageName: node + linkType: hard + +"has-flag@npm:^1.0.0": + version: 1.0.0 + resolution: "has-flag@npm:1.0.0" + checksum: 10c0/d0ad4bebbbc005edccfa1e2c0600c89375be5663d23f49a129e0f817187405748b0b515abfc5b3c209c92692e39bb0481c83c0ee4df69433d6ffd0242183100b + languageName: node + linkType: hard + +"has-symbols@npm:^1.1.0": + version: 1.1.0 + resolution: "has-symbols@npm:1.1.0" + checksum: 10c0/dde0a734b17ae51e84b10986e651c664379018d10b91b6b0e9b293eddb32f0f069688c841fb40f19e9611546130153e0a2a48fd7f512891fb000ddfa36f5a20e + languageName: node + linkType: hard + +"hasown@npm:^2.0.2": + version: 2.0.4 + resolution: "hasown@npm:2.0.4" + dependencies: + function-bind: "npm:^1.1.2" + checksum: 10c0/2d8de939e270b70618f8cebb69746620db10617dbb495bc66ddad326955ea24d3ca4af133aff3eb7c1853e0218f867bc2b050ec26fe02e3aea58f880ffc5e506 + languageName: node + linkType: hard + +"he@npm:1.1.1": + version: 1.1.1 + resolution: "he@npm:1.1.1" + bin: + he: bin/he + checksum: 10c0/3cf48cb072e58922c76832a34b0789a86acf27c4c492cb2934ce71a7709c136fafb6762cca0eb24e8fef6e936b29c3e8ee07769f4513e2aa937735324483dedb + languageName: node + linkType: hard + +"inflight@npm:^1.0.4": + version: 1.0.6 + resolution: "inflight@npm:1.0.6" + dependencies: + once: "npm:^1.3.0" + wrappy: "npm:1" + checksum: 10c0/7faca22584600a9dc5b9fca2cd5feb7135ac8c935449837b315676b4c90aa4f391ec4f42240178244b5a34e8bede1948627fda392ca3191522fc46b34e985ab2 + languageName: node + linkType: hard + +"inherits@npm:2, inherits@npm:~2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 + languageName: node + linkType: hard + +"ip-regex@npm:^1.0.0": + version: 1.0.3 + resolution: "ip-regex@npm:1.0.3" + checksum: 10c0/cdf49cc34c77f59b9891f1de65f31531e5c40f1d03c967b17c4d8268cc9775c9102559dd8a3b0e30331cb666b69906fa5565174797732ef156cc967ef469d36c + languageName: node + linkType: hard + +"is-ip@npm:1.0.0": + version: 1.0.0 + resolution: "is-ip@npm:1.0.0" + dependencies: + ip-regex: "npm:^1.0.0" + checksum: 10c0/5d28dc048f6af4b5938aa5c92fb637b0f328fa4d3557b6e7bfd3d3532de0ce791568193fce94741fd24d7553e8d631a73466603f0a7c5361c9d6548519a4a7c0 + languageName: node + linkType: hard + +"isarray@npm:~1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: 10c0/18b5be6669be53425f0b84098732670ed4e727e3af33bc7f948aac01782110eb9a18b3b329c5323bcdd3acdaae547ee077d3951317e7f133bff7105264b3003d + languageName: node + linkType: hard + +"json3@npm:3.3.2": + version: 3.3.2 + resolution: "json3@npm:3.3.2" + checksum: 10c0/370300e729f05c315cdd5892aa577a2a3ece43a9f6dcf4d42c2ce8adafbe2787c6b587d0091f0d1360812ea09f3510d417be5aabedb1ab9ed21172cab804fe33 + languageName: node + linkType: hard + +"lodash._baseassign@npm:^3.0.0": + version: 3.2.0 + resolution: "lodash._baseassign@npm:3.2.0" + dependencies: + lodash._basecopy: "npm:^3.0.0" + lodash.keys: "npm:^3.0.0" + checksum: 10c0/c4f5cdb12992732b1c56d0f2bc4c1d1b6c071a83a0dbef4f318f8a6d3bde335ccab669f06092a965c6bae31ab2f8c983de84905491dc07e2c9d8f9f7efe07a77 + languageName: node + linkType: hard + +"lodash._basecopy@npm:^3.0.0": + version: 3.0.1 + resolution: "lodash._basecopy@npm:3.0.1" + checksum: 10c0/617bd0426b83991aef206da0c81a0e839276615b31c7b0972b09ac8dbd4e15f0af343f315993bbe29869d09ad3a2bcb4435a7fbc20ca184c8ecf6683cf8723f7 + languageName: node + linkType: hard + +"lodash._basecreate@npm:^3.0.0": + version: 3.0.3 + resolution: "lodash._basecreate@npm:3.0.3" + checksum: 10c0/304962811f6ee05000919ae86df7c7fd7e6fc3577ed1782e7c2f2cde8a53d1b36d9bc16f0b003830c8b1abd581ea79f44bfa1fc1caf096f2c7e11e8a8a0c70f1 + languageName: node + linkType: hard + +"lodash._getnative@npm:^3.0.0": + version: 3.9.1 + resolution: "lodash._getnative@npm:3.9.1" + checksum: 10c0/858cff25fc52353a1e39f44ff87fc1e1e8a85da513818f0caebe50c2795cf5cbce9d71a3e91ec0972bee3b174a74d697a38c6bb16d0b416dcc32322ae152a104 + languageName: node + linkType: hard + +"lodash._isiterateecall@npm:^3.0.0": + version: 3.0.9 + resolution: "lodash._isiterateecall@npm:3.0.9" + checksum: 10c0/1b4b870e7b3110f3e714f4e148f1d37e56596d4815839c42935d4aedf6c07b54a6ce840915949233f3ec015e1da00cb09d38797addaff4c006d9dedd80bf0538 + languageName: node + linkType: hard + +"lodash.create@npm:3.1.1": + version: 3.1.1 + resolution: "lodash.create@npm:3.1.1" + dependencies: + lodash._baseassign: "npm:^3.0.0" + lodash._basecreate: "npm:^3.0.0" + lodash._isiterateecall: "npm:^3.0.0" + checksum: 10c0/e23214a9aa8ff89c086777cacf05a5393276969328753041115d2eb52cbf3199ecc2ec73bc21a99af590e67b53dde8acec48efee50f8bea3df04004c710a6c80 + languageName: node + linkType: hard + +"lodash.isarguments@npm:^3.0.0": + version: 3.1.0 + resolution: "lodash.isarguments@npm:3.1.0" + checksum: 10c0/5e8f95ba10975900a3920fb039a3f89a5a79359a1b5565e4e5b4310ed6ebe64011e31d402e34f577eca983a1fc01ff86c926e3cbe602e1ddfc858fdd353e62d8 + languageName: node + linkType: hard + +"lodash.isarray@npm:^3.0.0": + version: 3.0.4 + resolution: "lodash.isarray@npm:3.0.4" + checksum: 10c0/c6daf1a1e450f20b1426595dc33cfe415d68c1267d3d081253e77430972865ee8d0ab98d777afb448350c677999802d43a7690eb16986e64b8450efc31e5667d + languageName: node + linkType: hard + +"lodash.keys@npm:^3.0.0": + version: 3.1.2 + resolution: "lodash.keys@npm:3.1.2" + dependencies: + lodash._getnative: "npm:^3.0.0" + lodash.isarguments: "npm:^3.0.0" + lodash.isarray: "npm:^3.0.0" + checksum: 10c0/ac4c70f0ac158d282ca0097a8ac8e2e433f6d727635ee53b11585ce30c0bc264e7eb0ac6155aad69715f1ab73dd8d00322769d79120afd40adaa383f9bee705a + languageName: node + linkType: hard + +"math-intrinsics@npm:^1.1.0": + version: 1.1.0 + resolution: "math-intrinsics@npm:1.1.0" + checksum: 10c0/7579ff94e899e2f76ab64491d76cf606274c874d8f2af4a442c016bd85688927fcfca157ba6bf74b08e9439dc010b248ce05b96cc7c126a354c3bae7fcb48b7f + languageName: node + linkType: hard + +"methods@npm:^1.1.1, methods@npm:^1.1.2": + version: 1.1.2 + resolution: "methods@npm:1.1.2" + checksum: 10c0/bdf7cc72ff0a33e3eede03708c08983c4d7a173f91348b4b1e4f47d4cdbf734433ad971e7d1e8c77247d9e5cd8adb81ea4c67b0a2db526b758b2233d7814b8b2 + languageName: node + linkType: hard + +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 10c0/0557a01deebf45ac5f5777fe7740b2a5c309c6d62d40ceab4e23da9f821899ce7a900b7ac8157d4548ddbb7beffe9abc621250e6d182b0397ec7f10c7b91a5aa + languageName: node + linkType: hard + +"mime-types@npm:^2.1.10": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: "npm:1.52.0" + checksum: 10c0/82fb07ec56d8ff1fc999a84f2f217aa46cb6ed1033fefaabd5785b9a974ed225c90dc72fff460259e66b95b73648596dbcc50d51ed69cdf464af2d237d3149b2 + languageName: node + linkType: hard + +"mime@npm:>=2.2.0": + version: 4.1.0 + resolution: "mime@npm:4.1.0" + bin: + mime: bin/cli.js + checksum: 10c0/3b8602e50dff1049aea8bb2d4c65afc55bf7f3eb5c17fd2bcb315b8c8ae225a7553297d424d3621757c24cdba99e930ecdc4108467009cdc7ed55614cd55031d + languageName: node + linkType: hard + +"mime@npm:^1.3.4": + version: 1.6.0 + resolution: "mime@npm:1.6.0" + bin: + mime: cli.js + checksum: 10c0/b92cd0adc44888c7135a185bfd0dddc42c32606401c72896a842ae15da71eb88858f17669af41e498b463cd7eb998f7b48939a25b08374c7924a9c8a6f8a81b0 + languageName: node + linkType: hard + +"minimatch@npm:^3.0.2": + version: 3.1.5 + resolution: "minimatch@npm:3.1.5" + dependencies: + brace-expansion: "npm:^1.1.7" + checksum: 10c0/2ecbdc0d33f07bddb0315a8b5afbcb761307a8778b48f0b312418ccbced99f104a2d17d8aca7573433c70e8ccd1c56823a441897a45e384ea76ef401a26ace70 + languageName: node + linkType: hard + +"minimist@npm:0.0.8": + version: 0.0.8 + resolution: "minimist@npm:0.0.8" + checksum: 10c0/d0a998c3042922dbcd5f23566b52811d6977649ad089fd75dd89e8a9bff27634194900818b2dfb1b873f204edb902d0c8cdea9cb8dca8488b301f69bd522d5dc + languageName: node + linkType: hard + +"mkdirp@npm:0.5.1": + version: 0.5.1 + resolution: "mkdirp@npm:0.5.1" + dependencies: + minimist: "npm:0.0.8" + bin: + mkdirp: bin/cmd.js + checksum: 10c0/e5ff572d761240a06dbfc69e1ea303d5482815a1f66033b999bd9d78583fcdc9ef63e99e61d396bbd57eca45b388af80a7f7f35f63510619c991c9d44c75341c + languageName: node + linkType: hard + +"mocha@npm:^3.2.0": + version: 3.5.3 + resolution: "mocha@npm:3.5.3" + dependencies: + browser-stdout: "npm:1.3.0" + commander: "npm:2.9.0" + debug: "npm:2.6.8" + diff: "npm:3.2.0" + escape-string-regexp: "npm:1.0.5" + glob: "npm:7.1.1" + growl: "npm:1.9.2" + he: "npm:1.1.1" + json3: "npm:3.3.2" + lodash.create: "npm:3.1.1" + mkdirp: "npm:0.5.1" + supports-color: "npm:3.1.2" + bin: + _mocha: ./bin/_mocha + mocha: ./bin/mocha + checksum: 10c0/ce69cb61fe1473626cda6218523c369c66e535e9f669f10e2b980764532ca5b5ba1c92fe082bb20ad5a96f6d1bd7ffbe6ff3e75dbcf39274b03ccce3bbc31599 + languageName: node + linkType: hard + +"ms@npm:2.0.0": + version: 2.0.0 + resolution: "ms@npm:2.0.0" + checksum: 10c0/f8fda810b39fd7255bbdc451c46286e549794fcc700dc9cd1d25658bbc4dc2563a5de6fe7c60f798a16a60c6ceb53f033cb353f493f0cf63e5199b702943159d + languageName: node + linkType: hard + +"object-inspect@npm:^1.13.3, object-inspect@npm:^1.13.4": + version: 1.13.4 + resolution: "object-inspect@npm:1.13.4" + checksum: 10c0/d7f8711e803b96ea3191c745d6f8056ce1f2496e530e6a19a0e92d89b0fa3c76d910c31f0aa270432db6bd3b2f85500a376a83aaba849a8d518c8845b3211692 + languageName: node + linkType: hard + +"once@npm:^1.3.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" + dependencies: + wrappy: "npm:1" + checksum: 10c0/5d48aca287dfefabd756621c5dfce5c91a549a93e9fdb7b8246bc4c4790aa2ec17b34a260530474635147aeb631a2dcc8b32c613df0675f96041cbb8244517d0 + languageName: node + linkType: hard + +"path-is-absolute@npm:^1.0.0": + version: 1.0.1 + resolution: "path-is-absolute@npm:1.0.1" + checksum: 10c0/127da03c82172a2a50099cddbf02510c1791fc2cc5f7713ddb613a56838db1e8168b121a920079d052e0936c23005562059756d653b7c544c53185efe53be078 + languageName: node + linkType: hard + +"process-nextick-args@npm:~2.0.0": + version: 2.0.1 + resolution: "process-nextick-args@npm:2.0.1" + checksum: 10c0/bec089239487833d46b59d80327a1605e1c5287eaad770a291add7f45fda1bb5e28b38e0e061add0a1d0ee0984788ce74fa394d345eed1c420cacf392c554367 + languageName: node + linkType: hard + +"qs@npm:^6.1.0, qs@npm:^6.2.0": + version: 6.15.2 + resolution: "qs@npm:6.15.2" + dependencies: + side-channel: "npm:^1.1.0" + checksum: 10c0/e6fd5f6f0aab06d480fe9ab15cebfc4ce4235303e2f91dc69a8f7f4df1e668a61c11d1cfbabacf4295cbbeb7b670ed23db45307480726259761f98e5695e93a7 + languageName: node + linkType: hard + +"readable-stream@npm:^2.0.5": + version: 2.3.8 + resolution: "readable-stream@npm:2.3.8" + dependencies: + core-util-is: "npm:~1.0.0" + inherits: "npm:~2.0.3" + isarray: "npm:~1.0.0" + process-nextick-args: "npm:~2.0.0" + safe-buffer: "npm:~5.1.1" + string_decoder: "npm:~1.1.1" + util-deprecate: "npm:~1.0.1" + checksum: 10c0/7efdb01f3853bc35ac62ea25493567bf588773213f5f4a79f9c365e1ad13bab845ac0dae7bc946270dc40c3929483228415e92a3fc600cc7e4548992f41ee3fa + languageName: node + linkType: hard + +"safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": + version: 5.1.2 + resolution: "safe-buffer@npm:5.1.2" + checksum: 10c0/780ba6b5d99cc9a40f7b951d47152297d0e260f0df01472a1b99d4889679a4b94a13d644f7dbc4f022572f09ae9005fa2fbb93bbbd83643316f365a3e9a45b21 + languageName: node + linkType: hard + +"side-channel-list@npm:^1.0.1": + version: 1.0.1 + resolution: "side-channel-list@npm:1.0.1" + dependencies: + es-errors: "npm:^1.3.0" + object-inspect: "npm:^1.13.4" + checksum: 10c0/d346c787fd2f9f1c2fdea14f00e8250118db0e7596d85a6cb9faa75f105d31a73a8f7a341c93d7df2a2429098c3d37a77bd3be9e88c37094b8c01807bc77c7a2 + languageName: node + linkType: hard + +"side-channel-map@npm:^1.0.1": + version: 1.0.1 + resolution: "side-channel-map@npm:1.0.1" + dependencies: + call-bound: "npm:^1.0.2" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.5" + object-inspect: "npm:^1.13.3" + checksum: 10c0/010584e6444dd8a20b85bc926d934424bd809e1a3af941cace229f7fdcb751aada0fb7164f60c2e22292b7fa3c0ff0bce237081fd4cdbc80de1dc68e95430672 + languageName: node + linkType: hard + +"side-channel-weakmap@npm:^1.0.2": + version: 1.0.2 + resolution: "side-channel-weakmap@npm:1.0.2" + dependencies: + call-bound: "npm:^1.0.2" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.5" + object-inspect: "npm:^1.13.3" + side-channel-map: "npm:^1.0.1" + checksum: 10c0/71362709ac233e08807ccd980101c3e2d7efe849edc51455030327b059f6c4d292c237f94dc0685031dd11c07dd17a68afde235d6cf2102d949567f98ab58185 + languageName: node + linkType: hard + +"side-channel@npm:^1.1.0": + version: 1.1.1 + resolution: "side-channel@npm:1.1.1" + dependencies: + es-errors: "npm:^1.3.0" + object-inspect: "npm:^1.13.4" + side-channel-list: "npm:^1.0.1" + side-channel-map: "npm:^1.0.1" + side-channel-weakmap: "npm:^1.0.2" + checksum: 10c0/dc0ab81d67f61bda9247d053ce93f41c3fd8ad2bdcb9cf9d8d2f8540d488f26d87a5e99ebfc07eea49ec025867b2452b705442d974b1478f0395e69f6bfb3270 + languageName: node + linkType: hard + +"string_decoder@npm:~1.1.1": + version: 1.1.1 + resolution: "string_decoder@npm:1.1.1" + dependencies: + safe-buffer: "npm:~5.1.0" + checksum: 10c0/b4f89f3a92fd101b5653ca3c99550e07bdf9e13b35037e9e2a1c7b47cec4e55e06ff3fc468e314a0b5e80bfbaf65c1ca5a84978764884ae9413bec1fc6ca924e + languageName: node + linkType: hard + +"superagent@npm:^2.0.0": + version: 2.3.0 + resolution: "superagent@npm:2.3.0" + dependencies: + component-emitter: "npm:^1.2.0" + cookiejar: "npm:^2.0.6" + debug: "npm:^2.2.0" + extend: "npm:^3.0.0" + form-data: "npm:1.0.0-rc4" + formidable: "npm:^1.0.17" + methods: "npm:^1.1.1" + mime: "npm:^1.3.4" + qs: "npm:^6.1.0" + readable-stream: "npm:^2.0.5" + checksum: 10c0/131fedad0fb63e9079a6412a412e816ae87eb31421f62229dbe197db9472fa48a3b57f91d6ec6a65a1df89da52ad450b9d9c6eacf0f9feb62ceb58d612106aa7 + languageName: node + linkType: hard + +"supports-color@npm:3.1.2": + version: 3.1.2 + resolution: "supports-color@npm:3.1.2" + dependencies: + has-flag: "npm:^1.0.0" + checksum: 10c0/16e616c3423cc4f4606be4d1b821ab5aeff7150477010bb09c98dcb8cc5340061b978aebbddd24b138d2b6cc86f04e29fccb4a290e1df08a2278d5f6f5a4197b + languageName: node + linkType: hard + +"test-suite@workspace:.": + version: 0.0.0-use.local + resolution: "test-suite@workspace:." + dependencies: + chai: "npm:^3.5.0" + chai-http: "npm:^3.0.0" + mime: "npm:>=2.2.0" + mocha: "npm:^3.2.0" + languageName: unknown + linkType: soft + +"type-detect@npm:0.1.1": + version: 0.1.1 + resolution: "type-detect@npm:0.1.1" + checksum: 10c0/d2a9f98e0830432096f8792e9c73ef8748a3abafc4246aaa9dee11619b19a7569eb7f51bd187ad4b8d1e1ce6698417c9a1dd04c4998c8f7882dd9363092eb44b + languageName: node + linkType: hard + +"type-detect@npm:^1.0.0": + version: 1.0.0 + resolution: "type-detect@npm:1.0.0" + checksum: 10c0/943f8e372bd25e7fd46a180f9a3c7178dedac0d013007aa3c5cd52c834823a5671ad17d662e7615ca8eca1aec919e04661a5daa28f9654dead57ee1e52297d1d + languageName: node + linkType: hard + +"util-deprecate@npm:~1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 10c0/41a5bdd214df2f6c3ecf8622745e4a366c4adced864bc3c833739791aeeeb1838119af7daed4ba36428114b5c67dcda034a79c882e97e43c03e66a4dd7389942 + languageName: node + linkType: hard + +"wrappy@npm:1": + version: 1.0.2 + resolution: "wrappy@npm:1.0.2" + checksum: 10c0/56fece1a4018c6a6c8e28fbc88c87e0fbf4ea8fd64fc6c63b18f4acc4bd13e0ad2515189786dd2c30d3eec9663d70f4ecf699330002f8ccb547e4a18231fc9f0 + languageName: node + linkType: hard