-
-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
265 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,10 @@ | |
tags: | ||
- calibre | ||
|
||
- role: calibreweb | ||
tags: | ||
- calibreweb | ||
|
||
- role: cloudcmd | ||
tags: | ||
- cloudcmd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Calibre | ||
|
||
Homepage: [https://calibre-ebook.com](https://calibre-ebook.com) | ||
|
||
Calibre is a powerful and easy to use e-book manager. | ||
|
||
## Usage | ||
|
||
Set `calibre_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
## Specific Configuration | ||
|
||
By default, there is no password set for the main gui. Optional `calibre_password` will allow setting a password for the user `abc`. | ||
|
||
Optionally, cli start arguments can be passed to calibre using `calibre_cli_args`. | ||
|
||
The Calibre webserver must be turned on in the Calibre manager to make it available at the selected port (8094 by default). | ||
|
||
## Ports | ||
|
||
```yml | ||
calibre_port: "8093" | ||
calibre_webserver_port: "8094" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ provisioner: | |
group_vars: | ||
all: | ||
calibre_enabled: true | ||
calibre_port: "8085" # 8084 is used by github actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
calibreweb_enabled: false | ||
calibreweb_available_externally: false | ||
|
||
# uid / gid | ||
calibreweb_user_id: "0" | ||
calibreweb_group_id: "0" | ||
|
||
# directories | ||
calibreweb_data_directory: "{{ docker_home }}/calibreweb" | ||
calibreweb_books_root: "{{ books_root }}" | ||
|
||
# other | ||
calibreweb_ebook_conversion: "linuxserver/calibre-web:calibre" | ||
|
||
# network | ||
calibreweb_port: "8084" | ||
calibreweb_hostname: "calibreweb" | ||
|
||
# specs | ||
calibreweb_memory: 1g | ||
|
||
# docker | ||
calibreweb_container_name: calibreweb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# "Calibre-web" | ||
|
||
Homepage: <https://github.com/janeczku/calibre-web> | ||
|
||
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. | ||
|
||
## Usage | ||
|
||
Set `calibreweb_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
## Specific Configuration | ||
|
||
Requires Calibre ebook management program. Available for download [here](https://calibre-ebook.com/download). | ||
|
||
### Admin login | ||
|
||
**Default admin login:** Username: admin Password: admin123 | ||
|
||
### eBook Conversion | ||
|
||
If you do not need eBook conversion you can disable it to save resources by setting the `calibreweb_ebook_conversion` variable in `group_vars/all.yml` file to be empty. | ||
|
||
- Conversion enabled: `calibreweb_ebook_conversion: "linuxserver/calibre-web:calibre"` | ||
|
||
- Conversion disabled: `calibreweb_ebook_conversion: ""` | ||
|
||
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command. | ||
|
||
## Use with Calibre | ||
|
||
Ansible-NAS add [../calibre](Calibre) long after Calibre-web. To allow Calibre-web direct access to the Calibre database, both applications can share a Docker data directory. To do so, include the following in your inventory `nas.yml`: | ||
|
||
```yml | ||
calibreweb_data_directory: "{{ docker_home }}/calibre" | ||
``` | ||
In this case, the Calibre Database Directory is `/data/Calibre Library`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
calibreweb_enabled: true | ||
calibreweb_port: "8085" # 8084 is used by github actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Stop | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role" | ||
include_role: | ||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
vars: | ||
calibreweb_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get container state | ||
docker_container_info: | ||
name: "{{ calibreweb_container_name }}" | ||
register: result | ||
|
||
- name: Check Calibre-web is running | ||
assert: | ||
that: | ||
- result.container['State']['Status'] == "running" | ||
- result.container['State']['Restarting'] == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Try and stop and remove Calibre-web | ||
docker_container: | ||
name: "{{ calibreweb_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check Calibre-web is stopped | ||
assert: | ||
that: | ||
- not result.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
- name: Start Calibre-web | ||
block: | ||
- name: Create Calibre-web Directories | ||
file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ calibreweb_data_directory }}/config" | ||
|
||
- name: Calibre-web Docker Container | ||
docker_container: | ||
name: "{{ calibreweb_container_name }}" | ||
image: linuxserver/calibre-web:latest | ||
pull: true | ||
volumes: | ||
- "{{ calibreweb_data_directory }}/config:/config" | ||
- "{{ calibreweb_books_root }}:/books" | ||
- "{{ calibreweb_data_directory }}/data:/data" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
PUID: "{{ calibreweb_user_id }}" | ||
PGID: "{{ calibreweb_group_id }}" | ||
DOCKER_MODS: "{{ calibreweb_ebook_conversion }}" | ||
ports: | ||
- "{{ calibreweb_port }}:8083" | ||
restart_policy: unless-stopped | ||
memory: "{{ calibreweb_memory }}" | ||
labels: | ||
traefik.enable: "{{ calibreweb_available_externally | string }}" | ||
traefik.http.routers.calibreweb.rule: "Host(`{{ calibreweb_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.calibreweb.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.calibreweb.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.calibreweb.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.calibreweb.loadbalancer.server.port: "8083" | ||
when: calibreweb_enabled is true | ||
|
||
- name: Stop Calibre-web | ||
block: | ||
- name: Stop Calibre-web | ||
docker_container: | ||
name: "{{ calibreweb_container_name }}" | ||
state: absent | ||
when: calibreweb_enabled is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "Calibre-web" | ||
--- | ||
|
||
Homepage: <https://github.com/janeczku/calibre-web> | ||
|
||
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. | ||
|
||
## Usage | ||
|
||
Set `calibreweb_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
## Specific Configuration | ||
|
||
Requires Calibre ebook management program. Available for download [here](https://calibre-ebook.com/download). | ||
|
||
### Admin login | ||
|
||
**Default admin login:** Username: admin Password: admin123 | ||
|
||
### eBook Conversion | ||
|
||
If you do not need eBook conversion you can disable it to save resources by setting the `calibreweb_ebook_conversion` variable in `group_vars/all.yml` file to be empty. | ||
|
||
- Conversion enabled: `calibreweb_ebook_conversion: "linuxserver/calibre-web:calibre"` | ||
|
||
- Conversion disabled: `calibreweb_ebook_conversion: ""` | ||
|
||
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command. | ||
|
||
## Use with Calibre | ||
|
||
Ansible-NAS add [../calibre](Calibre) long after Calibre-web. To allow Calibre-web direct access to the Calibre database, both applications can share a Docker data directory. To do so, include the following in your inventory `nas.yml`: | ||
|
||
```yml | ||
calibreweb_data_directory: "{{ docker_home }}/calibre" | ||
``` | ||
In this case, the Calibre Database Directory is `/data/Calibre Library`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
--- | ||
title: "Calibre-web" | ||
Title: Calibre | ||
--- | ||
|
||
Homepage: [https://github.com/janeczku/calibre-web](https://github.com/janeczku/calibre-web) | ||
Homepage: [https://calibre-ebook.com](https://calibre-ebook.com) | ||
|
||
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. | ||
Calibre is a powerful and easy to use e-book manager. | ||
|
||
## Usage | ||
|
||
Set `calibre_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
Set `calibre_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
## Specific Configuration | ||
|
||
Requires Calibre ebook management program. Available for download [here](https://calibre-ebook.com/download). | ||
By default, there is no password set for the main gui. Optional `calibre_password` will allow setting a password for the user `abc`. | ||
|
||
### Admin login | ||
Optionally, cli start arguments can be passed to calibre using `calibre_cli_args`. | ||
|
||
**Default admin login:** Username: admin Password: admin123 | ||
The Calibre webserver must be turned on in the Calibre manager to make it available at the selected port (8094 by default). | ||
|
||
### eBook Conversion | ||
## Ports | ||
|
||
If you do not need eBook conversion you can disable it to save resources by setting the `calibre_ebook_conversion` variable in `group_vars/all.yml` file to be empty. | ||
|
||
- Conversion enabled: `calibre_ebook_conversion: "linuxserver/calibre-web:calibre"` | ||
|
||
- Conversion disabled: `calibre_ebook_conversion: ""` | ||
|
||
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command. | ||
```yml | ||
calibre_port: "8093" | ||
calibre_webserver_port: "8094" | ||
``` |