From b6780ba876140798d0d97d7ab545fd4397b761df Mon Sep 17 00:00:00 2001 From: MacRimi Date: Mon, 16 Mar 2026 17:46:34 +0100 Subject: [PATCH] Update oci manager --- AppImage/components/secure-gateway-setup.tsx | 101 +++++++++++++---- AppImage/scripts/flask_oci_routes.py | 23 ++++ AppImage/scripts/oci_manager.py | 108 +++++++++++++++++-- 3 files changed, 205 insertions(+), 27 deletions(-) diff --git a/AppImage/components/secure-gateway-setup.tsx b/AppImage/components/secure-gateway-setup.tsx index d2bce420..c6fc8057 100644 --- a/AppImage/components/secure-gateway-setup.tsx +++ b/AppImage/components/secure-gateway-setup.tsx @@ -30,6 +30,17 @@ interface NetworkInfo { recommended?: boolean } +interface StorageInfo { + name: string + type: string + total: number + used: number + avail: number + active: boolean + enabled: boolean + recommended: boolean +} + interface AppStatus { state: "not_installed" | "running" | "stopped" | "error" health: string @@ -73,6 +84,7 @@ export function SecureGatewaySetup() { const [configSchema, setConfigSchema] = useState(null) const [wizardSteps, setWizardSteps] = useState([]) const [networks, setNetworks] = useState([]) + const [storages, setStorages] = useState([]) // Wizard state const [showWizard, setShowWizard] = useState(false) @@ -113,14 +125,14 @@ export function SecureGatewaySetup() { const loadInitialData = async () => { setLoading(true) try { - // Load runtime info (checks for Proxmox 9.1+ OCI support) + // Secure Gateway uses standard LXC, not OCI containers + // So we don't require PVE 9.1+ - it works on any Proxmox version + setRuntimeAvailable(true) + + // Still load runtime info for reference const runtimeRes = await fetchApi("/api/oci/runtime") - if (runtimeRes.success && runtimeRes.available) { - setRuntimeAvailable(true) - setRuntimeInfo({ runtime: runtimeRes.runtime, version: runtimeRes.version }) - } else { - // Show version requirement message - setRuntimeInfo({ runtime: "proxmox-lxc", version: runtimeRes.version || "unknown" }) + if (runtimeRes.success) { + setRuntimeInfo({ runtime: runtimeRes.runtime || "proxmox-lxc", version: runtimeRes.version || "unknown" }) } // Load app definition @@ -156,6 +168,17 @@ export function SecureGatewaySetup() { setHostIp(ip) } } + + // Load available storages + const storagesRes = await fetchApi("/api/oci/storages") + if (storagesRes.success && storagesRes.storages?.length > 0) { + setStorages(storagesRes.storages) + // Set default storage (first recommended one) + const recommended = storagesRes.storages.find((s: StorageInfo) => s.recommended) || storagesRes.storages[0] + if (recommended) { + setConfig(prev => ({ ...prev, storage: recommended.name })) + } + } } catch (err) { console.error("Failed to load data:", err) } finally { @@ -644,6 +667,51 @@ export function SecureGatewaySetup() {

+ {/* Storage selector */} + {storages.length > 1 && ( +
+ +

Select where to create the container disk.

+
+ {storages.filter(s => s.active && s.enabled).map((storage) => ( +
setConfig({ ...config, storage: storage.name })} + className={`p-3 rounded-lg border cursor-pointer transition-colors ${ + config.storage === storage.name + ? "border-cyan-500 bg-cyan-500/10" + : "border-border hover:border-muted-foreground/50" + }`} + > +
+
+ {config.storage === storage.name && ( +
+ )} +
+
+
+ {storage.name} + ({storage.type}) + {storage.recommended && ( + + Recommended + + )} +
+

+ {(storage.avail / 1024 / 1024 / 1024).toFixed(1)} GB available +

+
+
+
+ ))} +
+
+ )} +

Configuration Summary

@@ -651,6 +719,12 @@ export function SecureGatewaySetup() { Hostname: {config.hostname || "proxmox-gateway"}
+ {storages.length > 1 && ( +
+ Storage: + {config.storage || storages[0]?.name} +
+ )}
Access Mode: {config.access_mode === "host_only" ? "Host Only" : config.access_mode === "proxmox_network" ? "Proxmox Network" : "Custom Networks"} @@ -1109,23 +1183,10 @@ export function SecureGatewaySetup() {

Deploy a Tailscale VPN gateway for secure remote access to your Proxmox infrastructure. No port forwarding required.

- - {runtimeAvailable ? ( -
- - Proxmox VE {runtimeInfo?.version} - OCI support available -
- ) : ( -
- - Requires Proxmox VE 9.1+ (current: {runtimeInfo?.version || "unknown"}) -
- )}