summaryrefslogtreecommitdiff
path: root/internal/api
AgeCommit message (Collapse)AuthorFiles
2025-03-03[feature] Refactor tokens, allow multiple app redirect_uris (#3849)Libravatar tobi33
* [feature] Refactor tokens, allow multiple app redirect_uris * move + tweak handlers a bit * return error for unset oauth2.ClientStore funcs * wrap UpdateToken with cache * panic handling * cheeky little time optimization * unlock on error
2025-03-02[chore] migrate oauth2 -> codeberg (#3857)Libravatar tobi1
2025-03-02[chore] github.com/superseriousbusiness/activity -> ↵Libravatar tobi5
codeberg.org/superseriousbusiness/activity (#3853)
2025-03-01[feature] Implement CSV import for mutes (#3696)Libravatar Xavier Vello2
* Implement CSV import for mutes * update swagger.yaml * update documentation * add ImportTestSuite.TestImportMutes * fix comment typo
2025-02-26[feature] Enforce OAuth token scopes (#3835)Libravatar tobi195
* move tokenauth to apiutil * enforce scopes * docs * update test models, remove deprecated "follow" * file header * tests * tweak scope matcher * simplify... * fix tests * log user out of settings panel in case of oauth error
2025-02-25[docs] Fix swagger operation descriptions (#3830)Libravatar mkljczk2
* Fix swagger operation descriptions Signed-off-by: mkljczk <git@mkljczk.pl> * generate a swagger file Signed-off-by: mkljczk <git@mkljczk.pl> --------- Signed-off-by: mkljczk <git@mkljczk.pl>
2025-02-24[feature] Use ETag for robots.txt to prevent mishaps (#3829)v0.18.1Libravatar tobi3
* [feature] Use ETag for robots.txt to prevent mishaps * check incoming if-none-match header
2025-02-20[feature] Add page-specific class per template (#3814)v0.18.0-rc3Libravatar tobi1
* [feature] Add page-specific class per template * cheeky bit cheaper
2025-02-12[feature] Implement backfilling statuses thru scheduled_at (#3685)Libravatar Vyr Cossont3
* Implement backfilling statuses thru scheduled_at * Forbid mentioning others in backfills * Update error messages & codes * Add new tests for backfilled statuses * Test that backfilling doesn't timeline or notify * Fix check for absence of notification * Test that backfills do not cause federation * Fix type of apimodel.StatusCreateRequest.ScheduledAt in tests * Add config file switch and min date check
2025-02-11[bug] respect `X-Robots-Tag` and `robots.txt` on api/v1/instance and ↵Libravatar alemi.dev1
nodeinfo (#3756) * feat: check X-Robots-Tag when accessing /api/v1/instance or /nodeinfo endpoints respect X-Robots-Tag * chore: go fmt ./... * Check robots.txt as well, add tests --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2025-02-11[bugfix] Suggest lowercase username when creating via OIDC (#3780)Libravatar tobi1
2025-02-08[bug] Add missing `group` property to the Account model (#3746)Libravatar pnwmatt10
* Stub out account's Group parameter * Fix typo in Contributing documentation * Update swagger and match style * Update the swagger command to mimic test/swagger.sh * Fix tests for new `group` param in Account model * More test changes for new `group` param in Account * Continuing test changes for `group` param stubbing * Another round of `group` stubbing for tests
2025-02-06[chore] update otel libraries (#3740)Libravatar Dominik Süß2
* chore: update otel dependencies * refactor: combine tracing & metrics in observability package * chore: update example tracing compose file
2025-02-05[feature] Use `X-Robots-Tag` headers to instruct scrapers/crawlers (#3737)Libravatar tobi8
* [feature] Use `X-Robots-Tag` headers to instruct scrapers/crawlers * use switch for RobotsHeaders
2025-02-04[feature] Change `instance-stats-randomize` to `instance-stats-mode` with ↵Libravatar tobi5
multiple options; implement nodeinfo 2.1 (#3734) * [feature] Change `instance-stats-randomize` to `instance-stats-mode` with multiple options; implement nodeinfo 2.1 * swaggalaggadingdong
2025-02-03[feature] Implement Web Push notification policy (#3721)Libravatar Vyr Cossont5
* Web Push: add policy column to subscriptions * Web Push: add policy to API * Web Push: test notification policy * go-fmt unrelated file (how did this get thru?)
2025-02-01[bugfix] Swagger: fix media_ids[] param for creating statuses (#3722)Libravatar Vyr Cossont1
2025-01-31[feature] Add `instance-stats-randomize` config option (#3718)Libravatar tobi4
* [feature] Add `instance-stats-randomize` config option * don't use cache (overkill)
2025-01-27[chore] skip `trusted-proxies` warning if ip excepted from rate limiting (#3699)Libravatar tobi1
* [chore] skip `trusted-proxies` warning if ip excepted from rate limiting * weep * typo * fix env parsing test
2025-01-26[chore] Allow suppressing trusted-proxies warning by disabling rate limiting ↵Libravatar tobi1
(#3686)
2025-01-26[docs] Swagger: fix filter context params by moving enum list from the list ↵Libravatar Vyr Cossont4
type to the item type (#3684) Reported by `@modulus:matrix.org`
2025-01-23[feature] Push notifications (#3587)Libravatar Vyr Cossont45
* 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[feature] Serve bot accounts over AP as Service instead of Person (#3672)Libravatar tobi1
* pepis * oopsie doopsie * bollocks
2025-01-23[feature] Add warning about `trusted-proxies` to make config easier (#3675)Libravatar tobi1
* [feature] Add warning about `trusted-proxies` to make config easier * thank you linter, hugs and kisses to you
2025-01-14[chore] better dns validation (#3644)Libravatar kim1
* add seperate PunifyValidate() function for properly validating domain names when converting to punycode * rename function, strip port from domain validation
2025-01-08[bugfix] More permissive CSV parsing for perm subs, text parse fix (#3638)Libravatar tobi1
* [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[feature] Fetch + create domain permissions from subscriptions nightly (#3635)Libravatar tobi28
* 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-05[feature] Create/update/remove domain permission subscriptions (#3623)Libravatar tobi11
* [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
2024-12-28[bugfix] Advertise audio/mpeg as supported (#3632)Libravatar Daenney1
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-23[feature] add support for clients editing statuses and fetching status ↵Libravatar kim9
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[chore] Stub /api/v1/announcements implementation (#3630)Libravatar Daenney3
* [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-08[chore] stub /api/v1/accounts/{id}/featured_tags endpoint (#3598)Libravatar Patrycja2
* [chore] stub /api/v1/accounts/{id}/featured_tags endpoint * fix swagger parsing issue --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-12-05[feature] add support for receiving federated status edits (#3597)Libravatar kim17
* add support for extracting Updated field from Statusable implementers * add support for status edits in the database, and update status dereferencer to handle them * remove unused AdditionalInfo{}.CreatedAt * remove unused AdditionalEmojiInfo{}.CreatedAt * update new mention creation to use status.UpdatedAt * remove mention.UpdatedAt, fixes related to NewULIDFromTime() change * add migration to remove Mention{}.UpdatedAt field * add migration to add the StatusEdit{} table * start adding tests, add delete function for status edits * add more of status edit migrations, fill in more of the necessary edit delete functionality * remove unused function * allow generating gotosocial compatible ulid via CLI with `go run ./cmd/gen-ulid` * add StatusEdit{} test models * fix new statusedits sql * use model instead of table name * actually remove the Mention.UpdatedAt field... * fix tests now new models are added, add more status edit DB tests * fix panic wording * add test for deleting status edits * don't automatically set `updated_at` field on updated statuses * flesh out more of the dereferencer status edit tests, ensure updated at field set on outgoing AS statuses * remove media_attachments.updated_at column * fix up more tests, further complete the dereferencer status edit tests * update more status serialization tests not expecting 'updated' AS property * gah!! json serialization tests!! * undo some gtscontext wrapping changes * more serialization test fixing :smiling_face_with_tear: * more test fixing, ensure the edit.status_id field is actually set :facepalm: * fix status edit test * grrr linter * add edited_at field to apimodel status * remove the choice of paging on the timeline public filtered test (otherwise it needs updating every time you add statuses ...) * ensure that status.updated_at always fits chronologically * fix more serialization tests ... * add more code comments * fix envparsing * update swagger file * properly handle media description changes during status edits * slight formatting tweak * code comment
2024-12-02[feature] Add global instance CSS customization setting (#3352)Libravatar Victor Dyotte4
Allow instance admins to add custom CSS that will affect every page of their instance. This is done with a new CustomCSS instance setting that works pretty much exactly like the Users CustomCSS property. This custom CSS is then requested for every page load. User styles/themes take precedence over this CSS. Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-11-28[chore] rename New___(string) int signature functions to Parse___(string) ↵Libravatar kim2
int (#3580) * rename New___(string) int {} signature functions to Parse___(string) int {} * remove test output
2024-11-27[bugfix] Log + ignore unknown notification types (#3577)Libravatar tobi3
* [bugfix] Log + ignore unknown notification types * pass context to ParseNotificationTypes
2024-11-26[bugfix] Allow unsetting filter expiration dates (#3560)Libravatar Vyr Cossont11
* 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-25[bugfix] notification types missing from link header (#3571)Libravatar kim1
* ensure notification types get included in link header query for notifications * fix type query keys
2024-11-25[performance] convert enum strings to ints (#3558)Libravatar kim3
* 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-21[feature] Add domain permission drafts and excludes (#3547)Libravatar tobi12
* [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded
2024-11-21[feature] Allow emoji shortcode to be 1-character length (#3556)Libravatar tobi3
* [feature] Allow emoji shortcode to be 1-character length * testerino fixeroni * spaghet
2024-11-21[bugfix] post counters should not include direct messages (#3554)Libravatar Jannis1
* [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-05[bugfix] sets the max value placeholders to MaxInt32 instead of MaxInt (#3517)v0.17.3Libravatar kim1
* sets the max value placeholders to MaxInt32 instead of MaxInt * update tests
2024-11-05[bugfix] Fix setting immediate `expires_at` value on filter endpoints (#3513)v0.17.2Libravatar tobi6
* [bugfix] Fix setting immediate `expires_at` value on filter endpoints * update wording * update wording * oh my
2024-11-04[feature] add support for hinting via api/v_/instance preferred image / ↵Libravatar kim1
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[bugfix] determine mime-type to use during ffprobe evaluation stage, don't ↵Libravatar kim1
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-10-22[bugfix] incorrect /api/v_/instance domain uri fields (#3477)Libravatar kim1
* update instance v1 / v2 endpoints to set uri / domain correctly (i.e. account domain) * fix tests relying on old instance behaviour
2024-10-21[feature] Add image descriptions for default avatar + header; don't allow ↵v0.17.1Libravatar tobi10
editing default desc (#3473)
2024-10-18[chore] Fix loop issue in streaming 🤦 (#3457)Libravatar tobi1
2024-10-18[chore] Thumbnail only first frame of animated media (#3448)Libravatar tobi1