summaryrefslogtreecommitdiff
path: root/internal/processing
AgeCommit message (Collapse)AuthorFiles
2022-04-24[bug] Fix status API / status web API being case sensitive (#481)Libravatar tobi1
* make getStatus by id case-insensitive * test get status case insensitive * init config before log
2022-04-16[bugfix] Use background ctx for domain block side effects (#457)Libravatar tobi1
2022-04-15[feature] Web profile pages for accounts (#449)Libravatar tobi9
* add default avatars * allow webModule to error * return errWithCode from account get * add AccountGetLocalByUsername * check nil requesting account * add timestampShort function for just month/year * move loading logic to New + add default avatars * add profile page view * update swagger docs * add excludeReblogs to GetAccountStatuses * ignore casing when selecting local account by username * appropriate redirects * css fiddling * add 'about' heading * adjust thread page to work with routing * return AP representation if requested + authorized * simplify auth check * go fmt * golangci-lint ignore math/rand
2022-04-02[chore] Update Go version to 1.18 (#444)Libravatar tobi2
* linting with new golangci-lint version * update go to 1.18 * bump versions in drone.yml * use new runtime/debug package for version info * remove Commit build flag from goreleaser * remove mock commit + version from build script * go fmt * add dummy version env flag to test container * install git in golang container for testing * only set versionString if Version is defined
2022-03-29[feature] Dereference remote mentions when the account is not already known ↵v0.2.2Libravatar tobi9
(#442) * remove mention util function from db * add ParseMentionFunc to gtsmodel * add parseMentionFunc to processor * refactor search to simplify it a bit * add parseMentionFunc to account * add parseMentionFunc to status * some renaming for clarity * test dereference of unknown mentioned account
2022-03-21[bugfix] Close ReadClosers properly in the media package (#434)Libravatar tobi2
* defer lock reader * close readers when finished with them * close the reader in the teereader when finished
2022-03-19[feature] Admin account actions (#432)Libravatar tobi4
* add accountAction to the admin API * model admin account action * add admin account action to the processor * add migration for new AdminAccountActions table * fix accounts admin path * Update swagger docs
2022-03-15[feature] Federate local account deletion (#431)Libravatar tobi7
* add account delete to API * model account delete request * add AccountDeleteLocal * federate local account deletes * add DeleteLocal * update transport (controller) to allow shortcuts * delete logic + testing * update swagger docs * more tests + fixes
2022-03-13[bugfix] Fix html-escaped characters in content warnings (#426)Libravatar tobi2
* test status create with odd CWs * use SanitizeCaption for content warning escaping
2022-03-07[feature] Clean up/uncache remote media (#407)Libravatar tobi7
* Add whereNotEmptyAndNotNull * Add GetRemoteOlderThanDays * Add GetRemoteOlderThanDays * Add PruneRemote to Manager interface * Start implementing PruneRemote * add new attachment + status to tests * fix up and test GetRemoteOlderThan * fix bad import * PruneRemote: return number pruned * add Cached column to mediaattachment * update + test pruneRemote * update mediaTest * use Cached column * upstep bun to latest version * embed structs in mediaAttachment * migrate mediaAttachment to new format * don't default cached to true * select only remote media * update db dependencies * step bun back to last working version * update pruneRemote to use Cached field * fix storage path of test attachments * add recache logic to manager * fix trimmed aspect ratio * test prune and recache * return errwithcode * tidy up different paths for emoji vs attachment * fix incorrect thumbnail type being stored * expose TransportController to media processor * implement tee-ing recached content * add thoughts of dog to test fedi attachments * test get remote files * add comment on PruneRemote * add postData cleanup to recache * test thumbnail fetching * add incredible diagram * go mod tidy * buffer pipes for recache streaming * test for client stops reading after 1kb * add media-remote-cache-days to config * add cron package * wrap logrus so it's available to cron * start and stop cron jobs gracefully
2022-02-22[feature] Add postDataCallbackFunc to allow cleanup (#408)Libravatar tobi3
2022-02-19[feature] Stream files via reader (#404)Libravatar tobi1
* serve files via reader rather than byte slice * close readcloser when we're done with it * cast reader to readcloser
2022-02-08merge fixupLibravatar tsmethurst1
2022-02-08Merge branch 'main' into media_refactorLibravatar tsmethurst9
2022-02-07[feature] add authorization to the already-existing authentication (#365)Libravatar Forest Johnson1
* add ensureUserIsAuthorizedOrRedirect to /oauth/authorize * adding authorization (email confirm, account approve, etc) to TokenCheck * revert un-needed changes to signin.go * oops what happened here * error css * add account.SuspendedAt check * remove redundant checks from oauth util Authed function * wip tests * tests passing * stop stripping useful information from ErrAlreadyExists * that feeling of scraping the dryer LINT off the screen * oops I didn't mean to get rid of this NewTestRouter function * make tests work with recorder * re-add ConfigureTemplatesWithGin to handle template path err Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2022-02-06if accountDomain isn't set, use Host value instead (#380)Libravatar tobi1
2022-02-05[feature] Rework timeline code to make it useful for more than just statuses ↵Libravatar tobi6
(#373) * add preparable and timelineable interfaces * initialize timeline manager within the processor * generic renaming * move status-specific timeline logic into the processor * refactor timeline to make it useful for more than statuses
2022-01-31[bug] Send plaintext emails to fix "message refused: Message is not RFC 2822 ↵Libravatar Forest Johnson1
compliant" (#366) * trying to fix "message refused: Message is not RFC 2822 compliant" * fix "message refused: Message is not RFC 2822 compliant" 550 5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant * remove silly regex * lint * fix tests * we should use text/template instead of html/template now
2022-01-25ensure blocking calls to getRemoteAccount before showing stuff to clientLibravatar tsmethurst1
2022-01-24ctx => innerctxLibravatar tsmethurst1
2022-01-24update remote account get/deref logicLibravatar tsmethurst9
2022-01-23rework data function to provide filesizeLibravatar tsmethurst3
2022-01-16pass reader around instead of []byteLibravatar tsmethurst3
2022-01-15emoji code passing musterLibravatar tsmethurst4
2022-01-15start fixing up emoji processing codeLibravatar tsmethurst1
2022-01-11pass a function into the manager, start work on emojiLibravatar tsmethurst3
2022-01-10test the media manager a bit, add shutdown logicLibravatar tsmethurst4
2022-01-09tests are passing, but there's still much to be doneLibravatar tsmethurst3
2022-01-08compiling nowLibravatar tsmethurst3
2022-01-08further refinementsLibravatar tsmethurst1
2021-12-28more refactoring, media handler => managerLibravatar tsmethurst9
2021-12-20Extend license notices to 2022 (#354)Libravatar tobi92
2021-12-20Remove unnecessary storage config variables (#344)Libravatar tobi9
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
2021-12-07Implement Cobra CLI tooling, Viper config tooling (#336)Libravatar tobi26
* start pulling out + replacing urfave and config * replace many many instances of config * move more stuff => viper * properly remove urfave * move some flags to root command * add testrig commands to root * alias config file keys * start adding cli parsing tests * reorder viper init * remove config path alias * fmt * change config file keys to non-nested * we're more or less in business now * tidy up the common func * go fmt * get tests passing again * add note about the cliparsing tests * reorganize * update docs with changes * structure cmd dir better * rename + move some files around * fix dangling comma
2021-11-22Fix streamed messages ending up in wrong timeline(s) (#325)Libravatar tobi9
* define timeline consts * remove double stream of status * change test stream creation up a bit * stream messages more selectively * add test for streaming new status creation via clientAPI * tidy code + comments a bit * tidy up tests * make sure new status isn't streamed to public
2021-11-22Fix image description unnecessarily html-escaping innocent characters (#321)Libravatar tobi2
* implement SanitizeCaption function * tidy up text test setup
2021-11-22Enable stricter linting with golangci-lint (#316)Libravatar tobi5
* update golangci-lint * add golangci config file w/ more linters * correct issues flagged by stricter linters * add more generous timeout for golangci-lint * add some style + formatting guidelines * move timeout to config file * go fmt
2021-11-13move to ssb gofed fork (#298)Libravatar tobi9
2021-11-13update dependencies (#296)Libravatar tobi4
2021-10-31smtp + email confirmation (#285)Libravatar tobi10
* add smtp configuration * add email confirm + reset templates * add email sender to testrig * flesh out the email sender interface * go fmt * golint * update from field with more clarity * tidy up the email formatting * fix tests * add email sender to processor * tidy client api processing a bit * further tidying in fromClientAPI * pin new account to user * send msg to processor on new account creation * generate confirm email uri * remove emailer from account processor again * add processCreateAccountFromClientAPI * move emailer accountprocessor => userprocessor * add email sender to user processor * SendConfirmEmail function * add noop email sender * use noop email sender in tests * only assemble message if callback is not nil * use noop email sender if no smtp host is defined * minify email html before sending * fix wrong email address * email confirm test * fmt * serve web hndler * add email confirm handler * init test log properly on testrig * log emails that *would* have been sent * go fmt ./... * unexport confirm email handler * updatedAt * test confirm email function * don't allow tokens older than 7 days * change error message a bit * add basic smtp docs * add a few more snippets * typo * add email sender to outbox tests * don't use dutch wikipedia link * don't minify email html
2021-10-24Serve `outbox` for Actor (#289)Libravatar tobi18
* add statusesvisible convenience function * add minID + onlyPublic to account statuses get * move swagger collection stuff to common * start working on Outbox GETting * move functions into federationProcessor * outboxToASCollection * add statusesvisible convenience function * add minID + onlyPublic to account statuses get * move swagger collection stuff to common * start working on Outbox GETting * move functions into federationProcessor * outboxToASCollection * bit more work on outbox paging * wrapNoteInCreate function * test + hook up the processor functions * don't do prev + next links on empty reply * test get outbox through api * don't fail on no status entries * add outbox implementation doc * typo
2021-10-17fix mention extracting when no domain exists (usually intra-instance ↵Libravatar kim1
mentions) (#272) * fix mention extracting when no domain exists (usually when intra-instance mentions) Signed-off-by: kim <grufwub@gmail.com> * fix search logic to match new mention matching logic Signed-off-by: kim <grufwub@gmail.com> * appease the linter :p Signed-off-by: kim <grufwub@gmail.com>
2021-10-16Follow request improvements (#282)Libravatar tobi6
* tiny doc update * add rejectfollowrequest to db * add follow request reject to processor * add reject handler * tidy up follow request api * tidy up federation call * regenerate swagger docs * api endpoint tests * processor test * add reject federatingdb handler * start writing reject tests * test reject follow request * go fmt * increase sleep for slow test setups * more relaxed time.sleep
2021-10-14User password change (#280)Libravatar tobi6
* start passwordChangeHandler * add user scope * add user module / api path * add password change request * make comment clearer * add user to processor * required true * add processor call to handler * don't pass tc or channel * change password func + tests * add some first docs about password management * update swagger docs * add api tests * go fmt * test fixes
2021-10-11reference global logrus (#274)Libravatar R. Aidan Campbell20
* reference logrus' global logger instead of passing and storing a logger reference everywhere * always directly use global logrus logger instead of referencing an instance * test suites should also directly use the global logrus logger * rename gin logging function to clarify that it's middleware * correct comments which erroneously referenced removed logger parameter * setting log level for tests now uses logrus' exported type instead of the string value, to guarantee error isn't possible
2021-10-10Handle forwarded messages (#273)Libravatar tobi3
* correct path of foss_satan * add APIri and notes * test create forward note * rename target => receiving account * split up create into separate funcs * update extractFromCtx * tidy up from federator processing * foss satan => http not https * check if status in db * mock dereference of status from IRI * add forward message deref test * update test with activities * add remote_account_2 to test rig
2021-10-04Refactor/tidy (#261)Libravatar tobi49
* tidy up streaming * cut down code duplication * test get followers/following * test streaming processor * fix some test models * add TimeMustParse * fix uri / url typo * make trace logging less verbose * make logging more consistent * disable quote on logging * remove context.Background * remove many extraneous mastodon references * regenerate swagger * don't log query on no rows result * log latency first for easier reading
2021-10-01Follow request auto approval (#259)Libravatar tobi5
* start messing about * fiddle more * Tests & fiddling
2021-09-30handle remote account deletion more systematically (#254)Libravatar tobi4
2021-09-28Account update issue (#250)Libravatar tobi1
* start poking around * tests * notes and fiddling