feat: backfeed of responses to crossposts (v2.13.0)
Likes, reposts, quotes and replies to a note's GoToSocial, Bluesky and Threads copies are read back from the silos and stored as webmentions (ADR-073): age-based schedule to 90 days, pruning of withdrawn responses, #nobridge/#nobot opt-outs, admin backfill and Check now, Threads counts, a Quotes group, local avatar copies, and delete tombstones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6aaac982d5
commit
55ce6a1fdd
27 files changed
+1763
-40
No files matched your search
@@ -5,7 +5,7 @@ Handles authenticated admin functionality including dashboard, note creation,
|
||||
editing, and deletion. All routes require authentication.
|
||||
"""
|
||||
|
||||
from flask import Blueprint, flash, g, jsonify, redirect, render_template, request, url_for
|
||||
from flask import Blueprint, current_app, flash, g, jsonify, redirect, render_template, request, url_for
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
@@ -259,6 +259,7 @@ def edit_note_form(note_id: int):
|
||||
syndication_targets=get_targets().values(),
|
||||
syndications=syndications,
|
||||
syndication_enabled=enabled,
|
||||
backfeed_enabled=current_app.config.get("BACKFEED_ENABLED", False),
|
||||
)
|
||||
|
||||
|
||||
@@ -496,18 +497,24 @@ def webmentions():
|
||||
from starpunk.webmention_queries import list_webmentions
|
||||
|
||||
status_filter = request.args.get('status')
|
||||
origin_filter = request.args.get('origin') or None
|
||||
page = int(request.args.get('page', 1))
|
||||
|
||||
webmentions, total_pages = list_webmentions(
|
||||
status_filter=status_filter,
|
||||
page=page,
|
||||
per_page=25
|
||||
per_page=25,
|
||||
origin_filter=origin_filter,
|
||||
)
|
||||
|
||||
from starpunk import backfeed
|
||||
|
||||
return render_template(
|
||||
"admin/webmentions.html",
|
||||
webmentions=webmentions,
|
||||
status_filter=status_filter,
|
||||
origin_filter=origin_filter,
|
||||
backfeed=backfeed.status(),
|
||||
page=page,
|
||||
total_pages=total_pages,
|
||||
user_me=g.me
|
||||
@@ -674,6 +681,28 @@ def revoke_token(token_id):
|
||||
return redirect(url_for("admin.tokens"))
|
||||
|
||||
|
||||
@bp.route("/backfeed/backfill", methods=["POST"])
|
||||
@require_auth
|
||||
def backfeed_backfill():
|
||||
"""Check every crosspost once for responses, whatever its age (v2.13.0)"""
|
||||
from starpunk import backfeed
|
||||
|
||||
count = backfeed.start_backfill()
|
||||
flash(f"Backfill started: {count} crosspost(s) to check", "success")
|
||||
return redirect(url_for("admin.webmentions"))
|
||||
|
||||
|
||||
@bp.route("/syndication/<int:syndication_id>/check", methods=["POST"])
|
||||
@require_auth
|
||||
def check_syndication_responses(syndication_id):
|
||||
"""Check one crosspost's responses at the next worker pass (v2.13.0)"""
|
||||
from starpunk import backfeed
|
||||
|
||||
backfeed.check_now(syndication_id)
|
||||
flash("Responses will be checked shortly", "success")
|
||||
return redirect(request.referrer or url_for("admin.dashboard"))
|
||||
|
||||
|
||||
@bp.route("/syndication/<int:syndication_id>/retry", methods=["POST"])
|
||||
@require_auth
|
||||
def retry_syndication(syndication_id):
|
||||
|
||||
Reference in new issue
Block a user