summaryrefslogtreecommitdiff
path: root/internal
AgeCommit message (Collapse)AuthorFiles
2023-02-19[chore] Move request validation earlier in client (#1531)Libravatar Daenney1
This moves checking if the request is valid as early as possible in the chain. This should ensure that for an invalid request we never bother acquiring the wait queue and taking up a spot in it.
2023-02-18[bugfix] In Postgres, drop shortcodedomain constraint before creating new ↵Libravatar tobi1
emoji table (#1528)
2023-02-18[chore] transport improvements (#1524)Libravatar kim6
* improve error readability, mark "bad hosts" as fastFail Signed-off-by: kim <grufwub@gmail.com> * pull in latest go-byteutil version with byteutil.Reader{} Signed-off-by: kim <grufwub@gmail.com> * use rewindable body reader for post requests Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-18[bugfix] Keep png transparency (#1522)Libravatar mushus1
* keep png transparency * rewrite to switch case
2023-02-18[bugfix] fix oob token route, update templates+css for oob and errors (#1519)Libravatar f0x521
2023-02-17[chore] Update more log calls to include context (#1517)Libravatar Daenney9
In #1476 we updated log.WithFields() but we forgot about log.WithField(). Also updates a few explicit log.Entry{} creations.
2023-02-17[bug] Pass context in logging middleware (#1514)Libravatar Daenney1
This updates the middleware log.WithField calls that create new loggers to include the context the first time around. Without it the requestID does not get logged. Fixup from #1476
2023-02-17[feature] Add a request ID and include it in logs (#1476)Libravatar Daenney104
This adds a lightweight form of tracing to GTS. Each incoming request is assigned a Request ID which we then pass on and log in all our log lines. Any function that gets called downstream from an HTTP handler should now emit a requestID=value pair whenever it logs something. Co-authored-by: kim <grufwub@gmail.com>
2023-02-16[bugfix] Set 'discoverable' properly on API accounts (#1511)v0.7.0Libravatar tobi10
2023-02-16[bugfix] Set cache-control max-age dynamically for s3 (#1510)Libravatar tobi4
* [bugfix] set cache-control max-age dynamically for s3 * woops * double whoops * time until, thank you linter, bless you, you're the best, no matter what kim says * aa
2023-02-15Fix 410 Gone race on account deletes (#1507)Libravatar Sam Lade1
2023-02-14[bugfix] Return empty result rather than 500 error when searching for ↵Libravatar tobi2
blocked domains (#1498) * [bugfix] Return empty result when searching for blocked domains * add tests
2023-02-13[bugfix] Fix up `error getting account avatar/header` errors, other small ↵Libravatar tobi6
fixes (#1496) * start fiddling with media + account queries a little * initialize state when pruning * allow for unsetting remote media make sure to wait til media loaded fix silly tiny bug * move comment a bit for readability * slight reformat of fetchRemoteAccount{Avatar,Header} * fix issue after rebase * slightly neaten up logic of avatar/header media handling * remove log prefix (callername log field handles this) --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
2023-02-13[performance] processing media and scheduled jobs improvements (#1482)Libravatar kim20
* replace media workers with just runners.WorkerPool, move to state structure, use go-sched for global task scheduling * improved code comment * fix worker tryUntil function, update go-runners/go-sched * make preprocess functions package public, use these where possible to stop doubled up processing * remove separate emoji worker pool * limit calls to time.Now() during media preprocessing * use Processor{} to manage singular runtime of processing media * ensure workers get started when media manager is used * improved error setting in processing media, fix media test * port changes from processingmedia to processing emoji * finish code commenting * finish code commenting and comment-out client API + federator worker pools until concurrency worker pools replaced * linterrrrrrrrrrrrrrrr --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-13[chore] Do cache-control in a less silly way to avoid writing header twice ↵Libravatar tobi2
(#1481) * do cache-control in a less silly way to avoid writing header twice * add comment back in
2023-02-12[bugfix] Set appropriate cache-control when using presigned s3 links (#1480)Libravatar tobi2
2023-02-11[chore/performance] Update media prune logic, add extra CLI command (#1474)v0.7.0-rc2Libravatar tobi22
* start updating media prune stuff a wee bit * continue prune / uncache work * more tidying + consistency stuff * add prune CLI command * docs * arg
2023-02-10[performance] remove throttling timers (#1466)Libravatar kim5
* remove throttling timers, support setting retry-after, use retry-after in transport * remove unused variables * add throttling-retry-after to cmd flags * update envparsing to include new throttling-retry-after * update example config to include retry-after documentation * also support retry-after formatted as date-time, ensure max backoff time --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-10[chore] small changes missed in previous dereferencer.GetAccount() PRs (#1467)Libravatar kim4
* small formatting changes, rewrite fetchRemoteMedia to use separate funcs + use mutex lock correctly * move url parsing before acquiring mutex locks * use wrapped mutexes to allow safe unlocking. (previously i did a fucky and passed mutex by value...) * remove unused code * use consistent map keying for dereferencing headers/avatars --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-09[bugfix] Fix error on searching for account w/accountDomain by host (#1465)Libravatar tobi1
2023-02-09[performance] Don't fetch avatar + header if uri hasn't changed (#1463)Libravatar tobi2
2023-02-08[chore/bugfix] Serve + throttle publickey separately from rest of ↵Libravatar tobi4
ActivityPub API (#1461) * serve publickey separately from AP, don't throttle it * update nginx cache documentation, cache main-key too * throttle public key, but separately from other endpoints
2023-02-07[bugfix] Use SignatureCheck middleware for web profile endpoints too (#1451)Libravatar tobi1
2023-02-07[bugfix] don't trash emoji in profile fields on edit (#1440)Libravatar Sam Lade1
2023-02-07[bugfix] fix file range length calculation being off by 1 (#1448)Libravatar kim2
* small formatting change * fix range handling new length calculation --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-06Ignore missing files when cleaning up media (#1435)Libravatar Sam Lade1
2023-02-06[performance] remove local copying of file for satisfying range headers (#1421)v0.7.0-rc1Libravatar kim1
* remove local copying of file for satisfying range headers Signed-off-by: kim <grufwub@gmail.com> * remove unused import Signed-off-by: kim <grufwub@gmail.com> * fix range header reader limit calculation Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-06[bugfix] fix old password hash staying in cache (#1432)Libravatar tobi1
2023-02-05[chore] stub /api/v1/featured_tags endpoint (#1420)Libravatar tobi3
2023-02-04[bugfix] Allow instance thumbnail description to be set separately from ↵Libravatar tobi3
image (#1417)
2023-02-03fix cache startup (#1414)Libravatar kim1
Signed-off-by: kim <grufwub@gmail.com>
2023-02-03[chore] reformat GetAccount() functionality, support updating accounts based ↵Libravatar kim46
on last_fetch (#1411) * reformat GetAccount() functionality, and add UpdateAccount() function. * use fetched_at instead of last_webfingered_at * catch local "not found" errors. small formatting / error string changes * remove now unused error type * return nil when wrapping nil error * update expected error messages * return correct url for foss satan webfinger * add AP model for Some_User * normalize local domain * return notretrievable where appropriate * expose NewErrNotRetrievable * ensure webfinger for new accounts searched by uri * update local account short circuit * allow enrich to fail for already-known accounts * remove unused LastWebfingeredAt * expose test maps on mock http client * update Update test * reformat GetAccount() functionality, and add UpdateAccount() function. * use fetched_at instead of last_webfingered_at * catch local "not found" errors. small formatting / error string changes * remove nil error checks (we shouldn't be passing nil errors to newError() initializers) * remove mutex unlock on transport init fail (it hasn't yet been locked!) * woops add back the error wrapping to use ErrNotRetrievable * caches were never being started... :see_no_evil: --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-02-03[chore] Text formatting overhaul (#1406)Libravatar Autumn!26
* Implement goldmark debug print for hashtags and mentions * Minify HTML in FromPlain * Convert plaintext status parser to goldmark * Move mention/tag/emoji finding logic into formatter * Combine mention and hashtag boundary characters * Normalize unicode when rendering hashtags
2023-02-02[bugfix] Read Bookwyrm Articles more thoroughly (#1410)Libravatar tobi5
2023-02-02[feature] Implement `/api/v2/instance` endpoint (#1409)Libravatar tobi106
* interim: start adding /api/v2/instance * finish up
2023-02-01[chore/performance] use only 1 sqlite db connection regardless of multiplier ↵Libravatar tobi1
(#1408)
2023-01-31[chore] Use 'immediate' lock for sqlite transactions (#1404)Libravatar tobi1
* [chore] Use 'immediate' lock for sqlite transactions * allow 1 connection regardless of cpu amount
2023-01-27[feature] Federate reports to remote instance as Flag (if desired) (#1386)Libravatar tobi9
* reports federate out, we did it lxds * fix optional line start (should be optional slash)
2023-01-26[chore] set max open / idle conns + conn max lifetime for both postgres and ↵Libravatar tobi5
sqlite (#1369) * [chore] set max open / idle conns + conn max lifetime for both postgres and sqlite * reduce cache size default to 8MiB, reduce connections to 2 * cpu * introduce max open conns multiplier, tune sqlite and pg separately * go fmt
2023-01-25[feature] Public list of suspended domains (#1362)Libravatar f0x5210
* basic rendered domain blocklist (unauthenticated!) * style basic domain block list * better formatting for domain blocklist * add opt-in config option for showing suspended domains * format/linter * re-use InstancePeersGet for web-accessible domain blocklist * reword explanation, border styling * always attach blocklist handler, update error message * domain blocklist error message grammar
2023-01-25[feature] Accept incoming federated Flag activity (#1382)Libravatar tobi11
* start working on handling incoming Flag activity * interim commit * federate Flag in successfully
2023-01-25[feature] Implement reports admin API so admins can view + close reports (#1378)Libravatar tobi18
* add admin report api endpoints + tests * [chore] remove funky duplicate attachment in testrig
2023-01-23[chore] remove funky duplicate attachment in testrig (#1379)Libravatar tobi3
* [chore] remove funky duplicate attachment in testrig * whoops
2023-01-23[feature] Implement `/api/v1/reports` endpoints on client API (#1330)Libravatar tobi25
* start adding report client api * route + test reports get * start report create endpoint * you can create reports now babyy * stub account report processor * add single reportGet endpoint * fix test * add more filtering params to /api/v1/reports GET * update swagger * use marshalIndent in tests * add + test missing Link info
2023-01-22[chore] extending maximumPasswordLength to 256 (#1372)Libravatar 즈눅2
* [chore] extending maximumPasswordLength to 256 Resolves: #1365 * Make long test longer
2023-01-18[chore] Change default sqlite busy timeout to 5m (#1352)Libravatar tobi1
2023-01-17[feature] Tune sqlite pragmas (#1349)Libravatar tobi5
* sqlite pragma tuning * use formatuint * add sqlite busy timeout * fix incorrect cache size format * update envparsing test * add sqlite tuning flags to cli * set sqlite timeout to 30s default
2023-01-16[bugfix] Parse video metadata more accurately; allow Range in fileserver (#1342)Libravatar tobi14
* don't serve unused fields for video attachments * parse video bitrate + duration more accurately * use ServeContent where appropriate to respect Range * abstract temp file seeker into its own function
2023-01-13[bugfix] Mount bookmarks endpoint correctly (#1338)Libravatar tobi1
2023-01-13[chore] Remove omitempty on account source; refactor tests to use ↵Libravatar tobi18
prettyprint json (#1337) * remove omitEmpty tag on account source items * update tests