Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add trusted_domains variable to code-server module for link protection#435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Foorack wants to merge2 commits intocoder:main
base:main
Choose a base branch
Loading
fromFoorack:link-protection-trusted-domains
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Add trusted_domains variable to code-server module for link protection (
#1)* Initial plan* Add trusted_domains variable to code-server module for link protectionCo-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>* Remove temporary plan files from commitCo-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>* Refactor TRUSTED_DOMAINS_ARG to match EXTENSION_ARG patternCo-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>* Remove trusted domains tests as requestedCo-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>* Fix trusted domains to use multiple flag instances instead of comma-separated valuesCo-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>* Update registry/coder/modules/code-server/run.shCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>* Update registry/coder/modules/code-server/run.shCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>---------Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>Co-authored-by: Foorack <5008081+Foorack@users.noreply.github.com>Co-authored-by: Foorack / Max Faxälv <max@foorack.com>Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Loading branch information
@Copilot@Foorack@Copilot
4 people committedSep 30, 2025
commit52099ea364b552c18e923482c6cfb54d28060e4c
7 changes: 7 additions & 0 deletionsregistry/coder/modules/code-server/main.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,6 +148,12 @@ variable "open_in" {
}
}

variable "trusted_domains" {
type = list(string)
description = "A list of trusted domains for link protection. These domains will be added to the --link-protection-trusted-domains option."
default = []
}

resource "coder_script" "code-server" {
agent_id = var.agent_id
display_name = "code-server"
Expand All@@ -168,6 +174,7 @@ resource "coder_script" "code-server" {
EXTENSIONS_DIR : var.extensions_dir,
FOLDER : var.folder,
AUTO_INSTALL_EXTENSIONS : var.auto_install_extensions,
TRUSTED_DOMAINS : join(",", var.trusted_domains),
})
run_on_start = true

Expand Down
14 changes: 13 additions & 1 deletionregistry/coder/modules/code-server/run.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,10 +13,22 @@ if [ -n "${EXTENSIONS_DIR}" ]; then
mkdir -p "${EXTENSIONS_DIR}"
fi

# Set trusted domains argument
TRUSTED_DOMAINS_ARG=""
if [ -n "${TRUSTED_DOMAINS}" ]; then
# Split comma-separated domains and create multiple --link-protection-trusted-domains arguments
IFS=',' read -r -a DOMAINS_ARRAY <<< "${TRUSTED_DOMAINS}"
for domain in "${DOMAINS_ARRAY[@]}"; do
if [ -n "$domain" ]; then
TRUSTED_DOMAINS_ARG="$TRUSTED_DOMAINS_ARG --link-protection-trusted-domains=${domain}"
Comment on lines +16 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@Foorack Have you tested this module to make sure it works after the update?

This doesn't interpret correctly.

Suggested change
# Set trusted domains argument
TRUSTED_DOMAINS_ARG=""
if [-n"${TRUSTED_DOMAINS}" ];then
# Split comma-separated domains and create multiple --link-protection-trusted-domains arguments
IFS=','read -r -a DOMAINS_ARRAY<<<"${TRUSTED_DOMAINS}"
fordomainin"${DOMAINS_ARRAY[@]}";do
if [-n"$domain" ];then
TRUSTED_DOMAINS_ARG="$TRUSTED_DOMAINS_ARG --link-protection-trusted-domains=${domain}"
# Set trusted domains argument
TRUSTED_DOMAINS_ARG=""
if [-n"${TRUSTED_DOMAINS}" ];then
# Split comma-separated domains and create multiple --link-protection-trusted-domains arguments
fordomainin$(echo"${TRUSTED_DOMAINS}"| tr',''');do
if [-n"$domain" ];then
TRUSTED_DOMAINS_ARG="$TRUSTED_DOMAINS_ARG --link-protection-trusted-domains=$domain"

fi
done
fi

function run_code_server() {
echo "👷 Running code-server in the background..."
echo "Check logs at ${LOG_PATH}!"
$CODE_SERVER"$EXTENSION_ARG" --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 &
$CODE_SERVER $EXTENSION_ARG $TRUSTED_DOMAINS_ARG --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 &
}

# Check if the settings file exists...
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp