From 95498f7ef5313ad8da6ed86dd30a264866d53756 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Tue, 14 Jun 2022 17:21:47 +0530 Subject: [PATCH 1/6] add openrc support --- docs/openrc.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/openrc.md diff --git a/docs/openrc.md b/docs/openrc.md new file mode 100644 index 000000000000..37b7af9c56b5 --- /dev/null +++ b/docs/openrc.md @@ -0,0 +1,55 @@ +This script is pretty generic and should be able to run on any OpenRC-based distribution with minimal tweaks. + +Save the file as `code-server` in `/etc/init.d` and make it executable with `chmod +x code-server`. Put your username in line 3. + +```bash +name=$RC_SVCNAME +description="$name - VS Code on a remote server" +user="" # your username here +homedir="/home/$user" +command="/usr/bin/$name" +# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead +#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry" +command_user="$user:$user" +pidfile="/run/$name/$name.pid" +command_background="yes" +extra_commands="report" + +depend() { + use logger dns + need net +} + +start_pre() { + checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name +} + +start() { + default_start + report +} + +stop() { + default_stop +} + +status() { + default_status + report +} + +report() { + # Report to the user + einfo "Reading configuration from ~/.config/code-server/config.yaml" +} +``` + +Start on boot with default runlevel +``` +rc-update add code-server default +``` + +Start the service immediately +``` +rc-service code-server start +``` From 201855ea2b6198bd373a23a32b665efe895a0ed2 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Tue, 14 Jun 2022 17:26:49 +0530 Subject: [PATCH 2/6] have the script pick code-server from path --- docs/openrc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/openrc.md b/docs/openrc.md index 37b7af9c56b5..459d1e8df01f 100644 --- a/docs/openrc.md +++ b/docs/openrc.md @@ -7,7 +7,7 @@ name=$RC_SVCNAME description="$name - VS Code on a remote server" user="" # your username here homedir="/home/$user" -command="/usr/bin/$name" +command="$(which code-server)" # Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead #command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry" command_user="$user:$user" From 0931e1ed23a617f72966cf6befba84fb2f86710d Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Wed, 15 Jun 2022 12:17:34 +0530 Subject: [PATCH 3/6] add shebang --- docs/openrc.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/openrc.md b/docs/openrc.md index 459d1e8df01f..b01dfd1fa967 100644 --- a/docs/openrc.md +++ b/docs/openrc.md @@ -3,6 +3,7 @@ This script is pretty generic and should be able to run on any OpenRC-based dist Save the file as `code-server` in `/etc/init.d` and make it executable with `chmod +x code-server`. Put your username in line 3. ```bash +#!/sbin/openrc-run name=$RC_SVCNAME description="$name - VS Code on a remote server" user="" # your username here From 943a4595d85e9fbf0f437c99dada82bc2aa35fb3 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Fri, 17 Jun 2022 23:52:22 +0530 Subject: [PATCH 4/6] move openrc.md to install.md --- docs/install.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/openrc.md | 56 ------------------------------------------- 2 files changed, 64 insertions(+), 56 deletions(-) delete mode 100644 docs/openrc.md diff --git a/docs/install.md b/docs/install.md index 64c35ddbecf2..6d645393e60b 100644 --- a/docs/install.md +++ b/docs/install.md @@ -9,6 +9,7 @@ - [Debian, Ubuntu](#debian-ubuntu) - [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse) - [Arch Linux](#arch-linux) +- [Artix Linux](#artix-linux) - [macOS](#macos) - [Docker](#docker) - [Helm](#helm) @@ -190,6 +191,69 @@ sudo systemctl enable --now code-server@$USER # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml ``` +## Artix Linux +```bash +# Install code-server from the AUR +git clone https://aur.archlinux.org/code-server.git +cd code-server +makepkg -si +``` + +Save the file as `code-server` in `/etc/init.d/` and make it executable with `chmod +x code-server`. Put your username in line 3. + +```bash +#!/sbin/openrc-run +name=$RC_SVCNAME +description="$name - VS Code on a remote server" +user="" # your username here +homedir="/home/$user" +command="$(which code-server)" +# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead +#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry" +command_user="$user:$user" +pidfile="/run/$name/$name.pid" +command_background="yes" +extra_commands="report" + +depend() { + use logger dns + need net +} + +start_pre() { + checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name +} + +start() { + default_start + report +} + +stop() { + default_stop +} + +status() { + default_status + report +} + +report() { + # Report to the user + einfo "Reading configuration from ~/.config/code-server/config.yaml" +} +``` + +Start on boot with default runlevel +``` +rc-update add code-server default +``` + +Start the service immediately +``` +rc-service code-server start +``` + ## macOS ```bash diff --git a/docs/openrc.md b/docs/openrc.md deleted file mode 100644 index b01dfd1fa967..000000000000 --- a/docs/openrc.md +++ /dev/null @@ -1,56 +0,0 @@ -This script is pretty generic and should be able to run on any OpenRC-based distribution with minimal tweaks. - -Save the file as `code-server` in `/etc/init.d` and make it executable with `chmod +x code-server`. Put your username in line 3. - -```bash -#!/sbin/openrc-run -name=$RC_SVCNAME -description="$name - VS Code on a remote server" -user="" # your username here -homedir="/home/$user" -command="$(which code-server)" -# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead -#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry" -command_user="$user:$user" -pidfile="/run/$name/$name.pid" -command_background="yes" -extra_commands="report" - -depend() { - use logger dns - need net -} - -start_pre() { - checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name -} - -start() { - default_start - report -} - -stop() { - default_stop -} - -status() { - default_status - report -} - -report() { - # Report to the user - einfo "Reading configuration from ~/.config/code-server/config.yaml" -} -``` - -Start on boot with default runlevel -``` -rc-update add code-server default -``` - -Start the service immediately -``` -rc-service code-server start -``` From a39d13cf687601cc4e61c42819e037f48ef368fc Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Sat, 18 Jun 2022 01:03:17 +0530 Subject: [PATCH 5/6] update CODEOWNERS --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 788f26bc9002..c7d9deed159f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,5 @@ * @coder/code-server-reviewers ci/helm-chart/ @Matthew-Beckett @alexgorbatchev + +docs/install.md @GNUxeava From 2ca1065ceaabed3f3668f44178d0a806ae0a2739 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 9 Aug 2022 12:58:05 -0500 Subject: [PATCH 6/6] Format doc changes --- docs/install.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/install.md b/docs/install.md index 6d645393e60b..c30a3d2ba105 100644 --- a/docs/install.md +++ b/docs/install.md @@ -192,6 +192,7 @@ sudo systemctl enable --now code-server@$USER ``` ## Artix Linux + ```bash # Install code-server from the AUR git clone https://aur.archlinux.org/code-server.git @@ -216,40 +217,42 @@ command_background="yes" extra_commands="report" depend() { - use logger dns - need net + use logger dns + need net } start_pre() { - checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name + checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name } start() { - default_start - report + default_start + report } stop() { - default_stop + default_stop } status() { - default_status - report + default_status + report } report() { - # Report to the user - einfo "Reading configuration from ~/.config/code-server/config.yaml" + # Report to the user + einfo "Reading configuration from ~/.config/code-server/config.yaml" } ``` Start on boot with default runlevel + ``` rc-update add code-server default ``` Start the service immediately + ``` rc-service code-server start ```