From 5c1ecfbd5fffb3fdf6a52b3ffba78955073761dd Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 21 Aug 2023 18:23:07 +0100 Subject: [PATCH] feat(scripts/develop.sh): provide an easy way to specify access url (#9222) Allows `develop.sh --access-url="http://host:port"` --- scripts/develop.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/develop.sh b/scripts/develop.sh index cc1ab23f05..39f81c2951 100755 --- a/scripts/develop.sh +++ b/scripts/develop.sh @@ -13,14 +13,19 @@ source "${SCRIPT_DIR}/lib.sh" [[ -n ${VERBOSE:-} ]] && set -x set -euo pipefail +CODER_DEV_ACCESS_URL="${CODER_DEV_ACCESS_URL:-http://127.0.0.1:3000}" DEFAULT_PASSWORD="SomeSecurePassword!" password="${CODER_DEV_ADMIN_PASSWORD:-${DEFAULT_PASSWORD}}" use_proxy=0 -args="$(getopt -o "" -l use-proxy,agpl,password: -- "$@")" +args="$(getopt -o "" -l access-url:,use-proxy,agpl,password: -- "$@")" eval set -- "$args" while true; do case "$1" in + --access-url) + CODER_DEV_ACCESS_URL="$2" + shift 2 + ;; --agpl) export CODER_BUILD_AGPL=1 shift @@ -131,7 +136,7 @@ fatal() { trap 'fatal "Script encountered an error"' ERR cdroot - start_cmd API "" "${CODER_DEV_SHIM}" server --http-address 0.0.0.0:3000 --swagger-enable --access-url "http://127.0.0.1:3000" --dangerous-allow-cors-requests=true "$@" + start_cmd API "" "${CODER_DEV_SHIM}" server --http-address 0.0.0.0:3000 --swagger-enable --access-url "${CODER_DEV_ACCESS_URL}" --dangerous-allow-cors-requests=true "$@" echo '== Waiting for Coder to become ready' # Start the timeout in the background so interrupting this script