From ead0a06f0c0e8693b7f0e4c219649f02fda7c165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kr=C3=BCger?= Date: Wed, 2 Feb 2022 10:12:54 +0100 Subject: [PATCH] Set custom hostname for local agent credentials (#1229) * Set custom hostname for local agent credentials --- docker/README.md | 1 + docker/docker_start.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/README.md b/docker/README.md index 0173e8c99..3748b9c91 100644 --- a/docker/README.md +++ b/docker/README.md @@ -123,6 +123,7 @@ Using binds rather than named volumes ([more explanation here](https://docs.dock * `LEVEL_TRACE` - Trace-level (VERY verbose) on stdout (default: `false`) : `-e LEVEL_TRACE=""` * `LEVEL_DEBUG` - Debug-level on stdout (default: `false`) : `-e LEVEL_DEBUG=""` * `LEVEL_INFO` - Info-level on stdout (default: `false`) : `-e LEVEL_INFO=""` +* `CUSTOM_HOSTNAME` - Custom hostname for local api (default: `localhost`) : `-e CUSTOM_HOSTNAME=""` ## Volumes diff --git a/docker/docker_start.sh b/docker/docker_start.sh index 3bca33888..c0f00e7c5 100755 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -21,11 +21,11 @@ fi # regenerate local agent credentials (ignore if agent is disabled) if [ "$DISABLE_AGENT" == "" ] ; then echo "Regenerate local agent credentials" - cscli -c "$CS_CONFIG_FILE" machines delete localhost + cscli -c "$CS_CONFIG_FILE" machines delete ${CUSTOM_HOSTNAME:-localhost} if [ "$LOCAL_API_URL" != "" ] ; then - cscli -c "$CS_CONFIG_FILE" machines add localhost --auto --url $LOCAL_API_URL + cscli -c "$CS_CONFIG_FILE" machines add ${CUSTOM_HOSTNAME:-localhost} --auto --url $LOCAL_API_URL else - cscli -c "$CS_CONFIG_FILE" machines add localhost --auto + cscli -c "$CS_CONFIG_FILE" machines add ${CUSTOM_HOSTNAME:-localhost} --auto fi if [ "$AGENT_USERNAME" != "" ] && [ "$AGENT_PASSWORD" != "" ] && [ "$LOCAL_API_URL" != "" ] ; then echo "set up lapi credentials for agent"