diff --git a/.gitignore b/.gitignore
index e8d0a97..8a5784c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*~
-*.sw[op]
\ No newline at end of file
+*.sw[op]
+/check_process
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8e4e3b8..0000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding//conf/generate_password_hash.py=utf-8
diff --git a/README.md b/README.md
index 0625610..31b251a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-
# Calibre-web for YunoHost
-[](https://ci-apps.yunohost.org/jenkins/job/calibreweb%20%28Community%29/lastBuild/consoleFull)
-[](https://install-app.yunohost.org/?app=calibreweb)
+
+[](https://dash.yunohost.org/appci/app/calibreweb)  
+[](https://install-app.yunohost.org/?app=calibreweb)
> *This package allow you to install calibreweb quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
@@ -15,7 +15,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d
Alternatively, you may use [COPS](https://github.com/YunoHost-Apps/cops_ynh) which also allows access to your Calibre Library, but in read-only mode.
-**Shipped version:** The shipped version is 0.6.7, but as the numbering changed in the calibre-web app, it is numbered as 0.96.7 in yunohost.
+**Shipped version:** The shipped version is 0.6.12 - Pilar, but as the numbering changed in the calibre-web app, it is numbered as 0.96.12 in yunohost.
Users will be synchronized with authorized Yunohost users (having the calibreweb.main authorization group) automatically. In case of issue you may force the sync in the app itself.
@@ -49,7 +49,7 @@ By default, removing the app will **never** delete the library.
## Known Limitations
-* Authorization access to library to be done manually after install if Calibre library was already existing, for example :
+* Authorization access to library to be done manually after install if Calibre library was already existing (except in yunohost.multimedia directory), for example :
```
chown -R calibreweb: path/to/library
or
@@ -58,7 +58,7 @@ chmod o+rw path/to/library
* Do not use a Nextcloud folder. It's all right if the folder is an external storage in Nextcloud but not if it's an internal one : Changing the data in the library will cause trouble with the sync
* "Magic link feature is not yet available
* Change to library made outside calibreweb are not automatically updated in calibreweb. It is required to disconnect and reconnect to see the changes : Do not open a database both in calibre & calibreweb!
-* Yunohost install use the Tornado server which limits the upload size of a single file to 200Mo.
+* Kobo Sync doesn’t work when Calibre is installed on a subdomain. This issue is caused by nginx. However, it works great when installed on a path e.g. `https://domain.tld/calibreweb`
## Links
@@ -68,16 +68,15 @@ chmod o+rw path/to/library
---
-Developers info
-----------------
+## Developers info
-Please do your pull request to the [testing branch](https://github.com/Yunohost-Apps/calibreweb_ynh/tree/Testing).
+Please do your pull request to the [testing branch](https://github.com/Yunohost-Apps/calibreweb_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
-sudo yunohost app install https://github.com/Yunohost-Apps/calibreweb_ynh/tree/Testing --debug
+sudo yunohost app install https://github.com/Yunohost-Apps/calibreweb_ynh/tree/testing --debug
or
-sudo yunohost app upgrade calibreweb -u https://github.com/Yunohost-Apps/calibreweb_ynh/tree/Testing --debug
+sudo yunohost app upgrade calibreweb -u https://github.com/Yunohost-Apps/calibreweb_ynh/tree/testing --debug
```
@@ -92,6 +91,7 @@ sudo yunohost app upgrade calibreweb -u https://github.com/Yunohost-Apps/calibre
- [ ] Add cronjob to reload database (for nextcloud integration)
- [X] OPDS activation
- [ ] Add config-panel option to trigger do_not_backup_data
+- [ ] Add config-panel to manage max upload size
- [ ] Add action to restart the server
- [ ] Add action to synchronize users
- [ ] Add action to deactivate LDAP et retrieve admin password
diff --git a/check_process b/check_process
index b991b3d..f8bad33 100644
--- a/check_process
+++ b/check_process
@@ -16,34 +16,19 @@
setup_private=1
setup_public=1
upgrade=1
- upgrade=1 from_commit=11f5b96df7d8850beff47f9904745fa53a6f7ed9
+#Last version
+ upgrade=1 from_commit=daf9f864b4f4adde4130c9d000ecc87f5d44ca42
+#v0.6.6
+# upgrade=1 from_commit=11f5b96df7d8850beff47f9904745fa53a6f7ed9
backup_restore=1
multi_instance=1
port_already_use=1 (8083)
change_url=1
-#;; Failed upgrade
-#Run to trigger an error during upgrade to check backup_restore
-# ; pre-install
-# touch /tmp/upgrade_error
-# ; Manifest
-# domain="domain.tld" (DOMAIN)
-# path="/calibre" (PATH)
-# calibre_path="/home/yunohost.app/calibreweb"
-# admin="john" (USER)
-# language="en"
-# is_public=0 (PUBLIC|public=1|private=0)
-# upload=1
-# password="a very long password"
-# ; Checks
-# setup_sub_dir=1
-# setup_root=1
-# upgrade=1 from_commit=3b9c5041e4fa73cb965368379f2b83d076c65341
-;;; Levels
- Level 5=auto
;;; Options
Email=nicolas@aubonalbanais.ovh
Notification=none
;;; Upgrade options
; commit=11f5b96df7d8850beff47f9904745fa53a6f7ed9
name=Version 0.96.0~ynh4
- manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1&
\ No newline at end of file
+ manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1&
+
\ No newline at end of file
diff --git a/conf/app.src b/conf/app.src
index 9723afd..60c3d04 100644
--- a/conf/app.src
+++ b/conf/app.src
@@ -1,3 +1,3 @@
-SOURCE_URL=https://github.com/janeczku/calibre-web/releases/download/0.6.7/calibre-web-0.6.7.zip
-SOURCE_SUM=0c803df4b49993987a7f317c47ba38e680e45712b49da3cb7eb6c66f57379f30
-SOURCE_FORMAT=zip
+SOURCE_URL=https://github.com/janeczku/calibre-web/releases/download/0.6.12/calibre-web-0.6.12.zip
+SOURCE_SUM=c9caeacb5e1ec0ca8e8b6f042193f7b41a403e3e84eaf6b7f238f93041b94a6a
+SOURCE_FORMAT=zip
\ No newline at end of file
diff --git a/conf/app066.src b/conf/app066.src
index f3f4ee7..586a6ab 100644
--- a/conf/app066.src
+++ b/conf/app066.src
@@ -1,3 +1,3 @@
SOURCE_URL=https://github.com/janeczku/calibre-web/archive/0.6.6.zip
SOURCE_SUM=87633c2817263ed2d12fce67ea292b1c6d042aa949aafb728789c15d495415cc
-SOURCE_FORMAT=zip
+SOURCE_FORMAT=zip
\ No newline at end of file
diff --git a/conf/init_calibre_db_user b/conf/init_calibre_db_user
deleted file mode 100644
index 81e736d..0000000
--- a/conf/init_calibre_db_user
+++ /dev/null
@@ -1,3 +0,0 @@
-nickname=\'$admin\',
-locale=\'$language\',
-mature_content=0
\ No newline at end of file
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 51f712c..e0329b4 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -1,9 +1,17 @@
location __PATH__ {
- client_max_body_size 200M;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
+ #Client max body size to allow upload of ebook.
+ #big number as audiobook may be quite big
+ client_max_body_size 500M;
+
+ #Proxy buffering is required for Kobo sync on large library
+ proxy_busy_buffers_size 512k;
+ proxy_buffers 4 512k;
+ proxy_buffer_size 256k;
+
proxy_pass http://localhost:__PORT__;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
diff --git a/conf/systemd.service b/conf/systemd.service
index d166c60..877f964 100644
--- a/conf/systemd.service
+++ b/conf/systemd.service
@@ -7,7 +7,7 @@ Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/
-ExecStart=/bin/sh -c '/usr/bin/python3.5 __FINALPATH__/cps.py'
+ExecStart=/bin/sh -c '/usr/bin/python3 __FINALPATH__/cps.py'
[Install]
WantedBy=multi-user.target
diff --git a/manifest.json b/manifest.json
index 9387bc0..b857e17 100644
--- a/manifest.json
+++ b/manifest.json
@@ -6,15 +6,15 @@
"en": "Browsing, reading and downloading eBooks using a Calibre database",
"fr": "Explorer, lire et télécharger des eBooks à partir d'une base de données Calibre"
},
- "version": "0.96.7~ynh5",
+ "version": "0.96.12~ynh1",
"url": "https://github.com/janeczku/calibre-web",
- "license": "free",
+ "license": "GPL-3.0-only",
"maintainer": {
"name": "Krakinou",
"email": "misterl56@hotmail.com"
},
"requirements": {
- "yunohost": ">= 3.7.1"
+ "yunohost": ">= 4.2.0"
},
"multi_instance": true,
"services": [
@@ -25,38 +25,22 @@
{
"name": "domain",
"type": "domain",
- "ask": {
- "en": "Choose a domain name for Calibre-web",
- "fr": "Choisissez un nom de domaine pour Calibre-web"
- },
"example": "example.com"
},
{
"name": "path",
"type": "path",
- "ask": {
- "en": "Choose a path for Calibre-web",
- "fr": "Choisissez un chemin pour Calibre-web"
- },
"example": "/calibre",
"default": "/calibre"
},
{
"name": "admin",
"type": "user",
- "ask": {
- "en": "Choose an admin user",
- "fr": "Choisissez l’administrateur"
- },
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
- "ask": {
- "en": "Is it a public application?",
- "fr": "Est-ce une application publique ?"
- },
"help":{
"en":"No will set the library in /home/yunohost.multimedia/admin/eBook, except if you set the library as public",
"fr":"Non parametrera la bibliothèque pour /home/yunohost.multimedia/admin/eBook sauf si la bibliothèque est également publique"
@@ -84,7 +68,7 @@
"optional": true,
"ask": {
"en": "Do you want to allow uploading of books?",
- "fr": "Voulez vous autoriser l'upload de livres?"
+ "fr": "Voulez vous autoriser le téléversement de livres?"
},
"help":{
"en":"You may change it later in the app",
diff --git a/pull_request_template.md b/pull_request_template.md
new file mode 100644
index 0000000..7d0417e
--- /dev/null
+++ b/pull_request_template.md
@@ -0,0 +1,18 @@
+## Problem
+- *Description of why you made this PR*
+
+## Solution
+- *And how do you fix that problem*
+
+## PR Status
+- [ ] Code finished.
+- [ ] Tested with Package_check.
+- [ ] Fix or enhancement tested.
+- [ ] Upgrade from last version tested.
+- [ ] Can be reviewed and tested.
+
+## Package_check results
+---
+*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
+
+[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/calibreweb_ynh%20PR-NUM-%20(USERNAME)/)
diff --git a/scripts/_common.sh b/scripts/_common.sh
index c9f1075..a80c917 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -2,97 +2,9 @@
PKG_DEPENDENCIES="sqlite3 libldap2-dev libsasl2-dev python3-dev imagemagick python3-lxml libjpeg-dev zlib1g-dev"
#PKG_DEPENDENCIES="sqlite3 python3-pip imagemagick"
+
DOSSIER_MEDIA=/home/yunohost.multimedia
-LOG_FILE=/var/log/$app/$app.log
-ACCESS_LOG_FILE=/var/log/$app/$app-access.log
-
-#=================================================
-# EXPERIMENTAL HELPERS
-# TO BE DELETED WHEN RELEASED
-#=================================================
-
-#=================================================
-#YNH_MULTIMEDIA
-#=================================================
-
-
-# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args
-
-# Install or update the main directory yunohost.multimedia
-#
-# usage: ynh_multimedia_build_main_dir
-ynh_multimedia_build_main_dir () {
- local ynh_media_release="v1.2"
- local checksum="806a827ba1902d6911095602a9221181"
-
- # Download yunohost.multimedia scripts
- wget -nv https://github.com/Yunohost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
-
- # Check the control sum
- echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
- || ynh_die "Corrupt source"
-
- # Check if the package acl is installed. Or install it.
- ynh_package_is_installed 'acl' \
- || ynh_package_install acl
-
- # Extract
- mkdir yunohost.multimedia-master
- tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
- ./yunohost.multimedia-master/script/ynh_media_build.sh
-}
-
-# Add a directory in yunohost.multimedia
-# This "directory" will be a symbolic link to a existing directory.
-#
-# usage: ynh_multimedia_addfolder "Source directory" "Destination directory"
-#
-# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
-# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia"
-ynh_multimedia_addfolder () {
- # Declare an array to define the options of this helper.
- declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
- local source_dir
- local dest_dir
- # Manage arguments with getopts
- ynh_handle_getopts_args "$@"
-
- ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
-}
-
-# Move a directory in yunohost.multimedia, and replace by a symbolic link
-#
-# usage: ynh_multimedia_movefolder "Source directory" "Destination directory"
-#
-# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
-# It will be moved to "Destination directory"
-# A symbolic link will replace it.
-# | arg: -d, --dest_dir= - Destination directory - The new name and place of the directory, relative to "/home/yunohost.multimedia"
-ynh_multimedia_movefolder () {
- # Declare an array to define the options of this helper.
- declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
- local source_dir
- local dest_dir
- # Manage arguments with getopts
- ynh_handle_getopts_args "$@"
-
- ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --inv --source="$source_dir" --dest="$dest_dir"
-}
-
-# Allow an user to have an write authorisation in multimedia directories
-#
-# usage: ynh_multimedia_addaccess user_name
-#
-# | arg: -u, --user_name= - The name of the user which gain this access.
-ynh_multimedia_addaccess () {
- # Declare an array to define the options of this helper.
- declare -Ar args_array=( [u]=user_name=)
- local user_name
- # Manage arguments with getopts
- ynh_handle_getopts_args "$@"
-
- groupadd -f multimedia
- usermod -a -G multimedia $user_name
-}
-
+#These var are used in init_calibre_db_settings conf file
+log_file=/var/log/$app/$app.log
+access_log_file=/var/log/$app/$app-access.log
diff --git a/scripts/backup b/scripts/backup
index d434683..75680d2 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
-
+source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
@@ -19,7 +19,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
+ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
@@ -31,26 +31,17 @@ port=$(ynh_app_setting_get $app port)
calibre_dir=$(sqlite3 $final_path/app.db "SELECT config_calibre_dir FROM settings WHERE ID=1")
#Save it in settings so that it can be used back afterward
calibre_dir=${calibre_dir%/}
-ynh_app_setting_set $app calibre_dir $calibre_dir
-
-source ../settings/scripts/_common.sh
-
+ynh_app_setting_set $app calibre_dir $calibre_dir
#=================================================
-# STANDARD BACKUP STEPS
+# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
-# STOP SYSTEMD SERVICE
-#=================================================
-ynh_script_progression --message="Stopping a systemd service..." --weight=1
-
-ynh_systemd_action --service_name=$app --action="stop"
-
+ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
-ynh_script_progression --message="Backing up the main app directory..." --weight=1
#This will backup the app.db file at the same time
ynh_backup --src_path="$final_path"
@@ -58,44 +49,30 @@ ynh_backup --src_path="$final_path"
# BACKUP THE NGINX CONFIGURATION
#=================================================
-ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1
-
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
-
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
-ynh_script_progression --message="Backing up logrotate configuration..." --weight=1
+
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
-ynh_script_progression --message="Backing up systemd configuration..." --weight=1
-ynh_backup --src_path="/etc/systemd/system/$app.service"
+ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE DATA DIRECTORY
#=================================================
-ynh_script_progression --message="Backing up data directory..."
-ynh_print_info "Data directory will be backup up only if BACKUP_CORE_ONLY is unset"
+
ynh_backup --src_path="$calibre_dir" --is_big
-
-#=================================================
-# START SYSTEMD SERVICE
-#=================================================
-ynh_script_progression --message="Starting a systemd service..." --weight=5
-
-ynh_systemd_action --service_name=$app --action="start" -l "server on :$port" -t 30
-
-
#=================================================
# END OF SCRIPT
#=================================================
-ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
\ No newline at end of file
+ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
diff --git a/scripts/change_url b/scripts/change_url
index cbed4c2..082ff29 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -26,6 +26,9 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get $app final_path)
port=$(ynh_app_setting_get $app port)
+
+#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script
+#when initializing the conf file of the app
source _common.sh
#=================================================
@@ -120,7 +123,7 @@ fi
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2
-ynh_systemd_action --service_name=$app --action="start" -l "server on :$port" -t 30
+ynh_systemd_action --service_name=$app --action="start" --line_match="Starting Gevent server on" -t 30
#=================================================
# RELOAD NGINX
diff --git a/scripts/install b/scripts/install
index a60559b..473947a 100755
--- a/scripts/install
+++ b/scripts/install
@@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
+
source /usr/share/yunohost/helpers
#=================================================
@@ -22,12 +23,22 @@ language=$YNH_APP_ARG_LANGUAGE
upload=$YNH_APP_ARG_UPLOAD
public_library=$YNH_APP_ARG_PUBLIC_LIBRARY
+#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script
+#when initializing the conf file of the app
+source _common.sh
+
#if app is public, we assume library is public
if [ $is_public -eq 1 ]; then
public_library=1
fi
-source _common.sh
+if [ $is_public -eq 1 ]; then #app is public, library is public
+ calibre_dir=$DOSSIER_MEDIA/share/eBook
+elif [ $is_public -eq 0 ] && [ $public_library -eq 1 ]; then #app is private, library is public
+ calibre_dir=$DOSSIER_MEDIA/share/eBook
+else #app is private, library is private
+ calibre_dir=$DOSSIER_MEDIA/$admin/eBook
+fi
#=================================================
# MANAGE SCRIPT FAILURE
@@ -36,7 +47,6 @@ source _common.sh
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
-
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@@ -45,9 +55,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder"
-# Normalize the url path syntax
-path_url=$(ynh_normalize_url_path $path_url)
-
# Check web path availability
ynh_webpath_available $domain $path_url
# Register (book) web path
@@ -63,18 +70,15 @@ ynh_app_setting_set $app path $path_url
ynh_app_setting_set $app admin $admin
ynh_app_setting_set $app is_public $is_public
-
#=================================================
# STANDARD MODIFICATIONS
#=================================================
-# FIND AND OPEN A PORT
+# FIND AN AVAILABLE PORT
#=================================================
# Find a free port
port=$(ynh_find_port 8083)
-# Open this port
-ynh_script_progression --message="Opening port $port..." --weight=5
-yunohost firewall allow --no-upnp TCP $port 2>&1
+ynh_script_progression --message="Setting port $port..." --weight=5
ynh_app_setting_set $app port $port
#=================================================
@@ -82,6 +86,12 @@ ynh_app_setting_set $app port $port
#=================================================
ynh_script_progression --message="Downloading sources to $final_path..." --weight=10
ynh_app_setting_set $app final_path $final_path
+
+#Set settings constant initializer of the app
+ynh_add_config --template="../sources/patches/app-config_sql.py.patch.src" --destination="../sources/patches/app-config_sql.py.patch"
+ynh_add_config --template="../sources/patches/app-ub.py.patch.src" --destination="../sources/patches/app-ub.py.patch"
+ynh_add_config --template="../sources/patches/app-constants.py.patch.src" --destination="../sources/patches/app-constants.py.patch"
+
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
@@ -89,7 +99,7 @@ ynh_setup_source "$final_path"
# INSTALL DEPENDENCIES
#=================================================
-ynh_script_progression --message="Installing package dependencies..." --weight=15
+ynh_script_progression --message="Installing package dependencies..." --weight=30
ynh_install_app_dependencies $PKG_DEPENDENCIES
#use latest version of pip as per documentation in https://github.com/pypa/get-pip
@@ -124,6 +134,7 @@ ynh_add_nginx_config
ynh_system_user_create $app
chown -R $app: $final_path
+chmod 740 $final_path
#=================================================
# SETUP SYSTEMD
@@ -145,13 +156,6 @@ ynh_script_progression --message="Creating files and directory..." --weight=5
ynh_multimedia_build_main_dir
ynh_multimedia_addaccess $app
-if [ $is_public -eq 1 ]; then #app is public, library is public
- calibre_dir=$DOSSIER_MEDIA/share/eBook
-elif [ $is_public -eq 0 ] && [ $public_library -eq 1 ]; then #app is private, library is public
- calibre_dir=$DOSSIER_MEDIA/share/eBook
-else #app is private, library is private
- calibre_dir=$DOSSIER_MEDIA/$admin/eBook
-fi
#Check if metadata.db file exists. If not create it (empty library)
if [ ! -e "$calibre_dir"/metadata.db ]; then
@@ -179,29 +183,26 @@ ynh_script_progression --message="Setting up database and settings..." --weight=
#we need to start and stop the service so that initial app.db file is created and that we can set default data
#If port 8083 is already in use (ex for second instance), then service start will fail, which is expected : so we do not want
#to set $port on the line match. "server on" will be displayed in case the port is already in use and should be ok to spot the fact that the database is initialized.
-ynh_systemd_action --service_name=$app --action="start" --line_match="server on " --log_path="$final_path/calibre-web.log" -t 30
+#ynh_systemd_action --service_name=$app --action="start" --line_match="Starting Gevent server on" --log_path="$final_path/calibre-web.log" -t 30
#sleep required on low spec like raspberryPi
-sleep 2s
+#sleep 2s
#remove unwanted calibre-web.log
-ynh_secure_remove --file="$final_path/calibre-web.log"
-ynh_systemd_action --service_name=$app --action="stop"
+#ynh_secure_remove --file="$final_path/calibre-web.log"
+#ynh_systemd_action --service_name=$app --action="stop"
#set database settings as per conf file
-conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))), $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""
-eval sqlite3 $final_path/app.db "$conf"
+#conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))), $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""
+#eval sqlite3 $final_path/app.db "$conf"
-conf="\"UPDATE user SET $(. <(echo -E echo $(<../conf/init_calibre_db_user))) WHERE ID=1\""
-eval sqlite3 $final_path/app.db "$conf"
+#conf="\"UPDATE user SET $(. <(echo -E echo $(<../conf/init_calibre_db_user))) WHERE ID=1\""
+#eval sqlite3 $final_path/app.db "$conf"
-#=================================================
-# SECURE FILES AND DIRECTORIES
-#=================================================
+#Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files
+ynh_replace_string --match_string="