Skip to content
Snippets Groups Projects
Verified Commit 1d759450 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

(automatically) add URL-encoded version of smtp password to cluster secrets

parent b12d4960
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ data:
base_url: https://sso.${domain}/api/
courier:
smtp:
connection_uri: smtp://${outgoing_mail_smtp_user}:${outgoing_mail_smtp_password}@${outgoing_mail_smtp_host}:${outgoing_mail_smtp_port}/
connection_uri: smtp://${outgoing_mail_smtp_user}:${outgoing_mail_smtp_password_urlencoded}@${outgoing_mail_smtp_host}:${outgoing_mail_smtp_port}/
from_address: ${outgoing_mail_from_address}
secrets:
session:
......
......@@ -5,6 +5,12 @@ set -euo pipefail
# shellcheck source=install/flux-version-check.sh
. "$(dirname "$0")/flux-version-check.sh"
# Check if stackspin-cluster-variables secret exists
smtp_password=$(kubectl get secret -n flux-system stackspin-cluster-variables --template '{{.data.outgoing_mail_smtp_password}}' | base64 -d)
smtp_password_urlencoded=$(python -c "import urllib.parse; print(urllib.parse.quote('${smtp_password}', safe=''), end='')" | base64 -w0)
# Add url-encoded version of password to the cluster
kubectl patch secret -n flux-system stackspin-cluster-variables -p "{\"data\": {\"outgoing_mail_smtp_password_urlencoded\": \"${smtp_password_urlencoded}\"}}"
flux install \
--network-policy=false \
--watch-all-namespaces=true \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment