Skip to content

Commit e438265

Browse files
CopilotFoorack
andcommitted
Refactor TRUSTED_DOMAINS_ARG to match EXTENSION_ARG pattern
Co-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>
1 parent 0a27351 commit e438265

File tree

1 file changed

+7
-12
lines changed
  • registry/coder/modules/code-server

1 file changed

+7
-12
lines changed

registry/coder/modules/code-server/run.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@ if [ -n "${EXTENSIONS_DIR}" ]; then
1313
mkdir -p "${EXTENSIONS_DIR}"
1414
fi
1515

16+
# Set trusted domains argument
17+
TRUSTED_DOMAINS_ARG=""
18+
if [ -n "${TRUSTED_DOMAINS}" ]; then
19+
TRUSTED_DOMAINS_ARG="--link-protection-trusted-domains=${TRUSTED_DOMAINS}"
20+
fi
21+
1622
function run_code_server() {
1723
echo "👷 Running code-server in the background..."
1824
echo "Check logs at ${LOG_PATH}!"
19-
20-
# Build trusted domains argument if domains are provided
21-
TRUSTED_DOMAINS_ARG=""
22-
if [ -n "${TRUSTED_DOMAINS}" ]; then
23-
TRUSTED_DOMAINS_ARG="--link-protection-trusted-domains=${TRUSTED_DOMAINS}"
24-
fi
25-
26-
if [ -n "$TRUSTED_DOMAINS_ARG" ]; then
27-
$CODE_SERVER $EXTENSION_ARG $TRUSTED_DOMAINS_ARG --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 &
28-
else
29-
$CODE_SERVER $EXTENSION_ARG --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 &
30-
fi
25+
$CODE_SERVER $EXTENSION_ARG $TRUSTED_DOMAINS_ARG --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 &
3126
}
3227

3328
# Check if the settings file exists...

0 commit comments

Comments
 (0)