-
Notifications
You must be signed in to change notification settings - Fork 5
/
calibre.yml
132 lines (117 loc) · 4.35 KB
/
calibre.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
- hosts: homelab
vars:
application: calibre
docker_network: "{{ networks.iot }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: lscr.io/linuxserver/calibre:7.23.0
ipv4_address: "{{ docker_network.prefix }}.248"
volumes:
- "{{ config_directory }}:/config"
- "{{ common_directory_books }}:/books"
env:
PUID: "{{ common_user_id | string }}"
PGID: "{{ common_root_group | string }}"
TZ: "{{ common_timezone }}"
TITLE: "{{ application | title }}"
security_opts:
- seccomp=unconfined
traefik:
- port: 8080
auth: page
labels:
# https://github.com/linuxserver/docker-baseimage-kasmvnc#lossless
'{
"traefik.http.middlewares.{{ application }}.headers.customResponseHeaders.Cross-Origin-Embedder-Policy": "require-corp",
"traefik.http.middlewares.{{ application }}.headers.customResponseHeaders.Cross-Origin-Opener-Policy": "same-origin",
"traefik.http.middlewares.{{ application }}.headers.customResponseHeaders.Cross-Origin-Resource-Policy": "same-site"
}'
homepage:
group: Media
weight: 600
description: "eBook Manager"
- name: Copy Kindle key
ansible.builtin.copy:
src: "{{ files_directory }}/kindle.k4i"
dest: "{{ config_directory }}/"
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
- name: Create plugins folder
ansible.builtin.file:
path: "{{ config_directory }}/plugins"
state: directory
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
register: _calibre_plugins_dir
- name: Download plugins
ansible.builtin.get_url:
url: "{{ item.url }}"
dest: "{{ _calibre_plugins_dir.path }}/{{ item.name }}.zip"
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0644"
notify: Restart
loop:
- name: kfx-input
url: https://plugins.calibre-ebook.com/291290.zip
- name: Download DeDRM
block:
- name: Create DeDRM folder
ansible.builtin.file:
path: "{{ config_directory }}/DeDRM"
state: directory
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
register: _calibre_dedrm_dir
- name: Download DeDRM_tools
ansible.builtin.get_url:
url: "https://github.com/noDRM/DeDRM_tools/releases/download/v10.0.9/DeDRM_tools_10.0.9.zip"
dest: "{{ _calibre_dedrm_dir.path }}/"
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0644"
checksum: "sha256:d46e7ff94a46dc871eb9b7e639e6da1883823cd5a9d705d53f51bd9c251aabda"
register: _calibre_dedrm_tools_download
notify: Restart
- name: Unarchive DeDRM_tools
ansible.builtin.unarchive:
src: "{{ _calibre_dedrm_tools_download.dest }}"
dest: "{{ _calibre_dedrm_dir.path }}"
remote_src: true
register: _calibre_dedrm_unzip
- name: Copy DeDRM to plugins folder
ansible.builtin.copy:
src: "{{ _calibre_dedrm_unzip.dest }}/DeDRM_plugin.zip"
dest: "{{ _calibre_plugins_dir.path }}/dedrm.zip"
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
remote_src: true
- name: Install plugins
community.docker.docker_container_exec:
container: "{{ application }}"
command: bash -c "find /config/plugins -name '*.zip' | xargs -l calibre-customize --add-plugin"
register: _command_result
failed_when: ('Plugin added:' not in _command_result.stdout)
changed_when: false