🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Test Paperless connection against entered values, not only saved settings
Sassanb0c9c2a68f4f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0193943..830b83a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,8 @@## 1.0.3 - 2026-05-18### Fixed+- **Paperless "Test Connection" ignored unsaved form values:** Clicking "Test Connection" on the settings page with a freshly entered URL and API token always reported "Connection Failed!", even when the Paperless-ngx instance was reachable, because `POST /api/paperless/test` ignored the `url`/`api_token` in the request body and only ever tested the saved site settings. The endpoint now tests the provided values directly when both are present, and falls back to the saved settings otherwise.+ - _Files: `backend/file_routes.py`- **Font Awesome now served locally (works offline):** The icon font was loaded from the cdnjs CDN, so all UI icons disappeared on offline or restricted networks. Font Awesome Free 7.0.1 (`all.min.css` + webfonts, ~312 KB) is now vendored under `frontend/vendor/fontawesome/` and referenced by all 8 pages; added `font/woff2`, `font/woff`, and `font/ttf` MIME types to `nginx.conf`.- _Files: `frontend/vendor/fontawesome/`, `frontend/*.html`, `nginx.conf`_- **Expired JWT Broken UI State:** Fixed critical issue where users returning to the app after their JWT expired would see a broken, empty UI instead of being redirected to login.diff --git a/backend/file_routes.py b/backend/file_routes.pyindex 88c0957..f7ce86a 100644--- a/backend/file_routes.py+++ b/backend/file_routes.py@@ -8,13 +8,13 @@ import loggingtry:from . import db_handlerfrom .auth_utils import token_required, admin_required- from .paperless_handler import get_paperless_handler+ from .paperless_handler import get_paperless_handler, PaperlessHandlerfrom .utils import allowed_filefrom .db_handler import get_db_connection, release_db_connectionexcept ImportError:import db_handlerfrom auth_utils import token_required, admin_required- from paperless_handler import get_paperless_handler+ from paperless_handler import get_paperless_handler, PaperlessHandlerfrom utils import allowed_filefrom db_handler import get_db_connection, release_db_connection@@ -426,13 +426,26 @@ def paperless_upload():@admin_requireddef test_paperless_connection():"""- Test connection to Paperless-ngx instance+ Test connection to Paperless-ngx instance.++ If `url` and `api_token` are provided in the request body, those+ (possibly unsaved) values are tested directly. Otherwise the saved+ site settings are tested."""conn = Nonetry:- conn = get_db_connection()- paperless_handler = get_paperless_handler(conn)-+ data = request.get_json(silent=True) or {}+ url = (data.get('url') or '').strip()+ api_token = (data.get('api_token') or '').strip()++ paperless_handler = None+ if url and api_token:+ # Test the provided values without requiring them to be saved first+ paperless_handler = PaperlessHandler(url, api_token)+ else:+ conn = get_db_connection()+ paperless_handler = get_paperless_handler(conn)+if not paperless_handler:return jsonify({"error": "Paperless-ngx integration is not enabled or configured"}), 400