Preserve the private integration API address through the active V2 backend

This commit is contained in:
Dev 2026-11-13 01:13:04 +01:00
commit 183388a018

View file

@ -32,6 +32,9 @@ for path,limit in [('/api/account/avatar','3m'),('/api/internal-mail/messages/se
}
'''.replace('PATH',path).replace('LIMIT',limit).replace('PORT',port)
s=s.replace(' location = /api/ban-evidence {',block+' location = /api/ban-evidence {',1)
# Preserve the existing private integration API address without a legacy Node process.
if 'listen 127.0.0.1:3003;' not in s:
s+='\nserver {\n listen 127.0.0.1:3003;\n server_name cp-internal.dunerealms.invalid;\n client_max_body_size 32m;\n location / {\n proxy_pass http://127.0.0.1:'+port+';\n proxy_http_version 1.1;\n proxy_set_header Host cp.dunerealms.com;\n proxy_set_header X-Forwarded-Proto https;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_read_timeout 120s;\n }\n}\n'
cp.write_text(s);preview.write_text(text)
try:
subprocess.run(['nginx','-t'],check=True,capture_output=True);subprocess.run(['nginx','-s','reload'],check=True,capture_output=True)