Commit Graph
100 Commits
Author SHA1 Message Date
infosave2007 86eeb765e7 feat: Load environment configuration in metrics collector 2026-02-13 20:34:11 +03:00
infosave2007 e400dfab73 feat: Add protocol_id to VPN clients insertion logic 2026-02-13 20:13:57 +03:00
infosave2007 7ea1c39c5a feat: Update client insertion logic to use name/email instead of login 2026-02-13 19:37:41 +03:00
infosave2007 35e2e9adfa feat: Enhance protocol detection and restoration for AWG and X-Ray installations 2026-02-13 19:01:00 +03:00
infosave2007 f0a24d2e22 feat: Enhance online client tracking by including recent handshake counts for WireGuard/AWG 2026-02-05 19:34:02 +03:00
infosave2007 853f57bc40 feat: Enforce single IP per peer for AWG/WireGuard connections 2026-01-30 22:14:09 +03:00
infosave2007 e200146dc0 feat: Enforce single IP per user for Xray servers and update protocol checks 2026-01-30 21:45:05 +03:00
infosave2007 1774fe598f feat: Add real-time online client status updates for servers 2026-01-30 21:23:57 +03:00
infosave2007 7b845e952d feat: Add online clients tracking and display on dashboard and server views 2026-01-30 21:07:30 +03:00
infosave2007 db881a39e3 feat: Implement single IP enforcement for Xray VLESS protocol with online tracking 2026-01-30 20:09:39 +03:00
infosave2007 100fb0e5a7 fix traffic reboot 2026-01-30 19:27:02 +03:00
infosave2007 20ca2d0df9 fix: Do not inherit client_id from server protocols (prevents duplicate UUIDs) 2026-01-30 15:58:15 +03:00
infosave2007 46938f77c7 fix: Prevent X-ray client UUID reuse 2026-01-30 15:38:18 +03:00
infosave2007 c677509f22 fix: Cleanup debug logging in ServerMonitoring 2026-01-30 15:30:32 +03:00
infosave2007 ce615e14a1 fix: Add X-ray support to ServerMonitoring for background stats collection 2026-01-30 15:21:32 +03:00
infosave2007 7d4129747a fix: Update vpn_clients speed columns in ServerMonitoring for real-time display 2026-01-30 15:14:29 +03:00
infosave2007 47b97d9a76 feat: Enforce 1 user 1 connection for X-ray and fix active stats speed 2026-01-30 15:04:23 +03:00
infosave2007 2f38cd58a3 feat: Added readme API new endpoints 2026-01-29 08:56:28 +03:00
infosave2007 0e144f2d01 feat: Реализован API для удаления клиентов, добавлен отладочный скрипт статистики XRay и метод InstallProtocolManager::install сделан публичным. 2026-01-27 16:15:00 +03:00
infosave2007 7254bd1547 cleanup: remove duplicate amnezia-wg protocol from migration
Only amnezia-wg-advanced should be used (installed via migration 044).
The simple amnezia-wg was a duplicate causing confusion.
2026-01-27 15:33:57 +03:00
infosave2007 b2b5d8643b fix(awg): reload wg0 interface after adding client to apply AWG params
Without interface reload, AWG obfuscation params (Jc, S1, S2, H1-H4) are not
applied to the kernel, and connections fail because client uses AWG but
server uses standard WireGuard protocol.
2026-01-27 15:17:16 +03:00
infosave2007 3ba372e60a fix(awg): reserve server gateway IP (.1) in client IP assignment
Previously only .0 was reserved, causing first client to get 10.8.1.1 (server IP).
Now both .0 and .1 are reserved, clients start from 10.8.1.2.
2026-01-27 15:12:49 +03:00
infosave2007 cb3165670a fix(awg): fix AWG Advanced install script - create container before generating keys
- Container now starts FIRST with docker run, then wg genkey is called inside it
- After config creation, explicitly reload wg0 interface with 'ip link del wg0' + 'wg-quick up'
- This ensures AWG obfuscation parameters (Jc, S1, S2, H1-H4) are applied to kernel
- Removed duplicate 'amnezia-xray' protocol from migration 047
2026-01-27 14:46:38 +03:00
infosave2007 ca51fa62dd feat: XRay Reality key backup and restoration
- Modified migrations/048_enable_xray_stats.sql to accept existing keys via env vars (PRIVATE_KEY, SHORT_ID)
- Updated InstallProtocolManager.php to extract and store reality_private_key after XRay installation
- Added key restoration logic in buildExports() to reuse saved keys during reinstallation
- Fixed VpnClient.php to correctly parse JSON stats output from XRay API
- Security fix: removed exposed port 2375 from docker-compose.yml (dind container)
2026-01-26 21:41:26 +03:00
infosave2007 a2b6cdd41f Fix: Read keys from host file in sync script to prevent container deadlock 2026-01-24 21:36:13 +03:00
infosave2007 486c9a862a Fix: Add missing $ in sync script and skip invalid clients 2026-01-24 21:16:57 +03:00
infosave2007 8b0a95c7a1 Feat: Auto-sync existing clients to AmneziaWG server (Fix) 2026-01-24 20:43:55 +03:00
infosave2007 cd984870d7 Add script to sync clients from DB to AmneziaWG server 2026-01-24 20:39:20 +03:00
infosave2007 9969014d3e Fix: Case-sensitive AWG params and XRay Identifier logic 2026-01-24 20:34:07 +03:00
infosave2007 a86e0cac9a Fix: Randomize AmneziaWG obfuscation parameters (H1..H4) in install script logic 2026-01-24 20:21:46 +03:00
infosave2007 e3f0e954ac Fix: Client deletion UI, Enable XRay stats, fix dns_servers schema 2026-01-24 19:53:23 +03:00
infosave2007 071c37cb39 fix(db): Add missing migration 047 to create protocols table 2026-01-24 15:35:41 +03:00
infosave2007 0139c31557 fix(qr): Generate full X-Ray Client config JSON to match Native Amnezia format 2026-01-24 14:56:13 +03:00
infosave2007 1018f96fc4 fix(qr): Pass raw VLESS URI in last_config without JSON wrapper 2026-01-24 14:50:55 +03:00
infosave2007 4554a77033 fix(qr): Use raw URI for X-Ray QR codes to ensure compatibility 2026-01-24 14:35:12 +03:00
infosave2007 0268e26c85 fix(client): Propagate show_text_content setting from protocol to client view 2026-01-24 14:28:53 +03:00
infosave2007 e4d4b4bdc0 feat(xray): Implement universal client addition with fallback
- Added InstallProtocolManager::addClient and fallback logic for X-Ray VLESS
  to update server configuration (server.json) and restart container.
