Created
July 12, 2023 11:09
-
-
Save kirederik/ba6f3c967879e290b7bb1f8f7abe9024 to your computer and use it in GitHub Desktop.
instruqt-editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Download and install Code server | |
CODE_SERVER_VERSION=4.7.0 | |
curl -fOL https://github.com/coder/code-server/releases/download/v$CODE_SERVER_VERSION/code-server_${CODE_SERVER_VERSION}_amd64.deb | |
dpkg -i code-server_${CODE_SERVER_VERSION}_amd64.deb | |
## Create Code Server startup script | |
### code-server config | |
CODE_SERVER_PATH=/root/.local/share/code-server | |
mkdir -p ${CODE_SERVER_PATH}/User | |
echo ' | |
{ | |
"editor.tabSize": 2, | |
"extensions.autoUpdate": false, | |
"extensions.autoCheckUpdates": false, | |
// Removing autosave as it does not properly run goimports | |
"files.autoSave": "off" | |
// "files.autoSave": "afterDelay", | |
// "files.autoSaveDelay": 10, | |
"go.formatTool": "goimports", | |
"redhat.telemetry.enabled": false, | |
"security.workspace.trust.startupPrompt": "never", | |
"security.workspace.trust.enabled": false, | |
"security.workspace.trust.banner": "never", | |
"security.workspace.trust.emptyWindow": false, | |
"security.workspace.trust.untrustedFiles": "open", | |
"update.showReleaseNotes": false, | |
"workbench.colorTheme": "Default Dark+" | |
} | |
' > ${CODE_SERVER_PATH}/User/settings.json | |
### code-server service | |
echo " | |
[Unit] | |
Description=Code Server | |
After=network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
Restart=always | |
RestartSec=1 | |
User=root | |
ExecStart=/usr/bin/code-server --host 0.0.0.0 --port 8443 --cert --auth none ${DEMO_HOME} | |
[Install] | |
WantedBy=multi-user.target | |
" > /etc/systemd/system/code-server.service | |
### Start Code Server | |
systemctl enable code-server | |
systemctl start code-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment