- Enhanced .env.example with new variables for PUBLIC_HOST, SECURE, and SUITE_ORIGIN to streamline environment setup. - Updated Authentik blueprints to utilize the new configuration variables for redirect URIs and launch URLs. - Introduced a new script to render Authentik blueprint templates dynamically based on environment variables. - Modified docker-compose files to reference the updated environment variables for better maintainability. - Improved expose.sh script to derive public URLs from the new configuration, ensuring consistency across deployments.
28 lines
755 B
Bash
Executable File
28 lines
755 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Render Authentik blueprint templates using PUBLIC_HOST / SECURE / SUITE_ORIGIN from .env.resolved.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
BP_DIR="$ROOT/deploy/authentik/blueprints"
|
|
|
|
if [[ -z "${SUITE_ORIGIN:-}" || -z "${PUBLIC_HOST:-}" ]]; then
|
|
echo "render-blueprints: SUITE_ORIGIN and PUBLIC_HOST must be set (source .env.resolved first)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
render_one() {
|
|
local tpl="$1"
|
|
local out="${tpl%.template}"
|
|
sed \
|
|
-e "s|{{SUITE_ORIGIN}}|${SUITE_ORIGIN}|g" \
|
|
-e "s|{{PUBLIC_HOST}}|${PUBLIC_HOST}|g" \
|
|
-e "s|{{SECURE}}|${SECURE:-}|g" \
|
|
"$tpl" > "$out"
|
|
echo "render-blueprints: ${out##*/}"
|
|
}
|
|
|
|
shopt -s nullglob
|
|
for tpl in "$BP_DIR"/*.yaml.template; do
|
|
render_one "$tpl"
|
|
done
|