Commit graph

347 commits

Author SHA1 Message Date
tsmethurst
113f9d9ab4 pass a function into the manager, start work on emoji 2022-01-11 17:49:14 +01:00
tsmethurst
e0f9323b9a test the media manager a bit, add shutdown logic 2022-01-10 18:36:09 +01:00
tsmethurst
0ef478584c add async test 2022-01-09 18:52:28 +01:00
tsmethurst
dccf21dd87 tests are passing, but there's still much to be done 2022-01-09 18:41:22 +01:00
tsmethurst
f61c3ddcf7 compiling now 2022-01-08 17:17:01 +01:00
tsmethurst
c2ff8f392b further refinements 2022-01-08 13:45:42 +01:00
tsmethurst
7ebe0f6a15 start working on thumb + full funcs 2022-01-04 17:37:54 +01:00
tsmethurst
8abfa7751a return very partial image on first upload 2022-01-03 17:37:38 +01:00
tsmethurst
e08c0e55ee add gruf worker pool 2022-01-03 17:37:09 +01:00
tsmethurst
2f57eb5ece fiddle around with workers 2022-01-02 15:00:53 +01:00
tsmethurst
c4d63d125b more refactoring, media handler => manager 2021-12-28 16:36:00 +01:00
tsmethurst
6803c1682b start refactor of media package 2021-12-27 18:03:36 +01:00
zoe-bat
14c472c1ab
[documentation] Add section for systemd service and nginx to installation guide (#353)
* add nginx and systemd section

* fix typso

* fix mkdoc and dots in config guide

* specify port

* Update nginx.md

* add section about configuring gts to nginx docs

* Update nginx.md

Co-authored-by: zoe <z8V54gHftevp7LeRVyys$8@DosKq^FeQKUWU!WGpTyiLaxGojNdgnWkaWiv673Twg$aPm&hU>
2021-12-26 13:58:15 +01:00
tobi
a01b178467
[documentation] update database docs (#355)
* update config to new db defaults
* update database docs
2021-12-21 12:24:19 +01:00
embr
ed9158fa05
[fix] Make postgres connections magically work in common setups (#352)
* 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-21 12:08:27 +01:00
tobi
ef5a9256a8
Extend license notices to 2022 (#354) 2021-12-20 18:42:19 +01:00
tobi
cb8688f429
Remove unnecessary storage config variables (#344)
* rewire config to not use extraneous serve vars

* rename 'file' to 'local' for consistency

* use Type and Size again
2021-12-20 15:19:53 +01:00
tobi
2582515b4d
return first offer when no accept header set (#351) 2021-12-20 11:08:54 +01:00
kim
635ad2a42f
Update codeberg.org/gruf libraries and fix go-store issue (#347)
* update codeberg.org/gruf/ libraries

Signed-off-by: kim <grufwub@gmail.com>

* another update

Signed-off-by: kim <grufwub@gmail.com>
2021-12-20 10:35:32 +01:00
embr
86e8e7fd21
Log when listening (#350)
* 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-20 10:34:57 +01:00
tobi
80ec714117
document post settings (#346) 2021-12-14 12:42:20 +01:00
tobi
c111b239f7
Add optional syslog logrus hook (#343)
* add optional syslog logrus hook

* document syslog
2021-12-12 18:00:20 +01:00
tobi
909f801742
add systemd service example to packaging (#342) 2021-12-12 15:54:51 +01:00
zoe-bat
c6912f5425
add example systemd service (#341) 2021-12-12 15:48:02 +01:00
tobi
67ac8db190
Upstep Go dependencies (#340)
* Upstep Go dependencies

* tiny linter fix

* Tidy
2021-12-12 15:47:51 +01:00
tobi
5506a5ecbe
upstep dependencies (#339) 2021-12-12 14:31:58 +01:00
tobi
e2daf0f012
Add Accept header negotiation to relevant API endpoints (#337)
* 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-11 17:50:00 +01:00
tobi
0884f89431
Implement Cobra CLI tooling, Viper config tooling (#336)
* 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-12-07 13:31:39 +01:00
tobi
182b4eea73
Update dependencies (#333) 2021-11-27 15:26:58 +01:00
tobi
ce22e03f9d
Require confirmed email when checking oauth token (#332)
* 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-27 14:53:34 +01:00
tobi
5ed03480e7
run sqlite tests in parallel (#331) 2021-11-27 13:41:00 +01:00
Forest Johnson
ab316d2250
Fix broken defaults and broken flags (#314)
* 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-24 17:01:38 +01:00
tobi
3caae376e7
Fix streamed messages ending up in wrong timeline(s) (#325)
* 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-22 19:03:21 +01:00
Mara Sophie Grosch
a7882fabc7
Use IPv6 doc prefix for docs (#324)
IPv6 has a dedicated prefix for documentation and examples, this commit makes use of it for BindAddress config flag docs and examples.
2021-11-22 17:58:19 +01:00
tobi
79ccd8fd8a
Fix mentioned accounts visibility bug (#323)
* 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-22 14:40:23 +01:00
tobi
b46e5fb65d
Fix incorrect target being used in CC prop for mentioning statuses (#322)
* hardcode time on admin_account_status_3

* add test for as status with mention

* fix incorrect target URI being used for mentions
2021-11-22 12:48:46 +01:00
tobi
24f9e11221
Fix image description unnecessarily html-escaping innocent characters (#321)
* implement SanitizeCaption function

* tidy up text test setup
2021-11-22 11:49:11 +01:00
tobi
1ded58b34b
add bindAddress configuration option (#320)
* add bindAddress configuration option

* clarify that bindAddress can be a hostname
2021-11-22 10:55:52 +01:00
tobi
6c0550e76f
properly initialize user client module (#319) 2021-11-22 09:04:16 +01:00
tobi
f8630348b4
Enable stricter linting with golangci-lint (#316)
* 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-22 08:46:19 +01:00
tobi
38d73f0316
tidy up database creation logic a bit (#317) 2021-11-21 17:41:51 +01:00
tobi
f3e36de78a
fix broken GetInstanceAccount selector (#311)
* fix broken GetInstanceAccount selector

* patch tests
2021-11-17 14:40:39 +01:00
tobi
ff7c96caa3
Fix instance account not being created (#310)
* Rework 'CreateInstanceAccount' with better checking logic

* add test for create instance account
2021-11-17 13:40:09 +01:00
tobi
d81a123473
Update docs with better config + installation instructions (#300)
* start reworking some documentation

* fuller documentation  + better docs structure
2021-11-14 16:54:23 +01:00
tobi
38e100a7a4
update drone file (#299) 2021-11-13 18:33:01 +01:00
tobi
aee1932bd4
First db migration (#297)
* store first db schema

* md linting *screams*
2021-11-13 17:30:01 +01:00
tobi
09ef9e639e
move to ssb gofed fork (#298) 2021-11-13 17:29:43 +01:00
tobi
829a934d23
update dependencies (#296) 2021-11-13 12:29:08 +01:00
tobi
2aaec82732
smtp + email confirmation (#285)
* 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-31 15:46:23 +01:00
tobi
de1f90ee46
regenerate swagger docs (#293) 2021-10-24 16:26:20 +02:00