summaryrefslogtreecommitdiff
path: root/internal/api
AgeCommit message (Collapse)AuthorFiles
2024-06-06[feature] Self-serve email change for users (#2957)Libravatar tobi12
* [feature] Email change * frontend stuff for changing email * docs * tests etc * differentiate more clearly between local user+account and account * populate user
2024-06-06[bugfix] Don't nil emojis + fields on blocked accounts (#2968)Libravatar tobi1
* [bugfix] Don't nil emojis + fields on blocked accounts * comment * swagger
2024-06-03[feature/frontend] Add debug sections to settings panel (#2950)Libravatar tobi2
* [feature/frontend] Add debug sections to settings panel * max-width * swagger
2024-05-31[feature] Add from: search operator and account_id query param (#2943)Libravatar Vyr Cossont4
* Add from: search operator * Fix whitespace in Swagger YAML comment * Move query parsing into its own method * Document search * Clarify post search scope
2024-05-31[feature] Implement Filter API v2 (#2936)Libravatar Vyr Cossont41
* Use correct entity name * We support server-side filters now * Document filter v1 methods that can throw a 409 * Validate v1 filter phrase as filter title * Always check v1 filter API status codes in tests * Document keyword minimum requirement on filter API v1 * Make it possible to specify filter keyword update columns per filter keyword * Implement v2 filter API * Fix lint and tests * Update Swagger spec * Fix filter update test * Update Swagger spec *correctly* * Update actual files Swagger spec was generated from * Remove keywords_attributes and statuses_attributes * Add test for serialization of empty filter * More helpful messages when object is owned by wrong account
2024-05-29[feature] Implement profile API (#2926)Libravatar Vyr Cossont3
* Implement profile API This Mastodon 4.2 extension provides capabilities missing from the existing Mastodon account update API: deleting an account's avatar or header. See: https://docs.joinmastodon.org/methods/profile/ * Move profile media methods to media processor * Remove check for moved account
2024-05-29[feature] Debug admin endpoint to clear caches (#2940)Libravatar tobi5
* [feature] Debug admin endpoint to clear caches * go fmt
2024-05-27[feature/frontend] Let admins send test email to validate SMTP config (#2934)Libravatar tobi2
* [feature/frontend] Let admins send test email to validate SMTP config * wee
2024-05-27[experiment] add alternative wasm sqlite3 implementation available via ↵Libravatar kim3
build-tag (#2863) This allows for building GoToSocial with [SQLite transpiled to WASM](https://github.com/ncruces/go-sqlite3) and accessed through [Wazero](https://wazero.io/).
2024-05-22[performance] update storage backend and make use of seek syscall when ↵Libravatar kim2
available (#2924) * update to use go-storage/ instead of go-store/v2/storage/ * pull in latest version from codeberg * remove test output :innocent: * add code comments * set the exclusive bit when creating new files in disk config * bump to actual release version * bump to v0.1.1 (tis a simple no-logic change) * update readme * only use a temporary read seeker when decoding video if required (should only be S3 now) * use fastcopy library to use memory pooled buffers when calling TempFileSeeker() * update to use seek call in serveFileRange()
2024-05-06feature: filters v2 server-side warning/hiding (#2793)Libravatar Vyr Cossont3
* Remove dead code * Filter statuses when converting to frontend representation * status.filtered is an array * Make matching case-insensitive * Remove TODOs that don't need to be done now * Add missing filter check for notification * lint: rename ErrHideStatus * APIFilterActionToFilterAction not used yet * swaggerino docseroni * Address review comments * Add apimodel.FilterActionNone --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-05-05[feature] Add HTTP header permission section to frontend (#2893)Libravatar tobi2
* [feature] Add HTTP header filter section to frontend * tweak naming a bit
2024-05-01[feature] Page through accounts as moderator (#2881)Libravatar tobi4
* [feature] Page through accounts as moderator * aaaaa * use COLLATE "C" for Postgres to ensure same ordering as SQLite * fix typo, test paging up * don't show moderation / info for our instance acct
2024-04-30[bugfix] further paging mishaps (#2884)Libravatar kim3
* FURTHER paging shenanigans :smiling_face_with_tear: * remove cursor logic from ToLinkURL() * fix up paging tests --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-04-30[bugfix] paging rel links (#2883)Libravatar kim1
* fix paging so it uses correct cursor query parameter name * improved code comment * whoops, flip the cursoring :facepalm: * fix the broken test
2024-04-26[performance] update remaining worker pools to use queues (#2865)Libravatar kim2
* start replacing client + federator + media workers with new worker + queue types * refactor federatingDB.Delete(), drop queued messages when deleting account / status * move all queue purging to the processor workers * undo toolchain updates * code comments, ensure dereferencer worker pool gets started * update gruf libraries in readme * start the job scheduler separately to the worker pools * reshuffle ordering or server.go + remove duplicate worker start / stop * update go-list version * fix vendoring * move queue invalidation to before wipeing / deletion, to ensure queued work not dropped * add logging to worker processing functions in testrig, don't start workers in unexpected places * update go-structr to add (+then rely on) QueueCtx{} type * ensure more worker pools get started properly in tests * fix remaining broken tests relying on worker queue logic * fix account test suite queue popping logic, ensure noop workers do not pull from queue * move back accidentally shuffled account deletion order * ensure error (non nil!!) gets passed in refactored federatingDB{}.Delete() * silently drop deletes from accounts not permitted to * don't warn log on forwarded deletes * make if else clauses easier to parse * use getFederatorMsg() * improved code comment * improved code comment re: requesting account delete checks * remove boolean result from worker start / stop since false = already running or already stopped * remove optional passed-in http.client * remove worker starting from the admin CLI commands (we don't need to handle side-effects) * update prune cli to start scheduler but not all of the workers * fix rebase issues * remove redundant return statements * i'm sorry sir linter
2024-04-18[bugfix] Fix incorrect field name for status source, add helpful message (#2854)Libravatar tobi2
* [bugfix] Fix incorrect field name for status source, add helpful message * swagger * yyammm
2024-04-18[feature] Stub conversations endpoint (#2853)Libravatar tobi4
2024-04-18[feature] Stub account mutes endpoint (#2852)Libravatar tobi3
* [feature] Stub account mutes endpoint * swagger? i barely know 'er!
2024-04-17[feature] Status source endpoint (#2848)Libravatar tobi4
* [feature] statusSource endpoint * finish up
2024-04-17[feature] Stub status history endpoint (#2847)Libravatar tobi4
2024-04-17[bugfix] Fix minor API issue w/ boosted statuses (#2846)Libravatar tobi1
2024-04-16[feature/performance] Store account stats in separate table (#2831)Libravatar tobi1
* [feature/performance] Store account stats in separate table, get stats from remote * test account stats * add some missing increment / decrement calls * change stats function signatures * rejig logging a bit * use lock when updating stats
2024-04-15[performance] cached oauth database types (#2838)Libravatar kim1
* update token + client code to use struct caches * add code comments * slight tweak to default mem ratios * fix envparsing * add appropriate invalidate hooks * update the tokenstore sweeping function to rely on caches * update to use PutClient() * add ClientID to list of token struct indices
2024-04-13[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)Libravatar tobi8
* update settings panels, add pending overview + approve/deny functions * add admin accounts get, approve, reject * send approved/rejected emails * use signup URL * docs! * email * swagger * web linting * fix email tests * wee lil fixerinos * use new paging logic for GetAccounts() series of admin endpoints, small changes to query building * shuffle useAccountIDIn check *before* adding to query * fix parse from toot react error * use `netip.Addr` * put valid slices in globals * optimistic updates for account state --------- Co-authored-by: kim <grufwub@gmail.com>
2024-04-11[feature] New user sign-up via web page (#2796)Libravatar tobi4
* [feature] User sign-up form and admin notifs * add chosen + filtered languages to migration * remove stray comment * chosen languages schmosen schmanguages * proper error on local account missing
2024-04-11[performance] massively improved ActivityPub delivery worker efficiency (#2812)Libravatar kim1
* add delivery worker type that pulls from queue to httpclient package * finish up some code commenting, bodge a vendored activity library change, integrate the deliverypool changes into transportcontroller * hook up queue deletion logic * support deleting queued http requests by target ID * don't index APRequest by hostname in the queue * use gorun * use the original context's values when wrapping msg type as delivery{} * actually log in the AP delivery worker ... * add uncommitted changes * use errors.AsV2() * use errorsv2.AsV2() * finish adding some code comments, add bad host handling to delivery workers * slightly tweak deliveryworkerpool API, use advanced sender multiplier * remove PopCtx() method, let others instead rely on Wait() * shuffle things around to move delivery stuff into transport/ subpkg * remove dead code * formatting * validate request before queueing for delivery * finish adding code comments, fix up backoff code * finish adding more code comments * clamp minimum no. senders to 1 * add start/stop logging to delivery worker, some slight changes * remove double logging * use worker ptrs * expose the embedded log fields in httpclient.Request{} * ensure request context values are preserved when updating ctx * add delivery worker tests * fix linter issues * ensure delivery worker gets inited in testrig * fix tests to delivering messages to check worker delivery queue * update error type to use ptr instead of value receiver * fix test calling Workers{}.Start() instead of testrig.StartWorkers() * update docs for advanced-sender-multiplier * update to the latest activity library version * add comment about not using httptest.Server{}
2024-04-04fix possible nil panic (#2809)Libravatar kim1
2024-04-03[bugfix] improved authenticate post inbox error handling (#2803)Libravatar kim1
* improved PostInboxScheme() error handling / logging in case of failed auth * dumbass kim. returning err instead of errWithCode... * add checks for the slightly changed error handling in tests, add notes in codebase about the odd way of working
2024-04-02[feature] Option to hide followers/following (#2788)Libravatar tobi5
2024-03-25[feature] User-selectable preset CSS themes for accounts (#2777)Libravatar tobi7
* [feature] User-selectable preset themes * docs, more theme stuff * lint, tests * fix css name * correct some little issues * add another theme * fix poll background * okay last theme i swear * make retrieval of apimodel themes more conventional * preallocate stylesheet slices
2024-03-25[feature] Add healthcheck endpoints `/livez` and `/readyz` (#2783)Libravatar tobi4
* [feature] Add healthcheck endpoints `/livez` and `/readyz` * use select that returns no data
2024-03-25[bugfix] Avoid empty public/local timeline queries (#2784)Libravatar tobi1
2024-03-22[chore] Move local account settings to separate db table (#2770)Libravatar tobi5
* [chore] Move local account settings to separate database model * don't use separate settings_id
2024-03-15[chore] Swagger: add missing paging params to bookmarks list (#2759)Libravatar Vyr Cossont1
No code changes.
2024-03-15[chore] Swagger: correct names and formats for several array params (#2758)Libravatar Vyr Cossont3
No code changes.
2024-03-13[chore] Expose move endpoint again, small settings panel fixes (#2752)Libravatar tobi2
2024-03-13[feature] Process outgoing Move from clientAPI (#2750)Libravatar tobi43
* prevent moved accounts from taking create-type actions * update move logic * federate move out * indicate on web profile when an account has moved * [docs] Add migration docs section * lock while checking + setting move state * use redirectFollowers func for clientAPI as well * comment typo * linter? i barely know 'er! * Update internal/uris/uri.go Co-authored-by: Daenney <daenney@users.noreply.github.com> * add a couple tests for move * fix little mistake exposed by tests (thanks tests) * ensure Move marked as successful * attach shared util funcs to struct * lock whole account when doing move * move moving check to after error check * replace repeated text with error func * linterrrrrr!!!! * catch self follow case --------- Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-13[bugfix]: Add missing Link headers in Swagger spec (#2751)Libravatar Vyr Cossont5
* Adds Link headers to all endpoints that use it for paging * Fixes the return type for listing what accounts someone follows
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