Added main code execution.

This commit is contained in:
Raphaël Numbus
2026-03-28 22:07:01 +01:00
parent 29d7eac981
commit 3494bac065
2 changed files with 40 additions and 10 deletions
+9 -9
View File
@@ -86,13 +86,13 @@
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<button @click="formData.deploymentMode = 'interactive'"
:class="formData.deploymentMode === 'interactive' ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'"
class="p-6 border rounded-2xl transition-all text-left group hover:bg-slate-800">
class="p-6 border rounded-2xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="font-bold text-lg mb-1" :class="formData.deploymentMode === 'interactive' ? 'text-white' : 'text-slate-200 group-hover:text-white'">Interactive</div>
<p class="text-xs transition-colors" :class="formData.deploymentMode === 'interactive' ? 'text-white' : 'text-slate-500 group-hover:text-white'">Guide me through every setting manually.</p>
</button>
<button @click="formData.deploymentMode = 'non-interactive'"
:class="formData.deploymentMode === 'non-interactive' ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'"
class="p-6 border rounded-2xl transition-all text-left group hover:bg-slate-800">
class="p-6 border rounded-2xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="font-bold text-lg mb-1" :class="formData.deploymentMode === 'non-interactive' ? 'text-white' : 'text-slate-200 group-hover:text-white'">Non-Interactive</div>
<p class="text-xs transition-colors" :class="formData.deploymentMode === 'non-interactive' ? 'text-white' : 'text-slate-500 group-hover:text-white'">Reuse an existing configuration from a Git repo.</p>
</button>
@@ -428,7 +428,7 @@
<button x-show="formData.users.length <= 5"
@click="formData.remote_access.provider = 'netbird-cloud'"
:class="formData.remote_access.provider === 'netbird-cloud' ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'"
class="p-6 border rounded-2xl transition-all text-left group hover:bg-slate-800 hover:border-slate-600">
class="p-6 border rounded-2xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="flex justify-between items-center mb-2">
<div class="flex items-center gap-4">
<i class="mdi mdi-cloud-outline text-3xl" :class="formData.remote_access.provider === 'netbird-cloud' ? 'text-white' : 'text-sky-400 group-hover:text-white'"></i>
@@ -466,7 +466,7 @@
<!-- Netbird Self-Hosted -->
<button @click="formData.remote_access.provider = 'netbird-selfhosted'"
:class="formData.remote_access.provider === 'netbird-selfhosted' ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'"
class="p-6 border rounded-2xl transition-all text-left group hover:border-fuchsia-500/50 hover:bg-slate-800">
class="p-6 border rounded-2xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="flex items-center gap-3 mb-2">
<i class="mdi mdi-server-network text-3xl" :class="formData.remote_access.provider === 'netbird-selfhosted' ? 'text-white' : 'text-sky-400 group-hover:text-white'"></i>
<div class="font-bold text-xl" :class="formData.remote_access.provider === 'netbird-selfhosted' ? 'text-white' : 'text-slate-200 group-hover:text-white'">Managed On-Premise</div>
@@ -477,7 +477,7 @@
<!-- External -->
<button @click="formData.remote_access.provider = 'external'"
:class="formData.remote_access.provider === 'external' ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'"
class="p-6 border rounded-2xl transition-all text-left group hover:border-fuchsia-500/50 hover:bg-slate-800">
class="p-6 border rounded-2xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="flex items-center gap-3 mb-2">
<i class="mdi mdi-earth text-3xl" :class="formData.remote_access.provider === 'external' ? 'text-white' : 'text-sky-400 group-hover:text-white'"></i>
<div class="font-bold text-xl" :class="formData.remote_access.provider === 'external' ? 'text-white' : 'text-slate-200 group-hover:text-white'">External / Manual Access</div>
@@ -583,7 +583,7 @@
<h3 class="text-lg font-semibold text-fuchsia-400">DNS Filter</h3>
<div class="flex gap-4">
<template x-for="dns in ['pi-hole', 'adguard']" :key="dns">
<button @click="formData.services.dns = dns" :class="formData.services.dns === dns ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'" class="flex-1 p-5 border rounded-xl transition-all text-left group hover:bg-slate-800 hover:border-slate-600">
<button @click="formData.services.dns = dns" :class="formData.services.dns === dns ? 'bg-fuchsia-600/20 border-fuchsia-500' : 'bg-slate-900 border-slate-700'" class="flex-1 p-5 border rounded-xl transition-all text-left group hover:bg-fuchsia-600/20 hover:border-fuchsia-500">
<div class="flex justify-between items-center mb-2">
<div class="flex items-center gap-3">
<img :src="'https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/' + (serviceMetadata[dns].icon || dns) + '.svg'" class="w-6 h-6" :alt="dns">
@@ -599,7 +599,7 @@
<h3 class="text-lg font-semibold text-fuchsia-400 mt-6">Web Applications</h3>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
<template x-for="app in webApps" :key="app">
<label :class="formData.services.apps.includes(app) ? 'border-sky-500 bg-sky-500/10' : 'border-slate-700 bg-slate-900/40'" class="flex flex-col gap-3 p-5 border rounded-xl cursor-pointer transition-all hover:border-sky-400 group relative">
<label :class="formData.services.apps.includes(app) ? 'border-fuchsia-500 bg-fuchsia-600/20' : 'border-slate-700 bg-slate-900/40'" class="flex flex-col gap-3 p-5 border rounded-xl cursor-pointer transition-all hover:bg-fuchsia-600/20 hover:border-fuchsia-500 group relative">
<img :src="'https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/' + (serviceMetadata[app].icon || app) + '.svg'" :class="formData.services.apps.includes(app) ? 'opacity-100' : 'opacity-20 group-hover:opacity-100'" class="w-8 h-8 transition-opacity absolute right-4 top-4" :alt="app">
<div class="flex items-center gap-3">
<input type="checkbox" :value="app" x-model="formData.services.apps" class="w-5 h-5 rounded border-slate-700 text-sky-500 focus:ring-sky-500 bg-slate-800">
@@ -614,7 +614,7 @@
<h3 class="text-lg font-semibold text-fuchsia-400 mt-6">System Services</h3>
<div class="grid grid-cols-2 gap-4">
<template x-for="sys in ['clamav', 'virtualization']" :key="sys">
<label :class="formData.services.system.includes(sys) ? 'border-sky-500 bg-sky-500/10' : 'border-slate-700 bg-slate-900/40'" class="flex flex-col gap-3 p-5 border rounded-xl cursor-pointer transition-all hover:border-sky-400 group">
<label :class="formData.services.system.includes(sys) ? 'border-fuchsia-500 bg-fuchsia-600/20' : 'border-slate-700 bg-slate-900/40'" class="flex flex-col gap-3 p-5 border rounded-xl cursor-pointer transition-all hover:bg-fuchsia-600/20 hover:border-fuchsia-500 group">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<input type="checkbox" :value="sys" x-model="formData.services.system" class="w-5 h-5 rounded border-slate-700 text-sky-500 focus:ring-sky-500 bg-slate-800">
@@ -1131,7 +1131,7 @@
},
async startDiscovery() {
this.updateNavigation();
this.step = 3;
this.step = 4; // Move to waiting room
try {
await fetch('/discovery', {
method: 'POST',
+31 -1
View File
@@ -796,7 +796,7 @@ set -euo pipefail
clear
gum style --align center --width 80 --foreground 212 "
echo "
██████ █████ █████
▒▒██████ ▒▒███ ▒▒███
▒███▒███ ▒███ █████ ████ █████████████ ▒███████ █████ ████ █████
@@ -818,4 +818,34 @@ gum style --align center --width 80 --foreground 212 "
sleep 1
# --- MAIN ORCHESTRATION LOOP ---
# 1. Initialize the UI and Bridge
launch_configurator
# 2. Wait for Live Credentials from the Website
echo -ne "⏳ Waiting for device credentials from web UI..."
while [ ! -f configurator/.discovery_ready ]; do
sleep 1
done
echo -e "\n✅ Credentials received."
# 3. Load Credentials and run Discovery
LIVE_TARGET_IP=$(jq -r '.live_ip' configurator/live_settings.json)
LIVE_TARGET_PASSWD=$(jq -r '.live_password' configurator/live_settings.json)
TARGET_USER="nixos" # Default for NixOS ISO
setup_ssh
hierarchy_preparation
hardware_detection
echo -e "✅ Discovery complete. Hardware data sent to Configurator."
# 4. Wait for Final Configuration Submission
echo -ne "⏳ Waiting for final configuration deployment signal..."
while [ ! -f configurator/.deploy_signal ]; do
sleep 1
done
# 5. Execute Deployment
echo -e "\n🚀 Starting deployment sequence..."
deploy | tee configurator/deploy.log