summaryrefslogtreecommitdiff
path: root/internal/api
AgeCommit message (Collapse)AuthorFiles
2023-07-23[chore] Admin CLI + new account creation refactoring (#2008)Libravatar tobi2
* set maxPasswordLength to 72 bytes, rename validate function * refactor NewSignup * refactor admin account CLI commands * refactor oidc create user * refactor processor create * tweak password change, check old != new password
2023-07-21[bugfix] Return all accounts when list accounts limit <= 0 (#2014)v0.10.0Libravatar tobi4
2023-07-18[bugfix] more robust list timeline invalidation (#1995)v0.10.0-rc3Libravatar kim1
2023-07-13[bugfix] Set Vary header correctly on cache-control (#1988)v0.10.0-rc2Libravatar tobi17
* [bugfix] Set Vary header correctly on cache-control * Prefer activitypub types on AP endpoints * use immutable on file server, vary by range * vary auth on Accept
2023-07-12[bugfix] Properly handle range > content-length (#1979)Libravatar MaeIsBad1
This makes the serveFileRange function return the entire file if suffix-range is larger than content-length in compliance with RFC9110 Co-authored-by: mae <git@badat.dev>
2023-07-07[bugfix] Reorder web view logic, other small fixes (#1954)Libravatar tobi1
2023-07-07[chore/bugfix] Domain block tidying up, Implement first pass of `207 ↵Libravatar tobi6
Multi-Status` (#1886) * [chore/refactor] update domain block processing * expose domain block import errors a lil better * move/remove unused query keys
2023-07-04[chore/bugfix] Break Websockets logic into smaller read/write functions, ↵Libravatar tobi2
don't log expected errors (#1932) * [chore/bugfix] Break Websockets logic into smaller read/write functions, don't log expected errors * tweak * tidy up, use control message
2023-06-22[bugfix/chore] oauth entropy fix + media cleanup tasks rewrite (#1853)Libravatar kim1
2023-06-21[feature] Add partial text search for accounts + statuses (#1836)Libravatar tobi15
2023-06-19[chore] Fix Swagger paths for lists API endpoints (#1904)Libravatar Umar Getagazov7
2023-06-19[bugfix] Parse POST-style forms in the list member removal endpoint (#1903)Libravatar Umar Getagazov1
2023-06-16[bugfix] Accept non-multipart forms for account updates (#1896)Libravatar Umar Getagazov2
* [bugfix] Update Swagger schema per max_profile_fields addition * [bugfix] Accept non-multipart forms for account updates
2023-06-13[chore] Refactor AP authentication, other small bits of tidying up (#1874)Libravatar tobi13
2023-06-13[Frontend] Settings for profile fields (#1885)Libravatar f0x522
* get max emoji size from instance settings * expose (hardcoded) max amount of profile fields in instance api * basic profile field setting * fix profile field hook structure for updates * *twirls mustache* fix ze tests --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-06-03[chore] Update versions, fix lint errors (#1860)Libravatar tobi2
2023-06-02[bugfix] Allow lowercase emoji shortcode in frontend (#1851)Libravatar Julian-Samuel Gebühr1
* Replace pinafore with semaphore * Typo * Allow lowercase emoji shortcode in frontend * Fix failing test (corrected expected outcome)
2023-06-02[bugfix] Overwrite API client closed errors with `499 - Client Closed ↵Libravatar tobi1
Request` (#1857) * [bugfix] Overwrite client closed errors with 499 * bleep bloop * review changes
2023-05-28[bugfix/chore] Inbox post updates (#1821)Libravatar tobi2
Co-authored-by: kim <grufwub@gmail.com>
2023-05-28[chore] tidy up media manager, add calling func to errors, build-script ↵Libravatar kim18
improvements (#1835) * media manager tidy-up: de-interface and remove unused PostDataFunc Signed-off-by: kim <grufwub@gmail.com> * remove last traces of media.Manager being an interface Signed-off-by: kim <grufwub@gmail.com> * update error to provide caller, allow tuneable via build tags Signed-off-by: kim <grufwub@gmail.com> * remove kim-specific build script changes Signed-off-by: kim <grufwub@gmail.com> * fix merge conflicts Signed-off-by: kim <grufwub@gmail.com> * update build-script to support externally setting build variables Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-05-25[bugfix/docs] Fix clear notifications API docs (#1831)Libravatar Daenney1
The handler is already hooked to the right path, it's just the docs that were missing the path.
2023-05-25[feature] Add List functionality (#1802)Libravatar tobi44
* start working on lists * further list work * test list db functions nicely * more work on lists * peepoopeepoo * poke * start list timeline func * we're getting there lads * couldn't be me working on stuff... could it? * hook up handlers * fiddling * weeee * woah * screaming, pissing * fix streaming being a whiny baby * lint, small test fix, swagger * tidying up, testing * fucked! by the linter * move timelines to state like a boss * add timeline start to tests using state * invalidate lists
2023-05-21[chore] Replace pinafore with semaphore (#1801)Libravatar Julian-Samuel Gebühr1
* Replace pinafore with semaphore * Typo
2023-05-16[bugfix] Fix NegotiateFormat with multiple accept headers (#1797)Libravatar Daenney2
* [bugfix] Fix NegotiateAccept with multi accept There's a bug in Gin's NegotiateFormat that doesn't handle the presence of multilpe accept headers. This lifts the code from the PR @tsmethurst sent a year ago to Gin into our codebase to fix the issue. * [bugfix] Concat accept header in webfinger Some implementations bug out when there's multiple accept headers, including Gin (see 7050112af1ccc935ec542cb41fa8b07f7357539d). But things seem to work reliably with a single accept header with multiple parts. Fixes: #1793
2023-05-13[frontend] Basic user moderation actions (#1728)Libravatar f0x521
* remove info banner * update swagger definition for AccountAction * basic user view, suspend action * clean up suspended user display * basic user searching * rename User -> Account for clarity * refactor error boundary component to give better info * appease the linter
2023-05-12[bugfix] Ensure account fields can be set by JSON (#1762)Libravatar tobi3
2023-05-12[chore] Prefer JSON errors in API endpoints (#1766)Libravatar Natsu Kagami2
* Default to JSON over HTML for error handling * Change the default error display for web endpoints to html
2023-05-09[bugfix] Don't try to get user when serializing local instance account (#1757)Libravatar tobi1
2023-05-09[feature] Enable federation in/out of profile PropertyValue fields (#1722)Libravatar tobi3
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-05-07[bugfix] Punycode fixes (#1743)Libravatar tobi1
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-05-06[bugfix] Return languages in api/v1/instance (#1741)Libravatar Daenney2
It turns out that in Masto v2.3.0 the languages key was added to the V1 Instance and that it's effectively mandatory. Though in GtS we don't really have this concept yet, some apps will explode if the languages key is missing altogether. So at least return the empty array on V1 too in the hopes that it makes things work well enough. For history's sake, you can see the attributes that will get serialised in https://github.com/mastodon/mastodon/blob/f877aa9d70d0d600961989b8e97c0e0ce3ac1db6/app/serializers/rest/v1/instance_serializer.rb#L6-L9. Because the attribute does not have a conditional defined for it, there isn't a filter that optionally omits it, or a def languages to modify the behaviour the attribute is effectively always included and serialised. Fixes: #1662
2023-05-06[feature] Implement the preferences client API (#1740)Libravatar Daenney4
This adds the preferences endpoint to our Mastodon Client API implementation. It's a read-only endpoint that returns a number of user preferences. Applications can query these settings when logging in a user (for the first time) to configure themselves.
2023-05-04[bugfix] Serve correct 'application/jrd+json' content type for webfinger ↵Libravatar tobi5
requests (#1738) * [bugfix] Return `application/jrd+json` from webfinger queries * update finger req content-type
2023-05-04[bugfix] Rework notifs to use min_id for paging up (#1734)Libravatar tobi2
2023-04-29[feature] Add GET endpoint for single notification (#1719)Libravatar tobi2
2023-04-28[performance] improved request batching (removes need for queueing) (#1687)Libravatar kim1
* revamp http client to not limit requests, instead use sender worker Signed-off-by: kim <grufwub@gmail.com> * remove separate sender worker pool, spawn 2*GOMAXPROCS batch senders each time, no need for transport cache sweeping Signed-off-by: kim <grufwub@gmail.com> * improve batch senders to keep popping recipients until remote URL found Signed-off-by: kim <grufwub@gmail.com> * fix recipient looping issue Signed-off-by: kim <grufwub@gmail.com> * fix missing mutex unlock Signed-off-by: kim <grufwub@gmail.com> * move request id ctx key to gtscontext, finish filling out more code comments, add basic support for not logging client IP Signed-off-by: kim <grufwub@gmail.com> * slight code reformatting Signed-off-by: kim <grufwub@gmail.com> * a whitespace Signed-off-by: kim <grufwub@gmail.com> * remove unused code Signed-off-by: kim <grufwub@gmail.com> * add missing license headers Signed-off-by: kim <grufwub@gmail.com> * fix request backoff calculation Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-04-10[feature] Receive notification when followed account posts (if desired) (#1680)Libravatar tobi1
* start working on notifs for new posts * tidy up a bit * update swagger * carry over show reblogs + notify from follow req * test notify on status post * update column slice * dedupe update logic + add tests * fix own boosts not being timelined * avoid type check, passing unnecessary accounts * remove unnecessary 'inReplyToID' check * add a couple todo's for future db functions
2023-04-06[bugfix/chore] Refactor timeline code (#1656)Libravatar tobi1
* start poking timelines * OK yes we're refactoring, but it's nothing like the last time so don't worry * more fiddling * update tests, simplify Get * thanks linter, you're the best, mwah mwah kisses * do a bit more tidying up * start buggering about with the prepare function * fix little oopsie * start merging lists into 1 * ik heb een heel zwaar leven nee nee echt waar * hey it works we did it reddit * regenerate swagger docs * tidy up a wee bit * adjust paging * fix little error, remove unused functions
2023-03-31[bugfix] Fix report serialization errors caused by user delete (#1659)Libravatar tobi1
* [bugfix] Fix report serialization errors caused by user delete * fix tests
2023-03-28[performance] refactoring + add fave / follow / request / visibility caching ↵Libravatar kim1
(#1607) * refactor visibility checking, add caching for visibility * invalidate visibility cache items on account / status deletes * fix requester ID passed to visibility cache nil ptr * de-interface caches, fix home / public timeline caching + visibility * finish adding code comments for visibility filter * fix angry goconst linter warnings * actually finish adding filter visibility code comments for timeline functions * move home timeline status author check to after visibility * remove now-unused code * add more code comments * add TODO code comment, update printed cache start names * update printed cache names on stop * start adding separate follow(request) delete db functions, add specific visibility cache tests * add relationship type caching * fix getting local account follows / followed-bys, other small codebase improvements * simplify invalidation using cache hooks, add more GetAccountBy___() functions * fix boosting to return 404 if not boostable but no error (to not leak status ID) * remove dead code * improved placement of cache invalidation * update license headers * add example follow, follow-request config entries * add example visibility cache configuration to config file * use specific PutFollowRequest() instead of just Put() * add tests for all GetAccountBy() * add GetBlockBy() tests * update block to check primitive fields * update and finish adding Get{Account,Block,Follow,FollowRequest}By() tests * fix copy-pasted code * update envparsing test * whitespace * fix bun struct tag * add license header to gtscontext * fix old license header * improved error creation to not use fmt.Errorf() when not needed * fix various rebase conflicts, fix account test * remove commented-out code, fix-up mention caching * fix mention select bun statement * ensure mention target account populated, pass in context to customrenderer logging * remove more uncommented code, fix typeutil test * add statusfave database model caching * add status fave cache configuration * add status fave cache example config * woops, catch missed error. nice catch linter! * add back testrig panic on nil db * update example configuration to match defaults, slight tweak to cache configuration defaults * update envparsing test with new defaults * fetch followingget to use the follow target account * use accounnt.IsLocal() instead of empty domain check * use constants for the cache visibility type check * use bun.In() for notification type restriction in db query * include replies when fetching PublicTimeline() (to account for single-author threads in Visibility{}.StatusPublicTimelineable()) * use bun query building for nested select statements to ensure working with postgres * update public timeline future status checks to match visibility filter * same as previous, for home timeline * update public timeline tests to dynamically check for appropriate statuses * migrate accounts to allow unique constraint on public_key * provide minimal account with publicKey --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-03-20[chore] Refactor account deleting/block logic, tidy up some other processing ↵Libravatar tobi5
things (#1599) * start refactoring account deletion * update to use state.DB * further messing about * some more tidying up * more tidying, cleaning, nice-making * further adventures in refactoring and the woes of technical debt * update fr accept/reject * poking + prodding * fix up deleting * create fave uri * don't log using requestingAccount.ID because it might be nil * move getBookmarks function * use exists query to check for status bookmark * use deletenotifications func * fiddle * delete follow request notif * split up some db functions * Fix possible nil pointer panic * fix more possible nil pointers * fix license headers * warn when follow missing (target) account * return wrapped err when bookmark/fave models can't be retrieved * simplify self account delete * warn log likely race condition * de-sillify status delete loop * move error check due north * warn when unfollowSideEffects has no target account * warn when no boost account is found * warn + dump follow when no account * more warnings * warn on fave account not set * move for loop inside anonymous function * fix funky logic * don't remove mutual account items on block; do make sure unfollow occurs in both directions!
2023-03-14[feature] Allow admins to send test emails (#1620)Libravatar tobi3
* [feature] Allow admins to send test emails * implement unwrap on new error type * add + use gtserror types * GoToSocial Email Test -> GoToSocial Test Email * add + use getInstance db call * removed unused "unknown" error type
2023-03-14[chore] fix + update swagger docs (#1622)Libravatar tobi1
2023-03-12[chore] Improve copyright header handling (#1608)Libravatar Daenney236
* [chore] Remove years from all license headers Years or year ranges aren't required in license headers. Many projects have removed them in recent years and it avoids a bit of yearly toil. In many cases our copyright claim was also a bit dodgy since we added the 2021-2023 header to files created after 2021 but you can't claim copyright into the past that way. * [chore] Add license header check This ensures a license header is always added to any new file. This avoids maintainers/reviewers needing to remember to check for and ask for it in case a contribution doesn't include it. * [chore] Add missing license headers * [chore] Further updates to license header * Use the more common // indentend comment format * Remove the hack we had for the linter now that we use the // format * Add SPDX license identifier
2023-03-11[feature] Support multiple subscriptions on single websocket connection (#1489)Libravatar darrinsmart1
- Allow Oauth authentication on websocket endpoint - Make streamType query parameter optional - Read websocket commands from client and update subscriptions
2023-03-09[feature] Provide .well-known/host-meta endpoint (#1604)Libravatar Daenney5
* [feature] Provide .well-known/host-meta endpoint This adds the host-meta endpoint as Mastodon clients use this to discover the API domain to use when the host and account domains aren't the same. * Address review comments
2023-03-08[feature] Discover webfinger through host-meta (#1588)Libravatar Daenney1
* [feature] Discover webfinger through host-meta This implements a fallback for discovering the webfinger endpoint in case the /.well-known/webfinger endpoint wasn't properly redirected. Some instances do this because the recommendation used to be to use host-meta for the webfinger redirect in the before times. Closes #1558. * [bug] Ensure we only ever update cache on success * [chore] Move finger tests to their own place This adds a test suite for transport and moves the finger cache tests into there instead of abusing the search test suite. * [chore] cleanup the test a bit more We don't really need a separate function for the oddly located webfinger response as we check the full URL string anyway * Address review comments * [chore] update config example * [chore] access DB only through state in controller
2023-03-06[feature] Add support for profile fields (#1483)Libravatar zowhoey2
* Add go-playground/form pkg * [feature] Add support for profile fields * Add field attributes test * Validate profile fields form * Add profile field validation tests * Add Field Attributes definition to swagger --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2023-03-03[bugfix] Clamp admin report limit <1 to 100 (#1583)Libravatar tobi2
* [bugfix] Clamp report limit <1 to 100 * add + update tests
2023-03-03[bugfix] Fix unpinning statuses not working (#1582)Libravatar tobi1
And also fix unpinning/pinning potentially leaking the ID of followers-only statuses through returning 422 instead of 404. Also tests!