summaryrefslogtreecommitdiff
path: root/internal
AgeCommit message (Collapse)AuthorFiles
2022-02-07[feature] add authorization to the already-existing authentication (#365)Libravatar Forest Johnson14
* 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-06don't bother negotiating Accept for webfinger (#381)Libravatar tobi1
2022-02-06if accountDomain isn't set, use Host value instead (#380)Libravatar tobi2
2022-02-05[feature] Rework timeline code to make it useful for more than just statuses ↵Libravatar tobi23
(#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] Fix OIDC users requiring second approval (#371)Libravatar tobi2
* tidy up NewSignup * pre-approve users created via OIDC
2022-01-31[bug] Send plaintext emails to fix "message refused: Message is not RFC 2822 ↵Libravatar Forest Johnson7
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-30[bug] Fix sqlite empty address issue (#370)Libravatar tobi2
* error when empty address has been set for sqlite * better explain sqlite db-address setting
2022-01-30[bug] Fix minimum description length check (#369)Libravatar tobi3
* add/update tests * don't check min description length on media create
2022-01-30[feature] Make Let's Encrypt integration an opt-in feature (#368)Libravatar tobi1
2021-12-21[fix] Make postgres connections magically work in common setups (#352)Libravatar embr2
* Don't use the system 'postgres' database by default * Use postgres adapter defaults The pgx code actually goes to great lengths to make postgres connections Just Work(tm) out of the box, including supporting `~/.pg_service.conf`, SSL certificates, UNIX sockets if it can find a socket at a common path, and falling back to TCP to localhost if not. (On Windows, it won't try to use UNIX sockets, but will read credentials from %appdata% as is standard over there.) By applying our flags as overrides only when they're specified, database connections should Just Work(tm) anywhere `psql gotosocial` does.
2021-12-20Extend license notices to 2022 (#354)Libravatar tobi521
2021-12-20Remove unnecessary storage config variables (#344)Libravatar tobi41
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
2021-12-20return first offer when no accept header set (#351)Libravatar tobi1
2021-12-20Log when listening (#350)Libravatar embr1
* Log when starting letsencrypt endpoint + clearer errors Running `gotosocial server` with the default configuration will try to bind to :80 and listen for letsencrypt challenges, which will fail if running as non-root (w/o capabilities), or if eg. nginx hogs the port. When that happens, this should make it more obvious what's wrong. * Log what address/port we're listening on Always nice not to have to guess. Also feels more consistent than just doing it for the letsencrypt endpoint.
2021-12-12Add optional syslog logrus hook (#343)Libravatar tobi6
* add optional syslog logrus hook * document syslog
2021-12-12Upstep Go dependencies (#340)Libravatar tobi1
* Upstep Go dependencies * tiny linter fix * Tidy
2021-12-11Add `Accept` header negotiation to relevant API endpoints (#337)Libravatar tobi76
* start centralizing negotiation logic for API * swagger document nodeinfo endpoint * go fmt * document negotiate function * use content negotiation * tidy up negotiation logic * negotiate content throughout client api * swagger * remove attachment on Content * add accept header to test requests
2021-12-07Implement Cobra CLI tooling, Viper config tooling (#336)Libravatar tobi149
* 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-27Require confirmed email when checking oauth token (#332)Libravatar tobi8
* move token checker to security package * update tests with new security package * add oauth token checking to security package * check if user email confirmed when parsing token
2021-11-24Fix broken defaults and broken flags (#314)v0.1.1Libravatar Forest Johnson3
* start with a default config, not an empty config. * some data structures were present on Empty config but not Default config * the monkey patched CLIContext is working * remove print debugging log * make the behaviour of the flags consistent across all data types Conflicts: internal/config/config.go * try to fix accidentally broken test
2021-11-22Fix streamed messages ending up in wrong timeline(s) (#325)Libravatar tobi10
* 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 mentioned accounts visibility bug (#323)Libravatar tobi7
* update other tests * set test status to followers_only * add test dm * fix mentioned accounts not being added to relevantAccounts * add some visibility tests for statuses
2021-11-22Fix incorrect target being used in CC prop for mentioning statuses (#322)Libravatar tobi2
* hardcode time on admin_account_status_3 * add test for as status with mention * fix incorrect target URI being used for mentions
2021-11-22Fix image description unnecessarily html-escaping innocent characters (#321)Libravatar tobi9
* implement SanitizeCaption function * tidy up text test setup
2021-11-22add bindAddress configuration option (#320)Libravatar tobi3
* add bindAddress configuration option * clarify that bindAddress can be a hostname
2021-11-22properly initialize user client module (#319)Libravatar tobi2
2021-11-22Enable stricter linting with golangci-lint (#316)Libravatar tobi42
* 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-21tidy up database creation logic a bit (#317)Libravatar tobi1
2021-11-17fix broken GetInstanceAccount selector (#311)Libravatar tobi2
* fix broken GetInstanceAccount selector * patch tests
2021-11-17Fix instance account not being created (#310)Libravatar tobi2
* Rework 'CreateInstanceAccount' with better checking logic * add test for create instance account
2021-11-13First db migration (#297)Libravatar tobi28
* store first db schema * md linting *screams*
2021-11-13move to ssb gofed fork (#298)Libravatar tobi57
2021-11-13update dependencies (#296)Libravatar tobi16
2021-10-31smtp + email confirmation (#285)Libravatar tobi47
* 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 tobi36
* 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 kim4
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 tobi22
* 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 tobi11
* 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-13go fmt (#278)Libravatar tobi5
2021-10-11reference global logrus (#274)Libravatar R. Aidan Campbell198
* 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 tobi17
* 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-06Derive visibility fixes (#271)Libravatar tobi9
* use pub public const * don't error on no summary * move extract visibility to separate function * extract visibility test * add addressable interface
2021-10-04fix logs not working properly (#264)Libravatar tobi6
2021-10-04Refactor/tidy (#261)Libravatar tobi122
* 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-10-01rework mention replacement func (#258)Libravatar tobi2
2021-09-30don't catch mentions within links (#257)Libravatar tobi2
2021-09-30allow dereferencing of groups (#256)Libravatar tobi3
2021-09-30Golint (#255)Libravatar tobi6
2021-09-30handle remote account deletion more systematically (#254)Libravatar tobi7