Commit graph

3,833 commits

Author SHA1 Message Date
31c49ac3fc
Adopt Laravel's Image facade for media processing, upgrade Intervention to v4
Laravel 13's Image facade wraps Intervention Image v4 internally, so
switching our upload width probe and resize job/command to it required
bumping intervention/image ^3 -> ^4 (and its intervention/gif ^5
dependency). Removes our own ImageManager container binding and
config/image.php in favour of Laravel's built-in driver resolution.

Also fixes a latent filename mismatch in ProcessMediaJobTest that Pint's
stricter typing on the new Image API turned into a hard TypeError, and
tidies config/flare.php to use imported class names instead of FQCNs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Sorsgn85nw7uQyRMNvzyD
2026-08-01 17:07:38 +01:00
287520ad7b
Force HTTPS URL generation in production
Uses Laravel's built-in URL::forceHttps() so route(), url(), and asset()
always generate https:// links in production, without affecting local dev.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RP5TeZbk9KS754xuJMobjE
2026-07-28 19:20:18 +01:00
2eab5749ea
Update dependencies 2026-07-26 10:57:20 +01:00
e08763c526
Migrate outbound HTTP calls from Guzzle to the Http facade
Replaces every raw GuzzleHttp\Client usage (Nominatim, web.archive.org,
webmention fetch/discover/send, Bridgy syndication, IndieAuth client_id
lookup, contact avatar/h-card fetch, profile image download, and the
CloudConvert screenshot pipeline) with Illuminate\Support\Facades\Http,
and enables Http::preventStrayRequests() globally in tests so any
un-faked outbound call now fails loudly instead of silently hitting the
network.

The CloudConvert retry-until-finished middleware in AppServiceProvider
is replaced by a plain polling loop in SaveScreenshot, which also fixes
a latent bug where the old middleware decoded a response object instead
of its body. Bridgy syndication jobs keep their tries=1/no-retry
semantics unchanged to avoid duplicate publishes. Guzzle's PSR-7 helpers
(Header, UriResolver, Utils) stay in SendWebMentions since Http has no
equivalent for them.

