Set container timezone during Proxmox install

Debian LXC templates default to UTC, which made the "hinzugefügt am"
timestamps and export filenames look wrong. Add a TIMEZONE variable
(default Europe/Berlin) applied via timedatectl during install, and
document it in the README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Erik Thiele
2026-07-30 15:51:45 +02:00
parent cfcdf9a667
commit 1a1b6fd896
2 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ CT_PASSWORD="${CT_PASSWORD:-}" # leer = zufällig generiert
REPO_URL="${REPO_URL:-https://gitea.teamthiele.de/ethiele/linkvault.git}"
APP_PORT="${APP_PORT:-8000}"
GIT_TOKEN="${GIT_TOKEN:-}" # Gitea Access Token, falls Repo privat ist
TIMEZONE="${TIMEZONE:-Europe/Berlin}" # wirkt sich auf die angezeigten Datumsangaben aus
# ---------------------------------------------------------------------------
# Vorbedingungen
@@ -50,6 +51,7 @@ echo "==> Container-ID: $CTID"
echo "==> Hostname: $CT_HOSTNAME"
echo "==> Storage (RootFS): $CT_STORAGE"
echo "==> Netzwerk: $CT_BRIDGE / $CT_IP"
echo "==> Zeitzone: $TIMEZONE"
# ---------------------------------------------------------------------------
# Debian-12-Template sicherstellen
@@ -114,6 +116,8 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install -y -qq git python3 python3-venv python3-pip build-essential curl >/dev/null
timedatectl set-timezone '${TIMEZONE}' || echo 'Warnung: Zeitzone ${TIMEZONE} konnte nicht gesetzt werden.'
if [ ! -d /opt/linkvault ]; then
if [ -n '${GIT_TOKEN}' ]; then
git -c http.extraHeader=\"Authorization: token ${GIT_TOKEN}\" clone --quiet '${REPO_URL}' /opt/linkvault