#!/usr/bin/env bash # Einmalige Einrichtung des Portal-CT (Debian 13). Auf dem CT als root ausführen. set -euo pipefail apt-get update -qq apt-get install -y -qq nodejs npm rsync python3 ca-certificates >/dev/null id hi-portal >/dev/null 2>&1 || useradd --system --home /var/lib/hi-portal --shell /usr/sbin/nologin hi-portal install -d -o hi-portal -g hi-portal -m 750 /var/lib/hi-portal install -d -m 755 /opt/hi-portal install -d -m 750 /etc/hi-portal if [ ! -f /etc/hi-portal/portal.env ]; then cat > /etc/hi-portal/portal.env </dev/null || head -c 32 /dev/urandom | xxd -p -c 64) OIDC_ISSUER=https://login.handy-insel.de/application/o/portal/ OIDC_CLIENT_ID= OIDC_CLIENT_SECRET= AUTHENTIK_URL=https://login.handy-insel.de AUTHENTIK_TOKEN= EDITOR_GROUPS=HI-Admin,HI-Leitung ALLOWED_DOMAINS=handy-insel.de ENV chmod 640 /etc/hi-portal/portal.env chgrp hi-portal /etc/hi-portal/portal.env fi echo "CT eingerichtet. Node: $(node -v)"