This commit is contained in:
dax 2024-06-04 11:48:21 +02:00
commit e5d621ba09
7 changed files with 75 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,6 @@
Package: codeserver-installer
Version: 1.0
Architecture: amd64
Maintainer: Daniele Callari <info@danielecallari.it>
Description: Simple code-server setup automation.
Depends: curl

View File

@ -0,0 +1,6 @@
#!/bin/bash
printf "\n \033[0;32mcode-server environment is installed!\033[0m\n"
printf " Now run \033[0;33mcodeserverctl upgrade\033[0m to install vscode (and in future to upgrade it).\n"
printf " Next, customize your password and server conf here: /etc/code-server/code-server.yaml\n\n"
printf " Systemd profile: /etc/systemd/system/code-server.service\n\n"

View File

@ -0,0 +1,4 @@
#!/bin/bash
mkdir -p /etc/code-server/code-server-userspace
chown www-data:www-data /etc/code-server/ -R

View File

@ -0,0 +1,7 @@
bind-addr: 0.0.0.0:9001
auth: password
password: change-me
#cert: /etc/ssl/private/ssl-cert-snakeoil.key
#cert-key: /etc/ssl/private/ssl-cert-snakeoil.key
#cert-host: ide.winet.wime.it
user-data-dir: /etc/code-server/code-server-userspace

View File

@ -0,0 +1,15 @@
[Unit]
Description=Web IDE 4 developers - https://github.com/coder/code-server
After=network.target
StartLimitIntervalSec=10
[Service]
Type=simple
Restart=always
RestartSec=5
User=www-data
ExecStart=/usr/bin/code-server --config /etc/code-server/code-server.yaml
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,37 @@
#!/bin/bash
function status() {
echo 'code-server is' $(systemctl is-active code-server)
}
function start() {
systemctl start code-server
}
function stop() {
systemctl stop code-server
}
function upgrade() {
VERSION="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/coder/code-server/releases/latest | sed 's:.*/::')"
VERSION=${VERSION#?}
# https://github.com/coder/code-server/releases/download/v4.7.1/code-server-4.7.1-amd64.rpm
wget "https://github.com/coder/code-server/releases/download/v$VERSION/code-server_${VERSION}_amd64.deb"
dpkg -i code-server_${VERSION}_amd64.deb
rm code-server_${VERSION}_amd64.deb
}
case "$1" in
start) start ;;
stop) stop ;;
status) status;;
restart) stop; start ;;
upgrade) upgrade; stop; start;;
*) printf "code-server controller\n\nusage: \n$0 start|stop|restart|upgrade|status\n\n" >&2
exit 1
;;
esac