From 757a6fab63541e376c2725fd22e2e06b1ba98ea8 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Tue, 2 Jun 2026 20:31:23 +0200 Subject: [PATCH] installer: accept ABS_URL/PORT as positional args, default REPO_URL Co-Authored-By: Claude Opus 4.8 --- deploy/README.md | 18 +++++++++++++----- deploy/install.sh | 18 ++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 4fa86f0..41784fb 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -31,14 +31,22 @@ ABS_URL=http://127.0.0.1:13378 PORT=8080 npm start # open http://:8080 ``` -## 4. Auto-start with systemd +## 4. One-shot install + auto-start (recommended) +The installer does everything (Node, build, systemd enable/start). The ABS URL and port +are positional args (or env vars): +```bash +git clone https://git.scarriffle.com/Scarriffle/shelfless.git /opt/shelfless +cd /opt/shelfless +bash deploy/install.sh http://127.0.0.1:13378 8080 +``` +- 1st arg = ABS_URL (default `http://127.0.0.1:13378`) +- 2nd arg = PORT (default `8080`) + +Manage it afterwards: ```bash -cp deploy/shelfless.service /etc/systemd/system/shelfless.service -# edit WorkingDirectory / ABS_URL / PORT inside the file if needed -systemctl daemon-reload -systemctl enable --now shelfless systemctl status shelfless # check it's running journalctl -u shelfless -f # logs +systemctl restart shelfless # restart ``` Open `http://:8080`. The setup screen asks only for username + password diff --git a/deploy/install.sh b/deploy/install.sh index 24d8319..7225727 100644 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -4,19 +4,25 @@ # that serves the app and reverse-proxies to your Audiobookshelf server. # # Usage (as root on the container): -# REPO_URL=https://git.scarriffle.com//shelfless.git \ -# ABS_URL=http://127.0.0.1:13378 PORT=8080 \ -# bash install.sh +# bash deploy/install.sh [ABS_URL] [PORT] # +# Examples: +# bash deploy/install.sh # ABS at localhost:13378, port 8080 +# bash deploy/install.sh http://192.168.1.10:13378 # ABS elsewhere +# bash deploy/install.sh http://192.168.1.10:13378 9000 +# +# All values can also be given as env vars (REPO_URL, ABS_URL, PORT, INSTALL_DIR). # Re-running updates an existing install. set -euo pipefail -REPO_URL="${REPO_URL:?Set REPO_URL to your git repo, e.g. https://git.scarriffle.com/owner/shelfless.git}" +REPO_URL="${REPO_URL:-https://git.scarriffle.com/Scarriffle/shelfless.git}" +ABS_URL="${1:-${ABS_URL:-http://127.0.0.1:13378}}" +PORT="${2:-${PORT:-8080}}" INSTALL_DIR="${INSTALL_DIR:-/opt/shelfless}" -ABS_URL="${ABS_URL:-http://127.0.0.1:13378}" -PORT="${PORT:-8080}" SERVICE="${SERVICE:-shelfless}" +echo "==> Config: ABS_URL=$ABS_URL PORT=$PORT INSTALL_DIR=$INSTALL_DIR" + echo "==> Installing system dependencies" apt-get update -y apt-get install -y git curl ca-certificates