aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks (follow)
Commit message (Collapse)AuthorAge
* refactor(core): split task workflows into focused helpersDennis Fink9 days
| | | | | | | | | Decompose receiver verification, source scanning, and Webmention delivery into explicit claim, check, reconciliation, and outcome-recording stages. Extract Huey backend parsing helpers and add focused tests for the new task boundaries while preserving existing processing semantics.
* refactor(core): use PEP 695 type parametersDennis Fink9 days
| | | | | | Replace explicit `ParamSpec` and `TypeVar` declarations with inline generic function parameters for Huey task decorators without changing runtime behavior.
* refactor(core): consolidate repeated helper logicDennis Fink9 days
| | | | | | | | | Centralize SQL row counts, hostname parsing, and content-type normalization so tasks, forms, and scanners share consistent implementations. Simplify periodic task registration and admin lookups with table-driven setup and Flask-SQLAlchemy's built-in 404 helper.
* refactor(sender): rename locked task helpersDennis Fink9 days
| | | | | | Rename the non-Huey scanner and sender helpers to `_scan_locked` and `_send_locked` so their names reflect that they run only while holding task locks.
* refactor(core): clarify Webmention mutation APIsDennis Fink9 days
| | | | | | | | Make in-place reset and reopen helpers return `None` so callers no longer perform pointless self-reassignment. Split explicit resend behavior into its own method instead of hiding it behind a boolean flag on `reopen`.
* refactor(core): centralize pending revision logicDennis Fink9 days
| | | | | | | | Make `SentWebmention.pending` a hybrid property so the same definition works in Python and SQL expressions. Reuse it across sender and scanner guards to remove duplicated revision checks.
* refactor(core): replace HTTP status magic numbersDennis Fink9 days
| | | | | | Use `HTTPStatus` constants for standard response codes and a named upper bound for retryable server errors so network and task status handling is self-documenting.
* fix(core): clarify Huey file path semanticsDennis Fink9 days
| | | | | | | | Document and test SQLAlchemy-style slash handling for file and SQLite Huey URLs, including distinct relative and absolute path forms. Update validation errors to show the supported three- and four-slash conventions.
* refactor(sender): flatten canonical URL parsingDennis Fink9 days
| | | | | | Return early when no canonical link is present so canonical URL validation can follow a linear path with less nesting and unchanged scan behavior.
* fix(core): make network task failures explicitDennis Fink9 days
| | | | | | | | | | Introduce a dedicated response-size error so callers only translate expected limit violations instead of masking unrelated `ValueError` exceptions. Ensure failed sockets are always closed, remove dead discovery error handling, and log unexpected sender failures with tracebacks before recording them.
* chore(core): enforce Ruff docstring spacingDennis Fink9 days
| | | | | | Enable additional Ruff docstring checks for summary separation and closing quotes, then normalize migration and application docstrings to satisfy the new rules.
* fix(core): decouple task imports from app initializationDennis Fink10 days
| | | | | | | | | | Keep stable lazy task handles that register against the active Huey backend so modules can be imported before app creation and survive backend reinitialization. Separate package metadata and the shared blueprint from application startup to remove import-order dependencies and keep build-time version lookup lightweight.
* refactor(sender): simplify HTML endpoint discoveryDennis Fink10 days
| | | | | | Use a case-insensitive CSS selector to find Webmention links directly, removing manual relation parsing while preserving endpoint validation and document order.
* refactor(receiver): simplify HTML mention selectorsDennis Fink10 days
| | | | | | Store complete CSS selectors alongside their target attributes so HTML mention detection can query supported references directly without rebuilding selectors.
* refactor(core): use lowercase extension namesDennis Fink10 days
| | | | | | Rename shared Flask extension singletons to conventional lowercase names and update imports throughout the application and tests to remove redundant aliases.
* fix(core): validate Redis Huey URL schemesDennis Fink10 days
| | | | | | Parse Redis backend flavours explicitly so supported combinations preserve the correct redis or rediss scheme while malformed or unknown variants fail fast.
* chore(core): enable stricter Ruff lint rulesDennis Fink10 days
| | | | | | | | Expand Ruff checks for bugbear, complexity, pathlib, return statements, simplifications, upgrades, and docstring style. Apply the resulting behavior-neutral cleanup across application and test code.
* chore(core): fix task typing issuesDennis Fink10 days
| | | | | | Add explicit result assertions, broader parser annotations, and SQLAlchemy result casts so static type checking reflects the runtime guarantees of task code.
* refactor(core): simplify task control flowDennis Fink10 days
| | | | | | Replace unnecessary pattern matching and temporary assignments with direct conditionals and inline configuration access without changing task behavior.
* refactor(core): split modules by responsibilityDennis Fink10 days
| | | | | | | | Break up monolithic views, task helpers, networking, CLI, and application extension setup so each module owns a focused concern. Reorganize the test suite around the new boundaries while preserving existing Webmention behavior and coverage.
* fix(sender): treat malformed requests as terminal failuresDennis Fink2026-10-31
| | | | | | | | | Reject invalid stored targets and local URL or protocol errors as permanent failures so unrecoverable requests do not consume the sender retry budget. Preserve the recorded attempt state while preventing duplicate retries for the same source revision.
* fix(sender): prevent source scanner path escapesDennis Fink2026-10-31
| | | | | | | | | Reject symlinked source files whose resolved targets leave the configured source directory so scans cannot read unintended files from the host filesystem. Normalize and validate ignored hostname patterns at startup and again at scan time to keep scanner filtering predictable.
* fix(receiver): prevent endless verification recoveryDennis Fink2026-10-31
| | | | | | | | Cap stale verification requeues so repeatedly lost or crashing tasks eventually become terminal failures instead of cycling indefinitely. Reject URLs that httpx cannot safely fetch before enqueueing, and persist unexpected verification errors as terminal failures.
* feat(receiver): add resource limits and retentionDennis Fink2026-10-31
| | | | | | | | Bound incoming request and URL sizes so untrusted Webmention submissions cannot consume unbounded application or database resources. Purge old failed and deleted received Webmentions on a schedule, and use portable SHA-256 URL fingerprints to preserve uniqueness for long URLs.
* fix(core): replace Huey pickle serialization with JSONDennis Fink2026-10-30
| | | | | | | | | Prevent broker-controlled task and result payloads from deserializing arbitrary Python objects by using a restricted JSON serializer with an explicit type allowlist. Fail closed on serializer overrides and document broker isolation and migration requirements for existing pickle-backed deployments.
* fix(core): prevent DNS rebinding in HTTP requestsDennis Fink2026-10-30
| | | | | | | | | | Pin outbound connections to validated public IP addresses so DNS changes cannot redirect receiver or sender requests onto private or link-local networks. Apply the same protection across redirects, add an overall request deadline, and keep DNS resolution out of synchronous endpoint form validation.
* fix(sender): validate missing source directoriesDennis Fink2026-10-30
| | | | | | Resolve configured source paths without requiring them to exist first so missing directories produce the scanner's explicit directory validation error instead of leaking a lower-level path resolution exception.
* fix(receiver): recover stale Webmention verificationsDennis Fink2026-10-30
| | | | | | | | | Add a periodic recovery sweep for Webmentions left in received or verifying states after worker crashes, lost queue entries, or interrupted processing. Use atomic lease-style updates so stale workers cannot overwrite newer results, and index verification state for efficient recovery scans.
* fix(sender): make endpoint discovery more resilientDennis Fink2026-10-30
| | | | | | | | Fall back to GET when HEAD fails so targets that reject or mishandle HEAD can still advertise a Webmention endpoint. Ignore malformed or unsupported endpoint candidates and continue searching for the first valid HTTP endpoint.
* fix(receiver): handle punctuation around plain-text URLsDennis Fink2026-10-30
| | | | | | | | | Ignore surrounding prose punctuation when matching target IRIs in text/plain sources so valid Webmentions are not rejected when URLs appear in normal sentences. Preserve balanced URL parentheses and reject longer URLs that only share the target as a prefix.
* fix(sender): stabilize source content fingerprintsDennis Fink2026-10-30
| | | | | | | | | Hash normalized reader-facing content and outgoing targets instead of raw h-entry markup so generated attributes and relative timestamps do not trigger spurious source revisions or repeat Webmentions. Preserve meaningful changes such as image updates and reaction target changes while ignoring target ordering and other markup noise.
* fix(sender): retry manual scans on lock contentionDennis Fink2026-10-30
| | | | | | | | Ensure requested rescans are not silently dropped when a periodic scan already holds the scanner lock. Defer the manual task and retry it after the active scan finishes while still propagating unrelated scan failures.
* fix(sender): prevent concurrent duplicate sendsDennis Fink2026-10-30
| | | | | | | | | Serialize delivery attempts per Webmention so duplicate queued tasks cannot send the same revision concurrently or consume additional retry attempts. Scope locks by Webmention UUID so unrelated deliveries can still run in parallel.
* feat(sender): add persistent retry backoffDennis Fink2026-10-30
| | | | | | | | | | Persist retry state per source revision so temporary delivery failures survive worker restarts and duplicate queued tasks cannot bypass the retry schedule. Use capped exponential backoff, stop after a configurable attempt limit, and reset the retry budget when a source changes or an admin resends manually.
* fix(sender): ignore inconclusive empty scansDennis Fink2026-10-30
| | | | | | | | Treat scans with no successfully processed source pages as inconclusive so a temporary empty or partially rebuilt output directory cannot mark every source deleted or trigger removal Webmentions. Defer pending sends until at least one source is scanned successfully.
* fix(sender): prevent duplicate canonical source URLsDennis Fink2026-10-30
| | | | | | | | | Keep persisted sources, including deleted ones, as owners of their canonical URLs so newly scanned aliases cannot claim the same source identity. Skip duplicate canonical paths without blocking unrelated sources from being saved or queued for delivery.
* fix(sender): isolate source parser failuresDennis Fink2026-10-30
| | | | | | | | | Prevent malformed pages or unexpected third-party parser exceptions from aborting an entire source scan or causing previously known sources to be treated as deleted. Keep persistence failures visible so database errors still fail the scan.
* feat(receiver): send Webmention notification digestsDennis Fink2026-10-29
| | | | | | | | | Batch verified Webmention notifications into a scheduled digest so bursts of incoming mentions do not generate a separate email for every verification. Track which mentions have already been reported and leave them pending when SMTP delivery fails so a later digest can retry safely.
* fix(sender): validate Webmention status URLsDennis Fink2026-10-29
| | | | | | | | | | Treat status URLs returned by remote endpoints as untrusted input so malformed or non-HTTP schemes cannot be persisted or exposed as clickable links. Preserve successful delivery when a Location header is invalid while rendering legacy unsafe status values as plain text in the admin interface.
* fix(core): resolve static type checking issuesDennis Fink2026-10-27
|
* refactor(core): simplify configuration keysDennis Fink2026-10-25
| | | | | | Remove the WEBMENTIONS_SSG prefix from application-specific configuration settings and update validators, tasks, and tests to use the shorter names.
* feat(receiver): add email notifications for new webmentionsDennis Fink2026-10-25
| | | | | | | | | Send an email after a newly received Webmention is successfully verified, with SMTP delivery configurable through Flask-Mail. Avoid notifications for resubmissions and manual reverification, and keep the persisted verification result unchanged if notification enqueueing fails.
* test(core): align tests with module ownershipDennis Fink2026-08-21
| | | | | | | | | Move direct validator, model, and Huey extension coverage into dedicated test modules and mock dependencies where behavior belongs to another module. Expand Huey extension typing and coverage while removing duplicate assertions from scanner, sender, form, and view tests.
* chore(core): standardize SPDX copyright headersDennis Fink2026-08-20
| | | | | | | | Add SPDX copyright and license headers to source, test, migration, template, and static files throughout the project. Include the maintainer email in copyright notices and fill in the BSD license copyright holder.
* refactor(core): improve typing and test coverageDennis Fink2026-08-19
| | | | | | | | | Restructure database and user CLI commands, make passwords write-only model properties, and use the UTC datetime constant throughout the application. Add PEP 287-style documentation and expand receiver, scanner, sender, and URL security tests to cover error paths and edge cases.
* feat(sender): add manual source rescan actionDennis Fink2026-08-17
| | | | | | | | Add an authenticated action to queue a source rescan from the sent Webmentions overview. Extract the reusable confirmation modal and its JavaScript so received and sent admin actions share the same implementation.
* feat(sender): add outgoing Webmention pipelineDennis Fink2026-08-15
| | | | | | | | | | | Scan generated h-entry documents for Webmention targets and track source revisions and delivery state in the database. Discover target endpoints, send Webmentions asynchronously, and reconcile updated, removed, restored, and deleted sources across scans. Add authenticated views for inspecting sent Webmentions and make the scanner schedule configurable.
* fix(receiver): prevent requests to non-public addressesDennis Fink2026-08-10
| | | | | | | | | Resolve source hostnames before fetching and reject addresses that are not globally routable to prevent SSRF against local or private services. Repeat the check for every HTTP request so redirects cannot bypass the initial source validation. Treat DNS resolution failures during verification as temporary fetch errors.
* Implement received Webmention handlingDennis Fink2026-08-09
Add the Flask application setup, database models and migrations, authentication, and configuration for development and testing. Implement asynchronous Webmention verification with Huey, including HTML and plain-text source validation, retries, status tracking, and size limits. Add status, login, and paginated received-Webmention views together with comprehensive tests for forms, views, and receiver tasks.