From 075c409c91ceedeef7b12b1b188442e92f19035b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Nov 2021 08:51:33 +0100 Subject: [PATCH 1/7] Fix linter warnings --- check_process | 8 ++++---- conf/nginx.conf | 17 +++++++---------- manifest.json | 8 +++----- scripts/restore | 6 ++---- 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/check_process b/check_process index 017dab1..3bfc8ff 100644 --- a/check_process +++ b/check_process @@ -1,12 +1,12 @@ ;; Complete Test # First Run of complete test ; Manifest - domain="domain.tld" (DOMAIN) - path="/calibre" (PATH) + domain="domain.tld" + path="/calibre" calibre_path="/home/yunohost.app/calibreweb" - admin="john" (USER) + admin="john" language="en" - is_public=0 (PUBLIC|public=1|private=0) + is_public=0 upload=1 password="a very long password" ; Checks diff --git a/conf/nginx.conf b/conf/nginx.conf index e0329b4..86caa24 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,5 @@ location __PATH__ { - # 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; @@ -13,12 +10,12 @@ location __PATH__ { proxy_buffer_size 256k; proxy_pass http://localhost:__PORT__; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Script-Name __PATH__; -# proxy_set_header X-Remote-User $remote_user; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + proxy_set_header X-Script-Name __PATH__; +# proxy_set_header X-Remote-User $remote_user; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/manifest.json b/manifest.json index 42cab9d..6d6bdf6 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "email": "misterl56@hotmail.com" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -30,8 +30,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -41,8 +40,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/restore b/scripts/restore index 2e14305..0035190 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,10 +37,8 @@ source ../settings/scripts/_common.sh # CHECK IF THE APP CAN BE RESTORED #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available $domain $path_url \ - || ynh_die "Path not available: ${domain}${path_url}" -test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " + +test ! -d $final_path || ynh_die "There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS From 9e1ade5bf843d14320beae775019396f0c2c790f Mon Sep 17 00:00:00 2001 From: Krakinou Date: Thu, 27 Jan 2022 00:01:46 +0100 Subject: [PATCH 2/7] 0.6.16 --- check_process | 2 +- conf/app.src | 4 +- manifest.json | 4 +- sources/patches/app-admin.html.patch | 9 ++--- .../app-optional-requirements.txt.patch | 37 +++++++++---------- 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/check_process b/check_process index 3bfc8ff..b570167 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,7 @@ setup_public=1 upgrade=1 #Last version - upgrade=1 from_commit=df304aadd7767a3e38bfc6d4da45ce8a94ebc749 + upgrade=1 from_commit=79c6c4ad03f62d2ed4f4180ac6b7dac1c117a62a #v0.6.6 # upgrade=1 from_commit=11f5b96df7d8850beff47f9904745fa53a6f7ed9 backup_restore=1 diff --git a/conf/app.src b/conf/app.src index 7c29e65..c1d3c84 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.14/calibre-web-0.6.14.zip -SOURCE_SUM=df772c692bfa42d3d4293b531133c833b0f4d427267e784c32b4678bb5a1b753 +SOURCE_URL=https://github.com/janeczku/calibre-web/releases/download/0.6.16/calibre-web-0.6.16.zip +SOURCE_SUM=7f9f1217b0010625765796c2122bd941b23f9d1a99f83eb6c9c4c9fa3cb2dcbc SOURCE_FORMAT=zip diff --git a/manifest.json b/manifest.json index 6d6bdf6..97786d4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,10 +6,10 @@ "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.14~ynh1", + "version": "0.96.16~ynh1", "url": "https://github.com/janeczku/calibre-web", "upstream": { - "version": "0.6.14", + "version": "0.6.16", "license": "GPL-3.0-only", "admindoc": "https://github.com/janeczku/calibre-web/wiki", "code": "https://github.com/janeczku/calibre-web" diff --git a/sources/patches/app-admin.html.patch b/sources/patches/app-admin.html.patch index ce4e067..5dedd55 100644 --- a/sources/patches/app-admin.html.patch +++ b/sources/patches/app-admin.html.patch @@ -1,11 +1,10 @@ ---- a/cps/templates/admin.html 2021-10-31 11:31:53.000000000 +0100 -+++ b/cps/templates/admin.html 2021-11-05 19:22:28.554122091 +0100 -@@ -185,12 +185,6 @@ +--- a/cps/templates/admin.html 2022-01-24 19:18:40.000000000 +0100 ++++ b/cps/templates/admin.html 2022-01-26 23:47:53.669309039 +0100 +@@ -189,11 +189,6 @@ - + - {% if feature_support['updater'] %} -- - -
{{_('Check for Update')}}
- diff --git a/sources/patches/app-optional-requirements.txt.patch b/sources/patches/app-optional-requirements.txt.patch index 5fbef2b..0df4493 100644 --- a/sources/patches/app-optional-requirements.txt.patch +++ b/sources/patches/app-optional-requirements.txt.patch @@ -1,35 +1,34 @@ ---- a/optional-requirements.txt 2021-10-31 11:31:53.000000000 +0100 -+++ b/optional-requirements.txt 2021-11-05 19:27:25.664091168 +0100 -@@ -1,21 +1,3 @@ --# GDrive Integration --gevent>20.6.0,<22.0.0 +--- a/optional-requirements.txt 2022-01-24 19:18:40.000000000 +0100 ++++ b/optional-requirements.txt 2022-01-26 23:46:47.077607055 +0100 +@@ -1,20 +1,5 @@ + # GDrive Integration +-google-api-python-client>=1.7.11,<2.37.0 + gevent>20.6.0,<22.0.0 -greenlet>=0.4.17,<1.2.0 --httplib2>=0.9.2,<0.20.0 +-httplib2>=0.9.2,<0.21.0 -oauth2client>=4.0.0,<4.1.4 --uritemplate>=3.0.0,<3.1.0 +-uritemplate>=3.0.0,<4.2.0 -pyasn1-modules>=0.0.8,<0.3.0 -pyasn1>=0.1.9,<0.5.0 --PyDrive2>=1.3.1,<1.9.0 +-PyDrive2>=1.3.1,<1.11.0 -PyYAML>=3.12 --rsa>=3.4.2,<4.8.0 +-rsa>=3.4.2,<4.9.0 -six>=1.10.0,<1.17.0 - --# Gdrive and Gmail integration --google-api-python-client>=1.7.11,<2.1.0 -- -# Gmail -google-auth-oauthlib>=0.4.3,<0.5.0 +-google-api-python-client>=1.7.11,<2.37.0 # goodreads goodreads>=0.3.2,<0.4.0 -@@ -25,10 +7,6 @@ - python-ldap>=3.0.0,<3.4.0 +@@ -24,10 +9,6 @@ + python-ldap>=3.0.0,<3.5.0 Flask-SimpleLDAP>=1.4.0,<1.5.0 --#oauth --Flask-Dance>=2.0.0,<5.1.0 --SQLAlchemy-Utils>=0.33.5,<0.38.0 +-# oauth +-Flask-Dance>=2.0.0,<5.2.0 +-SQLAlchemy-Utils>=0.33.5,<0.39.0 - - # extracting metadata + # metadata extraction rarfile>=2.7 - scholarly>=1.2.0, <1.3 + scholarly>=1.2.0,<1.6 From c6d7babf3bf558d2a10552ca46b05f767f6790e7 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 26 Jan 2022 23:01:54 +0000 Subject: [PATCH 3/7] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6dc4204..525b910 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ 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.14 +**Shipped version:** 0.6.16 diff --git a/README_fr.md b/README_fr.md index efb2683..6e7784f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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.14 +**Version incluse :** 0.6.16 From 6692b15a46c2526b0cb882d2867b1184749e02e9 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 6 Feb 2022 14:20:04 +0100 Subject: [PATCH 4/7] bugfixes fix linter warning fix root install in nginx conf --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 12 ------------ scripts/upgrade | 31 +++++++++---------------------- 4 files changed, 11 insertions(+), 36 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 082ff29..fc03a01 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -100,7 +100,7 @@ then path_url="$new_path" #Cannot use empty string for X-script-name, causes an issue in the python prg if [ $path_url = "/" ] ; then - ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf + ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf fi # Create a dedicated nginx config ynh_add_nginx_config diff --git a/scripts/install b/scripts/install index 1cafaca..604ebd2 100755 --- a/scripts/install +++ b/scripts/install @@ -120,7 +120,7 @@ ynh_script_progression --message="Setting up system configuration..." --weight=5 if [ $path_url = "/" ] ; then - ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf + ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf fi # Create a dedicated nginx config diff --git a/scripts/restore b/scripts/restore index 0035190..e6dcfc5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,6 @@ domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) final_path=$(ynh_app_setting_get $app final_path) calibre_dir=$(ynh_app_setting_get $app calibre_dir) -is_public=$(ynh_app_setting_get $app is_public) 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 @@ -164,17 +163,6 @@ ynh_replace_string --match_string=" Date: Sun, 6 Feb 2022 15:19:21 +0100 Subject: [PATCH 5/7] fix linter warning --- scripts/install | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 604ebd2..b329566 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN -is_public=$YNH_APP_ARG_IS_PUBLIC +public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE upload=$YNH_APP_ARG_UPLOAD public_library=$YNH_APP_ARG_PUBLIC_LIBRARY @@ -28,13 +28,13 @@ public_library=$YNH_APP_ARG_PUBLIC_LIBRARY source _common.sh #if app is public, we assume library is public -if [ $is_public -eq 1 ]; then +if [ $public -eq 1 ]; then public_library=1 fi -if [ $is_public -eq 1 ]; then #app is public, library is public +if [ $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 +elif [ $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 @@ -68,7 +68,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=5 ynh_app_setting_set $app domain $domain 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 From 9f1bda1e7dad836021fb1fd993ba7781889d8eae Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 6 Feb 2022 21:10:55 +0100 Subject: [PATCH 6/7] fix linter warning --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b329566..286f9dc 100755 --- a/scripts/install +++ b/scripts/install @@ -55,10 +55,8 @@ 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" -# Check web path availability -ynh_webpath_available $domain $path_url # Register (book) web path -ynh_webpath_register $app $domain $path_url +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST From 5e5c8234cb01676be27cdc5ebb5f78913fe2bdd4 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 6 Feb 2022 21:28:40 +0100 Subject: [PATCH 7/7] fix is_public --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 286f9dc..d018813 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN -public=$YNH_APP_ARG_IS_PUBLIC +is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE upload=$YNH_APP_ARG_UPLOAD public_library=$YNH_APP_ARG_PUBLIC_LIBRARY @@ -28,13 +28,13 @@ public_library=$YNH_APP_ARG_PUBLIC_LIBRARY source _common.sh #if app is public, we assume library is public -if [ $public -eq 1 ]; then +if [ $is_public -eq 1 ]; then public_library=1 fi -if [ $public -eq 1 ]; then #app is public, library is public +if [ $is_public -eq 1 ]; then #app is public, library is public calibre_dir=$DOSSIER_MEDIA/share/eBook -elif [ $public -eq 0 ] && [ $public_library -eq 1 ]; then #app is private, library is public +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