You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Phantom-WG Modern*** is a WireGuard®-based VPN management platform. All components run within a Docker container architecture, and the core component Phantom Daemon communicates over Unix Domain Socket (UDS).
7
+
***Phantom-WG*** is a modular tool that lets you set up and manage a WireGuard VPN infrastructure on your own server. Beyond basic VPN management, it offers censorship-resistant connections, multi-layered encryption, and advanced privacy scenarios.
8
+
9
+
***Phantom-WG Modern*** is the container-native implementation of this vision. All components run within Docker and are isolated from the host system:
10
+
11
+
-**Userspace WireGuard** — Container-scoped TUN device via Go FFI bridge. No kernel module required, does not touch the host's network namespace.
12
+
-**nftables netlink FFI** — Rust backend communicates directly with the kernel. No subprocess calls, firewall rules are managed programmatically.
13
+
-**SQLite State Persistence** — All state is stored in SQLite databases. A daemon restart after a crash is sufficient — kernel state is rebuilt from the DB.
14
+
-**Dual-Stack IPv6** — Even without IPv6 on the host, an IPv6 subnet is assigned within the container and traffic is carried through the tunnel.
15
+
-**Container Isolation** — `NET_ADMIN` + `NET_RAW` is sufficient. WireGuard interfaces live within the container namespace. Configurations that weaken host security such as `SYS_ADMIN`, `privileged`, or `host` network mode are not used.
16
+
17
+
---
18
+
19
+
## Topology
20
+
21
+
Three containers, managed via Docker Compose. Management traffic passes through TLS + JWT authentication, WireGuard traffic reaches the daemon directly.
The daemon performs system-level operations through two native bridges. Python manages the business logic, bridges communicate directly with the kernel.
IPv6 support across all layers — firewall rules, policy routing, masquerade, and multihop presets operate with `family: 10` (AF_INET6). IPv6 tunnel traffic can be carried from within the container even without an IPv6 address on the host.
67
+
68
+
### Crash Recovery
69
+
70
+
When the service starts, kernel state (nftables rules, routing policies) is rebuilt from SQLite state databases. No data loss after an unexpected shutdown.
Accessible via `https://<IPv4>` or `https://[<IPv6>]` through the tunnel. You can also remove the `ports: "443:443"` line from `docker-compose.yml` to make the dashboard accessible only through the VPN tunnel.
116
+
117
+
---
118
+
119
+
## Management
120
+
121
+
A convenient tool is available at `./tools/prod.sh` for management.
- Creates admin account. (32-character random password encrypted with Argon2id hash)
150
+
4. Generates self-signed TLS certificate for nginx. (`tls_cert`, `tls_key`)
151
+
152
+
All of these operations take place within the container — no additional dependencies or tools need to be installed on the host.
153
+
154
+
<InlineNotification
155
+
kind="info"
156
+
title="Secret Keys"
157
+
subtitle="Secret keys are stored under container-data/secrets/production/. The admin password is written to .admin_password in the same directory — you can safely remove it after logging in."
subtitle="If you have made configuration changes to docker-compose.yml and want to receive updates, use --skip-compose."
173
+
hideCloseButton
174
+
lowContrast
175
+
/>
176
+
177
+
For package dependency changes that require container recompilation (Dockerfile, requirements.txt):
178
+
179
+
```bash
180
+
./tools/prod.sh rebuild
181
+
./tools/prod.sh up
182
+
```
183
+
43
184
<InlineNotification
44
185
kind="info"
45
-
title="Detailed guide"
46
-
subtitle="See the SETUP file for all commands, environment variables, and update instructions."
186
+
title="Build vs Update"
187
+
subtitle="Dockerfiles only provide the system dependencies needed for the stack to run. Code updates are received with the update command — rebuild is only required when these dependencies change."
***Phantom-WG Modern***, WireGuard® tabanlı bir VPN yönetim platformudur. Tüm bileşenler Docker container yapısı içerisinde çalışır ve asıl işi yapan Phantom Daemon Unix Domain Socket (UDS) üzerinden haberleşir.
7
+
***Phantom-WG***, kendi sunucunuzda WireGuard VPN altyapısı kurmanızı ve yönetmenizi sağlayan modüler bir araçtır. Temel VPN yönetiminin ötesinde; sansüre dayanıklı bağlantılar, çok katmanlı şifreleme ve gelişmiş gizlilik senaryoları sunar.
8
+
9
+
***Phantom-WG Modern***, bu vizyonun container-native implementasyonudur. Tüm bileşenler Docker yapısı içerisinde çalışır ve host sistemden izole edilir:
10
+
11
+
-**Userspace WireGuard** — Go FFI bridge ile container-scoped TUN device. Kernel modülü gerektirmez, host'un network namespace'ine dokunmaz.
12
+
-**nftables netlink FFI** — Rust backend doğrudan kernel ile konuşur. Subprocess çağrısı yoktur, firewall kuralları programatik olarak yönetilir.
13
+
-**SQLite State Persistence** — Tüm state SQLite veritabanlarında tutulur. Crash sonrası daemon restart yeterlidir — kernel state DB'den yeniden oluşturulur.
14
+
-**Dual-Stack IPv6** — Host'ta IPv6 olmasa bile container içinde IPv6 subnet atanır, tünel içinde trafik taşınabilir.
15
+
-**Container İzolasyonu** — `NET_ADMIN` + `NET_RAW` yeterlidir. WireGuard arayüzleri container namespace içerisinde yaşar. `SYS_ADMIN`, `privileged` veya `host` network mode gibi host güvenliğini zayıflatan konfigürasyonlar kullanılmaz.
16
+
17
+
---
18
+
19
+
## Topoloji
20
+
21
+
Üç container, Docker Compose ile yönetilir. Yönetim trafiği TLS + JWT kimlik doğrulamadan geçer, WireGuard trafiği doğrudan daemon'a ulaşır.
Daemon, sistem düzeyindeki işlemleri iki native bridge aracılığıyla gerçekleştirir. Python iş mantığını yönetir, bridge'ler kernel ile doğrudan iletişim kurar.
Trafiğinizi harici bir WireGuard VPN sunucusu üzerinden aktarmak için exit tünelinizi tanımlayabilirsiniz. IPv4 ve IPv6 tünelleri eş zamanlı olarak desteklenir.
IPv6 desteği tüm katmanlarda — firewall kuralları, policy routing, masquerade ve multihop preset'leri `family: 10` (AF_INET6) ile çalışır. Host'ta IPv6 adresi olmadan da container içinden IPv6 tünel trafiği taşınabilir.
67
+
68
+
### Crash Recovery
69
+
70
+
Servis başlatıldığında kernel state (nftables kuralları, routing policy'leri) SQLite durum veritabanlarından yeniden oluşturulur. Beklenmeyen kapanma sonrası veri kaybı yaşanmaz.
7
71
8
72
---
9
73
@@ -22,7 +86,7 @@ curl -sSL get.phantom.tc | bash
22
86
```bash
23
87
cd phantom-wg
24
88
25
-
# İlk kurulum (anahtarlar, auth DB, TLS sertifikası, env dosyaları)
89
+
# İlk kurulum
26
90
./tools/prod.sh setup
27
91
28
92
# Endpoint yapılandırması
@@ -40,10 +104,87 @@ sed -i "s/^WIREGUARD_ENDPOINT_V6=.*/WIREGUARD_ENDPOINT_V6=${IPV6}/" .env.daemon
Tünel içerisinden `https://<IPv4>` veya `https://[<IPv6>]` adresi ile erişilebilir. Dilerseniz `docker-compose.yml` dosyasından `ports: "443:443"` satırını kaldırarak kontrol panelini yalnızca VPN tüneli üzerinden erişilebilir hale getirebilirsiniz.
116
+
117
+
---
118
+
119
+
## Yönetim
120
+
121
+
Yönetim için `./tools/prod.sh` konumunda kullanışlı bir araç bulunur.
- Admin hesabı oluşturur. (Argon2id hash ile şifrelenen 32 karakterlik rastgele şifre)
150
+
4. Nginx için self-signed TLS sertifikası üretir. (`tls_cert`, `tls_key`)
151
+
152
+
Tüm bu işlemler container içerisinde gerçekleşir — host tarafında ek bir bağımlılık veya araç kurulumu gerekmez.
153
+
154
+
<InlineNotification
155
+
kind="info"
156
+
title="Gizli Anahtarlar"
157
+
subtitle="Gizli anahtarlar container-data/secrets/production/ altında saklanır. Admin şifresi aynı dizindeki .admin_password dosyasına yazılır — giriş yaptıktan sonra güvenle kaldırabilirsiniz."
subtitle="Tüm komutlar, ortam değişkenleri ve güncelleme adımları için SETUP dosyasına bakın."
186
+
title="Build ve Update Farkı"
187
+
subtitle="Dockerfile'lar yalnızca yapının çalışması için gereken sistem bağımlılıklarını sağlar. Kod güncellemeleri update komutuyla alınır — rebuild yalnızca bu bağımlılıklar değiştiğinde gereklidir."
0 commit comments