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