feat: Add serving applications on subdomains and port-based proxying (#3753)

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Steven Masley
2022-09-13 13:31:33 -04:00
committed by GitHub
parent 99a7a8dd22
commit 9ab437d6e2
16 changed files with 895 additions and 88 deletions

View File

@ -10,15 +10,19 @@ source "${SCRIPT_DIR}/lib.sh"
GOOS="$(go env GOOS)"
GOARCH="$(go env GOARCH)"
CODER_DEV_BIN="build/coder_${GOOS}_${GOARCH}"
RELATIVE_BINARY_PATH="build/coder_${GOOS}_${GOARCH}"
cdroot
# To preserve the CWD when running the binary, we need to use pushd and popd to
# get absolute paths to everything.
pushd "$PROJECT_ROOT"
mkdir -p ./.coderv2
CODER_DEV_BIN="$(realpath "$RELATIVE_BINARY_PATH")"
CODER_DEV_DIR="$(realpath ./.coderv2)"
popd
if [[ ! -x "${CODER_DEV_BIN}" ]]; then
echo "Run this command first:"
echo " make $CODER_DEV_BIN"
echo " make $RELATIVE_BINARY_PATH"
exit 1
fi

View File

@ -64,13 +64,17 @@ CODER_DEV_SHIM="${PROJECT_ROOT}/scripts/coder-dev.sh"
echo '== Waiting for Coder to become ready'
timeout 60s bash -c 'until curl -s --fail http://localhost:3000 > /dev/null 2>&1; do sleep 0.5; done'
# Try to create the initial admin user.
"${CODER_DEV_SHIM}" login http://127.0.0.1:3000 --username=admin --email=admin@coder.com --password="${password}" ||
echo 'Failed to create admin user. To troubleshoot, try running this command manually.'
if [ ! -f "${PROJECT_ROOT}/.coderv2/developsh-did-first-setup" ]; then
# Try to create the initial admin user.
"${CODER_DEV_SHIM}" login http://127.0.0.1:3000 --username=admin --email=admin@coder.com --password="${password}" ||
echo 'Failed to create admin user. To troubleshoot, try running this command manually.'
# Try to create a regular user.
"${CODER_DEV_SHIM}" users create --email=member@coder.com --username=member --password="${password}" ||
echo 'Failed to create regular user. To troubleshoot, try running this command manually.'
# Try to create a regular user.
"${CODER_DEV_SHIM}" users create --email=member@coder.com --username=member --password="${password}" ||
echo 'Failed to create regular user. To troubleshoot, try running this command manually.'
touch "${PROJECT_ROOT}/.coderv2/developsh-did-first-setup"
fi
# If we have docker available and the "docker" template doesn't already
# exist, then let's try to create a template!