feat(core-net): пробросить /dev/net/tun для клиента NetBird
Unprivileged LXC иначе не поднимает WireGuard. Устройство появляется после одного перезапуска CT 902. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
72a9c86e52
commit
83fde054b4
2 files changed
+27
-1
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ Terraform в этом репозитории описывает только у
|
|||||||
|---|---|---|---|---|
|
|---|---|---|---|---|
|
||||||
| **CT 109** | `pve` | `192.168.1.217` | `gitea` | Gitea (`:3000`), Postgres (`:5432`), Gitea Actions Runner (`dind`) |
|
| **CT 109** | `pve` | `192.168.1.217` | `gitea` | Gitea (`:3000`), Postgres (`:5432`), Gitea Actions Runner (`dind`) |
|
||||||
| **CT 901** | `netcore` | `192.168.1.102` | `core-secrets` | Infisical (`:8080`), Postgres, Redis, Vaultwarden (`:8000`) |
|
| **CT 901** | `netcore` | `192.168.1.102` | `core-secrets` | Infisical (`:8080`), Postgres, Redis, Vaultwarden (`:8000`) |
|
||||||
| **CT 902** | `netcore` | `192.168.1.104` | `core-net` | Traefik (`:80`, `:443`); Remnawave Panel (`127.0.0.1:3000`) + Subscription (`127.0.0.1:3010`); Authentik (`127.0.0.1:9000`) — опционально, по умолчанию выкл. |
|
| **CT 902** | `netcore` | `192.168.1.104` | `core-net` | Traefik (`:80`, `:443`); Remnawave Panel (`127.0.0.1:3000`) + Subscription (`127.0.0.1:3010`); клиент NetBird (`/dev/net/tun`); Authentik (`127.0.0.1:9000`) — опционально, по умолчанию выкл. |
|
||||||
| **CT 903** | `netcore` | `192.168.1.108` | `core-mon` | Prometheus (`:9090`), VictoriaMetrics (`:8428`), Alertmanager (`:9093`), Grafana (`:3000`), Ntfy (`:80`) |
|
| **CT 903** | `netcore` | `192.168.1.108` | `core-mon` | Prometheus (`:9090`), VictoriaMetrics (`:8428`), Alertmanager (`:9093`), Grafana (`:3000`), Ntfy (`:80`) |
|
||||||
|
|
||||||
### 1.3. Внешние узлы
|
### 1.3. Внешние узлы
|
||||||
|
|||||||
@@ -48,4 +48,30 @@ resource "proxmox_virtual_environment_container" "core_net" {
|
|||||||
features {
|
features {
|
||||||
nesting = true
|
nesting = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# NetBird на панели поднимает WireGuard. В unprivileged LXC для этого нужен /dev/net/tun.
|
||||||
|
device_passthrough {
|
||||||
|
path = "/dev/net/tun"
|
||||||
|
mode = "0666"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Устройство появляется внутри CT после перезапуска. Срабатывает один раз.
|
||||||
|
resource "terraform_data" "core_net_tun_reboot" {
|
||||||
|
depends_on = [proxmox_virtual_environment_container.core_net]
|
||||||
|
triggers_replace = ["dev-net-tun"]
|
||||||
|
|
||||||
|
provisioner "local-exec" {
|
||||||
|
command = <<-EOT
|
||||||
|
set -eu
|
||||||
|
if [ -z "$${PROXMOX_API_TOKEN:-}" ] || [ -z "$${PROXMOX_ENDPOINT:-}" ]; then
|
||||||
|
echo "Нет PROXMOX_API_TOKEN или PROXMOX_ENDPOINT. Перезапустите CT 902, чтобы появился /dev/net/tun."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
endpoint="$${PROXMOX_ENDPOINT%/}"
|
||||||
|
curl -fsSk -X POST \
|
||||||
|
-H "Authorization: PVEAPIToken=$${PROXMOX_API_TOKEN}" \
|
||||||
|
"$endpoint/api2/json/nodes/${var.proxmox_node}/lxc/902/status/reboot"
|
||||||
|
EOT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user