From ce802830c37565d325ba2ecc060443550abb1955 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sun, 25 Oct 2026 22:26:40 +0100 Subject: refactor(core): simplify configuration keys Remove the WEBMENTIONS_SSG prefix from application-specific configuration settings and update validators, tasks, and tests to use the shorter names. --- webmentions_ssg/tasks/receiver.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'webmentions_ssg/tasks/receiver.py') diff --git a/webmentions_ssg/tasks/receiver.py b/webmentions_ssg/tasks/receiver.py index e99eea3..8c9c05a 100644 --- a/webmentions_ssg/tasks/receiver.py +++ b/webmentions_ssg/tasks/receiver.py @@ -137,11 +137,9 @@ def fetch_source(source_url: str) -> tuple[httpx.Response, bytes]: "Accept": "text/html, application/xhtml+xml;q=0.9, text/plain;q=0.8", "User-Agent": f"{APP_NAME}/{VERSION} ReceivedWebmention", }, - timeout=httpx.Timeout( - current_app.config.get("WEBMENTIONS_SSG_REQUEST_TIMEOUT", 5.0) - ), + timeout=httpx.Timeout(current_app.config.get("REQUEST_TIMEOUT", 5.0)), follow_redirects=True, - max_redirects=current_app.config.get("WEBMENTIONS_SSG_MAX_REDIRECTS", 20), + max_redirects=current_app.config.get("MAX_REDIRECTS", 20), trust_env=False, event_hooks={"request": [ensure_public_request]}, ) as client, @@ -158,9 +156,7 @@ def fetch_source(source_url: str) -> tuple[httpx.Response, bytes]: else: raise VerificationError(f"Source returned HTTP {status}") - max_source_bytes = current_app.config.get( - "WEBMENTIONS_SSG_MAX_SOURCE_BYTES", 1_000_000 - ) + max_source_bytes = current_app.config.get("MAX_SOURCE_BYTES", 1_000_000) if (content_length := response.headers.get("Content-Length")) is not None: try: -- cgit v1.3.1