diff --git a/apps/playmat/imgcache-configmap.yaml b/apps/playmat/imgcache-configmap.yaml index e58a22b..7679aa6 100644 --- a/apps/playmat/imgcache-configmap.yaml +++ b/apps/playmat/imgcache-configmap.yaml @@ -62,6 +62,7 @@ data: } location = /img/api/cards/collection { limit_except POST { deny all; } + limit_req zone=scryfall_upstream burst=${IMGCACHE_API_BURST}; set $api_upstream api.scryfall.com; proxy_pass https://$api_upstream/cards/collection; proxy_set_header Host $api_upstream; @@ -72,10 +73,12 @@ data: proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt; proxy_cache scryfall_api; proxy_cache_methods GET HEAD POST; + proxy_cache_lock on; proxy_cache_key "$request_method$request_uri$request_body"; proxy_cache_valid 200 24h; } location /img/api/ { + limit_req zone=scryfall_upstream burst=${IMGCACHE_API_BURST}; set $api_upstream api.scryfall.com; proxy_pass https://$api_upstream/; proxy_set_header Host $api_upstream; @@ -87,6 +90,7 @@ data: proxy_redirect https://cards.scryfall.io/ /img/cards/; proxy_redirect https://backs.scryfall.io/ /img/backs/; proxy_cache scryfall_api; + proxy_cache_lock on; proxy_cache_key $request_uri; proxy_cache_valid 200 301 302 24h; } diff --git a/apps/playmat/ingress.yaml b/apps/playmat/ingress.yaml index 0aeb807..07ce965 100644 --- a/apps/playmat/ingress.yaml +++ b/apps/playmat/ingress.yaml @@ -9,6 +9,16 @@ metadata: spec: ingressClassName: traefik rules: + - host: mtg.aleshym.co + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: web + port: + name: http - host: playmat.aleshym.co http: paths: @@ -21,5 +31,6 @@ spec: name: http tls: - hosts: + - mtg.aleshym.co - playmat.aleshym.co secretName: playmat-tls diff --git a/apps/playmat/web-deployment.yaml b/apps/playmat/web-deployment.yaml index 773af96..4813ddf 100644 --- a/apps/playmat/web-deployment.yaml +++ b/apps/playmat/web-deployment.yaml @@ -26,7 +26,7 @@ spec: containerPort: 80 env: - name: DOMAIN - value: playmat.aleshym.co + value: mtg.aleshym.co - name: TLS_MODE value: external - name: UPSTREAM_PROXIES @@ -34,9 +34,9 @@ spec: - name: XMAGE_GATEWAY value: off - name: XMAGE_ALLOWED_ORIGINS - value: https://playmat.aleshym.co + value: https://mtg.aleshym.co,https://playmat.aleshym.co - name: XMAGE_PUBLIC_URL - value: https://playmat.aleshym.co + value: https://mtg.aleshym.co - name: CADDY_IP value: 127.0.0.1 readinessProbe: diff --git a/apps/playmat/xmage-deployment.yaml b/apps/playmat/xmage-deployment.yaml index ad61be7..457aa5f 100644 --- a/apps/playmat/xmage-deployment.yaml +++ b/apps/playmat/xmage-deployment.yaml @@ -41,9 +41,9 @@ spec: containerPort: 17173 env: - name: XMAGE_ALLOWED_ORIGINS - value: https://playmat.aleshym.co + value: https://mtg.aleshym.co,https://playmat.aleshym.co - name: XMAGE_PUBLIC_URL - value: https://playmat.aleshym.co + value: https://mtg.aleshym.co - name: XMAGE_SERVER_NAME value: playmat - name: XMAGE_TRUSTED_PROXIES