Files
kbcrm/NGINX_Server/10-select-ssl.sh
T
gg ef563bad2f NGINX: Dynamische SSL-Konfiguration über Umgebungsvariable
- Aufteilung des NGINX-Templates in kbp_crm.nossl.conf.template (ohne SSL)
  und kbp_crm.ssl.conf.template (mit SSL)
- Neues Skript 10-select-ssl.sh wählt Template zur Laufzeit basierend auf
  NGINX_USE_SSL (true/false)
- Dockerfile: Vorbereitung für dynamische Template-Auswahl
- docker-compose: Template-Verzeichnis auf /etc/nginx/configtemplates geändert,
  NGINX_USE_SSL als Umgebungsvariable hinzugefügt
- .env: NGINX_USE_SSL=true standardmäßig aktiviert

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-11 14:52:08 +02:00

18 lines
640 B
Bash

#!/bin/sh
# Wählt das NGINX-Template abhängig von NGINX_USE_SSL aus.
# Kopiert das passende Template aus dem Staging-Mount (read-only) in das
# container-interne Verzeichnis, das vom envsubst-Skript verarbeitet wird.
# Läuft als 10-… vor dem eingebauten 20-envsubst-on-templates.sh.
src_dir="/etc/nginx/configtemplates"
dst_dir="/etc/nginx/templates"
# Falls noch ein Template aus einem vorherigen Start im dst_dir liegt, entfernen.
rm -f "$dst_dir"/kbp_crm.*.conf.template
if [ "$NGINX_USE_SSL" = "false" ]; then
cp "$src_dir/kbp_crm.nossl.conf.template" "$dst_dir/"
else
cp "$src_dir/kbp_crm.ssl.conf.template" "$dst_dir/"
fi