Switch Bridgy syndication from Micropub to webmention
Bridgy's Micropub endpoint required per-silo access tokens and posted raw markdown content directly. Switch to Bridgy's webmention publish endpoint instead: POST source/target to /publish/webmention and let Bridgy re-fetch the note page, which now carries hidden verification links for silos not yet syndicated. Removes the now-unused config/bridgy.php and BRIDGY_MASTODON_TOKEN env var, and caps both jobs to a single try since retries would send Bridgy a duplicate publish webmention.
This commit is contained in:
parent
11e2c469cb
commit
db09718a96
9 changed files with 167 additions and 94 deletions
|
|
@ -77,4 +77,38 @@ class NotesControllerTest extends TestCase
|
|||
$response = $this->get('/notes/photou-photologo');
|
||||
$response->assertNotFound();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes not yet syndicated should carry the hidden Bridgy publish
|
||||
* verification links, so Bridgy can confirm intent when it re-fetches
|
||||
* the page after receiving our webmention.
|
||||
*/
|
||||
#[Test]
|
||||
public function note_page_includes_bridgy_verification_links_when_not_yet_syndicated(): void
|
||||
{
|
||||
$note = Note::factory()->create();
|
||||
|
||||
$response = $this->get($note->uri);
|
||||
|
||||
$response->assertSee('https://brid.gy/publish/mastodon', false);
|
||||
$response->assertSee('https://brid.gy/publish/bluesky', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Once a note has been syndicated to a silo, the hidden verification
|
||||
* link for that silo should no longer be rendered.
|
||||
*/
|
||||
#[Test]
|
||||
public function note_page_omits_bridgy_verification_link_once_syndicated(): void
|
||||
{
|
||||
$note = Note::factory()->create();
|
||||
$note->mastodon_url = 'https://mastodon.example/@jonny/1';
|
||||
$note->bluesky_url = 'https://bsky.app/profile/jonnybarnes.uk/1';
|
||||
$note->save();
|
||||
|
||||
$response = $this->get($note->uri);
|
||||
|
||||
$response->assertDontSee('https://brid.gy/publish/mastodon', false);
|
||||
$response->assertDontSee('https://brid.gy/publish/bluesky', false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue