mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(scripts/develop.sh): provide an easy way to specify access url (#9222)
Allows `develop.sh --access-url="http://host:port"`
This commit is contained in:
+7
-2
@@ -13,14 +13,19 @@ source "${SCRIPT_DIR}/lib.sh"
|
|||||||
[[ -n ${VERBOSE:-} ]] && set -x
|
[[ -n ${VERBOSE:-} ]] && set -x
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
CODER_DEV_ACCESS_URL="${CODER_DEV_ACCESS_URL:-http://127.0.0.1:3000}"
|
||||||
DEFAULT_PASSWORD="SomeSecurePassword!"
|
DEFAULT_PASSWORD="SomeSecurePassword!"
|
||||||
password="${CODER_DEV_ADMIN_PASSWORD:-${DEFAULT_PASSWORD}}"
|
password="${CODER_DEV_ADMIN_PASSWORD:-${DEFAULT_PASSWORD}}"
|
||||||
use_proxy=0
|
use_proxy=0
|
||||||
|
|
||||||
args="$(getopt -o "" -l use-proxy,agpl,password: -- "$@")"
|
args="$(getopt -o "" -l access-url:,use-proxy,agpl,password: -- "$@")"
|
||||||
eval set -- "$args"
|
eval set -- "$args"
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--access-url)
|
||||||
|
CODER_DEV_ACCESS_URL="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--agpl)
|
--agpl)
|
||||||
export CODER_BUILD_AGPL=1
|
export CODER_BUILD_AGPL=1
|
||||||
shift
|
shift
|
||||||
@@ -131,7 +136,7 @@ fatal() {
|
|||||||
trap 'fatal "Script encountered an error"' ERR
|
trap 'fatal "Script encountered an error"' ERR
|
||||||
|
|
||||||
cdroot
|
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'
|
echo '== Waiting for Coder to become ready'
|
||||||
# Start the timeout in the background so interrupting this script
|
# Start the timeout in the background so interrupting this script
|
||||||
|
|||||||
Reference in New Issue
Block a user