Update admin portal and minor fixes, fix nginx config for git

This commit is contained in:
Kohaku-Blueleaf
2025-10-09 04:17:48 +08:00
parent 5ca5336528
commit a21d0df6e6
12 changed files with 1824 additions and 66 deletions

View File

@@ -50,7 +50,8 @@ server {
# 4. Git HTTP Smart Protocol endpoints
# Covers: /{namespace}/{name}.git/info/refs, /{namespace}/{name}.git/git-upload-pack, etc.
# This enables native Git clone/push operations
location ~ ^/([^/]+)/([^/]+)\.git/(info/refs|git-upload-pack|git-receive-pack|HEAD) {
# Pattern matches: /anything/anything.git/endpoint (hyphens, numbers, letters all OK)
location ~ \.git/(info/refs|git-upload-pack|git-receive-pack|HEAD) {
proxy_pass http://hub-api:48888;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -67,6 +68,16 @@ server {
# Git protocol specific headers
proxy_set_header Content-Type $content_type;
# Cloudflare compatibility - prevent caching and compression
# Add these headers to tell Cloudflare not to cache Git protocol responses
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Accel-Buffering "no" always;
# Ensure proper content type is preserved
proxy_hide_header X-Content-Type-Options;
proxy_hide_header Cache-Control;
}
# 5. Git LFS endpoints