Skip to content
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

RHOAIENG-14518: feat(codeserver): disable the VSCode workspace trust mechanism and the trust prompt #754

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 11 additions & 5 deletions codeserver/ubi9-python-3.11/run-code-server.sh
Copy link
Member Author

Choose a reason for hiding this comment

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

Test rerun thread

Copy link
Member Author

Choose a reason for hiding this comment

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

/test codeserver-notebook-e2e-tests

Copy link
Member Author

Choose a reason for hiding this comment

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

/override ci/prow/codeserver-notebook-e2e-tests

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source ${SCRIPT_DIR}/utils/*.sh
run-nginx.sh &
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &

# Add .bashrc for custom promt if not present
# Add .bashrc for custom prompt if not present
if [ ! -f "/opt/app-root/src/.bashrc" ]; then
echo 'PS1="\[\033[34;1m\][\$(pwd)]\[\033[0m\]\n\[\033[1;0m\]$ \[\033[0m\]"' > /opt/app-root/src/.bashrc
fi
Expand Down Expand Up @@ -42,16 +42,22 @@ create_dir_and_file() {
# Define universal settings
universal_dir="/opt/app-root/src/.local/share/code-server/User/"
user_settings_filepath="${universal_dir}settings.json"
universal_json_settings='{
universal_json_settings='// vscode settings are written in json-with-comments
/* https://code.visualstudio.com/docs/languages/json#_json-with-comments */
{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3",
"telemetry.telemetryLevel": "off",
"telemetry.enableTelemetry": false,
"workbench.enableExperiments": false,
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
"extensions.autoUpdate": false,

// RHOAIENG-14518: Disable the "Do you trust the authors [...]" startup prompt
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never"
}'

# Define python debuger settings
# Define python debugger settings
vscode_dir="/opt/app-root/src/.vscode/"
settings_filepath="${vscode_dir}settings.json"
launch_filepath="${vscode_dir}launch.json"
Expand All @@ -72,7 +78,7 @@ json_settings='{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}'

# Create necessary directories and files for python debuger and universal settings
# Create necessary directories and files for python debugger and universal settings
create_dir_and_file "$universal_dir" "$user_settings_filepath" "$universal_json_settings"
create_dir_and_file "$vscode_dir" "$settings_filepath" "$json_settings"
create_dir_and_file "$vscode_dir" "$launch_filepath" "$json_launch_settings"
Expand Down
16 changes: 11 additions & 5 deletions codeserver/ubi9-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source ${SCRIPT_DIR}/utils/*.sh
run-nginx.sh &
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &

# Add .bashrc for custom promt if not present
# Add .bashrc for custom prompt if not present
if [ ! -f "/opt/app-root/src/.bashrc" ]; then
echo 'PS1="\[\033[34;1m\][\$(pwd)]\[\033[0m\]\n\[\033[1;0m\]$ \[\033[0m\]"' > /opt/app-root/src/.bashrc
fi
Expand Down Expand Up @@ -42,16 +42,22 @@ create_dir_and_file() {
# Define universal settings
universal_dir="/opt/app-root/src/.local/share/code-server/User/"
user_settings_filepath="${universal_dir}settings.json"
universal_json_settings='{
universal_json_settings='// vscode settings are written in json-with-comments
/* https://code.visualstudio.com/docs/languages/json#_json-with-comments */
{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3",
"telemetry.telemetryLevel": "off",
"telemetry.enableTelemetry": false,
"workbench.enableExperiments": false,
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
"extensions.autoUpdate": false,

// RHOAIENG-14518: Disable the "Do you trust the authors [...]" startup prompt
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never"
}'

# Define python debuger settings
# Define python debugger settings
vscode_dir="/opt/app-root/src/.vscode/"
settings_filepath="${vscode_dir}settings.json"
launch_filepath="${vscode_dir}launch.json"
Expand All @@ -72,7 +78,7 @@ json_settings='{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}'

# Create necessary directories and files for python debuger and universal settings
# Create necessary directories and files for python debugger and universal settings
create_dir_and_file "$universal_dir" "$user_settings_filepath" "$universal_json_settings"
create_dir_and_file "$vscode_dir" "$settings_filepath" "$json_settings"
create_dir_and_file "$vscode_dir" "$launch_filepath" "$json_launch_settings"
Expand Down