Skip to content

Commit

Permalink
Merge pull request #224 from HSLdevcom/remove-old-services
Browse files Browse the repository at this point in the history
Remove removed API endpoints from code
  • Loading branch information
vesameskanen authored Apr 11, 2023
2 parents aed81f2 + 0a3bb33 commit 55dfe1a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 125 deletions.
118 changes: 0 additions & 118 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"" \
Expand Down

0 comments on commit 55dfe1a

Please sign in to comment.