Low priority fixes: debug comments, Fortify cleanup, badge cost setting, profile query merge, User model fixes, VPN constructor cleanup, PayPal POST, PII removal, Dutch→English translations, duplicate rank check, CHANGELOG

This commit is contained in:
root
2026-06-04 19:57:01 +02:00
parent 66cbd46f37
commit 4b6872e5e0
13 changed files with 82 additions and 61 deletions
+13 -13
View File
@@ -3,7 +3,7 @@
# Exit immediately if a command exits with a non-zero status
set -e
# --- CONFIGURATION (overschrijfbaar via omgevingsvariabelen) ---
# --- CONFIGURATION (overridable via environment variables) ---
DB_NAME="${NITRO_DB_NAME:-habbo}"
DB_HOST="${NITRO_DB_HOST:-127.0.0.1}"
DB_PORT="${NITRO_DB_PORT:-3306}"
@@ -44,7 +44,7 @@ echo "--> Checking for new SQL files..."
if [ -d "$SQL_DIR" ]; then
find "$SQL_DIR" -name "*.sql" -mmin -10 -print0 | while IFS= read -r -d '' sql_file; do
echo "--> Importing new SQL file: $(basename "$sql_file")"
mariadb $MYSQL_CRED --force "$DB_NAME" < "$sql_file" || echo "--> Opmerking: Sommige SQL-regels overgeslagen (bestonden waarschijnlijk al)."
mariadb $MYSQL_CRED --force "$DB_NAME" < "$sql_file" || echo "--> Note: Some SQL rules skipped (probably already exist)."
done
else
echo "--> SQL directory not found, skipping SQL import."
@@ -156,25 +156,25 @@ fi
# ----------------------------------------
echo "--> Starting automated cleanup..."
# 1. Verwijder emulator logs ouder dan 14 dagen
# 1. Remove emulator logs older than 14 days
echo "--> Removing emulator logs older than 14 days..."
find "$EMULATOR_DIR/" -name "*.log" -mtime +14 -exec rm -f {} \;
# 2. Hou maximaal de 5 nieuwste database backups, gooi oudere weg
# 2. Keep max 5 newest database backups, delete older ones
echo "--> Managing update backups (keeping max 5)..."
if [ -d "$BACKUP_DIR" ]; then
# Zoekt alle .sql bestanden in de backup map, sorteert op datum (nieuwste eerst),
# slaat de eerste 5 over (tail -n +6) en verwijdert de rest.
# Find all .sql files in backup dir, sort by date (newest first),
# skip the first 5 (tail -n +6) and delete the rest.
ls -t "$BACKUP_DIR"/*.sql 2>/dev/null | tail -n +6 | xargs -r rm -f || true
fi
# 3. Clean Yarn cache om SSD ruimte te besparen
# 3. Clean Yarn cache to save SSD space
echo "--> Cleaning Yarn cache..."
yarn cache clean
# ----------------------------------------
# 6. Fix Permissions (www-data) — alleen als sudo beschikbaar is
# 6. Fix Permissions (www-data) — only if sudo is available
# ----------------------------------------
if command -v sudo &> /dev/null; then
echo "--> Setting permissions to www-data:www-data..."
@@ -183,7 +183,7 @@ if command -v sudo &> /dev/null; then
sudo chown -R www-data:www-data "$EMULATOR_DIR" 2>/dev/null || echo "--> chown voor EMULATOR_DIR overgeslagen"
sudo chown -R www-data:www-data "$GAMEDATA_CONF_DIR" 2>/dev/null || echo "--> chown voor GAMEDATA_CONF_DIR overgeslagen"
else
echo "--> Sudo niet beschikbaar, overslaan van chown."
echo "--> Sudo not available, skipping chown."
fi
@@ -193,14 +193,14 @@ fi
if systemctl list-units --type=service --all | grep -q "$EMULATOR_SERVICE.service"; then
echo "--> Restarting $EMULATOR_SERVICE service..."
if command -v sudo &> /dev/null; then
sudo systemctl restart $EMULATOR_SERVICE 2>/dev/null || echo "--> Service restart via sudo mislukt (mogelijk geen sudo rechten)"
sudo systemctl restart $EMULATOR_SERVICE 2>/dev/null || echo "--> Service restart via sudo failed (possible insufficient sudo rights)"
sudo systemctl status $EMULATOR_SERVICE --no-pager -n 5 2>/dev/null || true
else
echo "--> Sudo niet beschikbaar. Herstart de service handmatig: sudo systemctl restart $EMULATOR_SERVICE"
echo "--> Sudo not available. Restart the service manually: sudo systemctl restart $EMULATOR_SERVICE"
fi
else
echo "--> Waarschuwing: Service '$EMULATOR_SERVICE' niet gevonden in systemd."
echo "--> Als je PM2 gebruikt, herstart je processen dan handmatig met: pm2 restart all"
echo "--> Warning: Service '$EMULATOR_SERVICE' not found in systemd."
echo "--> If you use PM2, restart your processes manually: pm2 restart all"
fi
echo "=== Update successfully completed! ==="