Skip to content

Commit

Permalink
RHOAIENG-14518: feat(codeserver): disable the VSCode workspace trust …
Browse files Browse the repository at this point in the history
…mechanism and the trust prompt
  • Loading branch information
jiridanek committed Oct 25, 2024
1 parent 1595213 commit 2cdbe8a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions codeserver/ubi9-python-3.11/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
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

0 comments on commit 2cdbe8a

Please sign in to comment.