Handy-Insel Portal: Startseite, Kopfleiste und Authentik-Anbindung
- Portal mit Kacheln aus Authentik (pro Benutzer gefiltert) und "Aktuelles" - Web-Component <hi-topbar> als zentraler App-Umschalter für alle Tools - OIDC-Login über Authentik, zentrales Abmelden - Setup-Skript für Authentik (Gruppen-Bindungen, Portal-App, Service-Account) - Deployment auf den Portal-CT per systemd Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
6606420b4a
43 files changed
+5577
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Baut das Portal lokal und spielt es auf den Portal-CT aus.
|
||||
# ./deploy/deploy.sh [root@192.168.1.28]
|
||||
set -euo pipefail
|
||||
TARGET="${1:-root@192.168.1.28}"
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
rsync -az --delete \
|
||||
--include='/dist/***' --include='/scripts/***' --include='/deploy/***' \
|
||||
--include='/package.json' --include='/package-lock.json' --exclude='*' \
|
||||
./ "$TARGET:/opt/hi-portal/"
|
||||
|
||||
ssh "$TARGET" bash -s <<'REMOTE'
|
||||
set -euo pipefail
|
||||
cd /opt/hi-portal
|
||||
npm ci --omit=dev --no-audit --no-fund
|
||||
chown -R root:root /opt/hi-portal
|
||||
install -m 644 deploy/hi-portal.service /etc/systemd/system/hi-portal.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable hi-portal >/dev/null
|
||||
if grep -q '^OIDC_CLIENT_SECRET=.\+' /etc/hi-portal/portal.env; then
|
||||
systemctl restart hi-portal
|
||||
sleep 2
|
||||
systemctl --no-pager --lines=5 status hi-portal
|
||||
else
|
||||
echo "Hinweis: /etc/hi-portal/portal.env ist noch nicht vollständig – Dienst nicht gestartet."
|
||||
fi
|
||||
REMOTE
|
||||
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Description=Handy-Insel Portal
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=hi-portal
|
||||
Group=hi-portal
|
||||
WorkingDirectory=/opt/hi-portal
|
||||
EnvironmentFile=/etc/hi-portal/portal.env
|
||||
ExecStart=/usr/bin/node dist/server/index.js
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/lib/hi-portal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/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 <<ENV
|
||||
NODE_ENV=production
|
||||
PUBLIC_URL=https://portal.handy-insel.de
|
||||
PORT=3010
|
||||
HOST=0.0.0.0
|
||||
DATA_DIR=/var/lib/hi-portal
|
||||
SESSION_SECRET=$(openssl rand -hex 32 2>/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)"
|
||||
Reference in new issue
Block a user