mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #879 from holta/calibre-with-logins
Calibre with logins: implements #830 so teachers can add/remove/convert books & edit their metadata
This commit is contained in:
commit
5cb1445a30
4 changed files with 24 additions and 6 deletions
|
@ -5,7 +5,14 @@ calibre_web_path: calibre
|
|||
# In addition to: http://box:8080 http://box/books box/libros box/livres box/livros box/liv
|
||||
|
||||
calibre_dbpath: "{{ content_base }}/calibre"
|
||||
# i.e. /library/calibre
|
||||
# i.e. /library/calibre (holds metadata.db + book directories + our users.sqlite)
|
||||
|
||||
calibre_userdb: "{{ calibre_dbpath }}/users.sqlite"
|
||||
# i.e. /library/calibre/users.sqlite since github.com/iiab/iiab/issues/830
|
||||
# Teachers add/remove/convert books & edit metadata using: Admin/changeme
|
||||
# Stub/Student acnts to browse: box/box, h/h, ht/ht, m/m, mx/mx, p/p, pe/pe
|
||||
# Edit accounts/permissions using:
|
||||
# calibre-server --manage-users --userdb /library/calibre/users.sqlite
|
||||
|
||||
calibre_sample_book: "Metamorphosis-jackson.epub"
|
||||
# Must be downloadable from http://download.iiab.io/packages
|
||||
|
|
|
@ -32,7 +32,16 @@
|
|||
# - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh
|
||||
# - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh
|
||||
|
||||
- name: Create calibre-serve.service and calibre.conf
|
||||
- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING)
|
||||
copy:
|
||||
src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite
|
||||
dest: "{{ calibre_userdb }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: (not calib_executable.stat.exists)
|
||||
|
||||
- name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING)
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
|
@ -40,15 +49,17 @@
|
|||
group: root
|
||||
mode: "{{ item.mode }}"
|
||||
backup: no
|
||||
register: calibre_config
|
||||
# register: calibre_config
|
||||
with_items:
|
||||
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
|
||||
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
|
||||
when: (not calib_executable.stat.exists)
|
||||
|
||||
- name: Force systemd to reread configs
|
||||
- name: Force systemd to reread configs (IF /usr/bin/calibre WAS MISSING)
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
when: calibre_config.changed
|
||||
when: (not calib_executable.stat.exists)
|
||||
# when: calibre_config.changed
|
||||
|
||||
# 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ After=syslog.target network.target local-fs.target
|
|||
Type=forking
|
||||
PIDFile=/var/run/calibre.pid
|
||||
TimeoutStartSec=400
|
||||
ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} {{ calibre_dbpath }}
|
||||
ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} --enable-auth --userdb={{ calibre_userdb }} {{ calibre_dbpath }}
|
||||
|
||||
[Install]
|
||||
TimeoutStartSec=900
|
||||
|
|
BIN
roles/calibre/templates/users.sqlite
Normal file
BIN
roles/calibre/templates/users.sqlite
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue