fix: improve portal stability, proxy security and frontend consistency v1.5.73

* security: add verified central client IP resolution with regression tests

* security: add verified central client IP resolution with regression tests

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix(stability): standardize request identity, readiness and predictable build

* fix: remove unused network imports after centralized IP handling

* fix: remove unused network imports after centralized IP handling

* fix: buffer public templates before responding and return HTTP 500 on render failures

* fix: cancel now-playing polling on graceful shutdown

* fix: join now-playing background worker before shutdown

* fix(deploy): ensure rollback on failed restart or wrong version

* fix(frontend): update public pages to app-v18 player and consent script (part 1)

* fix(frontend): update public pages to app-v18 player and consent script (part 2)

* fix(frontend): update public pages to app-v18 player and consent script (part 3)

* test: verify atomic public templates and consistent player JavaScript

* test: require Landwelle v1.5.73

* ci: validate frontend scripts and deployment shell syntax

* docs: document v1.5.73 changes, proxy setup and remaining architecture work

* docs: record Landwelle v1.5.73 quality release

* fix(charts): remove obsolete strings import after IP resolver refactor

* test(frontend): assert consent-aware analytics uses current app-v18.js
This commit is contained in:
OpenGenesis (MPL 2.0) authored and GitHub committed 2026-10-21 13:36:18 +02:00
1 parent 519ec0a1c5
commit 1831e499c8
45 files changed
+323 -121

No files matched your search

