Skip to content

Commit

Permalink
feat: add iam env var
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbousquet committed Feb 9, 2023
1 parent d0df82c commit 9dc0321
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
32 changes: 32 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,38 @@ fi
envsubst '$ARLAS_AUTHENT_CUSTOM_QUERY_PARAMS' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp
mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml

### ARLAS_AUTHENT_MODE
if [ -z "${ARLAS_AUTHENT_MODE}" ]; then
ARLAS_AUTHENT_MODE='iam'
export ARLAS_AUTHENT_MODE
echo "Default auth.mod: 'iam' "
else
echo ${ARLAS_AUTHENT_MODE} "is used for 'authentication.auth_mode'. Default value is 'iam'"
fi
envsubst '$ARLAS_AUTHENT_MODE' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp
mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml

### THRESHOLD
if [ -z "${ARLAS_AUTHENT_THRESHOLD}" ]; then
ARLAS_AUTHENT_THRESHOLD=60000
export ARLAS_AUTHENT_THRESHOLD
echo "Default threshold: 60000"
else
echo ${ARLAS_AUTHENT_THRESHOLD} "is used for 'authentication.threshold'. Default value is '60000'"
fi
envsubst '$ARLAS_AUTHENT_THRESHOLD' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp
mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml

### ARLAS_IAM_SERVER_URL
if [ -z "${ARLAS_IAM_SERVER_URL}" ]; then
ARLAS_IAM_SERVER_URL="http://localhost:9997"
export ARLAS_IAM_SERVER_URL
echo "Default url : http://localhost:9997"
else
echo ${ARLAS_IAM_SERVER_URL} "is used for 'authentication.url'."
fi
envsubst '$ARLAS_IAM_SERVER_URL' < /usr/share/nginx/html/settings.yaml > /usr/share/nginx/html/settings.yaml.tmp
mv /usr/share/nginx/html/settings.yaml.tmp /usr/share/nginx/html/settings.yaml

### Array of statics links
if [ -z "${ARLAS_STATIC_LINKS}" ]; then
Expand Down
9 changes: 6 additions & 3 deletions src/environments/prod/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
########################################################
authentication:
use_authent: ${ARLAS_USE_AUTHENT}
force_connect: ${ARLAS_AUTHENT_FORCE_CONNECT}
use_discovery: ${ARLAS_AUTHENT_USE_DISCOVERY}
auth_mode: ${ARLAS_AUTHENT_MODE}
force_connect: false
use_discovery: false
threshold: ${ARLAS_AUTHENT_THRESHOLD}
url: ${ARLAS_IAM_SERVER_URL}
issuer: ${ARLAS_AUTHENT_ISSUER}
client_id: ${ARLAS_AUTHENT_CLIENT_ID}
redirect_uri: ${ARLAS_AUTHENT_REDIRECT_URI}
Expand Down Expand Up @@ -36,4 +39,4 @@ ticketing_key: ${ARLAS_TICKETING_KEY}
tab_name: ${ARLAS_TAB_NAME}
histogram:
max_buckets: ${ARLAS_HISTOGRAMS_MAX_BUCKETS}
export_nb_buckets: ${ARLAS_EXPORT_HISTOGRAMS_NB_BUCKETS}
export_nb_buckets: ${ARLAS_EXPORT_HISTOGRAMS_NB_BUCKETS}

0 comments on commit 9dc0321

Please sign in to comment.