Skip to content

Commit

Permalink
Update dependencies: bump @types/node to 22.10.10, @types/geojson to …
Browse files Browse the repository at this point in the history
…7946.0.16, and zod-openapi to 4.2.3
  • Loading branch information
joao-vasconcelos committed Jan 24, 2025
1 parent 04fd2d7 commit 6d713dd
Show file tree
Hide file tree
Showing 16 changed files with 347 additions and 62 deletions.
4 changes: 2 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"luxon": "3.5.0",
"pino-pretty": "13.0.0",
"protobufjs": "7.4.0",
"zod-openapi": "4.2.2"
"zod-openapi": "4.2.3"
},
"devDependencies": {
"@carrismetropolitana/api-tsconfig": "*",
"@carrismetropolitana/api-types": "*",
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/luxon": "3.4.2",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
"typescript": "5.7.3"
Expand Down
2 changes: 1 addition & 1 deletion apps/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@dotenv-run/cli": "1.3.6",
"@helperkits/logger": "20240703.1726.24",
"@helperkits/timer": "20240627.34.23",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"fastify": "5.2.1",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/sync-alerts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@carrismetropolitana/api-types": "*",
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
"typescript": "5.7.3"
Expand Down
2 changes: 1 addition & 1 deletion apps/sync-facilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@carrismetropolitana/api-types": "*",
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
"typescript": "5.7.3"
Expand Down
4 changes: 2 additions & 2 deletions apps/sync-gtfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@dotenv-run/cli": "1.3.6",
"@types/adm-zip": "0.5.7",
"@types/luxon": "3.4.2",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"@types/papaparse": "5.3.15",
"@types/pg": "8.11.10",
"@types/pg": "8.11.11",
"@types/pg-copy-streams": "1.2.5",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/sync-locations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"@carrismetropolitana/api-utils": "*",
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/geojson": "7946.0.15",
"@types/node": "22.10.7",
"@types/geojson": "7946.0.16",
"@types/node": "22.10.10",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
"typescript": "5.7.3"
Expand Down
2 changes: 1 addition & 1 deletion apps/sync-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/luxon": "3.4.2",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"@types/papaparse": "5.3.15",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/sync-stores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/luxon": "3.4.2",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"@types/papaparse": "5.3.15",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/sync-vehicles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@carrismetropolitana/api-types": "*",
"@carrismetropolitana/eslint": "20250103.1610.23",
"@dotenv-run/cli": "1.3.6",
"@types/node": "22.10.7",
"@types/node": "22.10.10",
"@types/papaparse": "5.3.15",
"resolve-tspaths": "0.8.23",
"tsx": "4.19.2",
Expand Down
168 changes: 168 additions & 0 deletions nginx/nginx-proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Massive thank you to @ricardojorgerm and @tiagogaspar8
# for the help in creating this nginx configuration file.


# # #
# USER

user nginx;


# # #
# WORKER PROCESSES

worker_processes auto;


# # #
# DEFAULTS

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


# # #
# EVENTS

events {
use epoll;
worker_connections 2048;
}


# # #
# HTTP

http {

# # #
# MIME TYPES

include /etc/nginx/mime.types;
default_type application/octet-stream;


# # #
# LOGS

log_format main '[$time_iso8601] | IP: $remote_addr | Request: $status [$upstream_cache_status] "$request" | Referer: "$http_referer" | User Agent: "$http_user_agent"';

access_log /var/log/nginx/access.log main;


# # #
# FILE DESCRIPTOR SETTINGS

aio threads;
directio 512M;
output_buffers 2 1M;
sendfile on;
tcp_nopush on;

keepalive_timeout 65;


# # #
# RATE LIMITS

limit_req_zone global zone=global:10m rate=500r/s;
limit_req zone=global burst=200 delay=2;

limit_req_zone $http_x_forwarded_for zone=ip:16m rate=50r/s;
limit_req zone=ip burst=50 delay=2;

limit_req_status 429;


# # #
# COMPRESSION

gzip on;
gzip_types application/json;





# # # # # # # # # # # # # # # # # # # # # #
# # # API SERVER


# # #
# CACHE

proxy_cache_path /var/cache/nginx/api levels=1:2 keys_zone=api_cache:512m inactive=360m;


# # #
# UPSTREAM

upstream api_upstream {
zone upstreams 64K;
server server:5050 max_fails=2 fail_timeout=2s;
keepalive 10;
}


# # #
# DEFAULT HTTP SERVER
# Redirect to HTTPS

server {

listen 80;
listen [::]:80;
server_name api.cmet.pt;
server_tokens off;
http2 on;

# Do not skip cache by default
set $skip_cache 0;
set $skip_reason "";

# Cache configuration
etag on;
proxy_cache api_cache;
proxy_cache_key "$scheme$request_method$host$request_uri";
proxy_cache_valid 200 60m;
proxy_cache_valid any 30s;
proxy_cache_lock on;
proxy_cache_lock_age 30s;
proxy_cache_lock_timeout 90s;
proxy_cache_use_stale error timeout updating;
proxy_cache_revalidate on;
proxy_cache_bypass $skip_cache;

# Proxy configuration
proxy_http_version 1.1;
proxy_connect_timeout 10s;
proxy_send_timeout 20s;
proxy_read_timeout 20s;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout http_500;


location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' "*" always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' "Origin, X-Requested-With, Content-Type, Accept" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# Add headers
add_header CMET-Cache-Skip $skip_reason;
add_header CMET-Cache-Status $upstream_cache_status;
add_header Access-Control-Allow-Origin "*" always;
add_header Strict-Transport-Security "max-age=31536000" always;
# Proxy connect
proxy_pass http://api_upstream;
}

}

}
Loading

0 comments on commit 6d713dd

Please sign in to comment.