mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Refactor all cablibre-web variables to separte them from calibre
This commit is contained in:
parent
d940ed6532
commit
9160d76492
5 changed files with 44 additions and 44 deletions
|
@ -38,7 +38,7 @@ under admin panel.
|
|||
Upgrading
|
||||
---------
|
||||
Reinstalling Calibre-web automatically upgrades to the latest version. Please backup your configuration
|
||||
before reinstalling. To retain your configuration set calibre-web_provision variable to False.
|
||||
before reinstalling. To retain your configuration set calibreweb_provision variable to False.
|
||||
|
||||
You can manually upgrade while following commands:
|
||||
|
||||
|
@ -50,7 +50,7 @@ Backup Content
|
|||
--------------
|
||||
Calibre-web stores its configuration into SQLite database file /library/calibre-web/metadata.db.
|
||||
The content is stored in various folders under /library/calibre-web. Please backup the files before
|
||||
upgrading. Also set calibre_web_provision varilable to False before upgrading.
|
||||
upgrading. Also set calibreweb_provision variable to False before upgrading.
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
# To override them edit /etc/iiab/local_vars.yml
|
||||
|
||||
# Installation Variables
|
||||
calibre_web_install: False
|
||||
calibre_web_enabled: False
|
||||
calibreweb_install: False
|
||||
calibreweb_enabled: False
|
||||
|
||||
# calibre-web folder to store its data and configuration files.
|
||||
calibre_web_home: "{{ content_base }}/calibre-web"
|
||||
calibreweb_home: "{{ content_base }}/calibre-web"
|
||||
|
||||
calibre_web_http_port: 8083
|
||||
calibre_web_url: /calibre-web
|
||||
calibre_web_path: "{{ iiab_base }}/calibre-web"
|
||||
calibre_web_exec_path: "{{ calibre_web_path }}/cps.py"
|
||||
calibreweb_port: 8083
|
||||
calibreweb_url: /calibre-web
|
||||
calibreweb_path: "{{ iiab_base }}/calibre-web"
|
||||
calibreweb_exec_path: "{{ calibreweb_path }}/cps.py"
|
||||
|
||||
# Calibre-web setup will be provisioned with default administration account, metadata.db and
|
||||
# language. You could turn this to 'False' while reinstalling/upgrading calibre-web.
|
||||
calibre_web_provision: True
|
||||
calibreweb_provision: True
|
||||
|
||||
#calibre-web system user
|
||||
calibre_web_user: root
|
||||
calibreweb_user: root
|
||||
|
||||
# calibre_web admin account
|
||||
# calibre_web_admin_user: admin
|
||||
# calibre_web_admin_password: changeme
|
||||
# calibreweb admin account
|
||||
# calibreweb_admin_user: admin
|
||||
# calibreweb_admin_password: changeme
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
- name: Create calibre-web folders to store data and configuration files.
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
owner: "{{ calibre_web_user }}"
|
||||
owner: "{{ calibreweb_user }}"
|
||||
group: "{{ apache_user }}"
|
||||
mode: 0755
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ calibre_web_home }}"
|
||||
- "{{ calibre_web_path }}"
|
||||
- "{{ calibreweb_home }}"
|
||||
- "{{ calibreweb_path }}"
|
||||
|
||||
- name: Download calibre-web github repository.
|
||||
git:
|
||||
repo: https://github.com/janeczku/calibre-web.git
|
||||
dest: "{{ calibre_web_path }}"
|
||||
dest: "{{ calibreweb_path }}"
|
||||
update: yes
|
||||
version: master
|
||||
when: internet_available
|
||||
|
@ -20,14 +20,14 @@
|
|||
- name: Download calibre-web dependencies into vendor subdirectory.
|
||||
command: pip install --target vendor -r ./requirements.txt
|
||||
args:
|
||||
chdir: "{{ calibre_web_path }}"
|
||||
chdir: "{{ calibreweb_path }}"
|
||||
|
||||
- name: Create calibre-web systemd service unit and httpd2 configuration.
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
owner: "{{ calibre_web_user }}"
|
||||
owner: "{{ calibreweb_user }}"
|
||||
group: "{{ apache_user }}"
|
||||
with_items:
|
||||
- { src: 'calibre-web.service.j2', dest: '/etc/systemd/system/calibre-web.service', mode: '0644' }
|
||||
|
@ -36,12 +36,12 @@
|
|||
- name: Provision calibre-web with default administration account and database.
|
||||
copy:
|
||||
src: roles/calibre-web/files/updated-metadata.db
|
||||
dest: "{{ calibre-web_home }}/metadata.db"
|
||||
owner: "{{ calibre_web_user }}"
|
||||
dest: "{{ calibreweb_home }}/metadata.db"
|
||||
owner: "{{ calibreweb_user }}"
|
||||
group: "{{ apache_user }}"
|
||||
mode: 0644
|
||||
backup: yes
|
||||
when: calibre_web_provision
|
||||
when: calibreweb_provision
|
||||
|
||||
- name: Ask systemd to reread unit files (daemon-reload).
|
||||
systemd:
|
||||
|
@ -52,30 +52,30 @@
|
|||
name: calibre-web
|
||||
enabled: yes
|
||||
state: restarted
|
||||
when: calibre_web_enabled
|
||||
when: calibreweb_enabled
|
||||
|
||||
- name: Enable calibre-web httpd2 site
|
||||
command: a2ensite calibre-web.conf
|
||||
when: calibre_web_enabled
|
||||
when: calibreweb_enabled
|
||||
|
||||
- name: Restart Apache after enabling calibre-web httpd2 site.
|
||||
command: apachectl -k graceful
|
||||
when: calibre_web_enabled
|
||||
when: calibreweb_enabled
|
||||
|
||||
- name: Disable calibre-web service.
|
||||
service:
|
||||
name: calibre-web
|
||||
enabled: no
|
||||
state: stopped
|
||||
when: not calibre_web_enabled
|
||||
when: not calibreweb_enabled
|
||||
|
||||
- name: Disable calibre-web httpd2 site.
|
||||
command: a2dissite calibre-web.conf
|
||||
when: not calibre_web_enabled
|
||||
when: not calibreweb_enabled
|
||||
|
||||
- name: Restart Apache after disabling calibre-web httpd2 site.
|
||||
command: apachectl -k graceful
|
||||
when: not calibre_web_enabled
|
||||
when: not calibreweb_enabled
|
||||
|
||||
- name: Add 'calibre-web' to list of services at /etc/iiab/iiab.ini
|
||||
ini_file:
|
||||
|
@ -88,13 +88,13 @@
|
|||
value: calibre-web
|
||||
- option: description
|
||||
value: '"calibre-web is a web app providing a clean interface for browsing, reading and downloading eBooks."'
|
||||
- option: calibre_web_url
|
||||
value: "{{ calibre_web_url }}"
|
||||
- option: calibre-web_path
|
||||
value: "{{ calibre_web_path }}"
|
||||
- option: calibre_web_port
|
||||
value: "{{ calibre_web_http_port }}"
|
||||
- option: calibreweb_url
|
||||
value: "{{ calibreweb_url }}"
|
||||
- option: calibreweb_path
|
||||
value: "{{ calibreweb_path }}"
|
||||
- option: calibreweb_port
|
||||
value: "{{ calibreweb_port }}"
|
||||
- option: enabled
|
||||
value: "{{ calibre_web_enabled }}"
|
||||
value: "{{ calibreweb_enabled }}"
|
||||
- option: True
|
||||
value: "{{ calibre_web_provision }}"
|
||||
value: "{{ calibreweb_provision }}"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<VirtualHost *:80>
|
||||
<Location "{{ calibre_web_url }}" >
|
||||
RequestHeader set X-SCRIPT-NAME {{ calibre_web_url }}
|
||||
<Location "{{ calibreweb_url }}" >
|
||||
RequestHeader set X-SCRIPT-NAME {{ calibreweb_url }}
|
||||
RequestHeader set X-SCHEME http
|
||||
ProxyPass http://localhost:{{ calibre_web_http_port }}/
|
||||
ProxyPassReverse http://localhost:{{ calibre_web_http_port }}/
|
||||
ProxyPass http://localhost:{{ calibreweb_port }}/
|
||||
ProxyPassReverse http://localhost:{{ calibreweb_port }}/
|
||||
</Location>
|
||||
</VirtualHost>
|
||||
|
|
|
@ -2,9 +2,9 @@ Description=Calibre-Web
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ calibre_web_user }}
|
||||
ExecStart=/usr/bin/python " {{ calibre_web_exec_path }} "
|
||||
WorkingDirectory={{ calibre_web_path }}
|
||||
User={{ calibreweb_user }}
|
||||
ExecStart=/usr/bin/python " {{ calibreweb_exec_path }} "
|
||||
WorkingDirectory={{ calibreweb_path }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Add table
Reference in a new issue