Skip to content

Commit 06ac601

Browse files
committed
feat: add option to disable VS Code Web workspace trust protection
1 parent 8e051a8 commit 06ac601

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

registry/coder/modules/vscode-web/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ variable "use_cached" {
121121
default = false
122122
}
123123

124+
variable "disable_trust" {
125+
type = bool
126+
description = "Disables workspace trust protection for VS Code Web."
127+
default = false
128+
}
129+
124130
variable "extensions_dir" {
125131
type = string
126132
description = "Override the directory to store extensions in."
@@ -169,6 +175,7 @@ resource "coder_script" "vscode-web" {
169175
SETTINGS : replace(jsonencode(var.settings), "\"", "\\\""),
170176
OFFLINE : var.offline,
171177
USE_CACHED : var.use_cached,
178+
DISABLE_TRUST : var.disable_trust,
172179
EXTENSIONS_DIR : var.extensions_dir,
173180
FOLDER : var.folder,
174181
AUTO_INSTALL_EXTENSIONS : var.auto_install_extensions,

registry/coder/modules/vscode-web/run.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ if [ -n "${SERVER_BASE_PATH}" ]; then
1616
SERVER_BASE_PATH_ARG="--server-base-path=${SERVER_BASE_PATH}"
1717
fi
1818

19+
# Set disable workspace trust
20+
DISABLE_TRUST_ARG=""
21+
if [ "${DISABLE_TRUST}" = true ]; then
22+
DISABLE_TRUST_ARG="--disable-workspace-trust"
23+
fi
24+
1925
run_vscode_web() {
20-
echo "👷 Running $VSCODE_WEB serve-local $EXTENSION_ARG $SERVER_BASE_PATH_ARG --port ${PORT} --host 127.0.0.1 --accept-server-license-terms --without-connection-token --telemetry-level ${TELEMETRY_LEVEL} in the background..."
26+
echo "👷 Running $VSCODE_WEB serve-local $EXTENSION_ARG $SERVER_BASE_PATH_ARG $DISABLE_TRUST_ARG --port ${PORT} --host 127.0.0.1 --accept-server-license-terms --without-connection-token --telemetry-level ${TELEMETRY_LEVEL} in the background..."
2127
echo "Check logs at ${LOG_PATH}!"
22-
"$VSCODE_WEB" serve-local "$EXTENSION_ARG" "$SERVER_BASE_PATH_ARG" --port "${PORT}" --host 127.0.0.1 --accept-server-license-terms --without-connection-token --telemetry-level "${TELEMETRY_LEVEL}" > "${LOG_PATH}" 2>&1 &
28+
"$VSCODE_WEB" serve-local "$EXTENSION_ARG" "$SERVER_BASE_PATH_ARG" "$DISABLE_TRUST_ARG" --port "${PORT}" --host 127.0.0.1 --accept-server-license-terms --without-connection-token --telemetry-level "${TELEMETRY_LEVEL}" > "${LOG_PATH}" 2>&1 &
2329
}
2430

2531
# Check if the settings file exists...

0 commit comments

Comments
 (0)