Commit Graph

2247 Commits

Author SHA1 Message Date
Vyr Cossont
9e1779625a Fix lint 2025-01-19 16:24:50 -08:00
Vyr Cossont
4180024b7e Disallow cleartext HTTP for Web Push servers 2025-01-19 16:23:11 -08:00
Vyr Cossont
1dd0adc617 Improve titles, trim body to reasonable length 2025-01-19 16:19:50 -08:00
Vyr Cossont
d1f0e0f449 Special-case 400 errors other than 408/429
Most client errors should remove the subscription.
2025-01-19 14:17:51 -08:00
Vyr Cossont
48e87ed470 go mod tidy 2025-01-19 13:50:33 -08:00
Vyr Cossont
66632bfdf0 Post-rebase fixes 2025-01-19 13:49:25 -08:00
Vyr Cossont
205a281d12 Make GetVAPIDKeyPair idempotent
and remove PutVAPIDKeyPair
2025-01-19 13:29:42 -08:00
Vyr Cossont
66c905c947 Add notification type for update notifications
Not used yet
2025-01-19 13:27:42 -08:00
Vyr Cossont
e7f4d1d25d Remove unused date columns 2025-01-19 13:27:42 -08:00
Vyr Cossont
9bab353460 Use packed notification flags 2025-01-19 13:27:42 -08:00
Vyr Cossont
48591755ff Fix malformed VAPID sub claim 2025-01-19 13:27:42 -08:00
Vyr Cossont
67ed75fa6f Accept any 2xx code as a success 2025-01-19 13:27:42 -08:00
Vyr Cossont
c56d7ce8ff Send instance URL as Web Push JWT subject 2025-01-19 13:27:42 -08:00
Vyr Cossont
1569613418 Log Web Push server error messages 2025-01-19 13:27:42 -08:00
Vyr Cossont
654d53ad6a Create web push subscriptions table with indexes 2025-01-19 13:27:42 -08:00
Vyr Cossont
a76556c866 Fix GetVAPIDKeyPair 2025-01-19 13:27:42 -08:00
Vyr Cossont
317e6ee7d5 Fix enum to int migration 2025-01-19 13:27:42 -08:00
Vyr Cossont
3dbc8ef313 Update Swagger 2025-01-19 13:27:42 -08:00
Vyr Cossont
d5082f725c Linter fixes 2025-01-19 13:27:42 -08:00
Vyr Cossont
d7aa401ae4 Implement push subscription API 2025-01-19 13:27:42 -08:00
Vyr Cossont
861695cd32 Delete Web Push subscriptions when account is deleted 2025-01-19 13:27:42 -08:00
Vyr Cossont
bdabbf1364 Test Web Push notifications from workers 2025-01-19 13:27:40 -08:00
Vyr Cossont
46226b431d Add no-op push senders to most processor tests 2025-01-19 13:27:01 -08:00
Vyr Cossont
d739b35c33 Add Web Push sender (similar to email sender) 2025-01-19 13:26:29 -08:00
Vyr Cossont
cbfee3b0cf Store Web Push subscriptions in DB 2025-01-19 13:25:51 -08:00
Vyr Cossont
1bbec43a17 Return VAPID public key when registering an app 2025-01-19 13:25:00 -08:00
Vyr Cossont
a306d01509 Add VAPID public key to instance info API 2025-01-19 13:25:00 -08:00
Vyr Cossont
61a79e5bf2 Generate VAPID key pair during startup 2025-01-19 13:24:57 -08:00
Vyr Cossont
4a1a9742f7 Single-row table for storing instance's VAPID key pair 2025-01-19 13:24:45 -08:00
Vyr Cossont
a6aa7d78a0 Add webpush-go dependency
# Conflicts:
#	go.sum
2025-01-19 13:24:42 -08:00
Vyr Cossont
8cc484304f Update push subscription API model to be Mastodon 4.0 compatible 2025-01-19 13:24:02 -08: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
81b66ad7e3
update ncruces/go-sqlite3 v0.21.3 -> v0.22.0, gruf/go-ffmpreg v0.6.4 -> v0.6.5 (#3646) 2025-01-14 18:30:55 +00:00
kim
b8ef9fc4bc
bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) 2025-01-14 14:23:28 +00: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
dependabot[bot]
b95498b8c2
[chore]: Bump mvdan.cc/xurls/v2 from 2.5.0 to 2.6.0 (#3643)
Bumps [mvdan.cc/xurls/v2](https://github.com/mvdan/xurls) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/mvdan/xurls/releases)
- [Commits](https://github.com/mvdan/xurls/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: mvdan.cc/xurls/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 13:11:20 +00:00
dependabot[bot]
4d423102c1
[chore]: Bump github.com/gin-contrib/gzip from 1.0.1 to 1.1.0 (#3639)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/gin-contrib/gzip/releases)
- [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/gzip/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/gzip
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 13:10:39 +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
Daenney
1aa7f70660
[chore] Stub /api/v1/announcements implementation (#3630)
* [chore] Stub /api/v1/announcements implementation

This implements the /api/v1/announcements endpoint by simply returning
an empty array. This indicates there are no instance announcements.

Some clients retrieve this endpoint and get surprised by a 404. It tends
to be harmless, but results in some unnecessary logging when trying to
debug other things.

* [fix] Forgot some swagger

* [fix] Fix swagger some more
2024-12-23 16:43:50 +01:00
Daenney
9ae0c7b363
[chore] Update ncruces/go-sqlite3 to 0.21.3 (#3629)
This includes some additional locking fixes for the BSDs.
2024-12-20 21:37:19 +00:00
CDN
f78002f915
[bugfix] Load instance-wide custom css in page stylesheets template (#3601)
* [bugfix] Load instance-wide custom css in page stylesheets template

* [chore] remove redunt import
2024-12-18 10:47:17 +01:00