- Updated VpnClient::create to invoke InstallProtocolManager::addClient for
  scripted protocols, enabling dynamic user addition.
- Ensured UUID generation for X-Ray clients.
2026-01-24 14:08:43 +03:00
infosave2007 657fbf8df0 fix(qr): Use raw VLESS URI in last_config->config
Instead of generating a JSON config for X-Ray, pass the raw VLESS URI string
wrapped in a JSON object  inside .
This matches the behavior of WireGuard config handling in the master branch
and is likely the expected format for Amnezia Android X-Ray import.
2026-01-24 13:48:57 +03:00
infosave2007 a508cc665c fix(qr): Add isThirdPartyConfig and reorder keys
- Added 'isThirdPartyConfig' => true to X-Ray config object. This flag is present in imported configs in Amnezia Android.
- Reordered keys so protocol object ('xray') comes before 'container' key, matching the order seen in WireGuard QR codes.
2026-01-24 13:45:56 +03:00
infosave2007 1006debc42 fix(qr): Return to 12-byte Amnezia header but keep config wrapping
Reverting header to 12-byte format (0x07C00100 + compressedLen + uncompressedLen).
This header format is known to be scanned correctly by Amnezia app.
Previous failure with this header was due to missing config wrapping.
Now we have both: correct header AND correct content structure.
2026-01-24 13:42:20 +03:00
infosave2007 dc23a8f213 fix(qr): Use hybrid Chunked+Qt format for QR codes
The format that likely works with Amnezia Android is:
HEADER: 0x07C00100 (Magic 1984, Count 1, Id 0)
PAYLOAD: [UncompressedLen (4b)] + [Zlib Data]

