Skip to content

Audiobookshelf add #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ If you have a spare domain name you can configure applications to be accessible

* [Airsonic](https://airsonic.github.io/) - catalog and stream music
* [Apcupsd](http://www.apcupsd.org/) - A daemon for controlling APC UPSes
* [Audiobookshelf](https://www.audiobookshelf.org/) - Self-hosted audiobook and podcast server
* [Bazarr](https://github.com/morpheus65535/bazarr) - companion to Radarr and Sonarr for downloading subtitles
* [Bitwarden](https://github.com/dani-garcia/vaultwarden) - Password Manger (Technically Vaultwarden, a lightweight implementation in Rust)
* [Booksonic](https://booksonic.org/) - The selfhosted audiobook server
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
tags:
- apcupsd

- role: audiobookshelf
tags:
- audiobookshelf

- role: bazarr
tags:
- bazarr
Expand Down
33 changes: 33 additions & 0 deletions roles/audiobookshelf/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
audiobookshelf_enabled: false
audiobookshelf_available_externally: false

# directories
audiobookshelf_config_directory: "{{ docker_home }}/audiobookshelf/config"
audiobookshelf_metadata_directory: "{{ docker_home }}/audiobookshelf/metadata"
audiobookshelf_podcasts_directory: "{{ podcasts_root }}"
audiobookshelf_audiobooks_directory: "{{ audiobooks_root }}"

# uid / gid
audiobookshelf_user_id: "0"
audiobookshelf_group_id: "0"

# If you're paranoid, set permissions to "ro" so audiobookshelf won't ever be able to
# delete your files
audiobookshelf_podcasts_permissions: "rw"
audiobookshelf_audiobooks_permissions: "rw"

# network
audiobookshelf_hostname: "audiobookshelf"
audiobookshelf_port: "13378"

# docker
audiobookshelf_container_name: "audiobookshelf"
audiobookshelf_image_name: "ghcr.io/advplyr/audiobookshelf"
audiobookshelf_image_version: "latest"

# specs
audiobookshelf_memory: "2g"

# see https://hub.docker.com/r/linuxserver/audiobookshelf for details on this setting
audiobookshelf_version: "docker"
50 changes: 50 additions & 0 deletions roles/audiobookshelf/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
- name: Start Audiobookshelf
block:
- name: Create Audiobookshelf Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ audiobookshelf_config_directory }}"
- "{{ audiobookshelf_metadata_directory }}"

- name: Create Audiobookshelf Docker Container
community.docker.docker_container:
name: "{{ audiobookshelf_container_name }}"
image: "{{ audiobookshelf_image_name }}:{{ audiobookshelf_image_version }}"
pull: true
volumes:
- "{{ audiobookshelf_config_directory }}:/config:rw"
- "{{ audiobookshelf_metadata_directory }}:/metadata:rw"
- "{{ audiobookshelf_podcasts_directory }}:/podcasts:{{ audiobookshelf_podcasts_permissions }}"
- "{{ audiobookshelf_audiobooks_directory }}:/audiobooks:{{ audiobookshelf_audiobooks_permissions }}"
ports:
- "{{ audiobookshelf_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ audiobookshelf_user_id }}"
PGID: "{{ audiobookshelf_group_id }}"
VERSION: "{{ audiobookshelf_version }}"
restart_policy: unless-stopped
memory: "{{ audiobookshelf_memory }}"
labels:
traefik.enable: "{{ audiobookshelf_available_externally | string }}"
traefik.http.routers.audiobookshelf.rule: "Host(`{{ audiobookshelf_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.audiobookshelf.tls.certresolver: "letsencrypt"
traefik.http.routers.audiobookshelf.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.audiobookshelf.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.audiobookshelf.loadbalancer.server.port: "80"
homepage.group: Media
homepage.name: Audiobookshelf
homepage.icon: audiobookshelf
homepage.href: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ audiobookshelf_port }}"
homepage.description: Self-hosted audiobook and podcast server
when: audiobookshelf_enabled is true

- name: Stop Audiobookshelf
block:
- name: Stop Audiobookshelf
community.docker.docker_container:
name: "{{ audiobookshelf_container_name }}"
state: absent
when: audiobookshelf_enabled is false
17 changes: 17 additions & 0 deletions website/docs/applications/media-serving/audiobookshelf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "Audiobookshelf"
---

Homepage: [https://audiobookshelf.org/](https://audiobookshelf.org/)

Audiobookshelf is an open-source self-hosted media server for your audiobooks and podcasts.

Fully Open-Source. You can find the code on [GitHub](https://github.com/advplyr/audiobookshelf)

Get the Android app on [Google Play](https://play.google.com/store/apps/details?id=com.audiobookshelf.app). iOS app is in beta.

## Usage

Set `audiobookshelf_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

The Audiobookshelf web interface can be found at [http://ansible_nas_host_or_ip:13378](http://ansible_nas_host_or_ip:13378).