summaryrefslogtreecommitdiff
path: root/internal/api
AgeCommit message (Collapse)AuthorFiles
2024-03-07[docs/chore] Swagger fixes for filters (#2730)Libravatar Vyr Cossont3
* Swagger: filtersV1Get should return an array * Swagger: context must use multi format
2024-03-06[chore] Fix a Swagger warning that only manifests during Go client code ↵Libravatar Vyr Cossont1
generation (#2729)
2024-03-06[bugfix] Fix Swagger spec and add test script (#2698)Libravatar Vyr Cossont34
* Add Swagger spec test script * Fix Swagger spec errors not related to statuses with polls * Add API tests that post a status with a poll * Fix creating a status with a poll from form params * Fix Swagger spec errors related to statuses with polls (this is the last error) * Fix Swagger spec warnings not related to unused definitions * Suppress a duplicate list update params definition that was somehow causing wrong param names * Add Swagger test to CI - updates Drone config - vendorizes go-swagger - fixes a file extension issue that caused the test script to generate JSON instead of YAML with the vendorized version * Put `Sample: ` on its own line everywhere * Remove unused id param from emojiCategoriesGet * Add 5 more pairs of profile fields to account update API Swagger * Remove Swagger prefix from dummy fields It makes the generated code look weird * Manually annotate params for statusCreate operation * Fix all remaining Swagger spec warnings - Change some models into operation parameters - Ignore models that already correspond to manually documented operation parameters but can't be trivially changed (those with file fields) * Documented that creating a status with scheduled_at isn't implemented yet * sign drone.yml * Fix filter API Swagger errors * fixup! Fix filter API Swagger errors --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-03-06[feature] Filters v1 (#2594)Libravatar Vyr Cossont16
* Implement client-side v1 filters * Exclude linter false positives * Update test/envparsing.sh * Fix minor Swagger, style, and Bun usage issues * Regenerate Swagger * De-generify filter keywords * Remove updating filter statuses This is an operation that the Mastodon v2 filter API doesn't actually have, because filter statuses, unlike keywords, don't have options: the only info they contain is the status ID to be filtered. * Add a test for filter statuses specifically * De-generify filter statuses * Inline FilterEntry * Use vertical style for Bun operations consistently * Add comment on Filter DB interface * Remove GoLand linter control comments Our existing linters should catch these, or they don't matter very much * Reduce memory ratio for filters
2024-02-29[bugfix] unwrap boosts when checking in-reply-to status (#2702)Libravatar kim1
* add stronger checks on status being replied to * update error code test is expecting
2024-02-27[feature/oidc] Add support for very basic RBAC (#2642)Libravatar 9p42
* Add support for very basic RBAC * Add some small tests for allowedGroup and adminGroup * Switch to table-driven tests
2024-02-27[feature] Add experimental `instance-federation-spam-filter` option (#2685)Libravatar tobi19
* [chore] Move `visibility` to `filter/visibility` * [feature] Add experimental instance-federation-spam-filter option
2024-02-23[chore] Increase default max image description to 1500 chars, collapse cw ↵Libravatar tobi1
char count into status (#2682) * [chore] Make default max image description 1500 chars, collapse cw char count into status * oops * tests
2024-02-20[bugfix] fix possible mutex lockup during streaming code (#2633)Libravatar kim1
* rewrite Stream{} to use much less mutex locking, update related code * use new context for the stream context * ensure stream gets closed on return of writeTo / readFrom WSConn() * ensure stream write timeout gets cancelled * remove embedded context type from Stream{}, reformat log messages for consistency * use c.Request.Context() for context passed into Stream().Open() * only return 1 boolean, fix tests to expect multiple stream types in messages * changes to ping logic * further improved ping logic * don't export unused function types, update message sending to only include relevant stream type * ensure stream gets closed :facepalm: * update to error log on failed json marshal (instead of panic) * inverse websocket read error checking to _ignore_ expected close errors
2024-02-20[feature] Add `requested_by` to relationship model (#2672)Libravatar tobi3
* [feature] Add `requested_by` to relationship model * whoops, missed some tests
2024-02-19[bugfix] Use ptr for instance stats entries to avoid skipping 0 values (#2666)Libravatar tobi1
* [bugfix] Use ptr for instance stats entries to avoid skipping 0 values * comment explaining why stats values are pointers
2024-02-17[chore] Disable Move API endpoints for now until Move is fully implemented ↵Libravatar tobi2
in the backend (#2650) * [chore] Disable Move API endpoints for now until Move is fully implemented in the backend * disable other form fields * clarify that moving to GtS also isn't implemented yet
2024-02-14[chore] also allow text/xml in place of application/xml (#2640)Libravatar kim1
2024-02-14[bugfix] add stricter checks during all stages of dereferencing remote AS ↵Libravatar kim2
objects (#2639) * add stricter checks during all stages of dereferencing remote AS objects * a comment
2024-01-29[bugfix] Fix Postgres emoji delete, emoji category change (#2570)Libravatar tobi5
* [bugfix] Fix Postgres emoji delete, emoji category change * revert trace logging * caching issue * update tests
2024-01-28[chore] Add a couple tests for updating list entries (#2580)Libravatar tobi2
2024-01-28[bugfix] Fix EmptyJSONObject/EmptyJSONArray (#2576)Libravatar Vyr Cossont1
* Fix EmptyJSONObject/EmptyJSONArray These are meant to be the bytes representing an empty object and array in JSON: `{}` and `[]`. They are actually the strings `"{}"` and `"[]"`. This causes clients expecting an object or array to not be able to parse the response. * Use json.RawMessage instead of []byte
2024-01-22[feature] Ratelimit + serve emoji images on separate router group (#2548)Libravatar tobi2
* [feature] Serve + rate limit emoji files separately from attachments * add a wee little warning about uploading loads of emojis
2024-01-18[chore] chore rationalise http return codes for activitypub handlers (#2540)Libravatar kim1
* some small code fixups and changes * add check in ResolveIncomingActivity for transient activity types (i.e. activity ID is nil) * update test to handle new transient behaviour
2024-01-17[chore] update viper version (#2539)Libravatar kim2
* update viper version * removes our last uses of the slice package * fix tests
2024-01-16[feature] Account alias / move API + db models (#2518)Libravatar tobi6
* [feature] Account alias / move API + db models * go fmt * fix little cherry-pick issues * update error checking, formatting * add and use new util functions to simplify alias logic
2024-01-05[feature] Parse instance descriptors as markdown, show T&C on /about (#2481)Libravatar tobi3
* [feature] Parse instance descriptors as markdown, show T&C on /about * lint * remove unnecessary nullzero tags
2023-12-27[chore] Refactor HTML templates and CSS (#2480)Libravatar tobi9
* [chore] Refactor HTML templates and CSS * eslint * ignore "Local" * rss tests * fiddle with OG just a tiny bit * dick around with polls a bit more so SR stops saying "clickable" * remove break * oh lord * don't lazy load avatar * fix ogmeta tests * clean up some cruft * catch remaining calls to c.HTML * fix error rendering + stack overflow in tag * allow templating attributes * fix indent * set aria-hidden on status complementary content, since it's already present in the label anyway * tidy up templating calls a little * try to make styling a bit more consistent + readable * fix up some remaining CSS issues * fix up reports
2023-12-18[bugfix] :innocent: (#2476)Libravatar kim1
2023-12-18[feature] request blocking by http headers (#2409)Libravatar kim7
2023-12-16[performance] simpler throttling logic (#2407)Libravatar kim1
* reduce complexity of throttling logic to use 1 queue and an atomic int * use atomic add instead of CAS, add throttling test
2023-12-12[bugfix] poll vote count fixes (#2444)Libravatar kim1
* don't drop all vote counts if hideCounts is set, refactors poll option extraction slightly * omit voters_count when not set * make voters_count a ptr to ensure it is omit unless definitely needed * handle case of expires_at, voters_count and option.votes_count being nilable * faster isNil check * remove omitempty tags since mastodon API marks things as nullable but still sets them in outgoing json
2023-12-10[bugfix] Ensure `pre` renders as expected, fix orderedCollectionPage (#2434)Libravatar tobi6
2023-12-09[bugfix] Fix web media not showing as sensitive (#2433)Libravatar tobi2
* [bugfix] Fix web media not showing as sensitive * test * go fmt
2023-12-05[chore/frontend] Refactor status templates slightly, put polls behind CWs if ↵Libravatar tobi1
present (#2419) * [chore/frontend] Reorder templates, allow polls to be inside content warnings * show when multiple-choice
2023-11-30[bugfix] return 400 Bad Request on more cases of malformed AS data (#2399)Libravatar kim1
2023-11-29[bugfix] Correctly handle range > content-length (#2395)Libravatar Jadeiin1
2023-11-28[chore]: Bump github.com/gorilla/websocket from 1.5.0 to 1.5.1 (#2335)Libravatar dependabot[bot]2
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kim <grufwub@gmail.com>
2023-11-27[feature] Add `/api/v1/admin/debug/apurl` endpoint (#2359)Libravatar tobi4
2023-11-27[performance] http response encoding / writing improvements (#2374)Libravatar kim103
2023-11-23[chore/bugfix] Fix double gzip on prometheus endpoint (#2383)Libravatar tobi2
* [chore] Move "/metrics" into separate API module * use our own gzip middleware for prom
2023-11-22[bugfix/chore] id poll options properly (#2379)Libravatar tobi1
* aria-labels for polls, id poll options properly * my bad, aria labels are for interactive elements
2023-11-22[feature] Poll web view (#2377)Libravatar tobi2
* [feature] Render polls nicely on the web view * use figure for poll, other small tweaks * reverse share + count (lines up better) * poll options list entries * fix up some remaining things
2023-11-20[bugfix] self-referencing collection pages for status replies (#2364)Libravatar kim3
2023-11-17[feature] Set/show instance language(s); show post language on frontend (#2362)Libravatar tobi2
* update go text, include text/display * [feature] Set instance langs, show post lang on frontend * go fmt * WebGet * set language for whole article, don't use FA icon * mention instance languages + other optional config vars * little tweak * put languages in config properly * warn log language parse * change some naming around * tidy up validate a bit * lint * rename LanguageTmpl in template
2023-11-14[bugfix] process account delete side effects in serial, not in parallel (#2360)Libravatar tobi21
* [bugfix] process account delete side effects in serial, not in parallel * StartWorkers / StartNoopWorkers for tests * undo testrig trace logging * log errors instead of immediately returning
2023-11-13[feature/performance] Wrap incoming HTTP requests in timeout handler (#2353)Libravatar tobi7
* deinterface router, start messing about with deadlines * weeeee * thanks linter (thinter) * write Connection: close when timing out requests * update wording * don't replace req * don't bother with fancy Cause functions (I'll use them one day...)
2023-11-11[bugfix] support endless polls, and misskey's' method of inferring expiry in ↵Libravatar kim3
closed polls (#2349)
2023-11-10[feature] Media attachment placeholders (#2331)Libravatar tobi4
* [feature] Use placeholders for unknown media types * fix read of underreported small files * switch to reduce nesting * simplify cleanup
2023-11-10[chore/bugfix/horror] Allow `expires_in` and poll choices to be parsed from ↵Libravatar tobi13
strings (#2346)
2023-11-09[bugfix/docs] Poll api fixups + swagger docs (#2345)Libravatar tobi3
2023-11-08[feature] add support for polls + receiving federated status edits (#2330)Libravatar kim19
2023-10-30[bugfix] Allow blocked accounts to show in precise search (#2321)Libravatar tobi1
2023-10-30[feature] Customizable media cleaner schedule (#2304)Libravatar tobi1
2023-10-25[feature] Status thread mute/unmute functionality (#2278)Libravatar tobi4
* add db models + functions for keeping track of threads * give em the old linty testy * create, remove, check mutes * swagger * testerino * test mute/unmute via api * add info log about new index creation * thread + allow muting of any remote statuses that mention a local account * IsStatusThreadMutedBy -> IsThreadMutedByAccount * use common processing functions in status processor * set = NULL * favee! * get rekt darlings, darlings get rekt * testrig please, have mercy muy liege