This satisfies the Chunked QR check (magic 0x07C0) and then passes
the payload to qUncompress, which expects the 4-byte uncompressed length prefix.

Previous attempts failed because:
1. 12-byte header included compressedLen, which qUncompress interpreted as uncompressedLen (causing size mismatch error)
2. 4-byte header (Qt only) failed the Magic check
2026-01-24 13:38:32 +03:00
infosave2007 f5ab0ec2e3 fix(qr): Wrap X-Ray config in 'config' field inside last_config
Amnezia Android expects the contents of 'last_config' to be a JSON object
containing a 'config' field which holds the actual protocol configuration string.
Previously we were putting the configuration directly into 'last_config',
which caused the import to fail.
2026-01-24 13:34:13 +03:00
infosave2007 48f85365bd fix(qr): Revert to original 12-byte Amnezia header format
The working QR format from Amnezia app uses:
- 12-byte header: version (0x07C00100) + compressedLen + uncompressedLen
- zlib compressed JSON data

Previously I incorrectly changed this to Qt qCompress format (4-byte header).
This commit reverts to the correct Amnezia-compatible format.
2026-01-24 13:26:24 +03:00
infosave2007 644ee460af fix(qr): Use Qt qCompress format for QR code encoding
Amnezia Android uses qUncompress which expects:
- 4-byte big-endian uncompressed length prefix
- zlib compressed data (gzcompress output)

Previously we used a custom 12-byte header (version, compressedLen, uncompressedLen)
which was incompatible with Qt's qUncompress.

This fix ensures X-Ray QR codes can be properly decoded by Amnezia VPN app.
2026-01-24 13:17:57 +03:00
infosave2007 7734f54137 fix(xray): Fix X-Ray install script and QR code generation
- Fix docker run command in install script (use single line instead of
  backslash continuations which break when stored in MySQL)
