Add web setup UI for first-boot config
- server.py: Flask-free Python web server on port 80 - 4-step wizard: network → tier → tools → live install log - DHCP or static IP support - SSE log streaming, handles phase-1 reboot gracefully - user-data: deploy web UI service instead of TUI (whiptail) - sets hostname to cezenai (accessible as cezenai.local) - installs python3, avahi-daemon - entry.yml: skip roles based on skip_roles var from web UI - install.sh: reads /opt/cezen/install.conf for tier & skip_roles
This commit is contained in:
1 parent
a1948d93fe
commit
1991307903
4 files changed
+717
-28
No files matched your search
+20
-17
@@ -8,7 +8,7 @@ autoinstall:
|
||||
layout: us
|
||||
|
||||
# ── Network: DHCP on first ethernet ───────────
|
||||
# Final network config is set by firstboot-setup.sh wizard
|
||||
# Final network config is set by the web setup UI (browser on port 80)
|
||||
network:
|
||||
network:
|
||||
version: 2
|
||||
@@ -46,8 +46,10 @@ autoinstall:
|
||||
- git
|
||||
- curl
|
||||
- wget
|
||||
- whiptail
|
||||
- net-tools
|
||||
- python3
|
||||
- python3-pip
|
||||
- avahi-daemon
|
||||
|
||||
# ── Late commands ─────────────────────────────
|
||||
late-commands:
|
||||
@@ -62,35 +64,36 @@ autoinstall:
|
||||
# Clone the Cezen AI installer
|
||||
- git clone https://cgit.cezentech.com/jinojose/aipackage.git /target/opt/aipackage || true
|
||||
|
||||
# Deploy the firstboot setup wizard
|
||||
- cp /target/opt/aipackage/autoinstall/firstboot-setup.sh /target/opt/cezen-setup.sh
|
||||
- chmod +x /target/opt/cezen-setup.sh
|
||||
# Deploy the web setup server
|
||||
- mkdir -p /target/opt/cezen
|
||||
- cp /target/opt/aipackage/autoinstall/websetup/server.py /target/opt/cezen/websetup.py
|
||||
- chmod +x /target/opt/cezen/websetup.py
|
||||
|
||||
# Create firstboot systemd service (runs the TUI wizard on first login)
|
||||
# Set hostname to cezenai so it's reachable as cezenai.local via mDNS
|
||||
- echo "cezenai" > /target/etc/hostname
|
||||
- sed -i 's/aiserver/cezenai/g' /target/etc/hosts || true
|
||||
|
||||
# Create cezen-setup web UI systemd service
|
||||
- |
|
||||
cat > /target/etc/systemd/system/cezen-setup.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Cezen AI Suite Setup Wizard
|
||||
After=network-online.target getty@tty1.service
|
||||
Description=Cezen AI Suite — Web Setup UI
|
||||
After=network-online.target avahi-daemon.service
|
||||
Wants=network-online.target
|
||||
ConditionPathExists=!/opt/cezen/.setup-done
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash /opt/cezen-setup.sh
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
StandardError=tty
|
||||
TTYPath=/dev/tty1
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
RemainAfterExit=yes
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /opt/cezen/websetup.py
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
- curtin in-target -- systemctl enable cezen-setup.service
|
||||
- curtin in-target -- systemctl enable avahi-daemon.service
|
||||
|
||||
# ── Skip confirmations ─────────────────────────
|
||||
user-data:
|
||||
|
||||
Reference in new issue
Block a user