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

@@ -152,6 +152,7 @@ Alle Einstellungen lassen sich per Umgebungsvariable vor dem Aufruf setzen
| `REPO_URL` | Git-Repo, das geklont wird | `.../ethiele/linkvault.git` | | `REPO_URL` | Git-Repo, das geklont wird | `.../ethiele/linkvault.git` |
| `APP_PORT` | Port, auf dem uvicorn lauscht | `8000` | | `APP_PORT` | Port, auf dem uvicorn lauscht | `8000` |
| `GIT_TOKEN` | Gitea Access Token (nur bei privatem Repo) | | | `GIT_TOKEN` | Gitea Access Token (nur bei privatem Repo) | |
| `TIMEZONE` | Zeitzone des Containers (`timedatectl`) | `Europe/Berlin` |
Beispiel mit statischer IP und fester Container-ID: Beispiel mit statischer IP und fester Container-ID:

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