From c605cbcb4c15f439dbbcff5799c85107b28040b1 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 8 Apr 2023 15:50:34 +0200 Subject: [PATCH] Fix patching of sources --- scripts/install | 1 + sources/patches/app-config_sql.py.patch.src | 8 ------- .../app-optional-requirements.txt.patch | 24 +++++++++---------- sources/patches/app-ub.py.patch.src | 10 ++++---- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/scripts/install b/scripts/install index fa13bf7..fa49f0c 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN +admin_mail=$(ynh_user_get_info --username="$admin" --key=mail) is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE upload=$YNH_APP_ARG_UPLOAD diff --git a/sources/patches/app-config_sql.py.patch.src b/sources/patches/app-config_sql.py.patch.src index 73bcd7e..6fad06e 100644 --- a/sources/patches/app-config_sql.py.patch.src +++ b/sources/patches/app-config_sql.py.patch.src @@ -59,11 +59,3 @@ config_converterpath = Column(String, default=None) config_calibre = Column(String) config_rarfile_location = Column(String, default=None) -@@ -269,6 +269,7 @@ - def set_from_dictionary(self, dictionary, field, convertor=None, default=None, encode=None): - """Possibly updates a field of this object. - The new value, if present, is grabbed from the given dictionary, and optionally passed through a convertor. -+ - :returns: `True` if the field has changed value - """ - new_value = dictionary.get(field, default) diff --git a/sources/patches/app-optional-requirements.txt.patch b/sources/patches/app-optional-requirements.txt.patch index 706845b..861e31f 100644 --- a/sources/patches/app-optional-requirements.txt.patch +++ b/sources/patches/app-optional-requirements.txt.patch @@ -1,22 +1,22 @@ ---- a/optional-requirements.txt 2022-04-03 20:17:34.000000000 +0200 -+++ b/optional-requirements.txt 2022-04-18 12:10:55.761291352 +0200 +--- a/optional-requirements.txt 2023-03-27 19:49:57.000000000 +0200 ++++ b/optional-requirements.txt 2023-04-08 15:37:08.576678746 +0200 @@ -1,19 +1,5 @@ # GDrive Integration --google-api-python-client>=1.7.11,<2.50.0 - gevent>20.6.0,<22.0.0 --greenlet>=0.4.17,<1.2.0 --httplib2>=0.9.2,<0.21.0 +-google-api-python-client>=1.7.11,<2.90.0 + gevent>20.6.0,<23.0.0 +-greenlet>=0.4.17,<2.1.0 +-httplib2>=0.9.2,<0.23.0 -oauth2client>=4.0.0,<4.1.4 -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.11.0 +-PyDrive2>=1.3.1,<1.16.0 -PyYAML>=3.12 --rsa>=3.4.2,<4.9.0 +-rsa>=3.4.2,<4.10.0 - -# Gmail --google-auth-oauthlib>=0.4.3,<0.6.0 --google-api-python-client>=1.7.11,<2.50.0 +-google-auth-oauthlib>=0.4.3,<0.9.0 +-google-api-python-client>=1.7.11,<2.90.0 # goodreads goodreads>=0.3.2,<0.4.0 @@ -25,8 +25,8 @@ Flask-SimpleLDAP>=1.4.0,<1.5.0 -# oauth --Flask-Dance>=2.0.0,<5.2.0 --SQLAlchemy-Utils>=0.33.5,<0.39.0 +-Flask-Dance>=2.0.0,<6.3.0 +-SQLAlchemy-Utils>=0.33.5,<0.40.0 - # metadata extraction rarfile>=3.2 diff --git a/sources/patches/app-ub.py.patch.src b/sources/patches/app-ub.py.patch.src index c7601bf..802a808 100644 --- a/sources/patches/app-ub.py.patch.src +++ b/sources/patches/app-ub.py.patch.src @@ -1,6 +1,6 @@ ---- a/cps/ub.py 2022-03-06 16:10:41.000000000 +0100 -+++ b/cps/ub.py 2022-03-08 21:09:41.238818846 +0100 -@@ -231,7 +231,7 @@ +--- a/cps/ub.py 2023-03-27 19:49:57.000000000 +0200 ++++ b/cps/ub.py 2023-04-08 15:48:09.987725888 +0200 +@@ -235,7 +235,7 @@ kindle_mail = Column(String(120), default="") shelf = relationship('Shelf', backref='user', lazy='dynamic', order_by='Shelf.name') downloads = relationship('Downloads', backref='user', lazy='dynamic') @@ -9,12 +9,14 @@ sidebar_view = Column(Integer, default=1) default_language = Column(String(3), default="all") denied_tags = Column(String, default="") -@@ -768,7 +768,7 @@ +@@ -796,8 +796,8 @@ # Generate User admin with admin123 password, and access to everything def create_admin_user(_session): user = User() - user.name = "admin" +- user.email = "admin@example.org" + user.name = "__ADMIN__" ++ user.email = "__ADMIN_MAIL__" user.role = constants.ADMIN_USER_ROLES user.sidebar_view = constants.ADMIN_USER_SIDEBAR