summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/envoy.sh8
-rwxr-xr-xbin/init.sh3
2 files changed, 9 insertions, 2 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" \
diff --git a/bin/init.sh b/bin/init.sh
index 105c85a..6daf261 100755
--- a/bin/init.sh
+++ b/bin/init.sh
@@ -4,5 +4,6 @@ set -e
[ -n "$DEBUG" ] && set -x
+cd "$(dirname "$0")/.."
echo "[$(date "+%H:%M:%S")] ==> Starting…"
-/usr/local/bin/sparkled & /usr/local/bin/envoy.sh
+./bin/sparkled & ./bin/envoy.sh