From b2731a37d14eb525799209d299d58b4d74fa881b Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 18 Apr 2020 12:35:56 +0200 Subject: [PATCH] Init commit 0.6.7Beta --- conf/app.src | 4 +- conf/init_calibre_db_ldap_settings | 12 ++--- manifest.json | 2 +- scripts/install | 51 +++++++++---------- sources/patches/app-admin.patch | 11 ---- .../patches/app-optional-requirements.patch | 37 -------------- sources/patches/app-simpleldap.patch | 12 ----- sources/patches/app-web.patch | 11 ---- 8 files changed, 33 insertions(+), 107 deletions(-) delete mode 100644 sources/patches/app-admin.patch delete mode 100644 sources/patches/app-optional-requirements.patch delete mode 100644 sources/patches/app-simpleldap.patch delete mode 100644 sources/patches/app-web.patch diff --git a/conf/app.src b/conf/app.src index 355f00c..862bfcc 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,3 +1,3 @@ -SOURCE_URL=https://github.com/janeczku/calibre-web/archive/7c89f0b5b97678c8b93a484ee7e5acf746240938.zip -SOURCE_SUM=7127c42c2573d85a56da41ea705944a724742e9059a6c138de9cfd78424cce88 +SOURCE_URL=https://github.com/janeczku/calibre-web/archive/06fde4fcd00fcd067a58939e1d9eabee62a86913.zip +SOURCE_SUM=81aa6e95837569e9ebdb6da73529d8cbb33dfde65fd07a384ae6cc79dcfe5afa SOURCE_FORMAT=zip diff --git a/conf/init_calibre_db_ldap_settings b/conf/init_calibre_db_ldap_settings index 101bc15..6c01f4d 100644 --- a/conf/init_calibre_db_ldap_settings +++ b/conf/init_calibre_db_ldap_settings @@ -1,12 +1,10 @@ config_login_type=1, config_ldap_provider_url=\'localhost\', config_ldap_port=389, -config_ldap_schema=\'ldap\', -config_ldap_serv_username=\'cn=admin,dc=yunohost,dc=org\', -config_ldap_serv_password=\'eXVub2hvc3RfZGV2\', +config_ldap_authentication=0, config_ldap_dn=\'dc=yunohost,dc=org\', -config_ldap_user_object=\'\(\&\(objectClass=posixAccount\)\(uid=%s\)\)\', +config_ldap_user_object=\'\(\&\(objectClass=posixAccount\)\(permission=cn=calibreweb.main,ou=permission,dc=yunohost,dc=org\)\(uid=%s\)\)\', config_ldap_openldap=1, -config_ldap_group_object_filter='\(\&\(objectClass=posixGroup\)\(permission=cn=%s.main,ou=permission,dc=yunohost,dc=org\)\)', -config_ldap_group_members_field='memberUid', -config_ldap_group_name='calibreweb' \ No newline at end of file +config_ldap_group_object_filter=\'\(\&\(objectClass=posixGroup\)\(permission=cn=%s.main,ou=permission,dc=yunohost,dc=org\)\)\', +config_ldap_group_members_field=\'memberUid\', +config_ldap_group_name=\'calibreweb\' \ No newline at end of file diff --git a/manifest.json b/manifest.json index 043e31f..f8c7a2a 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.6~ynh4", + "version": "0.96.7beta~ynh4", "url": "https://github.com/janeczku/calibre-web", "license": "free", "maintainer": { diff --git a/scripts/install b/scripts/install index f91a11b..1cd1332 100755 --- a/scripts/install +++ b/scripts/install @@ -172,8 +172,6 @@ ynh_systemd_action -a stop #set database settings as per conf file -#insertion of dummy value for config_ldap_serv_username and config_ldap_serv_password : required for calibreweb and simpleldap but not -#required by Yunohost ldap. 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" @@ -188,31 +186,32 @@ eval sqlite3 $final_path/app.db "$conf" #ynh_print_ON #Creation des autres utilisateurs -if [ $public_library -eq 1 ]; then - table_schema=$(get_db "user") +#Disabled => Will be handled by LDAP +#if [ $public_library -eq 1 ]; then +# table_schema=$(get_db "user") - for i in $(ynh_user_list); do - if [ $i = $admin ]; then continue; fi - mail=$(ynh_user_get_info $i 'mail') - ###################################### - #Build new entry for user - ###################################### - insert_user=$table_schema - insert_user="${insert_user/id/null}" #so that a new entry is created - insert_user="${insert_user/nickname/\'$i\'}" - insert_user="${insert_user/role/0}" #standard role - # pass_hash=$(python /etc/yunohost/apps/$app/conf/generate_password_hash.py "$pass_clear" $final_path/vendor) - # insert_user="${insert_user/password/\'$pass_hash\'}" #we get the same pass even if it's not thanks to LDAP, ones never knows... - insert_user="${insert_user/email/\'$mail\'}" - - ####################################### - # Insert New entry in database - ####################################### - - sqlite3 $final_path/app.db "INSERT INTO user ($table_schema) SELECT $insert_user FROM user WHERE ID = 1;" - - done -fi +# for i in $(ynh_user_list); do +# if [ $i = $admin ]; then continue; fi +# mail=$(ynh_user_get_info $i 'mail') +# ###################################### +# #Build new entry for user +# ###################################### +# insert_user=$table_schema +# insert_user="${insert_user/id/null}" #so that a new entry is created +# insert_user="${insert_user/nickname/\'$i\'}" +# insert_user="${insert_user/role/0}" #standard role +# # pass_hash=$(python /etc/yunohost/apps/$app/conf/generate_password_hash.py "$pass_clear" $final_path/vendor) +# # insert_user="${insert_user/password/\'$pass_hash\'}" #we get the same pass even if it's not thanks to LDAP, ones never knows... +# insert_user="${insert_user/email/\'$mail\'}" +# +# ####################################### +# # Insert New entry in database +# ####################################### +# +# sqlite3 $final_path/app.db "INSERT INTO user ($table_schema) SELECT $insert_user FROM user WHERE ID = 1;" +# +# done +#fi #================================================= # SECURE FILES AND DIRECTORIES diff --git a/sources/patches/app-admin.patch b/sources/patches/app-admin.patch deleted file mode 100644 index 8486e78..0000000 --- a/sources/patches/app-admin.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cps/admin.py 2020-02-23 09:08:01.000000000 +0100 -+++ b/cps/admin.py 2020-04-12 12:51:28.100811662 +0200 -@@ -43,7 +43,7 @@ - from .web import admin_required, render_title_template, before_request, unconfigured, login_required_if_no_ano - - feature_support = { -- 'ldap': False, # bool(services.ldap), -+ 'ldap': bool(services.ldap), - 'goodreads': bool(services.goodreads_support) - } - \ No newline at end of file diff --git a/sources/patches/app-optional-requirements.patch b/sources/patches/app-optional-requirements.patch deleted file mode 100644 index 1088286..0000000 --- a/sources/patches/app-optional-requirements.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/optional-requirements.txt 2020-02-23 09:08:01.000000000 +0100 -+++ b/optional-requirements.txt 2020-04-13 10:50:30.317525119 +0200 -@@ -1,34 +1,3 @@ --# GDrive Integration --google-api-python-client==1.7.11,<1.8.0 --gevent>=1.2.1,<1.5.0 --greenlet>=0.4.12,<0.5.0 --httplib2>=0.9.2,<0.18.0 --oauth2client>=4.0.0,<4.14.0 --uritemplate>=3.0.0,<3.1.0 --pyasn1-modules>=0.0.8,<0.3.0 --pyasn1>=0.1.9,<0.5.0 --PyDrive>=1.3.1,<1.14.0 --PyYAML>=3.12 --rsa==3.4.2,<4.1.0 --six>=1.10.0,<1.14.0 -- --# goodreads --goodreads>=0.3.2,<0.4.0 --python-Levenshtein>=0.12.0,<0.13.0 -- - # ldap login - python_ldap>=3.0.0,<3.3.0 - flask-simpleldap>1.3.0,<1.5.0 -- --#oauth --flask-dance>=0.13.0 --sqlalchemy_utils>=0.33.5,<0.37.0 -- --# extracting metadata --lxml>=3.8.0,<4.6.0 --Pillow>=4.0.0,<7.1.0 --rarfile>=2.7 -- --# other --natsort>=2.2.0,<7.1.0 --git+https://github.com/OzzieIsaacs/comicapi.git@ad8bfe5a1c31db882480433f86db2c5c57634a3f#egg=comicapi diff --git a/sources/patches/app-simpleldap.patch b/sources/patches/app-simpleldap.patch deleted file mode 100644 index cbf869a..0000000 --- a/sources/patches/app-simpleldap.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/cps/services/simpleldap.py 2020-02-23 09:08:01.000000000 +0100 -+++ b/cps/services/simpleldap.py 2020-04-13 18:57:49.302535092 +0200 -@@ -35,8 +35,7 @@ - app.config['LDAP_HOST'] = config.config_ldap_provider_url - app.config['LDAP_PORT'] = config.config_ldap_port - app.config['LDAP_SCHEMA'] = config.config_ldap_schema -- app.config['LDAP_USERNAME'] = config.config_ldap_user_object.replace('%s', config.config_ldap_serv_username)\ -- + ',' + config.config_ldap_dn -+ app.config['LDAP_USERNAME'] = config.config_ldap_serv_username - app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password) - app.config['LDAP_REQUIRE_CERT'] = bool(config.config_ldap_require_cert) - if config.config_ldap_require_cert: diff --git a/sources/patches/app-web.patch b/sources/patches/app-web.patch deleted file mode 100644 index fe45177..0000000 --- a/sources/patches/app-web.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cps/web.py 2020-02-23 09:08:01.000000000 +0100 -+++ b/cps/web.py 2020-04-12 12:52:23.940774100 +0200 -@@ -53,7 +53,7 @@ - from .redirect import redirect_back - - feature_support = { -- 'ldap': False, # bool(services.ldap), -+ 'ldap': bool(services.ldap), - 'goodreads': bool(services.goodreads_support) - } - \ No newline at end of file