282 lines
No EOL
5.6 KiB
Markdown
282 lines
No EOL
5.6 KiB
Markdown
# hydra-veil CLI
|
|
|
|
> [English](#english) · [Español](#español)
|
|
|
|
---
|
|
|
|
### What is this?
|
|
|
|
A command-line tool to manage VPN profiles and encrypted proxy connections. It supports two connection types:
|
|
|
|
- **WireGuard** — system-level VPN tied to a specific location
|
|
- **Operator Proxy** — encrypted proxy (vless or hysteria2) tied to an operator
|
|
|
|
---
|
|
|
|
### Installation
|
|
|
|
```bash
|
|
pip install -e .
|
|
python -m cli --version
|
|
```
|
|
|
|
---
|
|
|
|
### Commands overview
|
|
|
|
| Command | Description |
|
|
|---|---|
|
|
| `profile` | Manage connection profiles |
|
|
| `application` | Manage supported applications |
|
|
| `operator` | List available operators |
|
|
| `policy` | Manage system policies |
|
|
| `get` / `set` | Read / write configuration |
|
|
| `sync` | Sync data from the server |
|
|
| `update` | Update the client |
|
|
|
|
---
|
|
|
|
### Creating a profile
|
|
|
|
#### WireGuard (system-level VPN)
|
|
|
|
```bash
|
|
python -m cli profile create system -i 2 -n "my-vpn" -l de:be
|
|
```
|
|
|
|
| Argument | Description |
|
|
|---|---|
|
|
| `-i` | Profile ID (unique integer) |
|
|
| `-n` | Profile name (any label) |
|
|
| `-l` | Location in `country:city` format |
|
|
|
|
#### Operator Proxy
|
|
|
|
```bash
|
|
python -m cli profile create operator -i 8 -n "zenaku-vless" -o 3 -pr vless
|
|
```
|
|
|
|
| Argument | Description |
|
|
|---|---|
|
|
| `-i` | Profile ID (unique integer) |
|
|
| `-n` | Profile name (any label) |
|
|
| `-o` | Operator ID (see `operator list`) |
|
|
| `-pr` | Protocol: `vless` or `hysteria2` |
|
|
|
|
To see available operators:
|
|
|
|
```bash
|
|
python -m cli operator list
|
|
```
|
|
|
|
---
|
|
|
|
### Enabling a profile
|
|
|
|
```bash
|
|
python -m cli profile enable -i 8
|
|
```
|
|
|
|
On first run, the profile has no subscription. The CLI will prompt:
|
|
|
|
```
|
|
1) Request new subscription
|
|
2) Enter billing code
|
|
3) Exit
|
|
```
|
|
|
|
Choose **1** to generate a billing code. The profile needs to be paid and activated before the connection is established.
|
|
|
|
---
|
|
|
|
### Dev / staging: bypass BTCPay payment
|
|
|
|
If the BTCPay server is not set up, manually activate the latest subscription:
|
|
|
|
```bash
|
|
sudo docker compose exec laravel php artisan tinker --execute="
|
|
\$sub = \App\Models\Subscription::orderBy('id', 'desc')->first();
|
|
\$sub->expires_at = '2027-12-31 23:59:59';
|
|
\$sub->duration = 720;
|
|
\$sub->payment_reference = 'bypass_' . uniqid();
|
|
\$sub->save();
|
|
echo 'OK' . PHP_EOL;
|
|
"
|
|
```
|
|
|
|
Then enable again:
|
|
|
|
```bash
|
|
python -m cli profile enable -i 8
|
|
```
|
|
|
|
---
|
|
|
|
### Other useful commands
|
|
|
|
```bash
|
|
# List all profiles
|
|
python -m cli profile list
|
|
|
|
# Show a specific profile
|
|
python -m cli profile show -i 8
|
|
|
|
# Disable a profile
|
|
python -m cli profile disable -i 8
|
|
|
|
# Destroy a profile
|
|
python -m cli profile destroy -i 8
|
|
|
|
# List available applications
|
|
python -m cli application list
|
|
|
|
# Sync data from server
|
|
python -m cli sync
|
|
|
|
# Get current connection type
|
|
python -m cli get connection
|
|
|
|
# Set connection type
|
|
python -m cli set connection tor
|
|
python -m cli set connection system
|
|
```
|
|
---
|
|
|
|
## Español
|
|
|
|
### ¿Qué es esto?
|
|
|
|
Una herramienta de línea de comandos para gestionar perfiles VPN y conexiones proxy encriptadas. Soporta dos tipos de conexión:
|
|
|
|
- **WireGuard** — VPN a nivel de sistema ligada a una ubicación específica
|
|
- **Operator Proxy** — proxy encriptado (vless o hysteria2) ligado a un operador
|
|
|
|
---
|
|
|
|
### Instalación
|
|
|
|
```bash
|
|
pip install -e .
|
|
python -m cli --version
|
|
```
|
|
|
|
---
|
|
|
|
### Resumen de comandos
|
|
|
|
| Comando | Descripción |
|
|
|---|---|
|
|
| `profile` | Gestionar perfiles de conexión |
|
|
| `application` | Gestionar aplicaciones soportadas |
|
|
| `operator` | Listar operadores disponibles |
|
|
| `policy` | Gestionar políticas del sistema |
|
|
| `get` / `set` | Leer / escribir configuración |
|
|
| `sync` | Sincronizar datos del servidor |
|
|
| `update` | Actualizar el cliente |
|
|
|
|
---
|
|
|
|
### Crear un perfil
|
|
|
|
#### WireGuard (VPN a nivel de sistema)
|
|
|
|
```bash
|
|
python -m cli profile create system -i 2 -n "mi-vpn" -l de:be
|
|
```
|
|
|
|
| Argumento | Descripción |
|
|
|---|---|
|
|
| `-i` | ID del perfil (número único) |
|
|
| `-n` | Nombre del perfil (cualquier etiqueta) |
|
|
| `-l` | Ubicación en formato `país:ciudad` |
|
|
|
|
#### Operator Proxy
|
|
|
|
```bash
|
|
python -m cli profile create operator -i 8 -n "zenaku-vless" -o 3 -pr vless
|
|
```
|
|
|
|
| Argumento | Descripción |
|
|
|---|---|
|
|
| `-i` | ID del perfil (número único) |
|
|
| `-n` | Nombre del perfil (cualquier etiqueta) |
|
|
| `-o` | ID del operador (ver `operator list`) |
|
|
| `-pr` | Protocolo: `vless` o `hysteria2` |
|
|
|
|
Para ver los operadores disponibles:
|
|
|
|
```bash
|
|
python -m cli operator list
|
|
```
|
|
|
|
---
|
|
|
|
### Activar un perfil
|
|
|
|
```bash
|
|
python -m cli profile enable -i 8
|
|
```
|
|
|
|
La primera vez el perfil no tiene suscripción. El CLI mostrará:
|
|
|
|
```
|
|
1) Request new subscription
|
|
2) Enter billing code
|
|
3) Exit
|
|
```
|
|
|
|
Elige **1** para generar un billing code. El perfil debe ser pagado y activado antes de que se establezca la conexión.
|
|
|
|
---
|
|
|
|
### Dev / staging: saltarse el pago de BTCPay
|
|
|
|
Si el servidor BTCPay no está configurado, activa manualmente la última suscripción:
|
|
|
|
```bash
|
|
sudo docker compose exec laravel php artisan tinker --execute="
|
|
\$sub = \App\Models\Subscription::orderBy('id', 'desc')->first();
|
|
\$sub->expires_at = '2027-12-31 23:59:59';
|
|
\$sub->duration = 720;
|
|
\$sub->payment_reference = 'bypass_' . uniqid();
|
|
\$sub->save();
|
|
echo 'OK' . PHP_EOL;
|
|
"
|
|
```
|
|
|
|
Luego activa el perfil de nuevo:
|
|
|
|
```bash
|
|
python -m cli profile enable -i 8
|
|
```
|
|
|
|
---
|
|
|
|
### Otros comandos útiles
|
|
|
|
```bash
|
|
# Listar todos los perfiles
|
|
python -m cli profile list
|
|
|
|
# Ver un perfil específico
|
|
python -m cli profile show -i 8
|
|
|
|
# Desactivar un perfil
|
|
python -m cli profile disable -i 8
|
|
|
|
# Eliminar un perfil
|
|
python -m cli profile destroy -i 8
|
|
|
|
# Listar aplicaciones disponibles
|
|
python -m cli application list
|
|
|
|
# Sincronizar datos del servidor
|
|
python -m cli sync
|
|
|
|
# Ver tipo de conexión actual
|
|
python -m cli get connection
|
|
|
|
# Cambiar tipo de conexión
|
|
python -m cli set connection tor
|
|
python -m cli set connection system
|
|
``` |