mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 11:05:37 +00:00
fix: patch calibre-web cloudflare login issues
This commit is contained in:
parent
a9ae0c8858
commit
0637cc693b
25
modules/services/calibre-web-cloudflare.patch
Normal file
25
modules/services/calibre-web-cloudflare.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff --git a/cps/__init__.py b/cps/__init__.py
|
||||
index 0b912d23..ad5d1fa9 100644
|
||||
--- a/cps/__init__.py
|
||||
+++ b/cps/__init__.py
|
||||
@@ -83,7 +83,6 @@ app.config.update(
|
||||
lm = MyLoginManager()
|
||||
lm.login_view = 'web.login'
|
||||
lm.anonymous_user = ub.Anonymous
|
||||
-lm.session_protection = 'strong'
|
||||
|
||||
if wtf_present:
|
||||
csrf = CSRFProtect()
|
||||
diff --git a/cps/admin.py b/cps/admin.py
|
||||
index 1004ee78..e295066e 100644
|
||||
--- a/cps/admin.py
|
||||
+++ b/cps/admin.py
|
||||
@@ -98,8 +98,6 @@ def before_request():
|
||||
# make remember me function work
|
||||
if current_user.is_authenticated:
|
||||
confirm_login()
|
||||
- if not ub.check_user_session(current_user.id, flask_session.get('_id')) and 'opds' not in request.path:
|
||||
- logout_user()
|
||||
g.constants = constants
|
||||
g.user = current_user
|
||||
g.allow_registration = config.config_public_reg
|
@ -25,9 +25,19 @@ in {
|
||||
calibreLibrary = libraryPath;
|
||||
reverseProxyAuth.enable = false;
|
||||
enableBookConversion = true;
|
||||
enableBookUploading = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Fix: https://github.com/janeczku/calibre-web/issues/2422
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
calibre-web = prev.calibre-web.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [ ./calibre-web-cloudflare.patch ];
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
caddyRoutes = [{
|
||||
match = [{ host = [ config.bookServer ]; }];
|
||||
handle = [{
|
||||
|
Loading…
Reference in New Issue
Block a user