Skip to content

Commit 5c1ecfb

Browse files
authored
feat(scripts/develop.sh): provide an easy way to specify access url (coder#9222)
Allows `develop.sh --access-url="http://host:port"`
1 parent b2ca3eb commit 5c1ecfb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/develop.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ source "${SCRIPT_DIR}/lib.sh"
1313
[[ -n ${VERBOSE:-} ]] && set -x
1414
set -euo pipefail
1515

16+
CODER_DEV_ACCESS_URL="${CODER_DEV_ACCESS_URL:-http://127.0.0.1:3000}"
1617
DEFAULT_PASSWORD="SomeSecurePassword!"
1718
password="${CODER_DEV_ADMIN_PASSWORD:-${DEFAULT_PASSWORD}}"
1819
use_proxy=0
1920

20-
args="$(getopt -o "" -l use-proxy,agpl,password: -- "$@")"
21+
args="$(getopt -o "" -l access-url:,use-proxy,agpl,password: -- "$@")"
2122
eval set -- "$args"
2223
while true; do
2324
case "$1" in
25+
--access-url)
26+
CODER_DEV_ACCESS_URL="$2"
27+
shift 2
28+
;;
2429
--agpl)
2530
export CODER_BUILD_AGPL=1
2631
shift
@@ -131,7 +136,7 @@ fatal() {
131136
trap 'fatal "Script encountered an error"' ERR
132137

133138
cdroot
134-
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 "$@"
139+
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 "$@"
135140

136141
echo '== Waiting for Coder to become ready'
137142
# Start the timeout in the background so interrupting this script

0 commit comments

Comments
 (0)