Fix gamedata alias, add ads.txt, update script for radio/custom-themes/ads

This commit is contained in:
root
2026-06-07 20:24:30 +02:00
parent ff04270b41
commit 392bb96ea0
4 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -113,12 +113,12 @@ server {
try_files $uri =404; try_files $uri =404;
} }
# Gamedata / Habbo assets (symlinked) # Gamedata / Habbo assets
location /gamedata/ { location /gamedata/ {
alias /var/www/Gamedata/config/;
expires 7d; expires 7d;
add_header Cache-Control "public"; add_header Cache-Control "public";
access_log off; access_log off;
try_files $uri =404;
} }
# Storage files (avatars, badges, photos) # Storage files (avatars, badges, photos)
View File
+1
View File
@@ -0,0 +1 @@
/var/www/Gamedata/config
+18
View File
@@ -141,6 +141,15 @@ yarn install
echo "--> Building Nitro-V3 with Vite 8 / Yarn..." echo "--> Building Nitro-V3 with Vite 8 / Yarn..."
yarn build yarn build
echo "--> Ensuring custom-themes/index.json exists..."
mkdir -p "$NITRO_CLIENT/dist/custom-themes"
if [ ! -f "$NITRO_CLIENT/dist/custom-themes/index.json" ]; then
echo '{"themes":[]}' > "$NITRO_CLIENT/dist/custom-themes/index.json"
echo "--> [OK] Created custom-themes/index.json"
else
echo "--> [OK] custom-themes/index.json already exists"
fi
# ---------------------------------------- # ----------------------------------------
# 4. Sync Configs & UITexts (.example logica) # 4. Sync Configs & UITexts (.example logica)
@@ -209,6 +218,8 @@ import json, sys, os
paths = [ paths = [
os.path.join(os.environ.get('NITRO_SRC_DIR', ''), 'renderer-config.json'), os.path.join(os.environ.get('NITRO_SRC_DIR', ''), 'renderer-config.json'),
os.path.join(os.environ.get('NITRO_DIST_CONFIG_DIR', ''), 'renderer-config.json'), os.path.join(os.environ.get('NITRO_DIST_CONFIG_DIR', ''), 'renderer-config.json'),
os.path.join(os.environ.get('NITRO_SRC_DIR', ''), 'ui-config.json'),
os.path.join(os.environ.get('NITRO_DIST_CONFIG_DIR', ''), 'ui-config.json'),
] ]
for path in paths: for path in paths:
@@ -225,6 +236,13 @@ for path in paths:
env_val = os.environ.get(f'NITRO_{key.upper().replace(".", "_")}') env_val = os.environ.get(f'NITRO_{key.upper().replace(".", "_")}')
if env_val: if env_val:
data[key] = env_val data[key] = env_val
# Forceer /config/ pad voor radio en soundboard
if 'gamedata.url' in data:
data['radio.url'] = data['gamedata.url'] + '/config/radio-stations.json5?t=%timestamp%'
data['soundboard.url'] = data['gamedata.url'] + '/config/soundboard-sounds.json5?t=%timestamp%'
# Zet Google Ads uit
if 'show.google.ads' in data:
data['show.google.ads'] = False
with open(path, 'w') as f: with open(path, 'w') as f:
json.dump(data, f, indent=(4 if 'dist' not in path else None), separators=(',', ':') if 'dist' in path else (',', ': ')) json.dump(data, f, indent=(4 if 'dist' not in path else None), separators=(',', ':') if 'dist' in path else (',', ': '))
print(f'--> [OK] Hersteld: {os.path.basename(path)}') print(f'--> [OK] Hersteld: {os.path.basename(path)}')