Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
c0407d6
k8s rev proxy
cmyui Nov 5, 2023
95e6d5f
osu.akatsuki.gg score-service meme
cmyui Nov 5, 2023
ebbbb52
support performance.akatsuki.gg
cmyui Nov 6, 2023
a256055
minor fix
cmyui Nov 10, 2023
04ff9e5
tempfix bancho upstream
cmyui Nov 10, 2023
fb5dfbc
rework frontend point to k8s
cmyui Nov 11, 2023
0fd417e
fix rework(s).akatsuki.gg
cmyui Nov 11, 2023
75505e5
payments service on k8s
cmyui Nov 18, 2023
a97b81f
fix
cmyui Nov 18, 2023
0ab1f61
fix
cmyui Nov 18, 2023
17da8d9
add profile backgrounds routing to avatars-service
tsunyoku Dec 19, 2023
4db4ef5
ensure that avatar-service endpoints cannot have their responses cached
tsunyoku Dec 23, 2023
9b51a1b
temp log 2xx and 3xx
cmyui Apr 14, 2024
7aa59a3
reroute `/api/v1/pp` to score-service
tsunyoku May 26, 2024
22c0ac5
Update to use of COMMON_HELM_CHARTS_PAT_2024 env var
cmyui May 26, 2024
2c6860e
add routing for beatmaps-service
tsunyoku May 26, 2024
4610139
add air conditioning to k8s rev proxy (#8)
tsunyoku May 26, 2024
49e658d
Disable 2xx and 3xx logging
cmyui May 26, 2024
b305ff6
stop double connection upgrade
tsunyoku May 26, 2024
21f5ac4
add back upgrade
tsunyoku May 26, 2024
76ed2b9
Merge branch 'main' into k8s-rev-proxy
cmyui May 26, 2024
b1d00c6
fix
cmyui May 26, 2024
bb37a9c
Remove all cmyui.xyz references/hosting
cmyui May 26, 2024
48988ef
Spacing
cmyui May 26, 2024
5ffd943
attempt to remove static from k8s rev proxy (#15)
tsunyoku May 26, 2024
04624ec
pypi in k8s
cmyui May 26, 2024
986d45a
fix
cmyui May 26, 2024
93eb7f6
fix
cmyui May 26, 2024
93fbf62
remove /static2 from k8s rev proxy (#17)
tsunyoku May 26, 2024
1ddd7fc
Remove pypi subdomain(s)
cmyui May 26, 2024
8b16855
Deploy admin panel on old.cmyui.xyz on k8s
cmyui May 26, 2024
006a177
fix poor ref
cmyui May 26, 2024
9a934e1
Move vault location on k8s rev proxy (#20)
tsunyoku May 27, 2024
ba8b8b9
Support akatsuki.gg admin panel
cmyui May 27, 2024
0753cba
Jame
cmyui May 27, 2024
aaa5e6e
k8s rev proxy for phpmyadmin
cmyui May 30, 2024
bf05d63
rewrite phpmyadmin url
cmyui May 30, 2024
19951bd
todo
cmyui May 30, 2024
9eba7f9
send bancho conns which reach k8s to the bancho service api
cmyui Jun 2, 2024
d20d806
c.akatsuki.gg
cmyui Jun 2, 2024
1b98fde
remove irc server and comment
cmyui Jun 2, 2024
edb666c
disable phpmyadmin for now
cmyui Jun 2, 2024
cc90c66
re-enable phpmyadmin
cmyui Jun 2, 2024
bf3576f
drop client max size to match CF maX
cmyui Jun 2, 2024
94756e8
add codeowners file
cmyui Jun 5, 2024
aa8862b
Remove unused upstreams
cmyui Jun 5, 2024
a156bd0
Enable 2xx and 3xx logging
cmyui Jun 5, 2024
9a14573
Two replicas for HA setup
cmyui Jun 5, 2024
1bf684c
Revert "Enable 2xx and 3xx logging"
cmyui Jun 5, 2024
a34a57c
Remove ratelimits (only have them at public-rev-proxy level)
cmyui Jun 9, 2024
8dc85c0
Remove duplicate cors headers (only have them at public rev proxy level)
cmyui Jun 9, 2024
f7d645c
Set infra codeowners
cmyui Jun 15, 2024
c3ed600
use http1.1
cmyui Jun 19, 2024
961fca3
Add legacy-beatmaps to LB
cmyui Jun 22, 2024
c4127f0
remove beatmaps-service from LB
cmyui Jun 22, 2024
719d959
5% rollout for python beatmaps API
cmyui Jun 22, 2024
0364992
Revert rollout
cmyui Jun 22, 2024
acf2f5e
5% rollout of new beatmaps svc (again)
cmyui Jun 22, 2024
a8151de
Send 4x more requests to new maps service
cmyui Jun 22, 2024
c06a383
Roll out 100% of traffic to new beatmaps service
cmyui Jun 22, 2024
ef404e5
Remove legacy beatmaps service
cmyui Jun 22, 2024
8aab2f4
Temp enable 2xx and 3xx logging
cmyui Jun 22, 2024
4fbffac
Add host to access logs
cmyui Jun 22, 2024
1c0d69d
Disable 2xx and 3xx logging
cmyui Jun 22, 2024
7cc4863
Enable 2xx/3xx logs
cmyui Jun 24, 2024
d380128
Revert "Enable 2xx/3xx logs"
cmyui Jun 24, 2024
51e8abd
rewrite proxy pass for avatars
cmyui Jun 26, 2024
2570c2d
expose users service public apis
cmyui Jul 6, 2024
f6b8baf
memes
cmyui Jul 6, 2024
99df49d
add next.akatsuki.gg
cmyui Jul 6, 2024
a776056
Delete .github/workflows/production-deploy.yml
cmyui Jul 18, 2024
66c97d7
avatars -> assets migration
cmyui Jul 19, 2024
c9240f2
avatars -> assets filename
cmyui Jul 19, 2024
a52488d
spacing
cmyui Jul 19, 2024
86e5151
temp 2xx and 3xx logs
cmyui Jul 20, 2024
ce99c2c
disable 2xx/3xx logs
cmyui Jul 20, 2024
c88b72f
Enabele 2xx logs
cmyui Jul 20, 2024
a617172
Revert "Enabele 2xx logs"
cmyui Jul 20, 2024
c66aed2
disable 404 logs
cmyui Jul 20, 2024
32071d5
Update next API routing
cmyui Aug 1, 2024
689e88c
Support public auth API on next frontend domain
cmyui Aug 1, 2024
5753a28
Support users apis
cmyui Aug 6, 2024
239e01d
Evil regex
cmyui Aug 8, 2024
9360669
Maybe working regex
cmyui Aug 8, 2024
1f5c68c
Support logout api
cmyui Aug 8, 2024
91d72a1
Add overall-stats API
cmyui Aug 11, 2024
47222b0
Expose aggregate score stats API and fix user stats url
cmyui Aug 12, 2024
04a437f
fix incorrect upstream for aggregate score stats API (#23)
tsunyoku Aug 15, 2024
bf43d7d
Update CODEOWNERS
cmyui Jan 15, 2025
e837f32
Update k8s-deploy.yml
cmyui Jan 15, 2025
3a6c87b
Update k8s-deploy.yml
cmyui Jan 15, 2025
f9660ee
Update k8s-deploy.yml
cmyui Jan 15, 2025
297db6f
redeploy
infernalfire72 Apr 28, 2025
8ca1220
plz kill me
cmyui Jun 10, 2025
485be7f
Banchus (#25)
infernalfire72 Jun 11, 2025
85c120e
perhaps fix
cmyui Jun 14, 2025
1281b64
unfix
cmyui Jun 14, 2025
0bcebc3
undo all
cmyui Jun 14, 2025
eef891e
cmyui why
cmyui Jun 14, 2025
5d148ec
copium
cmyui Jun 14, 2025
12367fe
Rewrite next.akatsuki.gg rules
cmyui Jun 22, 2025
d059cd9
fix bad comment
cmyui Jun 22, 2025
06e52fd
fixes
cmyui Jun 22, 2025
e65426c
fix
cmyui Jun 22, 2025
6a2d706
fixes
cmyui Jun 22, 2025
46ef331
fix profile history API
cmyui Jun 22, 2025
830329c
rewrite
cmyui Jun 22, 2025
dabc90a
add test server to k8s rev proxy (#27)
infernalfire72 Aug 23, 2025
878b0f9
redirect /users/<id> to /u/$id (#30)
infernalfire72 Aug 25, 2025
23247db
deploy banchus (#31)
infernalfire72 Aug 28, 2025
b03db40
remove old bancho service from upstreams (#32)
infernalfire72 Aug 28, 2025
78e61fc
remove cmyui.xyz bancho
Aug 28, 2025
0174842
Travelplanner configuration
Dec 22, 2025
cb8bd49
pin helm to 'v3.19.2' to fix issue for now
Dec 22, 2025
bcccb3b
remove /api prefix for travelplanner-api
Dec 22, 2025
b83e3f3
Improve gzip compression configuration (#36)
cmyui Jan 14, 2026
59d0309
Add immutable Cache-Control headers for static assets (#38)
cmyui Jan 14, 2026
30281ab
Fix phpMyAdmin routing issues (#39)
cmyui Jan 14, 2026
997112a
Route /api/v1/homepage/ to hanayo
cmyui Jan 15, 2026
cb58020
Migrate to self-hosted VPC runner and fix helm namespace (#41)
cmyui Jan 15, 2026
47c9e39
Remove proxy_redirect to avoid double prefix (#42)
cmyui Jan 15, 2026
6226151
Add resource limits and readiness probe (#43)
cmyui Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/k8s-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: k8s-deploy

on:
push:
branches:
- main
- k8s-rev-proxy

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
production-deploy:
runs-on: [self-hosted, vpc]

steps:
- name: Check out latest commit
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: osuAkatsuki/rev-proxy

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/rev-proxy:latest
${{ secrets.DOCKERHUB_USERNAME }}/rev-proxy:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}

- name: Get kubeconfig from github secrets
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
chmod 700 $HOME/.kube/config

- name: Install helm
uses: azure/setup-helm@v3
with:
version: "v3.19.2"
token: ${{ secrets.GITHUB_TOKEN }}
id: install

- name: Install helm-diff
run: helm plugin install https://github.com/databus23/helm-diff

- name: Checkout common-helm-charts repo
uses: actions/checkout@v3
with:
repository: osuAkatsuki/common-helm-charts
token: ${{ secrets.COMMON_HELM_CHARTS_PAT_2024 }}
path: common-helm-charts

- name: Clear pending deployments
run: |
kubectl delete secret -n default -l 'status in (pending-install, pending-upgrade, pending-rollback),name=rev-proxy-production'

- name: Show manifest diff since previous release
run: |
helm diff upgrade \
--namespace default \
--allow-unreleased \
--color=true \
--values chart/values.yaml \
rev-proxy-production \
common-helm-charts/microservice-base/

- name: Deploy service to production cluster
run: |
helm upgrade \
--namespace default \
--install \
--atomic \
--wait --timeout 10m \
--cleanup-on-fail \
--values chart/values.yaml \
rev-proxy-production \
common-helm-charts/microservice-base/
42 changes: 0 additions & 42 deletions .github/workflows/production-deploy.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* @cmyui @infernalfire72

# Infrastructure
/.github/* @cmyui
/tf/* @cmyui
/chart/* @cmyui
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nginx:latest

WORKDIR /usr/src/app

COPY . .

COPY nginx.conf /etc/nginx/nginx.conf
COPY sites-enabled/ /etc/nginx/sites-enabled/

EXPOSE 80

ENTRYPOINT [ "nginx", "-g", "daemon off;" ]
32 changes: 32 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apps:
- name: rev-proxy
environment: production
codebase: rev-proxy
replicaCount: 2
container:
image:
repository: osuakatsuki/rev-proxy
tag: latest
port: 80
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
imagePullSecrets:
- name: osuakatsuki-registry-secret
service:
name: http
type: NodePort
port: 80
nodePort: 30000
18 changes: 13 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ http {
# server_name_in_redirect off;
client_max_body_size 20M;

# nginx uses http/1.0 by default
# but istio/envoy proxy requires 1.1
proxy_http_version 1.1;

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

Expand All @@ -29,11 +33,12 @@ http {

# logging Settings
log_format main '[$time_local] $http_CF_Connecting_IP - '
'"$request_method $uri" $status $body_bytes_sent '
'"$request_method $host $uri" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';

map $status $loggable {
~^[23] 0;
404 0;
default 1;
}
access_log /var/log/nginx/access.log main if=$loggable;
Expand All @@ -47,6 +52,13 @@ http {

# compression settings
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml text/javascript
application/json application/javascript application/xml
application/rss+xml application/atom+xml
image/svg+xml font/ttf font/otf;

# deny any connections without a host header
server {
Expand All @@ -55,10 +67,6 @@ http {
return 444;
}

# define rate limiting zones
limit_req_zone $http_CF_Connecting_IP zone=api_zone:10m rate=10r/s;
limit_req_zone $http_CF_Connecting_IP zone=osu_zone:10m rate=20r/s;

# virtual host configs
include /etc/nginx/sites-enabled/*.conf;
}
33 changes: 16 additions & 17 deletions sites-enabled/admin_panel.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
server {
listen 80;
server_name old.akatsuki.pw old.akatsuki.gg;
server_name old.akatsuki.gg old.akatsuki.pw;

root /home/akatsuki/admin-panel;

location ~ \.php$ {
add_header Access-Control-Allow-Origin *;
try_files $uri =404;

fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Redirect /phpmyadmin to /phpmyadmin/
location = /phpmyadmin {
return 301 /phpmyadmin/;
}

include fastcgi.conf;
location /phpmyadmin/ {
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

}
# Strip /phpmyadmin prefix before passing to backend
rewrite ^/phpmyadmin(/.*)$ $1 break;

location /.git/ {
return 200 "yes";
proxy_pass http://phpmyadmin;
}

location / {
add_header Access-Control-Allow-Origin *;
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

index index.php;
rewrite ^/(?:u|d)/\d+$ /rewrite.php;
proxy_pass http://admin_panel;
}
}
14 changes: 14 additions & 0 deletions sites-enabled/air_conditioning.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ server {
listen 80;
server_name air_conditioning.akatsuki.pw air_conditioning.akatsuki.gg;

client_max_body_size 100M;

location / {
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_pass http://air_conditioning_service;
}

location /loader-hub {
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_cache_bypass $http_upgrade;
proxy_buffering off;

proxy_pass http://air_conditioning_service;
}
}
5 changes: 3 additions & 2 deletions sites-enabled/avatars.conf → sites-enabled/assets.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ server {
listen 80;
server_name a.akatsuki.pw a.akatsuki.gg;

location ~ ^/(?<id>\d+|d)(?:\.png)?/?$ {
location / {
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
add_header Cache-Control no-cache;

proxy_pass http://production_k8s;
proxy_pass http://assets_service;
}
}
8 changes: 3 additions & 5 deletions sites-enabled/bancho.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
server {
listen 80;
server_name c.akatsuki.pw c4.akatsuki.pw ce.akatsuki.pw c.akatsuki.gg c4.akatsuki.gg ce.akatsuki.gg;
server_name c.akatsuki.gg c4.akatsuki.gg ce.akatsuki.gg
c.akatsuki.pw c4.akatsuki.pw ce.akatsuki.pw;

location / {
limit_req zone=osu_zone burst=10 nodelay;
limit_req_status 429;

proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_pass http://bancho_server;
proxy_pass http://bancho_service;
}
}

Expand Down
12 changes: 12 additions & 0 deletions sites-enabled/beatmaps.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
server_name beatmaps.akatsuki.gg;

location / {
proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_pass http://beatmaps_service;
}
}
Loading