Skip to content

Commit 3617d3e

Browse files
2 parents 897fe0e + e29c564 commit 3617d3e

3 files changed

Lines changed: 20 additions & 24 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ This tells CWA to avoid enabling WAL on the Calibre `metadata.db` and the `app.d
142142
- Using the information provided in the Calibre eBook-converter documentation on which formats convert best into epubs, CWA is able to determine from downloads containing multiple eBook formats, which format will convert most optimally, ignoring the other formats to ensure the **best possible quality** and no **duplicate imports** -->
143143

144144
#### **Automatic Conversion Service** 🔃
145-
- On by default though can be toggled of in the CWA Settings page, with EPUB as the default target format
145+
- On by default though can be toggled off in the CWA Settings page, with EPUB as the default target format
146146
- _Available target formats include:_ **EPUB**, **MOBI**, **AZW3**, **KEPUB** & **PDF**
147147
- Upon detecting new files in the Ingest Directory, if any of the files are in formats the user has configured CWA to auto-convert to the current target format,
148148
- The following **28 file types are currently supported:**

cps/__init__.py

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,24 @@ def _cwa_ensure_db_session():
248248
from sqlalchemy import or_
249249
import time
250250

251+
if config.config_allow_reverse_proxy_header_login:
252+
"""
253+
Load user from reverse proxy authentication header if configured.
254+
Sets g.flask_httpauth_user early so that current_user proxy resolves correctly
255+
for user-specific settings like theme preferences.
256+
257+
This must run before any blueprint before_request handlers that access current_user.
258+
"""
259+
260+
from flask import g, request
261+
from . import usermanagement
262+
user = usermanagement.load_user_from_reverse_proxy_header(request)
263+
if user:
264+
g.flask_httpauth_user = user
265+
else:
266+
# Explicitly set to None to indicate we checked but found nothing
267+
g.flask_httpauth_user = None
268+
251269
if current_user.is_authenticated:
252270
try:
253271
# Verify required tables exist before querying
@@ -358,28 +376,6 @@ def shutdown_session(exception=None):
358376
if calibre_db.session_factory:
359377
calibre_db.session_factory.remove()
360378

361-
# Load user from reverse proxy header early in request lifecycle
362-
# This ensures current_user resolves correctly before any code accesses user settings
363-
@app.before_request
364-
def _load_reverse_proxy_user():
365-
"""
366-
Load user from reverse proxy authentication header if configured.
367-
Sets g.flask_httpauth_user early so that current_user proxy resolves correctly
368-
for user-specific settings like theme preferences.
369-
370-
This must run before any blueprint before_request handlers that access current_user.
371-
"""
372-
from flask import g, request
373-
374-
if config.config_allow_reverse_proxy_header_login:
375-
from . import usermanagement
376-
user = usermanagement.load_user_from_reverse_proxy_header(request)
377-
if user:
378-
g.flask_httpauth_user = user
379-
else:
380-
# Explicitly set to None to indicate we checked but found nothing
381-
g.flask_httpauth_user = None
382-
383379
from .schedule import register_scheduled_tasks, register_startup_tasks
384380
register_scheduled_tasks(config.schedule_reconnect)
385381
register_startup_tasks()

cps/translations/de/LC_MESSAGES/messages.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ msgstr ""
16231623

16241624
#: cps/shelf.py:207 cps/templates/layout.html:270
16251625
msgid "Create a Shelf"
1626-
msgstr "Bücherregal anlegen"
1626+
msgstr "Neues Bücherregal"
16271627

16281628
#: cps/shelf.py:215
16291629
msgid "Sorry you are not allowed to edit this shelf"

0 commit comments

Comments
 (0)