- Handle new xray x25519 output format that uses 'Password' instead of 'Public key'
- Make addClientToServer method public for backup restore functionality
- Created migration 046 with complete fix for X-Ray VLESS protocol
2026-01-24 13:03:05 +03:00
infosave2007 5bffc0fbbd fix: set xray default port to 443 to match android client 2026-01-23 20:07:27 +03:00
infosave2007 8fd8e19317 fix: add flow xtls-rprx-vision to xray server config 2026-01-23 19:55:56 +03:00
infosave2007 e11cb574c6 fix: proper json escaping in xray install script 2026-01-23 19:33:58 +03:00
infosave2007 c92696ad52 fix: update xray install script to correct variable expansion 2026-01-23 19:22:01 +03:00
infosave2007 14eda839bc feat: replace native confirm with custom modal to fix auto-close issue 2026-01-23 19:08:41 +03:00
infosave2007 690881803d fix: prevent confirm dialog from closing immediately on delete buttons 2026-01-23 18:57:27 +03:00
infosave2007 ea82b78a7d feat: ssh auth, protocol management, and cleanup 2026-01-23 17:55:40 +03:00
infosave2007 efa2ce8647 chore(update): update auto-update script (migrations handling & translations) 2025-11-14 09:56:47 +03:00
infosave2007 a292222933 fix: Improve LDAP configuration loading with table existence check 2025-11-11 19:04:53 +03:00
infosave2007 c94580bbea fix: Ensure Tailwind CSS devtools configuration is set correctly 2025-11-10 18:01:52 +03:00
infosave2007 28d04df3e7 chore: Add LDAP_FEATURE.md to gitignore 2025-11-10 18:01:52 +03:00
infosave2007 3d9cc02963 feat: Add LDAP/Active Directory integration with group-based access control
- Add PHP LDAP extension to Docker container
- Implement LdapSync class for authentication and user synchronization
- Add automatic user sync via cron (every 30 minutes)
- Create role-based access control system (admin, manager, viewer)
- Add LDAP configuration UI in settings
- Support for both Active Directory and OpenLDAP
- Group-to-role mapping with flexible configuration
- Add 50+ translations (EN + RU) for LDAP features
- Include comprehensive setup documentation
- Enhance Auth::login() with LDAP fallback
- Add LDAP settings page with connection testing
2025-11-10 18:01:52 +03:00
infosave2007 40abe38616 chore: Update gitignore 2025-11-10 18:01:52 +03:00
infosave2007 a147253912 fix: update last_handshake when collecting metrics 2025-11-10 16:46:08 +03:00
infosave2007 764feca598 feat: add cron configuration check in container and log status 2025-11-10 16:29:04 +03:00
infosave2007 1f36ade7de feat: improve metrics collector handling by starting it if not running and logging status 2025-11-10 16:09:21 +03:00
infosave2007 5f764cd9f4 fix: ensure NEW_COMMIT is set to CURRENT_COMMIT when no update is available 2025-11-10 16:05:31 +03:00
infosave2007 c837eedb22 feat: enhance update script to rebuild containers on Dockerfile changes and check metrics collector status 2025-11-10 16:04:15 +03:00
infosave2007 22dafe7654 feat: enhance update script with argument parsing and logging improvements 2025-11-10 15:53:23 +03:00
infosave2007 be3416eddc feat: implement automatic metrics collection and monitoring system 2025-11-10 15:19:36 +03:00
infosave2007 3e9ccb5f8d chore: remove outdated 2025-11-08 18:58:11 +03:00
infosave2007 12f755f66d Update installation instructions with both docker compose versions 2025-11-08 18:22:04 +03:00
infosave2007 94e13b82e9 Fix SettingsController for new translations table structure 2025-11-08 18:16:44 +03:00
infosave2007 86620c6307 Fix Translator.php for new table structure 2025-11-08 17:55:14 +03:00
infosave2007 298d17bf75 fix: Update user creation script to use mysql_native_password authentication 2025-11-08 17:49:03 +03:00
infosave2007 4559a2f1a6 fix: Ensure user creation and privileges are granted for localhost 2025-11-08 17:46:30 +03:00
infosave2007 1596325e82 Add automatic user creation on database init 2025-11-08 17:41:33 +03:00
infosave2007 993758b309 feat: Implement migration procedure for translations table structure and insert new translations 2025-11-08 17:26:05 +03:00
infosave2007 8d592e808d fix: Simplify SQL command for creating migrations tracking table in update script 2025-11-08 17:01:35 +03:00
infosave2007 17e48a37bb fix: Simplify query for checking applied migrations in update script 2025-11-08 17:00:02 +03:00
infosave2007 6a062f7d79 fix: Correct command substitution for checking applied migrations in update script 2025-11-08 16:57:13 +03:00
infosave2007 a45eeec12b feat: Source .env file safely in update script for improved security 2025-11-08 16:54:44 +03:00
infosave2007 7972a31b3f feat: Enhance update script with improved Docker command detection and database credential handling 2025-11-08 16:51:43 +03:00
infosave2007 3a1c58fc9f feat: Add auto update script for Amnezia VPN Panel with backup and migration support 2025-11-08 16:15:25 +03:00
infosave2007 257edb8226 feat: Implement server and client metrics collection and monitoring
- Added a new PHP script for collecting server metrics every 30 seconds.
- Created a ServerMonitoring class to handle metrics collection for CPU, RAM, Disk, and Network.
- Introduced database tables for storing server and client metrics.
- Updated server view template to display real-time metrics using Chart.js.
- Added translations for monitoring UI elements.
- Created a new monitoring template for detailed server metrics visualization.
- Implemented client speed tracking and display in the monitoring UI.
2025-11-08 15:35:17 +03:00
infosave2007 05c4eaa805 feat: sanitize client name input to allow only letters, numbers, underscores, and dashes 2025-11-08 13:56:11 +03:00
infosave2007 2bd7b58843 fix: update traffic metrics to use bytes instead of traffic values 2025-11-08 13:17:07 +03:00
infosave2007 a23a547572 docs: добавлена инструкция по тестированию импорта 2025-11-08 12:46:02 +03:00
infosave2007 ab479e61ff docs: добавлены примеры backup файлов для импорта
- Пример wg-easy backup (db.json)
- Пример 3x-ui export
- Подробная документация по импорту
- Инструкции по получению backup файлов
- Список импортируемых данных
2025-11-08 12:45:08 +03:00
infosave2007 fc39346240 feat: добавлена возможность импорта из wg-easy и 3x-ui панелей
Основные изменения:
- Создан класс PanelImporter для парсинга и импорта клиентов
- Добавлена поддержка wg-easy (db.json)
- Добавлена поддержка 3x-ui (export JSON)
- Создана таблица panel_imports для отслеживания истории
- Добавлен UI для загрузки backup файлов при создании сервера
- Добавлены API endpoints: POST /api/servers/{id}/import и GET /api/servers/{id}/imports
- Автоматический импорт после деплоя сервера
- Переводы на всех 6 языках (EN, RU, ES, DE, FR, ZH)
- Обновлена документация в README

