- Notifications
You must be signed in to change notification settings - Fork72
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for configuring trusted domains in the code-server module to enable link protection functionality. Users can now specify a list of domains that should be trusted when code-server validates external links.
- Adds a new
trusted_domains
variable to accept a list of trusted domain strings - Updates the run script to process the domains and pass them to code-server via
--link-protection-trusted-domains
flags - Integrates the trusted domains configuration into the coder_script resource environment
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
main.tf | Addstrusted_domains variable definition and passes it to the script environment |
run.sh | Implements domain processing logic and adds trusted domains arguments to code-server command |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
If I understand these logs correctly, the error has nothing to do with this change?
|
Will look into testing more this week, as well as adding tests specifically for this new feature. |
#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>
ccf5b22
to52099ea
Compare# 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}" |
There was a problem hiding this comment.
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.
# 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" |
Description
This PR adds support for configuring trusted domains in the code-server module through a new
trusted_domains
variable.This allows users to specify domains that should be trusted for link protection using code-server's
--link-protection-trusted-domains
option.Type of Change
Module Information
Path:
registry/coder/modules/code-server
New version: N/A
Breaking change: [ ] Yes [X] No
Related Issues
microsoft/vscode#82794
coder/coder#19995