Commit graph

1,318 commits

Author SHA1 Message Date
Vyr Cossont
b3aab4f0de Move webpush.MockSender and noopSender into testrig 2025-01-23 10:39:46 -08:00
Vyr Cossont
d89f3ec8f1 webpush.Sender: take type converter as ctor param 2025-01-23 10:38:37 -08:00
Vyr Cossont
b9f759d922 Stub policy and standard 2025-01-22 11:18:55 -08:00
Vyr Cossont
a8ae0e3173 Always load target account settings 2025-01-21 17:19:28 -08:00
Vyr Cossont
b982944e85 Restore treating all 5xx codes as temporary problems 2025-01-20 22:59:39 -08:00
Vyr Cossont
4f39da77bb Use Tobi's style for wrapping errors 2025-01-20 22:59:39 -08:00
Vyr Cossont
63ce52cbfa Make realsender.go more readable 2025-01-20 22:59:39 -08:00
Vyr Cossont
c1cc2a5217 Remove redundant index on unique column
Also removes redundant unique and notnull tags on ID column since these are implied by pk
2025-01-20 22:59:39 -08:00
Vyr Cossont
8542e8a7a3 Fix lint 2025-01-20 22:59:38 -08:00
Vyr Cossont
b0d0f8c0c6 Disallow cleartext HTTP for Web Push servers 2025-01-20 22:59:38 -08:00
Vyr Cossont
93aeadbd9f Improve titles, trim body to reasonable length 2025-01-20 22:59:38 -08:00
Vyr Cossont
13eda35985 Special-case 400 errors other than 408/429
Most client errors should remove the subscription.
2025-01-20 22:59:38 -08:00
Vyr Cossont
920ec76fd2 Post-rebase fixes 2025-01-20 22:59:00 -08:00
Vyr Cossont
bff26f4ebc Make GetVAPIDKeyPair idempotent
and remove PutVAPIDKeyPair
2025-01-20 22:59:00 -08:00
Vyr Cossont
9b8b3885bd Add notification type for update notifications
Not used yet
2025-01-20 22:59:00 -08:00
Vyr Cossont
bfc967f690 Remove unused date columns 2025-01-20 22:59:00 -08:00
Vyr Cossont
255833683f Use packed notification flags 2025-01-20 22:59:00 -08:00
Vyr Cossont
464d920cfd Fix malformed VAPID sub claim 2025-01-20 22:59:00 -08:00
Vyr Cossont
3a239fbe5a Accept any 2xx code as a success 2025-01-20 22:59:00 -08:00
Vyr Cossont
8ae57782ff Send instance URL as Web Push JWT subject 2025-01-20 22:59:00 -08:00
Vyr Cossont
23847f0e18 Log Web Push server error messages 2025-01-20 22:59:00 -08:00
Vyr Cossont
56a31656ef Create web push subscriptions table with indexes 2025-01-20 22:59:00 -08:00
Vyr Cossont
51113b8f27 Fix GetVAPIDKeyPair 2025-01-20 22:59:00 -08:00
Vyr Cossont
9f110a4af4 Fix enum to int migration 2025-01-20 22:59:00 -08:00
Vyr Cossont
26d99209a9 Update Swagger 2025-01-20 22:59:00 -08:00
Vyr Cossont
2cb7a8bf2a Linter fixes 2025-01-20 22:59:00 -08:00
Vyr Cossont
8b9a228ea2 Implement push subscription API 2025-01-20 22:59:00 -08:00
Vyr Cossont
1fe29c7c43 Delete Web Push subscriptions when account is deleted 2025-01-20 22:58:59 -08:00
Vyr Cossont
8e72a8fd24 Test Web Push notifications from workers 2025-01-20 22:58:59 -08:00
Vyr Cossont
c9aa25b42b Add no-op push senders to most processor tests 2025-01-20 22:58:59 -08:00
Vyr Cossont
0c92f9f0f3 Add Web Push sender (similar to email sender) 2025-01-20 22:58:59 -08:00
Vyr Cossont
0cffb8784e Store Web Push subscriptions in DB 2025-01-20 22:58:59 -08:00
Vyr Cossont
db2ba34630 Return VAPID public key when registering an app 2025-01-20 22:58:59 -08:00
Vyr Cossont
86fcc61879 Add VAPID public key to instance info API 2025-01-20 22:58:59 -08:00
Vyr Cossont
821c1da688 Generate VAPID key pair during startup 2025-01-20 22:58:59 -08:00
Vyr Cossont
7a02a19c3c Single-row table for storing instance's VAPID key pair 2025-01-20 22:58:59 -08:00
Vyr Cossont
f62859b61a Update push subscription API model to be Mastodon 4.0 compatible 2025-01-20 22:58:59 -08:00
tobi
37fd7c7a6a
[bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655) 2025-01-20 10:56:00 +01:00
tobi
634d4f408f
[bugfix] Fix existing perm adoption (#3651)
* [bugfix] Fix existing perm adoption

* go fmt

* test, small log fix
2025-01-18 18:55:27 +01:00
kim
e77c7e16b6
[chore] better dns validation (#3644)
* add seperate PunifyValidate() function for properly validating domain names when converting to punycode

* rename function, strip port from domain validation
2025-01-14 14:23:18 +00:00
kim
8cfae010a9
[bugfix] migration to cleanup dropped status edits (#3637)
* add migration to cleanup dropped status edits from previous bug, relinking with statuses

* don't use bun.Ident where not needed

* fix join statement

* fix query to work for both postgres and sqlite

* actually update by the currently set status ID field 🤦
2025-01-09 00:02:22 +00:00
tobi
8daa4dae34
[bugfix] More permissive CSV parsing for perm subs, text parse fix (#3638)
* [bugfix] More permissive CSV parsing for perm subs, text parse fix

* wee

* change the way dry works, slightly

* me oh my, i'm just a little guy

* we're just normal men
2025-01-08 22:38:27 +01:00
tobi
451803b230
[feature] Fetch + create domain permissions from subscriptions nightly (#3635)
* peepeepoopoo

* test domain perm subs

* swagger

* envparsing

* dries your wets

* start on docs

* finish up docs

* copy paste errors

* rename actions package

* rename force -> skipCache

* move obfuscate parse nearer to where err is checked

* make higherPrios a simple slice

* don't use receiver for permsFrom funcs

* add more context to error logs

* defer finished log

* use switch for permType instead of if/else

* thanks linter, love you <3

* validate csv headers before full read

* use bufio scanner
2025-01-08 11:29:40 +01:00
kim
c013892ca2
[chore] replace statuses.updated_at column with statuses.edited_at (#3636)
* update statuses table to replace updated_at column with edited_at

* code comment

* better code comments, fix setting of status + edit + mention + poll database times

* fix log to logf call

* fix status.EditIDs not being carried over in dereferencer.encrichStatus()

* move status.EditID setting into handleStatusEdit()
2025-01-08 11:29:23 +01:00
tobi
e9bb7ddd3a
[feature] Create/update/remove domain permission subscriptions (#3623)
* [feature] Create/update/remove domain permission subscriptions

* lint

* envparsing

* remove errant fmt.Println

* create drafts, subs, exclude, from snapshot models

* name etag column correctly

* remove count column

* lint
2025-01-05 13:20:33 +01:00
Daenney
77f1e79532
[chore] Update robots.txt with more AI bots (#3634) 2025-01-03 11:46:59 +00:00
kim
29da5b35a5
[bugfix] more little edit fixes (#3633)
* fix slice size calculation

* stop attached status edit slice getting cached
2024-12-31 10:44:07 +01:00
Daenney
6b727404be
[bugfix] Advertise audio/mpeg as supported (#3632)
This will be either an mp1, mp2 or mp3 file. In practice it'll probably
be mp3, but this handles mp1 too for good measure. We don't advertise
audio/mp1 as a supported media type since best I can tell that was never
a MIME type that's been used.

This also changes the returned MIME-type for mp2 and mp3 to audio/mpeg,
to match what's expected and supported by most things nowadays.

Fixes: #3531
2024-12-28 11:02:12 +01:00
kim
0784aa3218
[bugfix] small editing tweaks (#3631)
* ensure edited_at isn't set on boost wrapper statuses

* improve handling of remote status updated_at to fix previous cases

* formatting

* add remote status published / updated field validation checks, handle appropriately in handleStatusEdit()

* specifically allowed updated to be equal to published

* only check creation date change when an existing status
2024-12-24 21:16:49 +00:00
kim
fe8d5f2307
[feature] add support for clients editing statuses and fetching status revision history (#3628)
* start adding client support for making status edits and viewing history

* modify 'freshest' freshness window to be 5s, add typeutils test for status -> api edits

* only populate the status edits when specifically requested

* start adding some simple processor status edit tests

* add test editing status but adding a poll

* test edits appropriately adding poll expiry handlers

* finish adding status edit tests

* store both new and old revision emojis in status

* add code comment

* ensure the requester's account is populated before status edits

* add code comments for status edit tests

* update status edit form swagger comments

* remove unused function

* fix status source test

* add more code comments, move media description check back to media process in status create

* fix tests, add necessary form struct tag
2024-12-23 17:54:44 +00:00