Функционал:
- Импорт клиентов с сохранением ключей и IP (wg-easy)
- Импорт клиентов с автогенерацией ключей (3x-ui)
- Поддержка экспирации и лимитов трафика из исходных панелей
- История импортов с информацией о количестве клиентов
- Обработка ошибок с детальным логированием
2025-11-08 12:40:43 +03:00
infosave2007 bbb0fbeeb9 feat: добавлена возможность ручного ввода времени и трафика
- Добавлены custom input поля для expiration (секунды) и traffic (МБ)
- Добавлена функциональность редактирования клиента
- Исправлена migration 007 (AFTER expires_at)
- Удалены дублирующиеся миграции (0025, 0044, 0053, 0057)
- Удалён старый init.sql (заменён на 001_init.sql)
- Добавлены переводы для custom полей на 6 языках
2025-11-08 10:45:05 +03:00
infosave2007 b6cf9cbab7 Add traffic limit functionality
- Add traffic_limit field to vpn_clients table (migration 007)
- Add traffic limit management methods in VpnClient class
- Add API endpoints: set-traffic-limit, traffic-limit-status, overlimit
- Add UI for setting limits when creating clients
- Add traffic limit column in clients table with visual indicators
- Add automatic traffic limit check via cron (bin/check_traffic_limits.php)
- Add translations for traffic limits (6 languages)
- Update README with traffic limit documentation
2025-11-08 09:56:25 +03:00
infosave2007 5510e0b7b1 Fix(docs) cron 2025-11-08 09:41:54 +03:00
infosave2007 de73728733 Add automatic cron for client expiration check 2025-11-08 09:36:23 +03:00
infosave2007 da2bd8f8fa Add backups/ to .gitignore 2025-11-08 09:16:13 +03:00
infosave2007 8163684a79 Remove backups directory from git tracking 2025-11-08 09:15:57 +03:00
infosave2007 ea516bdd6f feat(database): add complete database schema with user, server, client, and translation tables 2025-11-08 09:14:59 +03:00
infosave2007 1f91f17f57 Add multilingual support with translations for German, Russian, French, and Chinese
Added time limits and backup functions for servers
2025-11-08 09:14:20 +03:00
infosave2007 1deea2e4b7 fix(docs): update installation commands for composer and translate script 2025-11-07 23:00:07 +03:00
infosave2007 ede8d610f7 fix(docs): correct directory name in installation instructions 2025-11-07 22:47:48 +03:00
infosave2007 abcad2cfe1 settings namespace JWT 2025-11-07 17:54:36 +03:00
infosave2007 ab500a1f98 refactor(JWT): improve secret key retrieval and storage logic
- Update database query to use namespace/key pattern for better organization
- Add JSON decoding for stored secret values
- Ensure minimum key length requirement is consistently enforced
- Simplify key generation and storage with proper JSON encoding
2025-11-07 17:49:28 +03:00
infosave2007 a52aba25d8 Add QR code support in API endpoints
- Updated /api/clients/create to return config and qr_code
- Updated /api/clients/{id}/details to include config and qr_code
- Added new endpoint /api/clients/{id}/qr for getting QR code only
- Added API_EXAMPLES.md with usage examples and integration code
- Updated README.md API documentation
2025-11-07 15:25:59 +03:00
infosave2007 f538fb65f1 Update installation instructions with correct repository URL 2025-11-07 13:58:27 +03:00
infosave2007 5d039484a1 Remove tests files 2025-11-07 13:36:54 +03:00