summaryrefslogtreecommitdiff
path: root/testrig/storage.go
AgeCommit message (Collapse)AuthorFiles
2024-08-03[bugfix] fix emoji recaching operations (#3167)Libravatar kim1
* add test for emoji update image * update emoji recache to set the instance account id * don't refresh emoji if only not cached. in that case literally just recache * code comment * rename + move a few things * add some more code comments, and rename some functions to make logic a bit clearer * remove unnecessary nil check (the value can be nil) * comment wording * remove test data output * handle the case of caching an emoji which has been refreshed then uncached * allow overwriting on testrig storage as we do now on regular storage * fix emoji category ID not getting updated --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-05-22[performance] update storage backend and make use of seek syscall when ↵Libravatar kim1
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()
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-01[chore/performance] simplify storage driver to use storage.Storage directly ↵Libravatar kim1
(#1576) * simply use storage.Storage, removing wrapping KVStore as we don't need KV store locking functionality Signed-off-by: kim <grufwub@gmail.com> * fix missing unwrapped function Signed-off-by: kim <grufwub@gmail.com> * add code comment Signed-off-by: kim <grufwub@gmail.com> * linter, please take my offering in peace Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-01-11[performance] media processing improvements (#1288)Libravatar kim1
* media processor consolidation and reformatting, reduce amount of required syscalls Signed-off-by: kim <grufwub@gmail.com> * update go-store library, stream jpeg/png encoding + use buffer pools, improved media processing AlreadyExists error handling Signed-off-by: kim <grufwub@gmail.com> * fix duration not being set, fix mp4 test expecting error Signed-off-by: kim <grufwub@gmail.com> * fix test expecting media files with different extension Signed-off-by: kim <grufwub@gmail.com> * remove unused code Signed-off-by: kim <grufwub@gmail.com> * fix expected storage paths in tests, update expected test thumbnails Signed-off-by: kim <grufwub@gmail.com> * remove dead code Signed-off-by: kim <grufwub@gmail.com> * fix cached presigned s3 url fetching Signed-off-by: kim <grufwub@gmail.com> * fix tests Signed-off-by: kim <grufwub@gmail.com> * fix test models Signed-off-by: kim <grufwub@gmail.com> * update media processing to use sync.Once{} for concurrency protection Signed-off-by: kim <grufwub@gmail.com> * shutup linter Signed-off-by: kim <grufwub@gmail.com> * fix passing in KVStore GetStream() as stream to PutStream() Signed-off-by: kim <grufwub@gmail.com> * fix unlocks of storage keys Signed-off-by: kim <grufwub@gmail.com> * whoops, return the error... Signed-off-by: kim <grufwub@gmail.com> * pour one out for tobi's code <3 Signed-off-by: kim <grufwub@gmail.com> * add back the byte slurping code Signed-off-by: kim <grufwub@gmail.com> * check for both ErrUnexpectedEOF and EOF Signed-off-by: kim <grufwub@gmail.com> * add back links to file format header information Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
2023-01-05[chore] Update/add license headers for 2023 (#1304)Libravatar tobi1
2022-12-02[performance]: make s3 urls cacheable (#1194)v0.6.0-rc3Libravatar Dominik Süß1
Implements #864 and should speed up s3 based installations by a lot. With more static urls, we can then also implement #1026 for even better performance when used in conjunction with CDNs
2022-11-24[chore] cleanup storage implementation, no need for multiple interface types ↵Libravatar kim1
(#1131) Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
2022-11-22[chore] use kv.KVStore also for S3 storage (#1113)Libravatar kim1
* replace s3 storage implementation to also use kv.KVStore Signed-off-by: kim <grufwub@gmail.com> * pull in latest `go-store` fix Signed-off-by: kim <grufwub@gmail.com> * pull-in go-store v2.0.9 fixes, update s3 put chunk size to 5MiB Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
2022-11-11[feature] S3: add config flag to proxy S3 media (#1014)Libravatar Mara Sophie Grosch1
* S3: add config value "proxy" for not redirecting Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org> * S3: document new config value "proxy" * S3: add new config value "proxy" to test scripts Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
2022-11-05[chore] bump gruf/go-store to v2 (#953)Libravatar tobi1
* [chore] bump gruf/go-store to v2 * no more boobs
2022-07-03[feature] S3 support (#674)Libravatar Dominik Süß1
* feat: vendor minio client * feat: introduce storage package with s3 support * feat: serve s3 files directly this saves a lot of bandwith as the files are fetched from the object store directly * fix: use explicit local storage in tests * feat: integrate s3 storage with the main server * fix: add s3 config to cli tests * docs: explicitly set values in example config also adds license header to the storage package * fix: use better http status code on s3 redirect HTTP 302 Found is the best fit, as it signifies that the resource requested was found but not under its presumed URL 307/TemporaryRedirect would mean that this resource is usually located here, not in this case 303/SeeOther indicates that the redirection does not link to the requested resource but to another page * refactor: use context in storage driver interface
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
2022-01-16pass reader around instead of []byteLibravatar tsmethurst1
2021-12-20Extend license notices to 2022 (#354)Libravatar tobi1
2021-11-27Update dependencies (#333)Libravatar tobi1
2021-11-13update dependencies (#296)Libravatar tobi1
2021-09-11add git.iim.gay/grufwub/go-store for storage backend, replacing blob.StorageLibravatar kim (grufwub)1
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
2021-05-30Move a lot of stuff + tidy stuff (#37)Libravatar Tobi Smethurst1
Lots of renaming and moving stuff, some bug fixes, more lenient parsing of notifications and home timeline.
2021-04-20linting + organizingLibravatar tsmethurst1
2021-04-19Api/v1/statuses (#11)Libravatar Tobi Smethurst1
This PR adds: Statuses New status creation. View existing status Delete a status Fave a status Unfave a status See who's faved a status Media Upload media attachment and store/retrieve it Upload custom emoji and store/retrieve it Fileserver Serve files from storage Testing Test models, testrig -- run a GTS test instance and play around with it.