style(config): auto-sync rules and mcp configuration
This commit is contained in:
parent
d28a3b2676
commit
8a531d0b4c
1 changed files with 31 additions and 0 deletions
31
templates/pull_secrets_template.sh
Normal file
31
templates/pull_secrets_template.sh
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
# pull_secrets_template.sh
|
||||
# Template für Methode B: Dynamischer Pull von Secrets auf einer VM/Host ohne MacBook.
|
||||
#
|
||||
# Voraussetzungen:
|
||||
# 1. Infisical CLI auf der VM/Host installiert.
|
||||
# 2. Eine Machine Identity in Infisical erstellt und für das Projekt freigegeben.
|
||||
# 3. Client ID und Client Secret in der Umgebung bereitgestellt.
|
||||
|
||||
set -e
|
||||
|
||||
# Konfiguration
|
||||
INFISICAL_API_URL="https://zitate.info.lu/api"
|
||||
CLIENT_ID="${INFISICAL_CLIENT_ID:-your-client-id}"
|
||||
CLIENT_SECRET="${INFISICAL_CLIENT_SECRET:-your-client-secret}"
|
||||
SECRET_PATH="/jmap-proxy" # Zielpfad im Infisical-Vault
|
||||
ENV_OUTPUT="/opt/jmap-proxy/.env"
|
||||
|
||||
if [ "$CLIENT_ID" = "your-client-id" ] || [ "$CLIENT_SECRET" = "your-client-secret" ]; then
|
||||
echo "❌ Fehler: Bitte passe CLIENT_ID und CLIENT_SECRET an!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== 1. Hole temporären Access Token via Universal Auth ==="
|
||||
export INFISICAL_API_URL
|
||||
export INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --silent --plain)
|
||||
|
||||
echo "=== 2. Exportiere Secrets direkt in lokale Konfigurationsdatei ==="
|
||||
infisical export --path "$SECRET_PATH" --env=prod --format=dotenv --silent > "$ENV_OUTPUT"
|
||||
|
||||
echo "=== Secrets erfolgreich bezogen und nach $ENV_OUTPUT geschrieben! ==="
|
||||
Loading…
Reference in a new issue