feat: add Feature Manager to Sovran Hub dashboard
- flake.nix: import /etc/nixos/hub-overrides.nix alongside custom.nix - sovran-hub.nix: add hub-overrides-init service (seeds file if missing), sovran-hub-rebuild service (nixos-rebuild switch only), and feature_manager=true in generated config.json - server.py: add FEATURE_REGISTRY with 6 features (rdp, haven, element-calling, mempool, bip110, bitcoin-core); add hub-overrides.nix read/write helpers; add /api/features, /api/features/toggle, /api/rebuild/status, /api/domains/set, /api/domains/set-email, /api/domains/status endpoints; update /api/config to expose feature_manager - index.html: add domain setup modal, SSL email modal, feature confirm modal, and rebuild modal HTML - app.js: add Feature Manager rendering with sub-category layout, feature toggle cards with sliding toggles, domain setup flow, SSL email collection, conflict confirmation, rebuild polling - style.css: add Feature Manager styles (feature cards, toggle switch, domain badge, conflict warning, domain input fields)" Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/9088415a-efc3-4dd1-9c22-877a543af47b Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
971b0797df
commit
b9c8c20347
@@ -99,6 +99,7 @@ let
|
||||
command_method = "systemctl";
|
||||
role = activeRole;
|
||||
services = monitoredServices;
|
||||
feature_manager = true;
|
||||
});
|
||||
|
||||
# ── Update wrapper script ──────────────────────────────────────
|
||||
@@ -159,6 +160,39 @@ let
|
||||
exit "$RC"
|
||||
'';
|
||||
|
||||
# ── Rebuild wrapper script ─────────────────────────────────────
|
||||
rebuild-script = pkgs.writeShellScript "sovran-hub-rebuild.sh" ''
|
||||
set -uo pipefail
|
||||
export PATH="${lib.makeBinPath [ pkgs.nix pkgs.nixos-rebuild pkgs.coreutils ]}:$PATH"
|
||||
|
||||
LOG="/var/log/sovran-hub-rebuild.log"
|
||||
STATUS="/var/log/sovran-hub-rebuild.status"
|
||||
|
||||
echo "RUNNING" > "$STATUS"
|
||||
: > "$LOG"
|
||||
exec > >(tee -a "$LOG") 2>&1
|
||||
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo " Sovran_SystemsOS Rebuild — $(date)"
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "── Rebuilding system configuration ──────────────"
|
||||
if nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1; then
|
||||
echo ""
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo " ✓ Rebuild completed successfully"
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo "SUCCESS" > "$STATUS"
|
||||
else
|
||||
echo ""
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo " ✗ Rebuild failed — see errors above"
|
||||
echo "══════════════════════════════════════════════════"
|
||||
echo "FAILED" > "$STATUS"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
sovran-hub-web = pkgs.python3Packages.buildPythonApplication {
|
||||
pname = "sovran-systemsos-hub-web";
|
||||
version = "1.0.0";
|
||||
@@ -241,6 +275,32 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.sovran-hub-rebuild = {
|
||||
description = "Sovran_SystemsOS System Rebuild";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${rebuild-script}";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.hub-overrides-init = {
|
||||
description = "Initialize hub-overrides.nix if missing";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
unitConfig.ConditionPathExists = "!/etc/nixos/hub-overrides.nix";
|
||||
script = ''
|
||||
cat > /etc/nixos/hub-overrides.nix <<'EOF'
|
||||
# Auto-generated by Sovran Hub — do not edit manually
|
||||
{ ... }:
|
||||
{
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 8937 ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user