222953049d
Issue #50: AWG2 clients connect (handshake OK) but no traffic flows. The awg2 client output_template lost its "MTU = 1280" line when migration 064 rewrote it (migration 058 had it). With no explicit MTU the client defaults to 1420, which is too large once AmneziaWG obfuscation overhead (Jc junk packets, S1/S2 padding) is added on top of WireGuard's: small packets (the handshake) pass, larger packets (TLS, web pages) are dropped — tunnel "connected" but unusable. 1280 is the official Amnezia app default. - migrations/071: add "MTU = 1280" to the awg2 output_template (existing DBs). - migrations/064: add the MTU line to the template source (fresh installs). - buildClientConfig(): emit MTU = 1280 in the fallback path too. Server-side NAT/forwarding/ip_forward were verified correct on a live server, so this is purely a client-config regression. Generated client config now contains "MTU = 1280" and mirrors the server's obfuscation params exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Database Migrations
This directory contains SQL migration files that are automatically executed when the database container is first initialized.
Execution Order
Migration files are executed in alphabetical order by MySQL's Docker entrypoint. Files are numbered to ensure correct execution sequence:
001_init.sql- Main database schema and tables002_translations_ru.sql- Russian translations003_translations_es.sql- Spanish translations004_translations_de.sql- German translations005_translations_fr.sql- French translations006_translations_zh.sql- Chinese translations
Adding New Migrations
When creating new migration files:
- Use numerical prefix (e.g.,
007_add_feature.sql) - Ensure the number is higher than existing migrations
- Use descriptive names
- Always use
ON DUPLICATE KEY UPDATEfor INSERT statements to make migrations idempotent
Manual Execution
To manually run migrations in an existing database:
# Single migration
docker compose exec db mysql -uroot -prootpassword amnezia_panel < migrations/001_init.sql
# All migrations in order
for file in migrations/*.sql; do
echo "Executing $file..."
docker compose exec -T db mysql -uroot -prootpassword amnezia_panel < "$file"
done
Regenerating Translation Migrations
To regenerate translation migrations from the current database:
# Export translations for a specific language
docker compose exec -T db mysql -uroot -prootpassword amnezia_panel \
--default-character-set=utf8mb4 \
-e "SELECT CONCAT('(''', language_code, ''', ''', translation_key, ''', ''',
REPLACE(translation_value, '''', ''''''), '''),')
FROM translations WHERE language_code = 'ru' ORDER BY translation_key;" \
| grep -v "CONCAT" > /tmp/translations_ru.sql
# Then wrap with INSERT statement and ON DUPLICATE KEY UPDATE