refactor(installer): KISS — remove all flags, just interactive deploy

This commit is contained in:
Claus Lohmar 2026-06-14 16:03:33 +00:00
parent d29ecf41ef
commit 3b4fd6a84c
2 changed files with 3 additions and 63 deletions

View file

@ -98,22 +98,8 @@ cd ../app && ./core
The server starts on `http://localhost:8080` with:
- **Workspace launcher**: `http://localhost:8080/` (OIDC-protected)
- **Admin panel**: `http://localhost:8080/admin` (bearer token)
- **Admin panel**: `http://localhost:8080/admin`
- **Health API**: `http://localhost:8080/api/health`
- **Auth status**: `http://localhost:8080/auth/status`
### Production Install
```bash
# Full install (build → test → deploy → systemd → smoke test)
sudo ./install.sh
sudo ./install.sh --status
sudo ./install.sh --uninstall
sudo ./install.sh --build-only # Compile only
sudo ./install.sh --skip-build # Install existing binary
sudo ./install.sh --config-only # Generate config only
sudo ./install.sh --help # Show all options
```
### Run Tests

View file

@ -1,14 +1,6 @@
#!/bin/bash
# ============================================================
# Next Workspace (NextWks) — Installer
#
# curl -fsSL https://git.lohmar.co.uk/lexton-it/NextWks/raw/main/install.sh | bash
#
# Usage:
# ./install.sh Full interactive install
# ./install.sh --from-env Load answers from .env
# ./install.sh --status Check installation health
# ./install.sh --uninstall Remove everything
# ============================================================
set -euo pipefail
@ -92,46 +84,8 @@ fi
# ============================================================
# PARSE FLAGS
# ============================================================
MODE="install"
FROM_ENV=false
for arg in "$@"; do
case "$arg" in
--from-env) FROM_ENV=true ;;
--status) MODE="status" ;;
--uninstall) MODE="uninstall" ;;
--help)
head -20 "$0" | grep "^#" | sed 's/^# //; 1s/.*/NextWks Installer/'
exit 0 ;;
*) error "Unknown: $arg (use --help)"; exit 1 ;;
esac
done
# ============================================================
# UNINSTALL
# ============================================================
if [ "$MODE" = "uninstall" ]; then
info "Uninstalling Next Workspace..."
$SUDO systemctl stop nextwks 2>/dev/null || true
$SUDO systemctl disable nextwks 2>/dev/null || true
$SUDO rm -f "$SERVICE_FILE"
$SUDO systemctl daemon-reload
[ -d "$INSTALL_DIR" ] && { $SUDO rm -rf "$INSTALL_DIR"; success "Removed $INSTALL_DIR"; }
success "Uninstall complete"
exit 0
fi
# ============================================================
# STATUS
# ============================================================
if [ "$MODE" = "status" ]; then
echo ""; header "Next Workspace Status"
[ -f "${BIN_DIR}/core" ] && success "✓ Binary: ${BIN_DIR}/core" || warn "✗ Binary: not found"
[ -f "$CONFIG_FILE" ] && success "✓ Config: $CONFIG_FILE" || warn "✗ Config: not found"
$SUDO systemctl is-active --quiet nextwks 2>/dev/null && success "✓ Service: running" || info " Service: stopped"
$SUDO systemctl is-active --quiet authelia 2>/dev/null && success "✓ Authelia: running" || info " Authelia: stopped"
command -v curl &>/dev/null && [ "$(curl -s --max-time 2 http://localhost:8080/api/health 2>/dev/null)" = '{"status":"ok"}' ] && success "✓ API: OK" || info " API: not responding"
echo ""; exit 0
fi
[ "${1:-}" = "--from-env" ] && FROM_ENV=true
# ============================================================
# INTERACTIVE WIZARD
@ -217,7 +171,7 @@ ENVEOF
success "Settings saved to $ENV_FILE"
}
[ "$MODE" = "install" ] && gather_inputs
gather_inputs
# Derive domains from URLs (needed even when --from-env)
NEXTWKS_DOMAIN=$(echo "$NEXTWKS_URL" | sed 's|https\?://||;s|/.*||')