summaryrefslogtreecommitdiff
path: root/testrig/config.go
AgeCommit message (Collapse)AuthorFiles
2025-02-12[feature] Implement backfilling statuses thru scheduled_at (#3685)Libravatar Vyr Cossont1
* 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-10[feature] make account sign-up / backlog limits configurable (#3768)Libravatar tobi1
2025-01-08[feature] Fetch + create domain permissions from subscriptions nightly (#3635)Libravatar tobi1
* 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
2024-08-25[bugfix] Let prometheus client do its own compression handling (#3232)Libravatar tobi1
2024-08-09[bugfix] ensure testrig package only compiled-in when debug enabled (#3185)Libravatar kim1
* ensure testrig package only compiled-in (including init) when debug enabled * add code comment to testrig init to indicate WebAssembly compilation
2024-07-12[feature] support processing of (many) more media types (#3090)Libravatar kim1
* initial work replacing our media decoding / encoding pipeline with ffprobe + ffmpeg * specify the video codec to use when generating static image from emoji * update go-storage library (fixes incompatibility after updating go-iotools) * maintain image aspect ratio when generating a thumbnail for it * update readme to show go-ffmpreg * fix a bunch of media tests, move filesize checking to callers of media manager for more flexibility * remove extra debug from error message * fix up incorrect function signatures * update PutFile to just use regular file copy, as changes are file is on separate partition * fix remaining tests, remove some unneeded tests now we're working with ffmpeg/ffprobe * update more tests, add more code comments * add utilities to generate processed emoji / media outputs * fix remaining tests * add test for opus media file, add license header to utility cmds * limit the number of concurrently available ffmpeg / ffprobe instances * reduce number of instances * further reduce number of instances * fix envparsing test with configuration variables * update docs and configuration with new media-{local,remote}-max-size variables
2024-05-27[experiment] add alternative wasm sqlite3 implementation available via ↵Libravatar kim1
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-05[feature] Add HTTP header permission section to frontend (#2893)Libravatar tobi1
* [feature] Add HTTP header filter section to frontend * tweak naming a bit
2024-04-26[chore] Update setting testrig loglevel (#2870)Libravatar Daenney1
cmp.Or was introduced in Go 1.22 and picks the first value that's not the zero value for the type. For a string, the zero value is the empty string, which is what os.Getenv will return if the environment variable is not set. That then results in "error" being returned instead. This allows loading an environment variable with a default without having to do the check and write out the conditional.
2024-04-11[feature] New user sign-up via web page (#2796)Libravatar tobi1
* [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-04[chore] Log less output on failed test (#2804)Libravatar Daenney1
* [chore] Log less output on failed test This changes the testrig log level to be error by default instead of info. This makes test failures a lot easier to read, as we don't have the parade of info logs for each failure to scroll through. It speeds up the test suite by a couple of seconds since we need to buffer and flush a lot less messages. On a clean run, so no test failures, it's about a 3s difference on my machine. Depending on the amount of test failures, total time saved can vary. This also introduces a GTS_TESTRIG_LOG_LEVEL environment variable that we explicitly check for, making it easy to override the log level should we have a need for it. This would be primarily for running locally, and not so much as part of go test. Lastly, it updates the syslog tests to use log.Error because if the log level is set to error but we call log.Info no message is emitted and we hang indefinitely on the channel read. * [chore] Rename the testrig log level env var
2024-03-01[docs] Use human sizes for size limitations (#2706)Libravatar Daenney1
This switches the documentation to use human sizes, so 50MiB instead of an integer number of bytes. This makes it much easier to understand what values are set, and less likely to accidentally set the wrong value.
2024-02-27[feature/oidc] Add support for very basic RBAC (#2642)Libravatar 9p41
* 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 tobi1
* [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
2023-11-20[feature] Initial Prometheus metrics implementation (#2334)Libravatar Tsuribori1
* feat: Initial OTEL metrics * docs: add metrics documentation * fix: metrics endpoint conditional check * feat: metrics endpoint basic auth * fix: make metrics-auth-enabled default false * fix: go fmt helpers.gen.go * fix: add metric-related env vars to envparsing.sh * fix: metrics docs * fix: metrics related stuff in envparsing.sh * fix: metrics docs * chore: metrics docs wording * fix: metrics stuff in envparsing? * bump otel versions --------- Co-authored-by: Tsuribori <user@acertaindebian> Co-authored-by: Tsuribori <none@example.org> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-11-17[feature] Set/show instance language(s); show post language on frontend (#2362)Libravatar tobi1
* 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-10-30[feature] Customizable media cleaner schedule (#2304)Libravatar tobi1
2023-09-21[feature] Implement explicit domain allows + allowlist federation mode (#2200)Libravatar tobi1
* love like winter! wohoah, wohoah * domain allow side effects * tests! logging! unallow! * document federation modes * linty linterson * test * further adventures in documentation * finish up domain block documentation (i think) * change wording a wee little bit * docs, example * consolidate shared domainPermission code * call mode once * fetch federation mode within domain blocked func * read domain perm import in streaming manner * don't use pointer to slice for domain perms * don't bother copying blocks + allows before deleting * admonish! * change wording just a scooch * update docs
2023-08-21[feature] Make log format configurable (#2130)Libravatar Daenney1
* [feature] Don't emit timestamp in log lines When running gotosocial with a service manager like systemd, or a container runtime, the associated log driver usually emits timestamps itself. In those cases, having the extra timestamp from our own log lines ends up being a bit noisy and when centrally ingesting logs is duplicate information. This introduces a configuration flag that allows disabling emitting the timestamp. It's only wired up for "daemonised" processes, meaning server and testrig. * [chore] Add docs for log-timestamp * [feature] Simplify timestamp handling Co-Authored-By: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> * [chore] Less escaped double-quotes * [chore] Fix help string --------- Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-07-21[feature] Lower remote media cache config duration (#2007)Libravatar Daenney1
The old default of 30d can lead to a lot of media getting cached and significant disk usage, even on small or single person instances. A lot of deployments decrease this value, to 15 or even less. This is less of an issue when using object storage, but for local storage which is the more popular deployment option running out of disk space is unpleasant. With GoToSocial's aim to fit in small places, this changes the default to a much more conservative 7 days. In all likelihood people aren't scrolling that far back in their timeline so this change shouldn't result in any issue. Existing deployments will only be affected by this change if the admin hasn't already configured this value, or didn't bootstrap from the example configuration.
2023-06-22[bugfix/chore] oauth entropy fix + media cleanup tasks rewrite (#1853)Libravatar kim1
2023-05-25[feature] Configurable custom css length (#1827)Libravatar tobi1
* [feature] Make accounts custom css length configurable * test custom css validation
2023-05-25[feature] Add List functionality (#1802)Libravatar tobi1
* 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-09feat: initial tracing support (#1623)Libravatar Dominik Süß1
2023-05-08[chore/performance] Make sender multiplier configurable (#1750)Libravatar tobi1
2023-03-19[feature] Email notifications for new / closed moderation reports (#1628)Libravatar tobi1
* start fiddling about with email sending to allow multiple recipients * do some fiddling * notifs working * notify on closed report * finishing up * envparsing * use strings.ContainsAny
2023-03-12[chore] Improve copyright header handling (#1608)Libravatar Daenney1
* [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-03[performance] cache media attachments (#1525)Libravatar kim1
* replace concurrency worker pools with base models in State.Workers, update code and tests accordingly * add media attachment caching, slightly tweak default cache config * further tweak default cache config values * replace other media attachment db calls to go through cache * update envparsing test * fix delete media attachment sql * fix media sql query * invalidate cached media entries during status create / update * fix envparsing test * fix typo in panic log message... * add 'updated_at' column during UpdateAttachment * remove unused func --------- Signed-off-by: kim <grufwub@gmail.com>
2023-02-11[chore/performance] Update media prune logic, add extra CLI command (#1474)v0.7.0-rc2Libravatar tobi1
* start updating media prune stuff a wee bit * continue prune / uncache work * more tidying + consistency stuff * add prune CLI command * docs * arg
2023-02-03[chore] reformat GetAccount() functionality, support updating accounts based ↵Libravatar kim1
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-01-26[chore] set max open / idle conns + conn max lifetime for both postgres and ↵Libravatar tobi1
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 f0x521
* 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-18[chore] Change default sqlite busy timeout to 5m (#1352)Libravatar tobi1
2023-01-17[feature] Tune sqlite pragmas (#1349)Libravatar tobi1
* 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-05[chore] Update/add license headers for 2023 (#1304)Libravatar tobi1
2023-01-04[feature] HTTP request throttling middleware (#1297)Libravatar tobi1
* [feature] Add throttling middleware to AP endpoints * refactor a lil bit * use config setting, start updating docs * doc updates * use relative links in faq doc * small docs fixes * return code 503 instead of 429 when throttled * throttle other endpoints too * simplify token channel prefills
2022-12-11[feature] support configuring database caches (#1246)Libravatar kim1
* update config generator to support nested structs, add cache configuration options * update envparsing test * add cache configuration to config parse tests * set cache configuration in testrig * move caches to sub-cache "gts" namespace, update envparsing, add cache config docs to example config Signed-off-by: kim <grufwub@gmail.com>
2022-12-06[feature] overhaul the oidc system (#961)Libravatar Dominik Süß1
* [feature] overhaul the oidc system this allows for more flexible username handling and prevents account takeover using old email addresses * [feature] add migration path for old OIDC users * [feature] nicer error reporting for users * [docs] document the new OIDC flow * [fix] return early on oidc error * [docs]: add comments on the finalization logic
2022-11-06[feature] Make rate limit requests amount configurable (#966)Libravatar tobi1
* update rate limit documentation * regenerate landingpage config helpers * make rate limit rate configurable
2022-11-03[feature] Allow user to show instead of landing page on / (#922)Libravatar Mia Heidenstedt1
* configurable user instead of landing page * rename DefaultUser to LandingPageUser * code review changes and fix tests * try to fix pipeline error * code review changes * code review changes * code review changes * remove unnecessary line
2022-09-29[chore] Add ipv6 localhost to trusted proxies by default (#868)Libravatar tobi1
* add ipv6 localhost to trusted proxies by default * test different trusted proxies
2022-09-23[feature] Allow delivery to sharedInboxes where possible (#847)Libravatar tobi1
* update Activity * add instance-deliver-to-shared-inboxes setting * update activity version again * add SharedInboxURI field to accounts * serdes for endpoints/sharedInbox * deliver to sharedInbox if one is available * update tests * only assign shared inbox if shared domain * look for shared inbox if currently nil * go fmt * finger to get params.RemoteAccountID if necessary * make comments clearer * compare dns more consistently
2022-09-12[feature] Allow users to set custom css for their profiles + threads (#808)Libravatar tobi1
* add custom css account property + db func to fetch * allow account to get/set custom css * serve custom css for an account * go fmt * use monospace for customcss, add link * add custom css to account cache * fix broken field * add custom css docs to user guide * add `accounts-allow-custom-css` config flag * add allow custom css to /api/v1/instance response * only show/set custom css if allowed to do so * only set/serve custom account css if enabled * update swagger docs * chain promise * make bool a bit clearer * use cache for GetAccountCustomCSSByUsername
2022-09-12[feature] Fetch + display custom emoji in statuses from remote instances (#807)Libravatar tobi1
* start implementing remote emoji fetcher * update status where pk * aaa * tidy up a little * check size limits for emojis * thank you linter, i love you <3 * update swagger docs * add emoji dereference test * make emoji max sizes configurable * normalize db.ErrAlreadyExists
2022-08-31[chore] Test fixes (#788)Libravatar tobi1
* use 'test' value for testrig storage backend * update test dependency * add WaitFor func in testrig * use WaitFor function instead of time.Sleep * tidy up tests * make SentMessages a sync.map * go fmt
2022-07-20[chore] Update image/video size defaults to mastodon's (#723)Libravatar tobi1
2022-07-03[chore] configure instance.Version for testrig (#659)Libravatar f0x521
* configure instance.Version for testrig * update instancepatch tests Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2022-06-23[feature] Implement `/api/v1/instance/peers` endpoint (#660)Libravatar tobi1
* add missing license headers * start adding instance peers get * rename domainblock.go * embed domain in domainblock so it can be reused * update swagger docs * add test instances to db * update tests * add/update instancepeersget * update domain model * add getinstancepeers to db * instance-expose-peers, instance-expose-suspended * add auth checks for both current filters * attach endpoint to router * include public comment * obfuscate domain if required * go mod tidy * update swagger docs * remove unnecessary comment * return 'flat' peerlist if no query params provided
2022-06-14[chore] Duplicated media cleanup (#649)v0.3.5Libravatar tobi1
* add migration to clean up duplicated media * use /tmp/gotosocial for testrig storage path * defer remove storage tempdir * skip if not attached to status or status not found * log errors at error level * only log delete as else clause if successful * just return nil on down * reword delete logic a little bit * check if storage base path is defined * check for status id more thoroughly * don't log error if just no rows * go fmt * break statusIDLoop when found * break currentlyUsedLoop when found