installer: accept ABS_URL/PORT as positional args, default REPO_URL

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-06-02 20:31:23 +02:00
parent 1e2b56e863
commit 757a6fab63
2 changed files with 25 additions and 11 deletions

View File

@@ -31,14 +31,22 @@ ABS_URL=http://127.0.0.1:13378 PORT=8080 npm start
# open http://<container-ip>: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://<container-ip>:8080`. The setup screen asks only for username + password

View File

@@ -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/<owner>/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