- 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.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
#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
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -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}" | ||||||||||||||||||||||||||||||||
Foorack marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||||||||||||||||||||||||||||
for domain in "${DOMAINS_ARRAY[@]}"; do | ||||||||||||||||||||||||||||||||
if [ -n "$domain" ]; then | ||||||||||||||||||||||||||||||||
TRUSTED_DOMAINS_ARG="$TRUSTED_DOMAINS_ARG --link-protection-trusted-domains=${domain}" | ||||||||||||||||||||||||||||||||
Foorack marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. Comment on lines +16 to +23 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
| ||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||
function run_code_server() { | ||||||||||||||||||||||||||||||||
echo "👷 Running code-server in the background..." | ||||||||||||||||||||||||||||||||
echo "Check logs at ${LOG_PATH}!" | ||||||||||||||||||||||||||||||||
$CODE_SERVER $EXTENSION_ARG $TRUSTED_DOMAINS_ARG --auth none --port "${PORT}" --app-name "${APP_NAME}" > "${LOG_PATH}" 2>&1 & | ||||||||||||||||||||||||||||||||
Foorack marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
# Check if the settings file exists... | ||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading.Please reload this page.