mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-09 05:07:46 +02:00
Merge remote-tracking branch 'htwk-org/development'
# Conflicts: # backend/go.mod # frontend/index.html # frontend/package-lock.json # frontend/package.json # frontend/public/themes/lara-dark-blue/theme.css # frontend/public/themes/lara-dark-blue/theme.css.map # frontend/public/themes/lara-light-blue/theme.css # frontend/public/themes/lara-light-blue/theme.css.map # frontend/src/App.vue # frontend/src/components/DarkModeSwitcher.vue # frontend/src/i18n/index.ts # frontend/src/main.ts # frontend/src/router/index.ts # frontend/src/view/CalendarLink.vue # frontend/src/view/edit/EditCalendar.vue # frontend/vite.config.ts # reverseproxy.conf # reverseproxy.local.conf # services/data-manager/main.go # services/data-manager/model/roomOccupancyModel.go # services/data-manager/service/addRoute.go # services/data-manager/service/addSchedule.go # services/data-manager/service/db/dbGroups.go # services/data-manager/service/feed/feedFunctions.go # services/data-manager/service/fetch/sport/sportFetcher.go # services/data-manager/service/fetch/v1/fetchSeminarEventService.go # services/data-manager/service/fetch/v1/fetchSeminarGroupService.go # services/data-manager/service/fetch/v2/fetcher.go # services/data-manager/service/functions/filter.go # services/data-manager/service/functions/filter_test.go # services/data-manager/service/functions/time/parse.go # services/data-manager/service/room/roomService.go # services/data-manager/service/room/roomService_test.go # services/go.sum # services/ical/service/connector/grpc/client.go
This commit is contained in:
@@ -26,6 +26,8 @@ events {
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
# Cloudflare IP Ranges (https://www.cloudflare.com/ips/)
|
||||
set_real_ip_from 173.245.48.0/20;
|
||||
@@ -91,6 +93,13 @@ http {
|
||||
proxy_temp_file_write_size 64k;
|
||||
proxy_max_temp_file_size 1024m;
|
||||
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
geo $admin {
|
||||
default 1;
|
||||
10.0.0.0/8 0; # Private Network
|
||||
@@ -105,16 +114,58 @@ http {
|
||||
1 $binary_remote_addr;
|
||||
}
|
||||
|
||||
# Different rate limits for different request methods
|
||||
map $request_method $ratelimit_key {
|
||||
POST $binary_remote_addr;
|
||||
default "";
|
||||
}
|
||||
|
||||
limit_req_zone $ratelimit_key zone=createFeed:10m rate=1r/m;
|
||||
# Limit the number of requests per IP
|
||||
limit_req_zone $limit_key zone=feed:20m rate=20r/m;
|
||||
limit_req_zone $limit_key zone=createFeed:10m rate=1r/m;
|
||||
limit_req_zone $limit_key zone=modules:10m rate=30r/m;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
http2 on;
|
||||
server_name pwa.htwk-leipzig.de;
|
||||
|
||||
location /api/feed {
|
||||
limit_req zone=createFeed nodelay;
|
||||
limit_req zone=feed burst=10 nodelay;
|
||||
proxy_pass http://htwkalender-ical:8091;
|
||||
client_max_body_size 2m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
limit_req_status 429;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
http2 on;
|
||||
server_name pwa.htwkalender.de;
|
||||
|
||||
location /api/feed {
|
||||
limit_req zone=createFeed nodelay;
|
||||
limit_req zone=feed burst=10 nodelay;
|
||||
proxy_pass http://htwkalender-ical:8091;
|
||||
client_max_body_size 2m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
limit_req_status 429;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
@@ -123,23 +174,37 @@ http {
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name pwa.htwkalender.de;
|
||||
|
||||
ssl_certificate htwkalender.de.pem;
|
||||
ssl_certificate_key htwkalender.de.key.pem;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
location /_ {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
# if user is not 0 in admin list, return 404
|
||||
if ($admin) {
|
||||
return 404 "Not Found";
|
||||
}
|
||||
# Increase upload file size
|
||||
client_max_body_size 100m;
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name pwa.htwk-leipzig.de;
|
||||
|
||||
ssl_certificate cal.htwk-leipzig.de.pem;
|
||||
ssl_certificate_key cal.htwk-leipzig.de.key.pem;
|
||||
|
||||
location /api/feed {
|
||||
limit_req zone=createFeed nodelay;
|
||||
limit_req zone=feed burst=10 nodelay;
|
||||
proxy_pass http://htwkalender-ical:8091;
|
||||
client_max_body_size 2m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
limit_req_status 429;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
@@ -149,7 +214,7 @@ http {
|
||||
|
||||
# Cache only specific URI
|
||||
location /api/modules {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
@@ -166,8 +231,26 @@ http {
|
||||
limit_req zone=modules burst=5 nodelay;
|
||||
}
|
||||
|
||||
location /api/events/types {
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
proxy_cache_bypass 0;
|
||||
proxy_no_cache 0;
|
||||
proxy_cache mcache; # mcache=RAM
|
||||
proxy_cache_valid 200 301 302 10m;
|
||||
proxy_cache_valid 403 404 5m;
|
||||
proxy_cache_lock on;
|
||||
proxy_cache_use_stale timeout updating;
|
||||
add_header X-Proxy-Cache $upstream_cache_status;
|
||||
limit_req zone=modules burst=10 nodelay;
|
||||
}
|
||||
|
||||
location /api/rooms {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
@@ -185,7 +268,7 @@ http {
|
||||
}
|
||||
|
||||
location /api/schedule {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
@@ -203,7 +286,7 @@ http {
|
||||
}
|
||||
|
||||
location /api/courses {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
client_max_body_size 20m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
@@ -220,26 +303,14 @@ http {
|
||||
limit_req zone=modules burst=5 nodelay;
|
||||
}
|
||||
|
||||
location /api/feed {
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
client_max_body_size 2m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
limit_req zone=feed burst=10 nodelay;
|
||||
}
|
||||
|
||||
location /api/createFeed {
|
||||
limit_req zone=createFeed nodelay;
|
||||
# return limit request error
|
||||
limit_req_status 429;
|
||||
proxy_pass http://htwkalender-backend:8090;
|
||||
client_max_body_size 2m;
|
||||
proxy_connect_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
location /_ {
|
||||
proxy_pass http://htwkalender-data-manager:8090;
|
||||
# if user is not 0 in admin list, return 404
|
||||
if ($admin) {
|
||||
return 404 "Not Found";
|
||||
}
|
||||
# Increase upload file size
|
||||
client_max_body_size 100m;
|
||||
}
|
||||
|
||||
location / {
|
||||
|
Reference in New Issue
Block a user