diff --git a/README.md b/README.md index 3a20efe..13d8279 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Browsing, reading and downloading eBooks using a Calibre database **Shipped version:** 0.6.19 - - ## Screenshots ![Screenshot of Calibre-web](./doc/screenshots/screenshot.png) @@ -57,6 +55,13 @@ or chmod o+rw path/to/library ``` +### Kobo Sync + +Calibre-web comes with a [synching feature with a kobo device](https://github.com/janeczku/calibre-web/wiki/Kobo-Integration). You can activate this feature from inside the app in the administration menu. You need to set port 443 as the external server port. +A dedicated permission "Kobo sync" is created by default by the app so that you don't need to expose the whole app for synching. + +[Kepubify](https://pgaskin.net/kepubify/) is also set up as the default kepub converter during installation : This means that your whole library will be converted to kepub when creating the sync token for the first time (this will not affect the existing epubs). This can take a long time : For reference, I have around 10K ebooks on my calibre library and the conversion lasted around 3-4hours on a raspberry Pi 4. + ### OPDS For **OPDS** to work, most OPDS-readers will require the app must be set in public mode. diff --git a/README_fr.md b/README_fr.md index a58f556..0a2cea0 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,9 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Explorer, lire et télécharger des eBooks à partir d'une base de données Calibre -**Version incluse :** 0.6.19 - - +**Version incluse :** 0.6.19 ## Captures d'écran ![Capture d'écran de Calibre-web](./doc/screenshots/screenshot.png) @@ -57,6 +55,13 @@ ou chmod o+rw chemin/vers/bibliothèque ``` +### Synchronisation Kobo + +Calibre-web possède [une fonction de synchronisation avec les liseuses Kobo](https://github.com/janeczku/calibre-web/wiki/Kobo-Integration). Vous pouvez activer cette fonctionnalité depuis le menu d'administration de l'application. Il faut paramétrer le port 443 comme port externe du serveur. +Une permission spécifique "Kobo sync" est créée lors de l'installation de l'application afin de ne pas avoir à exposer l'application entière. + +[Kepubify](https://pgaskin.net/kepubify/) est également installé en tant que convertisseur par défaut vers le format kepub : Cela signifie que l'intégralité de votre bibliothèque sera convertie en format kepub lorsque vous créerez le jeton de synchronisation pour la première fois (ceci n'affecte pas les epubs existant). Cela peut prendre un certain temps : Par exemple, j'ai environ 10K livres dans ma bibliothèque calibre, et la conversion a durée environ 3-4h sur un Raspberry Pi 4 . + ### OPDS Pour que l'**OPDS** fonctionne, la plupart des lecteurs OPDS exigent que l'application soit en accès publique. diff --git a/conf/appkepubify.src.default b/conf/appkepubify.src.default new file mode 100644 index 0000000..e7d020d --- /dev/null +++ b/conf/appkepubify.src.default @@ -0,0 +1,4 @@ +SOURCE_URL=https://github.com/pgaskin/kepubify/releases/download/v4.0.4/kepubify-linux-__MACH__ +SOURCE_SUM=__SHA256__ +SOURCE_EXTRACT=false +SOURCE_FILENAME=kepubify-linux-__MACH__ \ No newline at end of file diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 5d34773..437f69c 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -29,6 +29,13 @@ or chmod o+rw path/to/library ``` +### Kobo Sync + +Calibre-web comes with a [synching feature with a kobo device](https://github.com/janeczku/calibre-web/wiki/Kobo-Integration). You can activate this feature from inside the app in the administration menu. You need to set port 443 as the external server port. +A dedicated permission "Kobo sync" is created by default by the app so that you don't need to expose the whole app for synching. + +[Kepubify](https://pgaskin.net/kepubify/) is also set up as the default kepub converter during installation : This means that your whole library will be converted to kepub when creating the sync token for the first time (this will not affect the existing epubs). This can take a long time : For reference, I have around 10K ebooks on my calibre library and the conversion lasted around 3-4hours on a raspberry Pi 4. + ### OPDS For **OPDS** to work, most OPDS-readers will require the app must be set in public mode. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index c1a3c39..b96d501 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -29,6 +29,13 @@ ou chmod o+rw chemin/vers/bibliothèque ``` +### Synchronisation Kobo + +Calibre-web possède [une fonction de synchronisation avec les liseuses Kobo](https://github.com/janeczku/calibre-web/wiki/Kobo-Integration). Vous pouvez activer cette fonctionnalité depuis le menu d'administration de l'application. Il faut paramétrer le port 443 comme port externe du serveur. +Une permission spécifique "Kobo sync" est créée lors de l'installation de l'application afin de ne pas avoir à exposer l'application entière. + +[Kepubify](https://pgaskin.net/kepubify/) est également installé en tant que convertisseur par défaut vers le format kepub : Cela signifie que l'intégralité de votre bibliothèque sera convertie en format kepub lorsque vous créerez le jeton de synchronisation pour la première fois (ceci n'affecte pas les epubs existant). Cela peut prendre un certain temps : Par exemple, j'ai environ 10K livres dans ma bibliothèque calibre, et la conversion a durée environ 3-4h sur un Raspberry Pi 4 . + ### OPDS Pour que l'**OPDS** fonctionne, la plupart des lecteurs OPDS exigent que l'application soit en accès publique. diff --git a/manifest.json b/manifest.json index 5a70273..f5e8e80 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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.19~ynh1", + "version": "0.96.19~ynh5", "url": "https://github.com/janeczku/calibre-web", "upstream": { "version": "0.6.19", diff --git a/scripts/_common.sh b/scripts/_common.sh index a028de8..1b177ab 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,3 +8,35 @@ DOSSIER_MEDIA=/home/yunohost.multimedia #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 + + +mach=`uname -m` + +sha256_32bit=3365a848ce06d43fca8f1999eb69c6c8e0e20a56b6b8658a8466b9726adef0f5 +sha256_64bit=37d7628d26c5c906f607f24b36f781f306075e7073a6fe7820a751bb60431fc5 +sha256_arm=07f23275c4e674093443f01a591aa0980b0b87dbb0a10986d5001e9d56b0e1e7 +sha256_arm64=5a15b8f6f6a96216c69330601bca29638cfee50f7bf48712795cff88ae2d03a3 +sha256_armv6=7912901dc7b6f51e119f59cfd1f3f8ac2a5c64c42efba9d69ebf2ea8c3a7a2c9 + + + +case "$mach" in + "armv6l" ) mach="arm" + sha256=$sha256_arm + ;; + "armv7l" ) mach="arm" + sha256=$sha256_arm + ;; + "armv8l" ) mach="arm64" + sha256=$sha256_arm64 + ;; + "aarch64" ) mach="arm64" + sha256=$sha256_arm64 + ;; + "x86_64" ) mach="64bit" + sha256=$sha256_64bit + ;; + * ) mach="32bit" + sha256=$sha256_32bit + ;; +esac diff --git a/scripts/backup b/scripts/backup index 75680d2..c73535f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -45,6 +45,12 @@ ynh_print_info --message="Declaring files to be backed up..." #This will backup the app.db file at the same time ynh_backup --src_path="$final_path" +#================================================= +# BACKUP THE KEPUBIFY BINARY +#================================================= + +ynh_backup --src_path="/opt/kepubify" + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index 051c9a2..1d6d3c7 100755 --- a/scripts/install +++ b/scripts/install @@ -92,6 +92,11 @@ ynh_add_config --template="../sources/patches/app-constants.py.patch.src" --dest # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" +#install kepubify converter +ynh_script_progression --message="Installing kepubify..." --weight=1 +ynh_add_config --template="../conf/appkepubify.src.default" --destination="../conf/appkepubify.src" +ynh_setup_source --dest_dir="/opt/kepubify" --source_id="appkepubify" + #================================================= # CREATE DEDICATED USER #================================================= @@ -179,7 +184,8 @@ ynh_app_setting_set $app calibre_dir $calibre_dir #================================================= # Use logrotate to manage application logfile(s) -ynh_use_logrotate +ynh_use_logrotate --logfile="/var/log/$app/$app.log" +ynh_use_logrotate --logfile="/var/log/$app/$app-access.log" chown -R $app:$app /var/log/$app @@ -216,6 +222,8 @@ yunohost service add $app --description="Browse eBook in the web" --log="/var/lo chown -R $app: $final_path chmod 740 $final_path +chown -R $app: /opt/kepubify +chmod 770 /opt/kepubify/kepubify-linux-$mach #================================================= # SETUP SSOWAT @@ -232,6 +240,9 @@ if [ $public_library -eq 0 ]; then ynh_permission_update --permission "main" --add $admin fi +#Kobo sync permission +ynh_permission_create --permission="Kobo sync" --label="Kobo Sync" --url="$domain$path_url/kobo" --allowed="visitors" "all_users" --show_tile="false" --protected="true" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index addf0d9..b5e55ec 100755 --- a/scripts/remove +++ b/scripts/remove @@ -72,6 +72,14 @@ then ynh_secure_remove --file="$calibre_dir" fi +#================================================= +# REMOVE KEPUBIFY DIR +#================================================= + +# Remove the data directory if --purge option is used +ynh_script_progression --message="Removing kepubify directory..." --weight=1 +ynh_secure_remove --file="/opt/kepubify" + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index bf8d9aa..6854252 100755 --- a/scripts/restore +++ b/scripts/restore @@ -69,6 +69,13 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" +#================================================= +# RESTORE THE KEPUBIFY BINARIES +#================================================= +ynh_script_progression --message="Restoring Kepubify..." --weight=1 +ynh_restore_file --origin_path="/opt/kepubify" + + #================================================= # RESTORE USER RIGHTS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 39e10c4..909e31f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,6 +126,27 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +#Adding kepubify converter +if [ -z $(sqlite3 $final_path/app.db "SELECT config_kepubifypath FROM settings") ]; then + eval sqlite3 $final_path/app.db "\"UPDATE settings SET config_kepubifypath='/opt/kepubify/kepubify-linux-$mach' WHERE ID=1\"" +fi +if [ ! -d /opt/kepubify ]; then + ynh_add_config --template="../conf/appkepubify.src.default" --destination="../conf/appkepubify.src" + ynh_setup_source --dest_dir="/opt/kepubify" --source_id="appkepubify" + chmod 770 /opt/kepubify/kepubify-linux-$mach +fi + +# Create the permission "kobo_sync" only if it doesn't exist. +if ! ynh_permission_exists --permission="Kobo sync" +then + # API Authorization with dedicated URL + ynh_print_warn --message="This version has now a dedicated Kobo sync authorization, please review group and permission" + ynh_permission_create --permission="Kobo sync" --label="Kobo Sync" --url="$domain$path_url/kobo" --allowed="visitors" "all_users" --show_tile="false" --protected="true" +else + ##TO BE DELETED - error in testing has led to bad permission settings + ynh_permission_delete --permission="Kobo sync" + ynh_permission_create --permission="Kobo sync" --label="Kobo Sync" --url="$domain$path_url/kobo" --allowed="visitors" "all_users" --show_tile="false" --protected="true" +fi #================================================= # STANDARD UPGRADE STEPS @@ -228,7 +249,9 @@ ynh_replace_string --match_string="