-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add --disable-*
options
#5
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
6067463
267eeeb
f33c545
0eda689
360e865
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,42 @@ if [[ -n $WORKSPACE ]]; then | |
CODE_SERVER_WORKSPACE="$WORKSPACE" | ||
fi | ||
|
||
DISABLE_FLAGS="" | ||
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. Suggestions: using arrays would be slightly cleaner.
(Note the use of 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. Actually, a way to make it shell safe would be:
😄 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. If we do that second approach do we lose the ability to test the entrypoint for containing certain flags? 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. Both approaches I outlined should be fine for the test. But in the latter you can't test 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. Ah I understand the second approach more now, I'm happy to do that one 👍 |
||
|
||
if [[ "$DISABLEFILEDOWNLOADS" == "true" ]]; then | ||
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. Haha, couldn't they have |
||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-file-downloads" | ||
fi | ||
|
||
if [[ "$DISABLEFILEUPLOADS" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-file-uploads" | ||
fi | ||
|
||
if [[ "$DISABLEGETTINGSTARTEDOVERRIDE" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-getting-started-override" | ||
fi | ||
|
||
if [[ "$DISABLEPROXY" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-proxy" | ||
fi | ||
|
||
if [[ "$DISABLETELEMETRY" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-telemetry" | ||
fi | ||
|
||
if [[ "$DISABLEUPDATECHECK" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-update-check" | ||
fi | ||
|
||
if [[ "$DISABLEWORKSPACETRUST" == "true" ]]; then | ||
DISABLE_FLAGS="$DISABLE_FLAGS --disable-workspace-trust" | ||
fi | ||
|
||
cat > /usr/local/bin/code-server-entrypoint \ | ||
<< EOF | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
su $_REMOTE_USER -c 'code-server --auth "$AUTH" --bind-addr "$HOST:$PORT" "$CODE_SERVER_WORKSPACE"' | ||
su $_REMOTE_USER -c 'code-server --auth "$AUTH" --bind-addr "$HOST:$PORT" $DISABLE_FLAGS "$CODE_SERVER_WORKSPACE"' | ||
EOF | ||
|
||
chmod +x /usr/local/bin/code-server-entrypoint |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-file-downloads" grep $'\'code-server.* --disable-file-downloads .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-file-uploads" grep $'\'code-server.* --disable-file-uploads .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-getting-started-override" grep $'\'code-server.* --disable-getting-started-override .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
# Check for all three flags we enabled in this scenario | ||
check "code-server disable-file-downloads" grep $'\'code-server.* --disable-file-downloads .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-file-uploads" grep $'\'code-server.* --disable-file-uploads .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-getting-started-override" grep $'\'code-server.* --disable-getting-started-override .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-proxy" grep $'\'code-server.* --disable-proxy .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-telemetry" grep $'\'code-server.* --disable-telemetry .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-update-check" grep $'\'code-server.* --disable-update-check .*' < /usr/local/bin/code-server-entrypoint | ||
check "code-server disable-workspace-trust" grep $'\'code-server.* --disable-workspace-trust .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-proxy" grep $'\'code-server.* --disable-proxy .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-telemetry" grep $'\'code-server.* --disable-telemetry .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-update-check" grep $'\'code-server.* --disable-update-check .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
check "code-server version" code-server --version | ||
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||
check "code-server listening" lsof -i "@127.0.0.1:8080" | ||
|
||
check "code-server disable-workspace-trust" grep $'\'code-server.* --disable-workspace-trust .*' < /usr/local/bin/code-server-entrypoint | ||
|
||
# Report results | ||
reportResults |
Uh oh!
There was an error while loading. Please reload this page.