Migrate the full media batch from the monolith: - jellyfin: auto-VAAPI on /dev/dri/renderD128 + render GID; DLNA/discovery UDP ports - emby: UID/GID baked at install; HW transcoding block commented for manual opt-in - audiobookshelf: separate audiobooks + podcasts paths; port 13378 - arm: optical drive detection; privileged:true; split movies/music output; port 8080 - lyrion: network_mode:host for Chromecast/Squeezebox UDP discovery; port 9000 - immich: multi-container stack (server+ML+valkey+postgres); two library strategies (unified with import-photos.sh helper, or external read-only); port 2283 https://claude.ai/code/session_01Y4dMKtkqkpvmgDKoRdzhTG
99 lines
3.1 KiB
Bash
99 lines
3.1 KiB
Bash
#!/bin/bash
|
|
# services/audiobookshelf.sh — Audiobook & podcast server (Audiobookshelf).
|
|
# Part of the modular post-install system (sourced by setup.sh).
|
|
#
|
|
# Ported from ubuntu-post-install-24.04-crowdsec.sh (# ---- AUDIOBOOKSHELF ----).
|
|
# Own ~/docker/audiobookshelf/ with a standalone docker-compose.yml + .env.
|
|
|
|
register_service audiobookshelf media "Audiobook & podcast server (Audiobookshelf)" 13378
|
|
|
|
install_audiobookshelf() {
|
|
require_docker || return 1
|
|
|
|
local ABS_DIR="$DOCKER_DIR/audiobookshelf"
|
|
local DEFAULT_AUDIOBOOKS="$ACTUAL_HOME/audiobooks"
|
|
|
|
if [ "$DRY_RUN" = true ]; then
|
|
echo "[DRY-RUN] Audiobookshelf would:"
|
|
echo " - Create $ABS_DIR with docker-compose.yml + .env (config/ metadata/ podcasts/)"
|
|
echo " - Mount an audiobooks folder (default $DEFAULT_AUDIOBOOKS) at /audiobooks"
|
|
echo " - Expose port 13378"
|
|
echo " - Offer a Caddy reverse proxy and to start the container"
|
|
return 0
|
|
fi
|
|
|
|
local AUDIOBOOKS_PATH=""
|
|
prompt_text "Path to audiobooks folder [$DEFAULT_AUDIOBOOKS]:" "$DEFAULT_AUDIOBOOKS" AUDIOBOOKS_PATH
|
|
AUDIOBOOKS_PATH="${AUDIOBOOKS_PATH/#\~/$ACTUAL_HOME}"; AUDIOBOOKS_PATH="${AUDIOBOOKS_PATH%/}"
|
|
|
|
mkdir -p "$ABS_DIR"
|
|
ensure_docker_dir_ownership "$ABS_DIR"
|
|
cd "$ABS_DIR" || return 1
|
|
|
|
local TZ_VAL; TZ_VAL=$(cat /etc/timezone 2>/dev/null || echo "UTC")
|
|
|
|
cat > docker-compose.yml << ABS_COMPOSE
|
|
name: audiobookshelf
|
|
|
|
services:
|
|
audiobookshelf:
|
|
image: ghcr.io/advplyr/audiobookshelf:latest
|
|
container_name: audiobookshelf
|
|
hostname: audiobookshelf
|
|
restart: unless-stopped
|
|
environment:
|
|
- TZ=$TZ_VAL
|
|
volumes:
|
|
- ./config:/config
|
|
- ./metadata:/metadata
|
|
- \${AUDIOBOOKS_PATH}:/audiobooks
|
|
- \${PODCASTS_PATH:-./podcasts}:/podcasts
|
|
ports:
|
|
- "13378:80"
|
|
ABS_COMPOSE
|
|
|
|
cat > .env << ABS_ENV
|
|
AUDIOBOOKS_PATH=$AUDIOBOOKS_PATH
|
|
PODCASTS_PATH=./podcasts
|
|
ABS_ENV
|
|
|
|
mkdir -p config metadata podcasts
|
|
chown -R "$ACTUAL_USER:$ACTUAL_USER" "$ABS_DIR"
|
|
log_success "Audiobookshelf configured at $ABS_DIR"
|
|
|
|
configure_caddy_for_service "AudioBookshelf" "13378" "audiobooks"
|
|
|
|
write_readme "$ABS_DIR" << MD
|
|
# Audiobookshelf
|
|
|
|
Self-hosted audiobook and podcast server with progress sync across devices.
|
|
|
|
- Web UI: http://localhost:13378
|
|
- Audiobooks: \`$AUDIOBOOKS_PATH\` → mounted at /audiobooks
|
|
- Podcasts: \`podcasts/\` in this folder → /podcasts (change \`PODCASTS_PATH\` in .env)
|
|
- App data: \`config/\` and \`metadata/\`
|
|
|
|
## Manage
|
|
\`\`\`bash
|
|
cd $ABS_DIR
|
|
docker compose up -d # start
|
|
docker compose down # stop
|
|
docker compose logs -f # logs
|
|
docker compose pull && docker compose up -d # update
|
|
\`\`\`
|
|
|
|
First launch: open the web UI, create your admin account, then add libraries
|
|
pointing at /audiobooks and /podcasts.
|
|
MD
|
|
|
|
local START_ABS=""
|
|
prompt_yn "Start Audiobookshelf now? (y/n):" "y" START_ABS
|
|
if [ "$START_ABS" = "y" ] || [ "$START_ABS" = "Y" ]; then
|
|
docker compose up -d && log_success "Audiobookshelf started" || log_warning "Failed to start — check: docker compose logs"
|
|
fi
|
|
|
|
echo ""
|
|
echo " Access at: http://localhost:13378"
|
|
echo ""
|
|
}
|