From 33870572d4e0df488839066b513fd26947b8d234 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Wed, 21 Jun 2023 16:56:06 +0200 Subject: [PATCH] Improve unit files, add binary install to README After going through the process of getting this working using the unit files, I found a few issues that are fixed here. --- README.md | 8 ++++++++ radicle-httpd/radicle-httpd.service | 28 ++++++++++++++++++++++++++++ radicle-node/radicle-node.service | 25 +++++++++++++++++-------- 3 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 radicle-httpd/radicle-httpd.service diff --git a/README.md b/README.md index 2c7b1002..30cbc37a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,14 @@ and freedom. * Git 2.34 or later * OpenSSH 9.1 or later with `ssh-agent` +### 📀 From binaries + +> Requires `curl` and `tar`. + +Run the following command to install the latest binary release: + + sh <(curl -sSf https://radicle.xyz/install) + ### 📦 From source > Requires the Rust toolchain. diff --git a/radicle-httpd/radicle-httpd.service b/radicle-httpd/radicle-httpd.service new file mode 100644 index 00000000..f922e682 --- /dev/null +++ b/radicle-httpd/radicle-httpd.service @@ -0,0 +1,28 @@ +# Example systemd unit file for `radicle-httpd`. +# +# When running radicle-httpd on a server, it should be run as a separate user. +# +# Copy this file into /etc/systemd/system and set the User/Group parameters +# under [Service] appropriately. +# +# For users wishing to run a configured version of the service, copy this +# service file into the user's systemd directory, and edit appropriately. +# +# For example: +# +# mkdir -p $HOME/.config/systemd/user/ +# cp radicle-node.service $HOME/.config/systemd/user/radicle-node.service +# +[Unit] +After=syslog.target network.target +Description=Radicle HTTPd + +[Service] +ExecStart=%h/.radicle/bin/radicle-httpd +Environment=RAD_HOME=%h/.radicle +KillMode=process +Restart=always +RestartSec=1 + +[Install] +WantedBy=default.target diff --git a/radicle-node/radicle-node.service b/radicle-node/radicle-node.service index 161343cb..1fe108fa 100644 --- a/radicle-node/radicle-node.service +++ b/radicle-node/radicle-node.service @@ -1,27 +1,36 @@ +# Example systemd unit file for `radicle-node`. +# # When running radicle-node on a server, it should be run as a separate user. +# # Copy this file into /etc/systemd/system and set the User/Group parameters # under [Service] appropriately. - +# # For users wishing to run a configured version of the service, copy this # service file into the user's systemd directory, and edit appropriately. # -# mkdir -p $HOME/.local/share/systemd/user/ -# cp radicle-node.service $HOME/.local/share/systemd/user/radicle-node.service +# For example: # -# You will have to set the RAD_PASSPHRASE for the node to start. +# mkdir -p $HOME/.config/systemd/user/ +# cp radicle-node.service $HOME/.config/systemd/user/radicle-node.service +# +# You will have to set the RAD_PASSPHRASE environment variable to the +# passphrase supplied during `rad auth`, for the node to start, eg. # # [Service] -# Environment="RAD_PASSPHRASE=[passphrase]" - +# Environment=RAD_PASSPHRASE= +# +# Also ensure RAD_HOME is set appropriately. +# [Unit] After=syslog.target network.target Description=Radicle Node [Service] -ExecStart=%h/.radicle/bin/radicle-node +ExecStart=%h/.radicle/bin/radicle-node --listen 0.0.0.0:8776 +Environment=RAD_HOME=%h/.radicle KillMode=process Restart=always RestartSec=1 [Install] -WantedBy=multi-user.target +WantedBy=default.target