Every affected test file's Guzzle MockHandler/HandlerStack boilerplate
is replaced with Http::fake()/Http::sequence().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8j7cJhCiYDsGUgB7obKNQ
2026-07-26 09:12:01 +01:00
c420e19f08
Replace abandoned spatie/commonmark-highlighter with tempest/highlight v0.81.2
Swap the syntax highlighting library and its CSS theme (zenburn -> nord,
matching tempest's class names), add padding to code blocks, and commit
the missing compressed winter.js assets from the earlier asset rename.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 18:37:05 +01:00
f7e13976e0
Rename snow-fall.js asset to winter.js
Some ad/tracker blocklists were matching the "snow-fall" filename and blocking the script.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 18:01:57 +01:00
db09718a96
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.
2026-07-14 17:36:25 +01:00
11e2c469cb
Fix images overflowing on mobile by preserving aspect ratio
max-width: 100% alone lets img/picture height stay at intrinsic size,
so on narrow viewports images could still overflow vertically or look
squashed. Adding height: auto keeps the aspect ratio correct as width
scales down.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-02 20:02:49 +01:00
4569abc351
Add command to reprocess existing media with correct aspect-ratio scaling
ProcessMedia was using resize(), which distorts images that aren't the
target aspect ratio; scale() preserves it. Existing medium/small
variants generated before this fix need regenerating, so add an
artisan command (with --dry-run) to do that, plus feature tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-02 20:00:30 +01:00
dd203f6f31
Update dependencies 2026-06-29 20:13:11 +01:00
9f012b01e4
Upgrade to Laravel 13 2026-04-07 09:01:19 +01:00
e8e2bff5e4
Fix UpdateHandler crash when replace.content is a rich-text object
OwnYourSwarm sends content as an array of objects with `value` and `html`
keys per the Micropub spec. The handler now handles both forms: plain
strings and rich objects, preferring `html` over `value`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:43:57 +00:00
4451fc247e
Fix OwnYourSwarm checkin parsing to read from properties.checkin
Real OwnYourSwarm requests send the checkin h-card inside
properties.checkin (as an array), not at the top level. The code
was reading from the top-level key so no Place was ever created,
leaving checkin notes blank.

Update tests to match the real request format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 19:18:00 +00:00
0a13d27d6f
Expand webmentions source and target columns to text
Long brid.gy Bluesky source URLs exceed 255 characters, causing
SQLSTATE[22001] errors. Changed source and target from varchar(255)
to text (no performance impact in PostgreSQL).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 16:32:22 +00:00
1137d2a07e
Move request parsing into DTOs via fromRequest(), expand update handler
Each DTO now owns its own parsing logic via fromRequest(), removing
the normalization layer from MicropubRequest entirely. UpdateHandler
gains delete support and allows replace/add/delete to compose in a
single request rather than being mutually exclusive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 20:39:50 +00:00
ad15b36f4d
Introduce typed DTOs and sub-namespaces for Micropub handlers
Each handler now declares the data class it needs via dataClass(). The
controller builds the appropriate typed DTO from the raw request array
before calling handle(), giving handlers typed property access instead
of raw array lookups.

Handlers moved to App\Services\Micropub\Handlers, data objects to
App\Services\Micropub\Data. MicropubHandlerRegistry and the interface
are documented with flow diagrams and guidance for adding new types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 10:41:33 +00:00
24cb6d61aa
Implement micropub update support with clean exception-based error handling
- Add MicropubUnsupportedModelException for non-note update attempts
- Refactor UpdateHandler to throw exceptions instead of returning JsonResponse objects; extract applySyndication() to DRY up duplicated syndication URL mapping
- Fix MicropubController: InvalidTokenScopeException now returns 401 + insufficient_scope; add catches for ModelNotFoundException (404) and MicropubUnsupportedModelException (500); updates return 200 not 201
- Slim MicropubRequest.normalizeMicropubJson() to branch on action type, keeping update and create fields cleanly separated
- Update tests to match corrected status codes and error keys; remove markTestSkipped() from all update tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 10:15:35 +00:00
a342b432d4
Update dependencies 2026-02-21 17:06:37 +00:00
a5f146125b
Allow migrate media command to be re-run 2026-01-09 14:21:37 +00:00
4dd4977dd9
Fix issue with migrating old S3 media 2026-01-08 18:21:28 +00:00
d31a59cbbe Merge branch 'main' into develop 2026-01-04 11:29:54 +01:00
51780523b4
Fix unit tests 2026-01-04 10:22:32 +00:00
9e788e0fe8
Images can be uploaded with alt text
This means associating images to notes via a pivot table, we also finish
off the migration of medai from S3.
2026-01-04 10:07:25 +00:00
76db869af5
Allow files to be added to notes
This is specifically when a Micropub client is using the JSON syntax and
initially uploads the photo via the media endpoint
2025-12-27 17:58:43 +00:00
d3d6913474
Switch local setup to PHP8.5
Also pull in config changes from upstream laravel/laravel
2025-12-13 15:53:00 +00:00
69e11d0799 Merge pull request 'MTM Small mobile layout tweaks' (#63) from develop into main v0.75.2
Reviewed-on: #63
2025-12-11 21:13:47 +01:00
6b4607e4f9
Small mobile layout tweaks 2025-12-11 19:58:17 +00:00
aef76e023a Merge pull request 'MTM Fix layout of note metadata' (#61) from develop into main
Reviewed-on: #61
2025-12-11 18:54:12 +01:00
f85085c34f
Fix layout of note metadata v0.75.1
Especially the syndication links
2025-12-11 17:48:42 +00:00
4409e42029 Merge pull request 'MTM Redesign 2025.1' (#57) from develop into main v0.75
Reviewed-on: #57
2025-12-11 18:20:26 +01:00
a8cb30456c
Redesign v2025.1 2025-12-11 17:17:01 +00:00
a46a760669
Fix code style of flare’s config.php 2025-10-30 12:01:46 +00:00
273bdbbb49
Update dependencies 2025-10-30 11:49:54 +00:00
6183a065e9 Merge pull request 'MTM Micropub fixes' (#52) from develop into main v0.74.1
Reviewed-on: #52
2025-08-17 12:18:06 +02:00
9efde2708e
Dependency updates 2025-08-17 11:12:55 +01:00
363254d13c
Some fixes related to developing my Micropub client 2025-08-17 11:05:38 +01:00
0ef822de0c Merge pull request 'MTM No snow' (#49) from develop into main v0.74
Reviewed-on: #49
2025-07-01 17:57:22 +02:00
8eaca85fe0
Update dependencies 2025-06-30 19:43:28 +01:00
fe48864f39
Laravel Sail dependency updates
Update PHP to v8.4
Update PostgreSQL to v17
2025-06-30 19:27:39 +01:00
83d10e1a70
Refactor of micropub request handling
Trying to organise the code better. It now temporarily doesn’t support
update requests. Thought the spec defines them as SHOULD features and
not MUST features. So safe for now :)
2025-04-27 16:38:25 +01:00
23c275945a
Refactor micropub token verification 2025-04-12 11:47:30 +01:00
70f90dd456
Remove un-needed config files 2025-04-10 21:03:22 +01:00
cd5c97afd3
Remove psalm annotations 2025-04-10 20:09:36 +01:00
97f3848b66
Use esbuild 2025-04-10 17:08:19 +01:00
540bd17792
Use lightningcss 2025-04-10 16:53:23 +01:00
1fe9a42d8d
Remove GitHub config 2025-04-07 19:47:48 +01:00
cf978cd749
Fix PasskeysController with new webauthn library version
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
2025-04-07 19:44:13 +01:00
126bb29ae2
Laravel Pint fixes
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
2025-04-06 17:25:06 +01:00
7a58287b34
Remove references to short domain 2025-04-06 17:22:36 +01:00
328c9badb4
Remove snow fall
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
2025-04-06 14:33:45 +01:00