-3
View File
@@ -21,9 +21,6 @@ done <<<"$CONTENT_PAGE_SLUGS"
# Alte Build-Artefakte vor einem neuen Build entfernen. So kann ein fehlgeschlagener
# Build niemals versehentlich ein altes Portal-Binary für das Update stehen lassen.
rm -f "$ROOT_DIR/dist/landwelle-portal-linux-arm64" "$ROOT_DIR/dist/landwelle-adminpass-linux-arm64"
# Das Firebase-Quellupdate kann auf älteren Installationen ohne vollständige
# go.sum liegen. Tidy ergänzt reproduzierbar die benötigten Modulprüfsummen.
go mod tidy
go mod download
go mod verify
COMMIT="$(git rev-parse --short=12 HEAD 2>/dev/null || printf unknown)"
+63 -23
View File
@@ -46,17 +46,67 @@ fi
install -d -o root -g root -m 755 "$TARGET_DIR"
install -d -o landwelle -g landwelle -m 750 /var/lib/landwelle
BACKUP_BINARY=""
BACKUP_SERVICE=""
BACKUP_ADMINPASS=""
STAMP="$(date +%Y%m%d-%H%M%S)"
if [[ -f "$TARGET_BINARY" ]]; then
BACKUP_BINARY="$TARGET_BINARY.backup-$STAMP"
cp -a "$TARGET_BINARY" "$BACKUP_BINARY"
fi
if [[ -f "$TARGET_SERVICE" ]]; then
BACKUP_SERVICE="$TARGET_SERVICE.backup-$STAMP"
cp -a "$TARGET_SERVICE" "$BACKUP_SERVICE"
fi
if [[ -f "$TARGET_DIR/landwelle-adminpass" ]]; then
BACKUP_ADMINPASS="$TARGET_DIR/landwelle-adminpass.backup-$STAMP"
cp -a "$TARGET_DIR/landwelle-adminpass" "$BACKUP_ADMINPASS"
fi
DEPLOY_STARTED=0
rollback_if_needed() {
result=$?
trap - EXIT
if [[ "$result" -ne 0 && "$DEPLOY_STARTED" -eq 1 ]]; then
echo "Update fehlgeschlagen (Exit-Code $result). Starte automatisches Rollback." >&2
set +e
systemctl stop "$SERVICE"
if [[ -n "$BACKUP_BINARY" && -f "$BACKUP_BINARY" ]]; then
install -o root -g root -m 755 "$BACKUP_BINARY" "$TARGET_BINARY"
else
rm -f "$TARGET_BINARY"
fi
if [[ -n "$BACKUP_ADMINPASS" && -f "$BACKUP_ADMINPASS" ]]; then
install -o root -g root -m 755 "$BACKUP_ADMINPASS" "$TARGET_DIR/landwelle-adminpass"
fi
if [[ -n "$BACKUP_SERVICE" && -f "$BACKUP_SERVICE" ]]; then
install -o root -g root -m 644 "$BACKUP_SERVICE" "$TARGET_SERVICE"
else
rm -f "$TARGET_SERVICE"
fi
rm -f "$TARGET_BINARY.new"
systemctl daemon-reload
if [[ -n "$BACKUP_BINARY" && -f "$BACKUP_BINARY" ]]; then
systemctl start "$SERVICE"
if curl -fsS --max-time 5 http://127.0.0.1:2200/ready >/dev/null 2>&1; then
echo "Rollback erfolgreich: vorherige Version ist wieder bereit." >&2
else
echo "ACHTUNG: Vorherige Version ist noch nicht bereit. Bitte 'journalctl -u landwelle-radio' prüfen." >&2
fi
else
echo "ACHTUNG: Kein vorheriges Portal-Binary vorhanden. Manueller Eingriff erforderlich." >&2
fi
fi
exit "$result"
}
trap rollback_if_needed EXIT
DEPLOY_STARTED=1
if [[ -f "$SOURCE_SERVICE" ]]; then
install -o root -g root -m 644 "$SOURCE_SERVICE" "$TARGET_SERVICE"
systemctl daemon-reload
fi
BACKUP_BINARY=""
if [[ -f "$TARGET_BINARY" ]]; then
BACKUP_BINARY="$TARGET_BINARY.backup-$(date +%Y%m%d-%H%M%S)"
cp -a "$TARGET_BINARY" "$BACKUP_BINARY"
fi
systemctl stop "$SERVICE"
install -o root -g root -m 755 "$SOURCE_BINARY" "$TARGET_BINARY.new"
mv -f "$TARGET_BINARY.new" "$TARGET_BINARY"
@@ -64,13 +114,14 @@ install -o root -g root -m 755 "$SOURCE_ADMINPASS" "$TARGET_DIR/landwelle-adminp
systemctl start "$SERVICE"
for _ in {1..20}; do
if curl -fsS http://127.0.0.1:2200/ready >/dev/null 2>&1; then
ACTIVE_VERSION="$(curl -fsS http://127.0.0.1:2200/version 2>/dev/null | tr -d '\r\n' || true)"
if curl -fsS --max-time 5 http://127.0.0.1:2200/ready >/dev/null 2>&1; then
ACTIVE_VERSION="$(curl -fsS --max-time 5 http://127.0.0.1:2200/version 2>/dev/null | tr -d '\r\n' || true)"
if [[ "$ACTIVE_VERSION" != "$EXPECTED_VERSION" ]]; then
echo "Versionsprüfung fehlgeschlagen: erwartet $EXPECTED_VERSION, aktiv ${ACTIVE_VERSION:-unbekannt}" >&2
journalctl -u "$SERVICE" -n 80 --no-pager >&2
echo "Versionsprüfung fehlgeschlagen: erwartet $EXPECTED_VERSION, aktiv $(printf '%s' "$ACTIVE_VERSION")" >&2
journalctl -u "$SERVICE" -n 80 --no-pager >&2 || true
exit 1
fi
DEPLOY_STARTED=0
echo "$ACTIVE_VERSION ist aktiv: http://127.0.0.1:2200"
if ! grep -qE '^LANDWELLE_ADMIN_PASSWORD(_HASH)?=' /etc/landwelle/landwelle.env 2>/dev/null; then
echo "Adminzugang noch einrichten: sudo ./scripts/setup-admin-on-pi.sh"
@@ -80,17 +131,6 @@ for _ in {1..20}; do
sleep 1
done
echo "Readiness-Check fehlgeschlagen. Starte automatisches Rollback." >&2
journalctl -u "$SERVICE" -n 80 --no-pager >&2
if [[ -n "$BACKUP_BINARY" && -f "$BACKUP_BINARY" ]]; then
systemctl stop "$SERVICE" || true
install -o root -g root -m 755 "$BACKUP_BINARY" "$TARGET_BINARY"
systemctl start "$SERVICE"
sleep 2
if curl -fsS http://127.0.0.1:2200/ready >/dev/null 2>&1; then
echo "Rollback erfolgreich: $BACKUP_BINARY" >&2
else
echo "Rollback konnte den Dienst nicht wiederherstellen." >&2
fi
fi
echo "Readiness-Check fehlgeschlagen." >&2
journalctl -u "$SERVICE" -n 80 --no-pager >&2 || true
exit 1