From 4322c39f8f0c03168a912fe969df103ff053fa39 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:38:38 -0400 Subject: [PATCH 01/13] Try 3 URL's (for 3 langs) in calibre-web.conf.j2 --- roles/calibre-web/templates/calibre-web.conf.j2 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/roles/calibre-web/templates/calibre-web.conf.j2 b/roles/calibre-web/templates/calibre-web.conf.j2 index cb81c9ad6..d3853e962 100644 --- a/roles/calibre-web/templates/calibre-web.conf.j2 +++ b/roles/calibre-web/templates/calibre-web.conf.j2 @@ -6,17 +6,22 @@ # Unnec when "{{ calibreweb_url }}" is added to Proxy* directive(s) further below # +# 2019-07-14: this line remains necessary (page barely renders without it!) RequestHeader set X-SCRIPT-NAME {{ calibreweb_url }} # Appears unnec: -RequestHeader set X-SCHEME http +#RequestHeader set X-SCHEME http -ProxyPass {{ calibreweb_url }} http://localhost:{{ calibreweb_port }}/ +ProxyPass {{ calibreweb_url1 }} http://localhost:{{ calibreweb_port }}/ +ProxyPass {{ calibreweb_url2 }} http://localhost:{{ calibreweb_port }}/ +ProxyPass {{ calibreweb_url3 }} http://localhost:{{ calibreweb_port }}/ # Possibly unnec? (ProxyPassReverse rewrites internal links, that come back # from Apache proxy. Whereas e.g. kiwix.conf doesn't need this, as kiwix itself # prefixes URLs, thanks to --urlRootLocation=/kiwix/ in its systemd file.) -ProxyPassReverse {{ calibreweb_url }} http://localhost:{{ calibreweb_port }}/ +ProxyPassReverse {{ calibreweb_url1 }} http://localhost:{{ calibreweb_port }}/ +ProxyPassReverse {{ calibreweb_url2 }} http://localhost:{{ calibreweb_port }}/ +ProxyPassReverse {{ calibreweb_url3 }} http://localhost:{{ calibreweb_port }}/ # From 7aeea457aac800356802470425b213e1658061a2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:43:37 -0400 Subject: [PATCH 02/13] Calibre-Web: 3 short URL's --- roles/calibre-web/defaults/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/calibre-web/defaults/main.yml b/roles/calibre-web/defaults/main.yml index 4f396a77b..69c939af3 100644 --- a/roles/calibre-web/defaults/main.yml +++ b/roles/calibre-web/defaults/main.yml @@ -3,9 +3,11 @@ # calibreweb_install: False # calibreweb_enabled: False -# calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) +# calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) -# calibreweb_url: /books # FOR SHORT URL http://box/books -- add {box/libros, box/livres, box/livros, box/liv} etc? +# calibreweb_url1: /books # For SHORT URL http://box/books (English) +# calibreweb_url2: /libros # For SHORT URL http://box/libros (Spanish) +# calibreweb_url3: /livres # For SHORT URL http://box/livres (French) # calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web for books, metadata.db & config/app.db From c748162cd3964153af07e34f103bfe8e95632897 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:47:14 -0400 Subject: [PATCH 03/13] Update default_vars.yml --- vars/default_vars.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 85668f590..d7b99556d 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -494,9 +494,11 @@ calibre_web_path: calibre # NEEDS WORK: https://github.com/iiab/iiab/issues/5 # Calibre-Web alternative to Calibre, offers a clean/modern UX calibreweb_install: False calibreweb_enabled: False -calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) +calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) # http://box/books works. Add {box/libros, box/livres, box/livros, box/liv} etc? -calibreweb_url: /books +calibreweb_url1: /books # For SHORT URL http://box/books (English) +calibreweb_url2: /libros # For SHORT URL http://box/libros (Spanish) +calibreweb_url3: /livres # For SHORT URL http://box/livres (French) calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web # Internet Archive Decentralized Web - create your own offline version box:4244 From 2bcd58ae991eab4b1794ec7c650a0689cc5bb0b3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:47:24 -0400 Subject: [PATCH 04/13] Update local_vars_min.yml --- vars/local_vars_min.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index e26d98535..ebf54d2d4 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -314,9 +314,11 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 # Calibre-Web alternative to Calibre, offers a clean/modern UX calibreweb_install: False calibreweb_enabled: False -calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) +calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) # http://box/books works. Add {box/libros, box/livres, box/livros, box/liv} etc? -calibreweb_url: /books +calibreweb_url1: /books # For SHORT URL http://box/books (English) +calibreweb_url2: /libros # For SHORT URL http://box/libros (Spanish) +calibreweb_url3: /livres # For SHORT URL http://box/livres (French) calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web # Internet Archive Decentralized Web - create your own offline version box:4244 From 286fa03d68927b5bf4cfb628e66927542500c7d3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:47:33 -0400 Subject: [PATCH 05/13] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 955e0c7f5..45de0b3ff 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -314,9 +314,11 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 # Calibre-Web alternative to Calibre, offers a clean/modern UX calibreweb_install: True calibreweb_enabled: True -calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) +calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) # http://box/books works. Add {box/libros, box/livres, box/livros, box/liv} etc? -calibreweb_url: /books +calibreweb_url1: /books # For SHORT URL http://box/books (English) +calibreweb_url2: /libros # For SHORT URL http://box/libros (Spanish) +calibreweb_url3: /livres # For SHORT URL http://box/livres (French) calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web # Internet Archive Decentralized Web - create your own offline version box:4244 From 5dbabaf7274d6b7eb8507d2291c52f859ecfd744 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:47:44 -0400 Subject: [PATCH 06/13] Update local_vars_big.yml --- vars/local_vars_big.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 8f70661ea..e33aa0f3e 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -314,9 +314,11 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 # Calibre-Web alternative to Calibre, offers a clean/modern UX calibreweb_install: True calibreweb_enabled: True -calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) +calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019) # http://box/books works. Add {box/libros, box/livres, box/livros, box/liv} etc? -calibreweb_url: /books +calibreweb_url1: /books # For SHORT URL http://box/books (English) +calibreweb_url2: /libros # For SHORT URL http://box/libros (Spanish) +calibreweb_url3: /livres # For SHORT URL http://box/livres (French) calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web # Internet Archive Decentralized Web - create your own offline version box:4244 From 943aed671e4594bfe4dbf6fe2dd476ca336edc52 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:52:18 -0400 Subject: [PATCH 07/13] "RequestHeader set X-SCRIPT-NAME /books" nec..in just 1 lang? --- roles/calibre-web/templates/calibre-web.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre-web/templates/calibre-web.conf.j2 b/roles/calibre-web/templates/calibre-web.conf.j2 index d3853e962..369270aed 100644 --- a/roles/calibre-web/templates/calibre-web.conf.j2 +++ b/roles/calibre-web/templates/calibre-web.conf.j2 @@ -7,7 +7,7 @@ # # 2019-07-14: this line remains necessary (page barely renders without it!) -RequestHeader set X-SCRIPT-NAME {{ calibreweb_url }} +RequestHeader set X-SCRIPT-NAME {{ calibreweb_url1 }} # Appears unnec: #RequestHeader set X-SCHEME http From a0e80dc4ca615204e1accc1d6c349777682c72e0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:54:27 -0400 Subject: [PATCH 08/13] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index d7b99556d..bd11ba271 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -486,7 +486,7 @@ calibre_port: 8080 # http://box:8080 & http://box:8080/mobile WORK FOR NOW, but short/mnemonic # URL's like http://box/calibre DON'T YET WORK -- BOOKS RARELY DISPLAY: calibre_web_path: calibre # NEEDS WORK: https://github.com/iiab/iiab/issues/529 -# Avoid URL collisions with calibreweb_url: below! +# Avoid URL collisions w/ calibreweb_url1, calibreweb_url2, calibreweb_url3 below! # WARNING: Calibre-Web (below) depends on Calibre's own /usr/bin/ebook-convert # program, so we recommend you also install Calibre (above!) From 980c016a2d65a7c5b549bbbfb959c88fc2dd718a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:54:51 -0400 Subject: [PATCH 09/13] Update local_vars_min.yml --- vars/local_vars_min.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index ebf54d2d4..c9e76bbe5 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -306,7 +306,7 @@ calibre_enabled: False calibre_port: 8080 # Change calibre to XYZ to add your own mnemonic URL like: http://box/XYZ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 -# Avoid collisions with calibreweb_url: below! +# Avoid URL collisions w/ calibreweb_url1, calibreweb_url2, calibreweb_url3 below! # WARNING: Calibre-Web (below) depends on Calibre's own /usr/bin/ebook-convert # program, so we recommend you also install Calibre (above!) From 26910609eb701c50a4fa33e76511249f1a591b8a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:55:08 -0400 Subject: [PATCH 10/13] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 45de0b3ff..01e8d4f79 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -306,7 +306,7 @@ calibre_enabled: False calibre_port: 8080 # Change calibre to XYZ to add your own mnemonic URL like: http://box/XYZ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 -# Avoid collisions with calibreweb_url: below! +# Avoid URL collisions w/ calibreweb_url1, calibreweb_url2, calibreweb_url3 below! # WARNING: Calibre-Web (below) depends on Calibre's own /usr/bin/ebook-convert # program, so we recommend you also install Calibre (above!) From 3653ddfb4037bac6b2e654d5f9e6e6558bba72d7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 10:55:22 -0400 Subject: [PATCH 11/13] Update local_vars_big.yml --- vars/local_vars_big.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index e33aa0f3e..440ab63c5 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -306,7 +306,7 @@ calibre_enabled: False calibre_port: 8080 # Change calibre to XYZ to add your own mnemonic URL like: http://box/XYZ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529 -# Avoid collisions with calibreweb_url: below! +# Avoid URL collisions w/ calibreweb_url1, calibreweb_url2, calibreweb_url3 below! # WARNING: Calibre-Web (below) depends on Calibre's own /usr/bin/ebook-convert # program, so we recommend you also install Calibre (above!) From fcc45c5b41f584f043b8edce01308959aa0d65cb Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 11:08:14 -0400 Subject: [PATCH 12/13] calibre/defaults/main.yml URL warning --- roles/calibre/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index aad43da11..b41475e23 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -18,7 +18,7 @@ # http://box:8080 & http://box:8080/mobile WORK FOR NOW, but short/mnemonic # URL's like http://box/calibre DON'T YET WORK -- BOOKS RARELY DISPLAY: # calibre_web_path: calibre # NEEDS WORK: https://github.com/iiab/iiab/issues/529 -# Avoid URL collisions with calibreweb_url ! +# Avoid URL collisions w/ calibreweb_url1, calibreweb_url2, calibreweb_url3 below! # All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml # If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! From 8f5240b3be3d2748a6ec1620e6fca8dad902d8e7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Jul 2019 11:14:11 -0400 Subject: [PATCH 13/13] calibre-web/tasks/main.yml 3 Short URL's --- roles/calibre-web/tasks/main.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/roles/calibre-web/tasks/main.yml b/roles/calibre-web/tasks/main.yml index 85184898b..7882e00de 100644 --- a/roles/calibre-web/tasks/main.yml +++ b/roles/calibre-web/tasks/main.yml @@ -59,7 +59,7 @@ dest: "{{ calibreweb_venv_path }}/vendor" state: link -- name: Install unit file /etc/systemd/system/calibre-web.service & /etc/apache2/sites-available/calibre-web.conf for http://box{{ calibreweb_url }}, from templates +- name: Install unit file /etc/systemd/system/calibre-web.service & /etc/apache2/sites-available/calibre-web.conf for http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} from templates template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -110,7 +110,7 @@ # Default: http://box/books # SEE ALSO: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy -- name: Enable http://box{{ calibreweb_url }} with Apache +- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache command: a2ensite calibre-web.conf when: calibreweb_enabled | bool @@ -126,7 +126,7 @@ state: stopped when: not calibreweb_enabled -- name: Disable http://box{{ calibreweb_url }} with Apache +- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache command: a2dissite calibre-web.conf when: not calibreweb_enabled @@ -150,8 +150,12 @@ value: calibre-web - option: description value: '"calibre-web is a web app providing a clean interface for browsing, reading and downloading e-books."' - - option: calibreweb_url - value: "{{ calibreweb_url }}" + - option: calibreweb_url1 + value: "{{ calibreweb_url1 }}" + - option: calibreweb_url2 + value: "{{ calibreweb_url2 }}" + - option: calibreweb_url3 + value: "{{ calibreweb_url3 }}" - option: calibreweb_path value: "{{ calibreweb_venv_path }}" - option: calibreweb_home