Refactor: Use heredoc when creating env files and creds/other (#15469)

* Use heredoc

* Fixes
This commit is contained in:
Slaviša Arežina
2026-06-30 13:01:18 +02:00
committed by GitHub
parent 02bbb774c9
commit 4d56173394
65 changed files with 418 additions and 424 deletions
+5 -6
View File
@@ -58,12 +58,11 @@ function update_script() {
-e 's/^NODE_/APP_/' \
-e '/^SERVER_*/d' \
-e '/^# API*/,+2d' /opt/patchmon/.env
{
echo ""
echo "SESSION_SECRET=$(openssl rand -hex 64)"
echo "AI_ENCRYPTION_KEY=$(openssl rand -hex 64)"
echo "AGENT_BINARIES_DIR=/opt/patchmon/agents"
} >>/opt/patchmon/.env
cat <<EOF >/opt/patchmon/.env
SESSION_SECRET=$(openssl rand -hex 64)
AI_ENCRYPTION_KEY=$(openssl rand -hex 64)
AGENT_BINARIES_DIR=/opt/patchmon/agents
EOF
sed -i -e '\|Directory|s|/backend||' \
-e 's|^ExecStart=.*|ExecStart=/opt/patchmon/patchmon-server|' \
-e 's|^Environment=NODE_.*|EnvironmentFile=/opt/patchmon/.env|' \