mirror of
https://github.com/tanrax/org-social-relay
synced 2026-07-25 10:45:00 +02:00
Implements the sender side of https://www.w3.org/TR/webmention/. During feed scans, external URLs found in new posts (and links added by edits) are queued as OutgoingWebmention rows; a periodic task discovers each target's endpoint and delivers the notification. The unique (source, target) pair guarantees a webmention is sent at most once, no matter how many times a feed is rescanned. Targets without an endpoint are marked permanently, failures retry with exponential backoff, and endpoints resolving to loopback/private addresses are rejected. Receiving webmentions is out of scope: plain text feeds cannot advertise an endpoint.
32 lines
1.5 KiB
Python
32 lines
1.5 KiB
Python
# Generated by Django 6.0.7 on 2026-07-16 08:13
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('feeds', '0010_profile_birthday_profile_language_profile_location_and_more'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='OutgoingWebmention',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('source', models.URLField(help_text='Post URL (feed#post_id) containing the link', max_length=500)),
|
|
('target', models.URLField(help_text='External URL the post links to', max_length=500)),
|
|
('endpoint', models.URLField(blank=True, help_text='Discovered Webmention endpoint', max_length=500)),
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('sent', 'Sent'), ('failed', 'Failed'), ('no_endpoint', 'No endpoint')], default='pending', max_length=20)),
|
|
('attempts', models.PositiveSmallIntegerField(default=0)),
|
|
('response_code', models.IntegerField(blank=True, help_text='HTTP status of the last delivery attempt', null=True)),
|
|
('last_attempt_at', models.DateTimeField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
'ordering': ['created_at'],
|
|
'unique_together': {('source', 'target')},
|
|
},
|
|
),
|
|
]
|