Commit graph

1278 commits

Author SHA1 Message Date
Vyr Cossont 74e30f06d2 Accept any 2xx code as a success 2024-12-01 21:25:55 -08:00
Vyr Cossont a356c860dd Send instance URL as Web Push JWT subject 2024-12-01 21:17:54 -08:00
Vyr Cossont dcac7f2035 Log Web Push server error messages 2024-12-01 20:41:27 -08:00
Vyr Cossont 79559933e0 Create web push subscriptions table with indexes 2024-12-01 20:22:02 -08:00
Vyr Cossont 74b0541e02 Fix GetVAPIDKeyPair 2024-12-01 20:02:00 -08:00
Vyr Cossont c8d213a9ef Fix enum to int migration 2024-12-01 20:01:51 -08:00
Vyr Cossont f663f56946 Update Swagger 2024-11-30 21:05:54 -08:00
Vyr Cossont 88dddd529f Linter fixes 2024-11-30 21:05:54 -08:00
Vyr Cossont b99ea8121c Implement push subscription API 2024-11-30 21:05:54 -08:00
Vyr Cossont 4ddfbad557 Delete Web Push subscriptions when account is deleted 2024-11-30 21:05:54 -08:00
Vyr Cossont 1d0e608c81 Test Web Push notifications from workers 2024-11-30 21:05:54 -08:00
Vyr Cossont 05b8156ba5 Add no-op push senders to most processor tests 2024-11-30 21:05:54 -08:00
Vyr Cossont ddb21cd515 Add Web Push sender (similar to email sender) 2024-11-30 21:05:54 -08:00
Vyr Cossont 17fd35661d Store Web Push subscriptions in DB 2024-11-30 21:05:41 -08:00
Vyr Cossont 5a2e8341a2 Return VAPID public key when registering an app 2024-11-30 21:00:06 -08:00
Vyr Cossont b082e53c8c Add VAPID public key to instance info API 2024-11-30 21:00:06 -08:00
Vyr Cossont 1ea57b398a Generate VAPID key pair during startup 2024-11-30 21:00:06 -08:00
Vyr Cossont 875517c324 Single-row table for storing instance's VAPID key pair 2024-11-30 21:00:06 -08:00
Vyr Cossont 2d0dcff754 Update push subscription API model to be Mastodon 4.0 compatible 2024-11-30 21:00:06 -08:00
kim c9d36f7e45
[performance] use new instance of bun.DB *after* migrations to reduce number of in-memory model schema (#3578)
* use new instance of bun.DB *after* migrations to reduce number of model schema in-memory

* update sqlite address comment
2024-11-29 15:03:10 +00:00
kim d9f67efae5
send out poll votes as separate create activities given that no other AP servers support multiple objects in a single activity (#3582) 2024-11-28 15:37:37 +00:00
kim 312cb8b9c7
[chore] rename New___(string) int signature functions to Parse___(string) int (#3580)
* rename New___(string) int {} signature functions to Parse___(string) int {}

* remove test output
2024-11-28 12:54:22 +01:00
tobi 65917f5bb9
[bugfix] Log + ignore unknown notification types (#3577)
* [bugfix] Log + ignore unknown notification types

* pass context to ParseNotificationTypes
2024-11-27 17:22:45 +00:00
Vyr Cossont 6a8af42647
[bugfix] Allow unsetting filter expiration dates (#3560)
* Regression tests for #3497 (v1 and v2)
* use Nullable type for v2 form.expires_in

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-11-26 08:23:00 -08:00
kim a444adee97
[bugfix] notification types missing from link header (#3571)
* ensure notification types get included in link header query for notifications

* fix type query keys
2024-11-25 15:33:21 +00:00
tobi c454b1b488
[chore] Bump tooling versions, bump go -> v1.23.0 (#3258)
* [chore] Bump tooling versions, bump go -> v1.23.0

* undo silly change

* sign

* bump go version in go.mod

* allow overflow in imaging

* goreleaser deprecation notices

* bump versions

* undo accidental rebase change

* update container versions to just use latest major version

* update swagger to our release with go1.23 fix

* update goreleaser to use our vendored swagger version

---------

Co-authored-by: kim <grufwub@gmail.com>
2024-11-25 16:15:33 +01:00
kim cac9d65029
[performance] convert enum strings to ints (#3558)
* convert statuses.visibility and notifications.notification_type columns from type string -> int for performance / space savings

* fix test trying to compare string to int

* fix instance count query using string literal instead of gtsmodel const type

* ensure a default value is always set

* also migrate the account settings and sin bin status tables

* initialize maps outside loops and place into singular enum mapping creation func

* use int16 for enum types

* update sinbinstatus creation to be from a snapshot at initial creation

* add snapshot of poll type at creation time
2024-11-25 14:48:59 +01:00
tobi 301543616b
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes

* fix typescript complaining

* lint

* make filenames more consistent

* test own domain excluded
2024-11-21 13:09:58 +00:00
tobi c2029df9bc
[feature] Allow emoji shortcode to be 1-character length (#3556)
* [feature] Allow emoji shortcode to be 1-character length

* testerino fixeroni

* spaghet
2024-11-21 12:13:55 +01:00
Jannis 9ace025da1
[bugfix] post counters should not include direct messages (#3554)
* [bugfix] post counters should not include direct messages #3504

The fix is relativly simple, it just adds a line to the relevant
function which excludes all private posts.

* Formating fix

* mb
2024-11-21 11:06:06 +01:00
kim e3c2b790fd
[performance] minimise log field allocations (#3529)
* when appending log field only do so by minimal amount

* move slice utils to separate package to fix import cycle, add GrowJust() and AppendJust() functions

* fix GrowJust() not returning slice of same length

* improved xslices tests

* make AppendJust() test check for slice contents, fix AppendJust() final copying behaviour

* add a +1 with field growth to try minimise allocation for log 'msg' field
2024-11-11 15:45:19 +00:00
kim b84637801a
[chore] update go ffmpreg to v0.6.0 (#3515)
* pull in go-ffmpreg v0.6.0

* add code comment

* grrr linter

* set empty module name when calling ffmpeg / ffprobe
2024-11-06 14:38:13 +01:00
kim 6f4cb2f14e
[bugfix] sets the max value placeholders to MaxInt32 instead of MaxInt (#3517)
* sets the max value placeholders to MaxInt32 instead of MaxInt

* update tests
2024-11-05 22:16:06 +00:00
tobi e953d80dff
[bugfix] Fix setting immediate expires_at value on filter endpoints (#3513)
* [bugfix] Fix setting immediate `expires_at` value on filter endpoints

* update wording

* update wording

* oh my
2024-11-05 13:29:51 +01:00
kim 53aaeb18d4
previously we were using the ffmpeg runner for ffprobe 🤦 (#3512) 2024-11-05 10:50:56 +00:00
kim f3b2eca8b8
[feature] add support for hinting via api/v_/instance preferred image / video max sizes (#3505)
* add support for hinting via api/v_/instance endpoints a preferred image / video size limit

* fix tests expecting old default values
2024-11-04 15:00:10 +01:00
kim 8f288f1689
[bugfix] determine mime-type to use during ffprobe evaluation stage, don't bother checking against file extension (#3506)
* determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension

* set mjpeg content-type

* fix up tests expecting differing default values
2024-11-04 14:58:15 +01:00
kim 7ec6509e11
[bugfix] support classifying correct video codec without audio as webm (#3494)
* for webm support video:[vp8,vp9,av1] and audio:[NONE,vorbis,opus]

* improved unsupported data type error output
2024-10-28 14:09:21 +01:00
kim e86592bc32
[chore] pull in go-ffmpreg v0.4.1 (#3485)
* pull in go-ffmpreg v0.4.1

* bring back GTS_WAZERO_COMPILATION_CACHE
2024-10-28 10:55:48 +00:00
kim d8a83860bc
[bugfix] incorrect /api/v_/instance domain uri fields (#3477)
* update instance v1 / v2 endpoints to set uri / domain correctly (i.e. account domain)

* fix tests relying on old instance behaviour
2024-10-22 14:47:28 +00:00
tobi 8a93300ac4
[feature] Add image descriptions for default avatar + header; don't allow editing default desc (#3473) 2024-10-21 14:04:50 +02:00
tobi fab7d17031
[bugfix] Fix filter title unique constraint (#3458) 2024-10-19 11:04:07 +02:00
tobi 0d0314b98d
[chore] Fix loop issue in streaming 🤦 (#3457) 2024-10-18 16:57:50 +02:00
tobi 602c858379
[chore] Thumbnail only first frame of animated media (#3448) 2024-10-18 15:44:08 +02:00
tobi ffc86f9092
[bugfix] Fix occasionally streaming empty messages (#3456) 2024-10-18 15:43:09 +02:00
Markus Unterwaditzer a48cce82b9
[chore] Upgrade golangci-lint, ignore existing int overflow warnings (#3420)
* [chore] Bump tooling versions, bump go -> v1.23.0

* undo silly change

* sign

* bump go version in go.mod

* allow overflow in imaging

* goreleaser deprecation notices

* [chore] Upgrade golangci-lint, ignore existing int overflow warnings

There is a new lint for unchecked int casts. Integer overflows are bad,
but the old code that triggers this lint seems to be perfectly fine.
Instead of disabling the lint entirely for new code as well, grandfather
in existing code.

* fix golangci-lint documentation link

* revert unrelated changes

* revert another unrelated change

* get rid of remaining nolint:gosec

* swagger updates

* apply review feedback

* fix wrong formatting specifier thing

* fix the linter for real

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-10-16 14:13:58 +02:00
kim 3ad49f7718
updates exported interface types to match ncruces/go-sqlite3/driver methods (#3440) 2024-10-14 20:28:59 +00:00
kim 6a76b9d609
[feature/OFFICIALLY UNSUPPORTED] add nowasm build tag to disable building with WebAssembly (#3429)
* add experimental build-tag 'nowasm' which uses local ffmpeg / ffprobe

* updated experimental support message

* add comment to build script explaining build tag

* add nowasm build tags to moderncsqlite files
2024-10-14 11:59:12 +02:00
kim 2076f7d85f
[feature] for an sqlite database with journal mode != WAL, use maximum of 1 open conn (#3428) 2024-10-14 00:19:52 +02:00
Markus Unterwaditzer 95a316236e
[bugfix] Account.last_status_at is a date, not datetime (#3419)
* [bugfix] Account.last_status_at is a date, not datetime

Fix #3418

* update swagger
2024-10-12 10:02:26 +02:00