Änderung der werbung
All checks were successful
Deploy SingleChat / deploy (push) Successful in 26s

This commit is contained in:
Torsten Schulz (local)
2026-06-18 08:33:42 +02:00
parent 0c6ab5727f
commit 62f5914b04
7 changed files with 274 additions and 568 deletions

View File

@@ -141,11 +141,17 @@ fi
log "Synchronisiere .env mit Vorlage"
session_secret="$(openssl rand -hex 32)"
if [ -f "$APP_DIR/.env" ]; then
env_backup_path="$APP_DIR/.env.bak"
cp -a "$APP_DIR/.env" "$env_backup_path"
log "Backup der bisherigen .env erstellt: $env_backup_path"
fi
"$ENV_MERGE_SCRIPT" "$ENV_TEMPLATE" "$APP_DIR/.env" "$session_secret"
if [ "$(id -u)" -eq 0 ]; then
chown "$RUN_USER:$RUN_GROUP" "$APP_DIR/.env"
fi
chmod 640 "$APP_DIR/.env"
log "Baue Client"
run_as_deploy_user npm run build

View File

@@ -19,6 +19,11 @@ fi
tmp_output="$(mktemp)"
trap 'rm -f "$tmp_output"' EXIT
target_mode="640"
if [ -f "$env_file" ]; then
target_mode="$(stat -c '%a' "$env_file" 2>/dev/null || printf '640')"
fi
if [ -f "$env_file" ]; then
awk '
function key_from(line, key) {
@@ -74,4 +79,5 @@ if [ -n "$session_secret" ] && grep -q '^SESSION_SECRET=$' "$tmp_output"; then
sed -i "s/^SESSION_SECRET=$/SESSION_SECRET=$session_secret/" "$tmp_output"
fi
mv "$tmp_output" "$env_file"
cat "$tmp_output" > "$env_file"
chmod "$target_mode" "$env_file"