From d1a0498c5f97297c59399f783e1f2d3d44a3316a Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 4 Sep 2024 12:26:31 +0200 Subject: [PATCH] [RFR-1122] Require OAuth site and callback URL to be set --- collector/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/collector/entrypoint.sh b/collector/entrypoint.sh index edf7e57..03771ba 100644 --- a/collector/entrypoint.sh +++ b/collector/entrypoint.sh @@ -21,8 +21,6 @@ DEFAULT_API_PORT="8080" DEFAULT_OAUTH_TENANT="rfr" DEFAULT_OAUTH_CLIENT="collector" -DEFAULT_OAUTH_CALLBACK="http://localhost:8080/callback" -DEFAULT_OAUTH_SITE="https://auth.cyface.de:8443/realms/{tenant}" DEFAULT_DATABASE_NAME="cyface" JAR_FILE="collector-all.jar" @@ -43,7 +41,8 @@ loadAuthParameters() { CYFACE_AUTH_TYPE="oauth" fi if [ -z "$CYFACE_OAUTH_CALLBACK" ]; then - CYFACE_OAUTH_CALLBACK=$DEFAULT_OAUTH_CALLBACK + echo "Unable to find OAuth callback url. Please set the environment variable CYFACE_OAUTH_CALLBACK to an appropriate value! API will not start!" + exit 1 fi if [ -z "$CYFACE_OAUTH_CLIENT" ]; then CYFACE_OAUTH_CLIENT=$DEFAULT_OAUTH_CLIENT @@ -54,8 +53,9 @@ loadAuthParameters() { exit 1 fi - if [ -z "$CYFACE_OAUTH_SITE" ]; then - CYFACE_OAUTH_SITE=$DEFAULT_OAUTH_SITE + if [ -z "$CYFACE_OAUTH_SITE" ]; thenthen + echo "Unable to find OAuth site url. Please set the environment variable CYFACE_OAUTH_SITE to an appropriate value! API will not start!" + exit 1 fi if [ -z "$CYFACE_OAUTH_TENANT" ]; then CYFACE_OAUTH_TENANT=$DEFAULT_OAUTH_TENANT