diff --git a/README.md b/README.md index 11b7535..0619e1e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,14 @@ docker volume create ssb docker run --mount source=ssb,target=/root/.ssb -p 3000:3000 --rm oasis ``` +### Starting on login + +This will install an oasis service for the current user. + +```shell +bash contrib/install-systemd-service.bash +``` + ## Resources - [Contributing](https://github.com/fraction/oasis/blob/master/docs/contributing.md) diff --git a/contrib/install-systemd-service.bash b/contrib/install-systemd-service.bash new file mode 100644 index 0000000..356f2bb --- /dev/null +++ b/contrib/install-systemd-service.bash @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +test "$XDG_CONFIG_HOME" || XDG_CONFIG_HOME=$HOME/.config +test "$SYSTEMD_USER_HOME" || SYSTEMD_USER_HOME="$XDG_CONFIG_HOME"/systemd/user +mkdir -p "$SYSTEMD_USER_HOME" +test -f "$SYSTEMD_USER_HOME"/oasis.service || cp oasis.service "$SYSTEMD_USER_HOME"/ +systemctl --user daemon-reload + +printf "oasis service has been installed to %s" "$SYSTEMD_USER_HOME" +printf "to enable for the current user, run" +printf "\n\tsystemctl --user enable oasis" + +printf "to start right now, run" +printf "\n\tsystemctl --user start oasis" +printf "\txdg-open http://localhost:4515" + diff --git a/contrib/oasis.service b/contrib/oasis.service index 0c36f67..bcc5ae1 100644 --- a/contrib/oasis.service +++ b/contrib/oasis.service @@ -1,8 +1,3 @@ -# cp oasis.service ~/.config/systemd/user -# systemctl --user daemon-reload -# systemctl --user enable oasis -# systemctl --user start oasis - [Unit] Description=Oasis - Friendly Scuttlebutt Web Interface Documentation=https://github.com/fraction/oasis @@ -10,7 +5,7 @@ After=network.target [Service] Type=simple -ExecStart=%s -l -c 'oasis --host localhost --port 4515' +ExecStart=%s -l -c 'oasis --host localhost --port 4515 --no-open' Restart=on-failure [Install] diff --git a/docs/install.md b/docs/install.md deleted file mode 100644 index 30cb03a..0000000 --- a/docs/install.md +++ /dev/null @@ -1,40 +0,0 @@ -# Installation - -## Download - -### HTTP - -```shell -git clone https://github.com/fraction/oasis.git -cd oasis -``` - -### SSH - -```shell -git clone git@github.com:fraction/oasis.git -cd oasis -``` - -## Dependencies - -### Yarn - -```shell -yarn -``` - -### npm - -```shell -npm install -``` - -## System service - -```shell -cp contrib/oasis.service ~/.config/systemd/user -systemctl --user daemon-reload -systemctl --user enable oasis -systemctl --user start oasis -```