Commit graph

2236 commits

Author SHA1 Message Date
tobi
28a54b6253 Merge branch 'main' into delivery_recipient_pre_sort 2025-01-24 19:15:34 +01:00
tobi
4c052c85f5
[bugfix] Rename domain perm sub migration to unique date (#3679)
* [bugfix] Rename domain perm sub migration to unique date

* add repeat migration
2025-01-24 18:09:55 +01:00
tobi
71b50353eb
[feature] Process incoming Undo Announce properly (#3676)
* [feature] Process incoming Undo Announce properly

* test undo announce
2025-01-24 17:36:34 +01:00
kim
3720251fca
[feature] show status edits on frontend (#3678)
* add 'edited-at' field to status info web template

* make the edited-at text italic

* small change in phrasing
2025-01-24 16:02:13 +01:00
tobi
6a30c7785e Merge branch 'main' into delivery_recipient_pre_sort 2025-01-24 10:37:26 +01:00
Vyr Cossont
5b765d734e
[feature] Push notifications (#3587)
* Update push subscription API model to be Mastodon 4.0 compatible

* Add webpush-go dependency

# Conflicts:
#	go.sum

* Single-row table for storing instance's VAPID key pair

* Generate VAPID key pair during startup

* Add VAPID public key to instance info API

* Return VAPID public key when registering an app

* Store Web Push subscriptions in DB

* Add Web Push sender (similar to email sender)

* Add no-op push senders to most processor tests

* Test Web Push notifications from workers

* Delete Web Push subscriptions when account is deleted

* Implement push subscription API

* Linter fixes

* Update Swagger

* Fix enum to int migration

* Fix GetVAPIDKeyPair

* Create web push subscriptions table with indexes

* Log Web Push server error messages

* Send instance URL as Web Push JWT subject

* Accept any 2xx code as a success

* Fix malformed VAPID sub claim

* Use packed notification flags

* Remove unused date columns

* Add notification type for update notifications

Not used yet

* Make GetVAPIDKeyPair idempotent

and remove PutVAPIDKeyPair

* Post-rebase fixes

* go mod tidy

* Special-case 400 errors other than 408/429

Most client errors should remove the subscription.

* Improve titles, trim body to reasonable length

* Disallow cleartext HTTP for Web Push servers

* Fix lint

* Remove redundant index on unique column

Also removes redundant unique and notnull tags on ID column since these are implied by pk

* Make realsender.go more readable

* Use Tobi's style for wrapping errors

* Restore treating all 5xx codes as temporary problems

* Always load target account settings

* Stub `policy` and `standard`

* webpush.Sender: take type converter as ctor param

* Move webpush.MockSender and noopSender into testrig
2025-01-23 16:47:30 -08:00
tobi
01adf8f307 Merge branch 'main' into delivery_recipient_pre_sort 2025-01-23 18:18:48 +01:00
tobi
9333bbc4d0
[feature] Serve bot accounts over AP as Service instead of Person (#3672)
* pepis

* oopsie doopsie

* bollocks
2025-01-23 18:18:23 +01:00
tobi
b42cb7a802
[feature] Add warning about trusted-proxies to make config easier (#3675)
* [feature] Add warning about `trusted-proxies` to make config easier

* thank you linter, hugs and kisses to you
2025-01-23 15:48:09 +01:00
tobi
1472d92a8d
[feature] Add published property to outgoing AP Actor representations (#3671) 2025-01-23 14:42:31 +00:00
tobi
f88c398423 Merge branch 'main' into delivery_recipient_pre_sort 2025-01-22 16:00:10 +01:00
kim
0a99901c65
[performance] reduce InboxForward->Create calls by partially implementing Exists() (#3647)
* alphabetical reordering

* keep a cache of activity IDs we have handled creates for

* reduce number of inbox forwarding create calls by partially implementing Exists()

* increase cache size, since all we're storing is string keys
2025-01-22 13:42:12 +01:00
tobi
fee12158c4 update to latest activity 2025-01-22 13:17:59 +01:00
tobi
301e822abf weeeeenus 2025-01-21 10:35:46 +01:00
dependabot[bot]
5c0514e83c
[chore]: Bump github.com/coreos/go-oidc/v3 from 3.11.0 to 3.12.0 (#3662) 2025-01-20 10:15:27 +00:00
tobi
37fd7c7a6a
[bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655) 2025-01-20 10:56:00 +01:00
dependabot[bot]
9835d3e65d
[chore]: Bump github.com/gin-contrib/cors from 1.7.2 to 1.7.3 (#3661) 2025-01-20 09:47:07 +00:00
dependabot[bot]
77ea30542b
[chore]: Bump golang.org/x/net from 0.33.0 to 0.34.0 (#3660) 2025-01-20 09:03:10 +00:00
dependabot[bot]
cfe6ac5a42
[chore]: Bump github.com/jackc/pgx/v5 from 5.7.1 to 5.7.2 (#3663)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.1 to 5.7.2.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 10:01:46 +01:00
dependabot[bot]
0096222c0e
[chore]: Bump github.com/gin-contrib/sessions from 1.0.1 to 1.0.2 (#3664)
Bumps [github.com/gin-contrib/sessions](https://github.com/gin-contrib/sessions) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/gin-contrib/sessions/releases)
- [Changelog](https://github.com/gin-contrib/sessions/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/sessions/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 10:01:17 +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
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
kim
eb77ceeed6
update gruf/go-ffmpreg to v0.6.4 (#3627) 2024-12-18 00:27:24 +00:00
kim
c953f57e55
update ncruces/go-sqlite3 to v0.21.2 (#3626) 2024-12-17 23:16:20 +00:00
kim
9697df0955
bump ncruces/go-sqlite3 to v0.21.1 (#3625) 2024-12-16 11:37:53 +00:00
kim
ec00dbd496
bump gruf/go-ffmpreg to v0.6.3 (#3624) 2024-12-16 11:36:01 +00:00
kim
8504043024
bump gruf/go-ffmpreg to v0.6.2 (#3622) 2024-12-12 22:02:20 +00:00
kim
fb12bbb10b
bump ncruces/go-sqlite3 to v0.21.0 (#3621) 2024-12-12 19:44:53 +00:00
dependabot[bot]
60acdb21a9
Bump nanoid from 3.3.7 to 5.0.9 in /web/source (#3615) 2024-12-10 10:24:31 +00:00
dependabot[bot]
fd3b1e64da
[chore] Bump nanoid from 4.0.2 to 5.0.9 in /web/source (#3614)
Bumps [nanoid](https://github.com/ai/nanoid) from 4.0.2 to 5.0.9.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/4.0.2...5.0.9)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 10:52:54 +01:00
tobi
acdd495c70
[chore] Log during potentially long migrations (#3613)
* [chore] Log during potentially long migrations

* remove unneeded log lines
2024-12-09 15:53:56 +01:00
dependabot[bot]
d9e722dea3
[chore]: Bump golang.org/x/net from 0.31.0 to 0.32.0 (#3610)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/net/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  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>
2024-12-09 12:18:35 +01:00
STFN
4fbe06e332
[docs] Add missing --config-path arg in backup documentation (#3607) 2024-12-09 11:40:33 +01:00