summaryrefslogtreecommitdiff
path: root/bin/envoy.sh
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-12 13:40:49 -0600
committermo khan <mo@mokhan.ca>2025-05-12 13:40:49 -0600
commit4bd72e131c7db3093c7bd4236a5d2319462fcbad (patch)
tree677e48ca90cefa3da7c71cd568341a67d09d4c16 /bin/envoy.sh
parent251539d40e89b3bc91dea14ed6afb311788962df (diff)
chore: mimic how services are run between docker and host machine
Diffstat (limited to 'bin/envoy.sh')
-rwxr-xr-xbin/envoy.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/envoy.sh b/bin/envoy.sh
index a123c62..8690bd1 100755
--- a/bin/envoy.sh
+++ b/bin/envoy.sh
@@ -2,10 +2,11 @@
set -e
[ -n "$DEBUG" ] && set -x
+cd "$(dirname "$0")/.."
oidc_scheme=$(echo "$OIDC_ISSUER" | awk -F[/:] '{print $1}')
oidc_host=$(echo "$OIDC_ISSUER" | awk -F[/:] '{print $4}')
-yaml=$(sed -e "s/OAUTH_CLIENT_ID/$OAUTH_CLIENT_ID/" /etc/envoy/envoy.yaml)
+yaml=$(sed -e "s/OAUTH_CLIENT_ID/$OAUTH_CLIENT_ID/" etc/envoy/envoy.yaml)
yaml=$(echo "$yaml" | sed -e "s,https://example.com,$OIDC_ISSUER,")
yaml=$(echo "$yaml" | sed -e "s/example.com/$oidc_host/")
@@ -26,6 +27,11 @@ if [ -z "$HMAC_SESSION_SECRET" ]; then
export HMAC_SESSION_SECRET="$OAUTH_CLIENT_SECRET"
fi
+if ! command -v envoy; then
+ echo "envoy could not be found"
+ exit 1
+fi
+
echo "[$(date "+%H:%M:%S")] ==> Starting…"
envoy \
--config-yaml "$yaml" \