Compare commits

...

1000 commits

Author SHA1 Message Date
kim
5fd52369c9 [performance] handle emoji refreshes asynchronously when fetched as part of account|status dereferences (#4486)
# Description

Updates our dereferencer emoji handling to work asynchronously when going through the route of account or status dereferencing.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4485

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4486
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-08 14:13:40 +02:00
kim
baf2c54730 [performance] add benchmarks for native Go imaging code, small tweaks to reduce nil and boundary checks, some loop unrolling (#4482)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4482
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-08 11:12:12 +02:00
tobi
b012a81f66 [bugfix] Log a warning when clientIP could not be parsed during rate limiting (#4481)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Fixes a panic when clientIP cannot be parsed in the rate limiting middleware, and warn logs the derived clientIP and a hint that reverse proxy may be misconfigured.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4479

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4481
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-10-07 16:02:57 +02:00
tobi
c6044d0142 [bugfix] Fix db error checking for int req: sql: no rows in result set (#4478)
Fixes `sql: no rows in result set` when trying to append approvedByURI to a reply that was sent impolitely and approved impolitely.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4478
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-10-06 13:11:23 +02:00
tobi
03fc6eaf39 [bugfix] Fix nil ptr in DifferentFrom func (#4477)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4476

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4477
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-10-06 11:45:40 +02:00
Daniël Franke
5b95636993 [docs] Add db migration tip for slow hardware instances. (#4457)
This PR adds a new section to the documentation to contain workarounds for running
GtS on slow hardware. Right now it only contains a procedure on how to run migrations
on a different database instance in case the original database is too slow to finish
a database migration in a timely manner.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4457
Co-authored-by: Daniël Franke <df@ponc.tech>
Co-committed-by: Daniël Franke <df@ponc.tech>
2025-10-05 14:43:09 +02:00
tobi
259fa1ffac [bugfix] Update interaction policies of freshly dereffed statuses if different from last deref (#4474)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request adds a check to see whether interaction policy on a refreshed status is different from the interaction policy set on that status before, and updates the status with the new policy if it's changed.

Should fix a pesky issue where folks on v0.19.2 and above still can't interact with statuses they dereferenced before updating.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4474
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-10-05 13:33:16 +02:00
kim
57cb4fe748 [bugfix] status refresh race condition causing double edit notifications (#4470)
# Description

fixes possible race condition of existing status being out-of-date in enrichStatus()

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4470
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-03 15:50:57 +02:00
kim
ff950e94bb [chore] update dependencies (#4468)
- github.com/ncruces/go-sqlite3
- codeberg.org/gruf/go-mempool
- codeberg.org/gruf/go-structr (changes related on the above) *
- codeberg.org/gruf/go-mutexes (changes related on the above) *

* this is largely just fiddling around with package internals in structr and mutexes to rely on changes in mempool, which added a new concurrency-safe pool

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4468
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-03 15:29:41 +02:00
tobi
e7cd8bb43e [chore] Use bulk updates + fewer loops in status rethreading migration (#4459)
This pull request tries to optimize our status rethreading migration by using bulk updates + avoiding unnecessary writes, and doing the migration in one top-level loop and one stragglers loop, without the extra loop to copy thread_id over.

On my machine it runs at about 2400 rows per second on Postgres, now, and about 9000 rows per second on SQLite.

Tried *many* different ways of doing this, with and without temporary indexes, with different batch and transaction sizes, etc., and this seems to be just about the most performant way of getting stuff done.

With the changes, a few minutes have been shaved off migration time testing on my development machine. *Hopefully* this will translate to more time shaved off when running on a vps with slower read/write speed and less processor power.

SQLite before:

```
real	20m58,446s
user	16m26,635s
sys	5m53,648s
```

SQLite after:

```
real	14m25,435s
user	12m47,449s
sys	2m27,898s
```

Postgres before:

```
real	28m25,307s
user	3m40,005s
sys	4m45,018s
```

Postgres after:

```
real	22m31,999s
user	3m46,674s
sys	4m39,592s
```

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4459
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-10-03 12:28:55 +02:00
Zoë Bijl
bd1c43d55e [bugfix/frontend] restore blockquote “block” margin (#4465)
stripping `<blockquote>` of all the margin looks a bit funky. this only removes the inline margin. in English this generally means that it won’t have horizontal margin but will still have vertical margin.

Closes #4466

![before the change any content after the blockquote is flush against it without space](/attachments/7cc808ee-a999-435d-9235-60651a3d9bca)

![after the changes there is vertical rhythm](/attachments/3240480a-14ee-4739-a497-14237879993c)

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes. (I ran `go test ./...` from the main dir, they passed with one exception related to thumbnail file size, most likely caused by testing on macOS)
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4465
Co-authored-by: Zoë Bijl <code@moiety.me>
Co-committed-by: Zoë Bijl <code@moiety.me>
2025-10-01 19:04:44 +02:00
kim
dfdf06e4ad [chore] update dependencies (#4458)
- codeberg.org/gruf/go-ffmpreg: v0.6.11 -> v0.6.12

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4458
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-25 16:38:19 +02:00
kim
3db2d42247 [chore] ffmpeg webassembly fiddling (#4454)
This disables ffmpeg / ffprobe support on platforms where the wazero compiler is not available. The slowness introduced is hard to pindown for admins (and us!), so it's easier to just return an error message linking to docs on attempted media processing. It still allows the instance to run, just erroring if anything other than a jpeg is attempted to be processed. This should hopefully make it easier for users to notice these issues.

Also further locks down our wazero 'allowFiles' fs and other media code to address: https://codeberg.org/superseriousbusiness/gotosocial/issues/4408

relates to: https://codeberg.org/superseriousbusiness/gotosocial/issues/4427
also relates to issues raised in #gotosocial-help on matrix

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4408

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4454
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-24 15:12:25 +02:00
tobi
121677754c [docs] Update tracing.md with up-to-date way of doing things (#4452)
Updates tracing docs with the latest stufffff

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4446

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4452
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-22 15:32:04 +02:00
tobi
602022701b [chore] Update config to remove unnecessary square brackets around ipv6 addresses (#4451)
Tweak example config for `bind-address`, as square brackets around ipv6 addresses was causing issues launching.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4450

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4451
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-22 13:10:30 +02:00
tobi
82216281ce [chore/docs] Fix Prometheus metric names for Gin, include example Grafana dash, update docs (#4443)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request updates some of our inconsistent metric naming, and adds an example Grafana dashboard using all the most up-to-date metrics names, and updates our docs to describe the latest way of setting up metrics.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4362
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4055

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: kim <grufwub@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4443
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-18 16:48:45 +02:00
kim
6607e1c944 [feature] add paging support to rss feed endpoint, and support JSON / atom feed types (#4442)
originally based on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4396

hope this is okay https://codeberg.org/zordsdavini !

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4411
closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3407

Co-authored-by: Arnas Udovic <zordsdavini@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4442
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-18 16:33:23 +02:00
kim
e81bcb5171 [chore] update dependencies (#4441)
- modernc.org/sqlite v1.38.2 -> v1.39.0 (w/ concurrency workaround)
- golang.org/x/net v0.43.0 -> v0.44.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4441
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-17 14:48:09 +02:00
kim
6801ce299a [chore] remove nollamas middleware for now (after discussions with a security advisor) (#4433)
i'll keep this on a separate branch for now while i experiment with other possible alternatives, but for now both our hacky implementation especially, and more popular ones (like anubis) aren't looking too great on the deterrent front: https://github.com/eternal-flame-AD/pow-buster

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4433
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-17 14:16:53 +02:00
tobi
247733aef4 [bugfix/frontend] Use correct account domain in move account helper (#4440)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Just a quick fix to the frontend to use the account domain in the move helper namestring thingy, instead of the host.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4197

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4440
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-17 13:37:28 +02:00
tobi
5533fbc1f8 [bugfix/frontend] Fix overzealous padding removal on caption (#4439)
Leave just a little bit of padding between media + caption, for the lads!

[image](/attachments/5802a3d1-15c6-4ca2-8de2-4a149ba69f54)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4439
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-17 12:15:05 +02:00
tobi
11f39bead0 [feature] Stub out trends + suggestions (always return empty array) (#4435)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request stubs out the trends and suggestions APIs, just returning empty arrays for all four of the added endpoints. This is to help clients show fewer errors. It does *not* signal any intention to actually implement these endpoints properly, though you never know.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4385

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4435
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-16 14:30:39 +02:00
ptrcnull
0a32fc0980 [bugfix] prevent clicking Enter in description field from deleting the image (#4436)
# Description

Change the type of "Delete header" / "Delete avatar" button to just "button" to prevent them from getting deleted if user presses Enter in the description field.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4363

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: ptrcnull <git@ptrcnull.me>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4436
Co-authored-by: ptrcnull <ptrcnull@noreply.codeberg.org>
Co-committed-by: ptrcnull <ptrcnull@noreply.codeberg.org>
2025-09-16 14:30:00 +02:00
tobi
10b8d270f2 [bugfix/frontend] preserve whitespace in photoswipe captions (#4434)
This PR fixes https://codeberg.org/superseriousbusiness/gotosocial/issues/4382 by updating the photoswipe caption plugin CSS to include whitespace. Thanks @olivergeer for the fix. It also updates the padding + width in "aside" mode to increase the chances of a visitor being able to read an entire caption, in lieu of https://codeberg.org/superseriousbusiness/gotosocial/issues/4413 being fixable.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4434
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-16 13:00:30 +02:00
kim
882d07db5f [bugfix] API status edit history returned in inverse order (#4432)
Simply reverses the order in which we build status edit history for the frontend. In fact now it matches how we store it in the database which is even easier :p. Why I thought it needed to be returned inverse to begin with? Who knows.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4426 (thank you [@DarkCat09](https://codeberg.org/DarkCat09) for pointing it out!)

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4432
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-15 18:28:48 +02:00
Markus Unterwaditzer
d9ee6cddea [docs] Fix broken links and typos (#4418)
# Description

Fix links and typos in docs and settings page:

* Fix https://codeberg.org/superseriousbusiness/gotosocial/issues/4328
* Fix https://codeberg.org/superseriousbusiness/gotosocial/issues/4360

Also fix broken issuetracker links as forgejo does not support search
queries like "label:bug"

The translation for Zh-cn still says "this project" according to google
translate, I only fixed the link.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4418
Co-authored-by: Markus Unterwaditzer <markus-tarpit+git@unterwaditzer.net>
Co-committed-by: Markus Unterwaditzer <markus-tarpit+git@unterwaditzer.net>
2025-09-15 17:31:06 +02:00
tobi
f9cb086c53 [bugfix] Parse scheduled_at as ISO8601 with offset if RFC3339 parse fails (#4431)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4409 by reattempting `scheduled_at` parsing using ISO8601 offset.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4431
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-15 13:26:50 +02:00
tobi
754b7be9cf [feature] Support new model of interaction flow for forward compat with v0.21.0 (#4394)
~~Still WIP!~~

This PR allows v0.20.0 of GtS to be forward-compatible with the interaction request / authorization flow that will fully replace the current flow in v0.21.0.

Basically, this means we need to recognize LikeRequest, ReplyRequest, and AnnounceRequest, and in response to those requests, deliver either a Reject or an Accept, with the latter pointing towards a LikeAuthorization, ReplyAuthorization, or AnnounceAuthorization, respectively. This can then be used by the remote instance to prove to third parties that the interaction has been accepted by the interactee. These Authorization types need to be dereferencable to third parties, so we need to serve them.

As well as recognizing the above "polite" interaction request types, we also need to still serve appropriate responses to "impolite" interaction request types, where an instance that's unaware of interaction policies tries to interact with a post by sending a reply, like, or boost directly, without wrapping it in a WhateverRequest type.

Doesn't fully close https://codeberg.org/superseriousbusiness/gotosocial/issues/4026 but gets damn near (just gotta update the federating with GtS documentation).

Migrations tested on both Postgres and SQLite.

Co-authored-by: kim <grufwub@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4394
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-09-14 15:37:35 +02:00
kim
33fed81a8d [bugfix] set link header lo,hi values directly from returned slice, don't account for filtering (#4421)
this fixes an issue with list pagination in list timelines as seen here: https://codeberg.org/tusky/Tusky/issues/5235

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4421
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-11 14:57:32 +02:00
kim
c949b9f2d1 [chore] update dependencies (#4423)
- codeberg.org/gruf/go-ffmpreg: v0.6.10 -> v0.6.11
- github.com/spf13/cast: v1.9.2 -> v1.10.0
- github.com/spf13/viper: v1.20.1 -> v1.21.0
- golang.org/x/crypto: v0.41.0 -> v0.42.0
- golang.org/x/image: v0.30.0 -> v0.31.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4423
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-09 16:12:29 +02:00
kim
a6429b5410 [chore] update dependencies (#4422)
- github.com/jackc/pgx/v5 v5.7.5 -> v5.7.6
- github.com/ncruces/go-sqlite3 v0.28.0 -> v0.29.0
- github.com/tdewolff/minify/v2 v2.24.2 -> v2.24.3
- golang.org/x/oauth2 v0.30.0 -> v0.31.0
- golang.org/x/sys v0.35.0 -> v0.36.0
- golang.org/x/text v0.28.0 -> v0.29.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4422
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-08 20:53:25 +02:00
kim
9b7db51436 [bugfix] check for nil notification (#4417)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4417
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-07 18:16:43 +02:00
kim
4b6c65fc15 [bugfix] ensure std log writer passes byte slices along as string, or JSON will encode as base64 raw bytes (#4416)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4416
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-07 16:16:06 +02:00
kim
19784e381b [performance] more logging tweaks (#4415)
- reduces number of necessary function calls by moving log level checking out of the uninlineable `logf(...)` function and into each of its caller (which are all inlined). this in turn means the log level check is performed in-situ wherever a call to `log.Debug(...)` (etc) is made, reduce unnecessary calls when a certain log level is disabled.
- sets the http.Server{}.ErrorLog to output to our internal logging package (which in turn ensures it gets wrapped in either our logfmt or json log formatting)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4415
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-07 14:47:45 +02:00
kim
ed3035699f [bugfix] fix lo paging value not always being set (#4407)
the "lo" paging value wasn't always being set when loading statuses from the database. this seems to (potentially) fix an issue in tusky with list timelines showing repeated posts.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4407
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-04 18:06:26 +02:00
kim
78defcd916 [chore] bump dependencies (#4406)
- codeberg.org/gruf/go-ffmpreg: v0.6.9 -> v0.6.10
- github.com/ncruces/go-sqlite3: v0.27.1 -> v0.28.0
- github.com/stretchr/testify: v1.10.0 -> v1.11.1
- github.com/tdewolff/minify/v2 v2.23.11 -> v2.24.2
- go.opentelemetry.io/otel{,/*}: v1.37.0 -> v1.38.0
- go.opentelemetry.io/contrib/*: v0.62.0 -> v0.63.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4406
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-04 15:29:27 +02:00
kim
5a54e7156b [performance] faster request id generation (#4405)
This uses a much faster method of generating request IDs using an atomically updated counter instead of a mutex lock and read of /dev/random.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4405
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-09-04 14:43:36 +02:00
karolis
9cb177cd8a style: add a missing whitespace (#4404)
Added a missing whitespace in callback page template.

Co-authored-by: Karolis Pocius <kpocius@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4404
Co-authored-by: karolis <karolis@noreply.codeberg.org>
Co-committed-by: karolis <karolis@noreply.codeberg.org>
2025-09-04 14:05:22 +02:00
mkljczk
3efb338ca9 [chore] fix copy-pasted comment (#4402)
# Description

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4402
Co-authored-by: mkljczk <git@mkljczk.pl>
Co-committed-by: mkljczk <git@mkljczk.pl>
2025-08-31 11:42:42 +02:00
kim
380bfd0289 [bugfix] fix nootel metrics function signature (#4392)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4392
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-24 20:01:47 +02:00
kim
383e41e3e5 [chore] bump go-structr to v0.9.9 (#4390)
this improves handling of zero value keys. not something we bump into often, but a useful fix to have in place.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4390
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-22 16:04:22 +02:00
kim
a79f83cbde [chore] update dependencies (#4386)
- codeberg.org/gruf/go-bytesize v1.0.3 -> v1.0.4
- codeberg.org/gruf/go-kv/v2 v2.0.6 -> v2.0.7
- codeberg.org/gruf/go-mutexes v1.5.2 -> v1.5.3
- codeberg.org/gruf/go-structr v0.9.7 -> v0.9.8
- codeberg.org/gruf/go-ffmpreg v0.6.8 -> v0.6.9
- github.com/tomnomnom/linkheader HEAD@2018 -> HEAD@2025

all of the above codeberg.org/gruf updates are in preparation for Go1.25, except for bytesize, and also ffmpreg which is a rebuild with the latest version of ffmpeg (v5.1.7)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4386
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-21 16:41:50 +02:00
nicole mikołajczyk
8c619d51b5 [chore] bump golangci-lint version in CI, disable var-naming package name checks (#4372)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

This PR bumps golangci-lint used by CI to the latest version and partially disables the `var-naming` rule, which complains about the `common` and `util` package names.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4372
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-08-21 15:57:25 +02:00
kim
1144ac037f [feature] add metrics for worker counts, and worker queue sizes (#4387)
should help to debug https://codeberg.org/superseriousbusiness/gotosocial/issues/4309

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4387
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-20 18:14:00 +02:00
kim
3fad524089 [bugfix] when clearing media metadata, copy all streams not just first (#4375)
Updates our ffmpeg metadata clearing arguments to copy all streams when copying codecs, not just the first of each.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4312

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4375
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-16 15:16:00 +02:00
kim
a6bb45e5e4 [bugfix] media CLI list missing thumbs and statics (#4379)
refactors some of the media CLI listing code, and updates it to include both attachment thumbnails and emoji static images, which previously were missing.

addresses https://codeberg.org/superseriousbusiness/gotosocial/issues/4370

though in a follow-up i'll add support for regenerating attachment thumbnails and emoji static images.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4379
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-16 15:13:30 +02:00
kim
e9b7e977a5 [performance] replace uses of fmt.Sprintf() with inlineable buildURL_() and buildPath_() functions (#4374)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4374
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-14 14:09:06 +02:00
nicole mikołajczyk
12e3cb71c1 [bugfix] insert filter keywords/statuses into DB when creating new filters (#4376)
I don't see an issue for this, but the endpoint used for creating filters simply didn't store the filter keywords/statuses in the DB.

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4376
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-08-14 12:54:56 +02:00
nicole mikołajczyk
8e76c9ab57 [chore] return correct error message (#4377)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4377
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-08-14 12:17:42 +02:00
nicole mikołajczyk
fb2ef90ec5 [feature] support blur filter action (#4371)
This pull request implements the `blur` value of `filter_action` for status filtering. It was introduced by Mastodon 4.4.0. [Related docs update](https://github.com/mastodon/documentation/pull/1620)

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4371
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-08-13 13:23:42 +02:00
kim
7f8cb204cd [feature] 2fa management via CLI (#4368)
Adds 2FA management to the admin CLI. Also does some CLI refactoring so the functions we pass around are exported functions instead of changeable global variables.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4320

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4368
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-13 12:24:40 +02:00
kim
1edc0f7b3c [chore] bump to code.superseriousbusiness.org/oauth2/v4@ssb-v4.5.3-2 (#4367)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4367
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-12 16:04:30 +02:00
nicole mikołajczyk
660cf2c94c [feature] scheduled statuses (#4274)
An implementation of [`scheduled_statuses`](https://docs.joinmastodon.org/methods/scheduled_statuses/). Will fix #1006.

this is heavily WIP and I need to reorganize some of the code, working on this made me somehow familiar with the codebase and led to my other recent contributions
i told some fops on fedi i'd work on this so i have no choice but to complete it 🤷‍♀️
btw iirc my avatar presents me working on this branch

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4274
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-08-12 14:05:15 +02:00
tobi
cead741c16 [docs] Revamp trusted proxies warning a bit (#4365)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4352 by mentioning required headers in reverse proxy.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4365
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-08-11 16:23:55 +02:00
tobi
e565855540 [chore] pin to go 1.24.6 (#4364)
Pins our Go version to v1.24.6 for bugfixes etc.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4364
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-08-11 16:04:29 +02:00
kim
67100809b3 [chore] update dependencies (#4361)
- codeberg.org/gruf/go-kv/v2 v2.0.5 => v2.0.6
- github.com/coreos/go-oidc/v3 v3.14.1 => v3.15.0
- github.com/miekg/dns v1.1.67 => v1.1.68
- github.com/tdewolff/minify/v2 v2.23.9 => v2.23.11
- github.com/yuin/goldmark v1.7.12 => v1.7.13
- golang.org/x/crypto v0.40.0 => v0.41.0
- golang.org/x/image v0.29.0 => v0.30.0
- golang.org/x/net v0.42.0 => v0.43.0
- golang.org/x/sys v0.34.0 => v0.35.0
- golang.org/x/text v0.27.0 => v0.28.0
- modernc.org/sqlite v1.38.0 => v1.38.2

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4361
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-10 15:05:54 +02:00
kim
7af9117e0d [feature + performance] add JSON logging format (#4355)
# Description

Adds JSON logging as an optional alternative log output format. In the process this moves our log formatting itself into a separate subpkg to make it more easily modular, and improves caller name getting with some calling function name caching.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4355
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-08-09 16:23:00 +02:00
daenney
96c05a90a2 chore: github/README update release month (#4359)
# Description

July is definitely over.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4359
Co-authored-by: daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: daenney <git@noreply.sourcery.dny.nu>
2025-08-06 13:43:24 +02:00
Jade Arson
f301bd5abf [feature/frontend] Add Ninety Eight theme (#4348)
This pull request adds a new theme that I've just put together after procrastinating for 7 or 8 months lol

I made this pull request mainly because tobi already considered adding it to GtS upstream 5 minutes after [I made a fedi post about it](https://gts.apicrim.es/@awoo/statuses/01K18MJ1SD56581TANEKAKA6GV) ^^" (does this technically count as "discussing the proposed change"? probably not-) (though to be fair, this shows a slightly older revision of the theme -- you can see the most current one on [one of my fedi accounts](https://gts.apicrim.es/@128293). (…also I think it's quite obvious that I took the Ecks Pee theme as a basis ><)

Co-authored-by: Jade Arson <awoo@wolfyja.de>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4348
Co-authored-by: Jade Arson <codeberg@wolfyja.de>
Co-committed-by: Jade Arson <codeberg@wolfyja.de>
2025-07-30 17:56:30 +02:00
kim
7e45168d33 [feature] add streaming of statuses and status updates to LOCAL / PUBLIC timelines (#4353)
This adds streaming of statuses and edits to LOCAL and PUBLIC timeline types. Note that in the future we should probably rearrange some of the surface code so we don't perform so many repeated mute and visibility checks on the same status in sequence.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4342

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4353
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-30 17:54:07 +02:00
kim
ac032ff6ab [chore] bump codeberg.org/gruf/go-ffmpreg to v0.6.8 (#4349)
see: https://codeberg.org/gruf/go-ffmpreg/releases/tag/v0.6.8

nothing too exciting, though wasi-sdk-27 contains one or two (though many more to go) of nuno's wasi-libc string function simd optimizations which may make *some* difference

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4349
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-29 15:15:55 +02:00
kim
e3dfd88893 [performance] bump codeberg.org/gruf/go-kv to v2 (#4341)
updates our codeberg.org/gruf/go-kv log key-value formatting library to latest version, which comes with some maaaaaaajor speed boosts in the form of:
- very minimal reflect.Value{} usage
- caching prepared formatting functions per type

~~still a work-in-progress until i make a release tag on the go-kv repository, which itself is waiting on published benchmark results in the README and finishing writing some code comments~~

benchmarks so far show this to be ~3x faster than the "fmt" stdlib package on average, when run across a wide variety (106 different types) of test cases, while still creating more visually friendly log output and actually recursing down nested struct ptrs

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4341
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-29 09:23:20 +02:00
nicole mikołajczyk
30cd1cd9eb [chore] Only display report comment forwarding notice when reporting account is local (#4344)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request implements xyz or fixes abc.

closes #(issue)
closes #(another issue)

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4344
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-07-28 14:38:31 +02:00
kim
c00cad2ceb [chore] bump dependencies (#4339)
- github.com/KimMachineGun/automemlimit v0.7.4
- github.com/miekg/dns v1.1.67
- github.com/minio/minio-go/v7 v7.0.95
- github.com/spf13/pflag v1.0.7
- github.com/tdewolff/minify/v2 v2.23.9
- github.com/uptrace/bun v1.2.15
- github.com/uptrace/bun/dialect/pgdialect v1.2.15
- github.com/uptrace/bun/dialect/sqlitedialect v1.2.15
- github.com/uptrace/bun/extra/bunotel v1.2.15
- golang.org/x/image v0.29.0
- golang.org/x/net v0.42.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4339
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-22 18:00:27 +02:00
Daenney
eb60081985 [chore/deps] Upgrade to go-sqlite 0.27.1 (#4334)
# Description

This brings some performance improvements and SQLite 3.50.3.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4334
Co-authored-by: Daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
2025-07-18 11:56:40 +02:00
tobi
a4b54aa935 [feature] Add avif file support (#4331)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request implements support for reading avif images properly.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4330

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4331
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-07-17 13:20:01 +02:00
nicole mikołajczyk
94cbe1120e [bugfix] use correct interaction type for pre-accepted interaction requests (#4325)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request fixes `InteractionType` incorrectly set for pre-approved interaction requests.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4325
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-07-14 17:12:47 +02:00
tobi
a97a15fd10 [bugfix] Fix wrong default used for HidesCcPublicFromUnauthedWeb in migration (#4318)
🤦 Changed it in gtsmodel but not in the migration ohhh, oooh

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4318
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-07-09 17:43:36 +02:00
tobi
352353ce7a [chore/testing] Add env vars to skip testrig setup/teardown (#4317)
Add flags to skip local testrig db setup and teardown, to allow somewhat easier testing of migrations. Documents env vars available to the testrig.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4317
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-07-09 17:25:45 +02:00
tobi
dcfc9b7885 [feature] Use hidesToPublicFromUnauthedWeb and hidesCcPublicFromUnauthedWeb properties for web visibility of statuses (#4315)
This pull request implements two new properties on ActivityPub actors: `hidesToPublicFromUnauthedWeb` and `hidesCcPublicFromUnauthedWeb`.

As documented, these properties allow actors to signal their preference for whether or not their posts should be hidden from unauthenticated web views (ie., web pages like the GtS frontend, web apps like the Mastodon frontend, web APIs like the Mastodon public timeline API, etc). This allows remote accounts to *opt in* to having their unlisted visibility posts shown in (for example) the replies section of the web view of a GtS thread. In future, we can also use these properties to determine whether we should show boosts of a remote actor's post on a GtS profile, and that sort of thing.

In keeping with our stance around privacy by default, GtS assumes `true` for `hidesCcPublicFromUnauthedWeb` if the property is not set on a remote actor, ie., hide unlisted/unlocked posts by default. `hidesToPublicFromUnauthedWeb` is assumed to be `false` if the property is not set on a remote actor, ie., show public posts by default.

~~WIP as I still want to work on the documentation for this a bit.~~

New props are already in the namespace document: https://gotosocial.org/ns

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4315
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-07-09 16:50:25 +02:00
kim
c8a4ce9a88 [performance] use our own typed value context types for Value() key checking to improve performance (#4316)
Replaces our gtscontext package context.Context handling with our own typed contexts instead of `context.WithValue()`.

I wrote a quick benchmark consisting of (printlns to stop the compiler optimizing instructions away):
```golang
func BenchmarkContexts(b *testing.B) {
	var receiving *gtsmodel.Account
	var requesting *gtsmodel.Account
	var otherIRIs []*url.URL

	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
			ctx := context.Background()

			ctx = gtscontext.SetBarebones(ctx)
			ctx = gtscontext.SetFastFail(ctx)
			ctx = gtscontext.SetDryRun(ctx)
			ctx = gtscontext.SetReceivingAccount(ctx, receiving)
			ctx = gtscontext.SetRequestingAccount(ctx, requesting)
			ctx = gtscontext.SetOtherIRIs(ctx, otherIRIs)

			if !gtscontext.Barebones(ctx) {
				println("oh no!")
			}

			if !gtscontext.IsFastfail(ctx) {
				println("oh no!")
			}

			if !gtscontext.DryRun(ctx) {
				println("oh no!")
			}

			if gtscontext.ReceivingAccount(ctx) != nil {
				println("oh no!")
			}

			if gtscontext.RequestingAccount(ctx) != nil {
				println("oh no!")
			}

			if len(gtscontext.OtherIRIs(ctx)) > 0 {
				println("oh no!")
			}
		}
	})
}
```

Before results:
```shell
kim @ ~/Projects/main/gts.4
--> go test -v -run=none -bench=.* -benchmem ./internal/gtscontext/ -count=5
goos: linux
goarch: amd64
pkg: code.superseriousbusiness.org/gotosocial/internal/gtscontext
cpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics
BenchmarkContexts
BenchmarkContexts-16            19050348                61.73 ns/op          288 B/op          6 allocs/op
BenchmarkContexts-16            18245772                61.71 ns/op          288 B/op          6 allocs/op
BenchmarkContexts-16            18853680                61.80 ns/op          288 B/op          6 allocs/op
BenchmarkContexts-16            18561621                62.67 ns/op          288 B/op          6 allocs/op
BenchmarkContexts-16            17819241                62.89 ns/op          288 B/op          6 allocs/op
PASS
ok      code.superseriousbusiness.org/gotosocial/internal/gtscontext    6.112s
```

After results:
```shell
kim @ ~/Projects/main/gts.4
--> go test -v -run=none -bench=.* -benchmem ./internal/gtscontext/ -count=5
goos: linux
goarch: amd64
pkg: code.superseriousbusiness.org/gotosocial/internal/gtscontext
cpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics
BenchmarkContexts
BenchmarkContexts-16            28038618                41.67 ns/op          144 B/op          6 allocs/op
BenchmarkContexts-16            26537552                42.50 ns/op          144 B/op          6 allocs/op
BenchmarkContexts-16            26720542                42.39 ns/op          144 B/op          6 allocs/op
BenchmarkContexts-16            27408031                43.15 ns/op          144 B/op          6 allocs/op
BenchmarkContexts-16            25597026                44.02 ns/op          144 B/op          6 allocs/op
PASS
ok      code.superseriousbusiness.org/gotosocial/internal/gtscontext    5.997s
```

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4316
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-09 01:38:33 +02:00
nicole mikołajczyk
07f61a13de [chore] update error message (#4311)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4311
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-07-06 13:11:18 +02:00
kim
66e1ec14aa [chore] move status filtering from type converter (#4306)
This finalizes the moving status filtering out of the type converter, and into its own `./internal/filter/` subpkg :)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4306
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-04 15:30:39 +02:00
nicole mikołajczyk
79914bdbf7 [bugfix] set correct scope for StatusFavePOSTHandler (#4310)
> **OAuth:** User token + `write:favourites`

https://docs.joinmastodon.org/methods/statuses/#favourite

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4310
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-07-04 15:29:27 +02:00
agx
bf46b87343 [docs] Document STARTTLS behavior (#4301)
The docs currently state that sending via `localhost` unencrypted can work but that's only true when the SMTP server doesn't offer `STARTTLS`. Make that a bit more obvious.

Couldn't test the doc build as miniconda isn't in my distro and pip wouldn't find all dependencies.

# Description

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: Guido Günther <agx@sigxcpu.org>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4301
Co-authored-by: agx <agx@noreply.codeberg.org>
Co-committed-by: agx <agx@noreply.codeberg.org>
2025-07-03 16:52:07 +02:00
kim
7a5144b4cc [bugfix] fix possible nil ptr if requester is nil (#4307)
closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4305

thank you https://codeberg.org/Xilefian !

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4307
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-02 21:40:43 +02:00
kim
4f2aa792b3 [performance] add statusfilter cache to cache calculated status filtering results (#4303)
this adds another 'filter' type cache, similar to the visibility and mute caches, to cache the results of status filtering checks. for the moment this keeps all the check calls themselves within the frontend typeconversion code, but i may move this out of the typeconverter in a future PR (also removing the ErrHideStatus means of propagating a hidden status).

also tweaks some of the cache invalidation hooks to not make unnecessary calls.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4303
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-01 16:00:04 +02:00
kim
8b0ea56027 [chore] update go dependencies (#4304)
- github.com/KimMachineGun/automemlimit v0.7.2 => v0.7.3
- github.com/gin-contrib/cors v1.7.5 => v1.7.6
- github.com/minio/minio-go/v7 v7.0.92 => v7.0.94
- github.com/spf13/cast v1.8.0 => v1.9.2
- github.com/uptrace/bun{,/*} v1.2.11 => v1.2.14
- golang.org/x/image v0.27.0 => v0.28.0
- golang.org/x/net v0.40.0 => v0.41.0
- code.superseriousbusiness.org/go-swagger v0.31.0-gts-go1.23-fix => v0.32.3-gts-go1.23-fix

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4304
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-30 15:19:09 +02:00
kim
7712885038 [chore] bumps ncruces/go-sqlite3 v0.26.1 => v0.26.3 (#4302)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4302
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-30 14:30:56 +02:00
tobi
5fbaf5b7be [feature] Allow anchor href to work for footnotes, use ID prefix to avoid clashes (#4298)
Updates markdown parser + sanitizer to allow footnote anchors to work properly, with appropriate roles. Footnote anchor IDs and backrefs use the status ID as a prefix to avoid clashes, so that footnotes don't break when multiple footnoted statuses are rendered on the same page (eg., in a thread or on the account's home page).

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4296

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4298
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-30 12:56:50 +02:00
kim
39b11dbfb6 [bugfix] fix issues with postgres array serialization (#4295)
thank you to @kipvandenbos -erino for figuring this out!

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4295
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-26 14:17:47 +02:00
kim
700bd69828 [bugfix] move broken stage of filters migration into new migration (#4293)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4293
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-25 20:22:50 +02:00
kim
996da6e029 [performance] filter model and database table improvements (#4277)
- removes unnecessary fields / columns (created_at, updated_at)
- replaces filter.context_* columns with singular filter.contexts bit field which should save both struct memory and database space
- replaces filter.action string with integer enum type which should save both struct memory and database space
- adds links from filter to filter_* tables with Filter{}.KeywordIDs and Filter{}.StatusIDs fields (this also means we now have those ID slices cached, which reduces some lookups)
- removes account_id fields from filter_* tables, since there's a more direct connection between filter and filter_* tables, and filter.account_id already exists
- refactors a bunch of the filter processor logic to save on code repetition, factor in the above changes, fix a few bugs with missed error returns and bring it more in-line with some of our newer code

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4277
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-24 17:24:34 +02:00
kim
9d5af6c3dc [bugfix] update the default configuration to not set a db type or address, to require explicitly setting it (#4228)
This updates the database defaults to remove a type or address. This is to help ensure we don't have any repeats of https://codeberg.org/superseriousbusiness/gotosocial/issues/4183, it means the user needs to explicitly configure these things core settings instead of relying on defaults.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4228
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-24 12:32:52 +02:00
tobi
56d1248a85 [chore] Add info and reminder to save changes at the top of profile settings page (#4289)
Adds a little message at the top of the profile settings page to remind folks to click save after changing things.

Related to https://codeberg.org/superseriousbusiness/gotosocial/issues/4281

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4289
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-23 17:29:27 +02:00
kim
80191348ba [bugfix] fix status.Local sometimes being nil (#4285)
also comments-out a flaky test, (or at-least part of it), since it's testing a pkg part that is already tested.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4285
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-21 12:03:35 +02:00
tobi
38ff88f006 [bugfix] Queue implicit accepts *before* other side effects (#4282)
This PR just fiddles with the order in which we process status create / boost / fave side effects and implicit acceptances. The goal is to try to make sure the Accept message gets sent to a remote instance *before* the interaction with an implicitly accepted status.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4282
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-20 15:38:23 +02:00
nicole mikołajczyk
bfc8c31e5f [feature] Support incoming avatar/header descriptions (#4275)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

Follow-up to #4270

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3450

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4275
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-19 15:10:41 +02:00
nicole mikołajczyk
29d481d769 [bugfix] delete interaction requests when deleting account (#4278)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

I recently noticed that pending interaction requests don't disappear on domain suspension.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4278
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-19 10:21:03 +02:00
tobi
8b615391e5 [bugfix] Remove errant alsoKnownAs inline @context entry (#4280)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Our extra `alsoKnownAs` inline `@context` entry was incorrect, and doesn't need to be included anyways as it's already present at the AS namespace context doc here: https://www.w3.org/ns/activitystreams. This PR just removes it :)

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3883

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4280
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-18 13:39:09 +02:00
kim
b1c0eca1d8 [bugfix] improved mute checking for boosted statuses (#4276)
This unwraps and follows the boosted status to do a full mute check on the original.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4276
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-16 13:12:48 +02:00
nicole mikołajczyk
7d50aec6dc [feature] Outgoing federation of avatar/header descriptions (#4270)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

This implementation is compatible with Iceshrimp.NET, Pleroma and Chuckya, which already support federated avatar/header descriptions. I will add support for incoming descriptions federation in this or another PR (depending on when this one gets merged).

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4270
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-15 12:38:01 +02:00
tobi
a9b2d4ee35 [feature] Handle retractions of domain permission subscription entries (#4261)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request adds logic for nicely handling retractions of entries from domain permission subscriptions.

See docs for how this works but basically retracted entries will either be removed (and possibly picked up by a lower-prio subscription), or orphaned (and then possibly adopted), depending on the config of the domain permission subscription.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4101

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4261
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-15 12:36:51 +02:00
kim
76e7fd62d2 [performance] use faster pixel format matching function (#4271)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4271
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-14 12:27:53 +02:00
tobi
726584287a [bugfix] Remove hardcoded "public" db schema assumption (#4269)
This pull request closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4257 by removing the hardcoded "public" schema assumption in the database migrations. Tested on a local postgres with both the default public schema, and with the connection string (gotosocial schema) mentioned in the issue. Both seem to work OK!

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4269
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-13 16:05:00 +02:00
nicole mikołajczyk
5717ce6f3c [chore] upgrade golangci-lint to v2.1.6 and migrate config (#4265)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

Contribution guidelines link to the golangci-lint documentation for the up-to-date version rather than [the legacy v1 doc](https://golangci.github.io/legacy-v1-doc/), which uses a different configuration schema. I migrated the config using the `golangci-lint migrate` command, moved the comments, adjusted staticcheck config and ensured the rules still work.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4265
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-13 15:45:35 +02:00
tobi
fc074d2357 [bugfix/accessibility] Don't remove marker from unordered lists, recolor instead (#4268)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4195 by removing unnecessary styling.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4268
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-13 14:22:56 +02:00
tobi
933a9091eb [bugfix] Fix nil ptr dereffing instance acct outbox (#4267)
Well well well it was something silly, no surprise there!

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4266

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4267
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-13 14:08:25 +02:00
kim
e87681d433 [bugfix] process account delete synchronously to prevent OOM (#4260)
# Description

- updates account delete processing to handle side-effects synchronously to prevent OOM
- updates account delete processing to check more often if account.IsLocal() for certain deletes / side-effects
- ensures that mutes get removed from database on delete

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4260
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-11 11:38:10 +02:00
kim
d7f967cbb5 [feature] configurable maximum thumbnail dimensions (#4258)
- adds configuration for thumbnail maximum dimensions with warning on exceeding recommendations
- moves the media configuration vars into their own sub-struct
- replaces the configuration flag funcs with simple string consts

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4258
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-10 15:43:31 +02:00
tobi
1dc79c9586 [chore] Update interactionPolicy sub-policy parsing in line with documented defaults (#4229)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Brings our parsing of unset sub-policies in line with the defaults documented here: https://docs.gotosocial.org/en/v0.19.1/federation/interaction_policy/#defaults-per-sub-policy

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4146

Part of https://codeberg.org/superseriousbusiness/gotosocial/issues/4026

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4229
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-10 14:29:42 +02:00
kim
4ad17788cd [chore] update to modernc.org/sqlite v1.38.0 with our concurrency workaround (#4256)
see: https://gitlab.com/cznic/sqlite/-/tags/v1.38.0
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4256
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-10 13:19:18 +02:00
nicole mikołajczyk
d3f2c2c765 [bugfix] fix existing statuses with invalid visibility (#4253)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

Related to #4252. This fixes existing statuses with visibility enum set to 0, if any exist on the server, by replacing their visibility to direct (to not leak them outside the intended scope).

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4253
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-10 12:16:09 +02:00
Oliver Calder
153f6feecd [docs] update protocol arg help text to reflect documentation (#4250)
The current documentation states that the `protocol` configuration
option should only be changed to `http` for local testing, and that even
if running behind a reverse proxy, `https` should be used.

https://docs.gotosocial.org/en/latest/configuration/general/

As such, update the `protocol` option help text so that it does not
suggest using `http` when running behind a reverse proxy.

Signed-off-by: Oliver Calder <oliver@calder.dev>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4250
Co-authored-by: Oliver Calder <oliver@calder.dev>
Co-committed-by: Oliver Calder <oliver@calder.dev>
2025-06-10 12:14:46 +02:00
Daenney
37f9a9fa94 [chore] Upgrade to SQLite 3.50.1 (#4255)
# Description

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4255
Co-authored-by: Daenney <daenney@noreply.codeberg.org>
Co-committed-by: Daenney <daenney@noreply.codeberg.org>
2025-06-10 01:08:57 +02:00
nicole mikołajczyk
3f1c3c0dac [bugfix] return 422 for invalid status visibility (#4252)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

closes #4247

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4252
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-09 16:26:49 +02:00
nicole mikołajczyk
54a0af34fb [feature] enable footnote extension for markdown parser (#4251)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

This enables footnote support which is mentioned as allowed in the [user guide](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/docs/user_guide/posts.md#input-types). The regression was reported on Matrix.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [sort of] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4251
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-09 16:00:25 +02:00
Nicole Mikołajczyk
bd4fe7081e [docs] change ID links in ToC to match goldmark parser behavior (#4223)
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>

# Description

I'm not sure if this should be handled this way, but some of the TOC links don't work on Forgejo due to, I guess, the Markdown parser behavior. This, however, makes them not work on GitHub

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4223
Co-authored-by: Nicole Mikołajczyk <git@mkljczk.pl>
Co-committed-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-06-09 12:35:37 +02:00
nicole mikołajczyk
01e3765268 [feature] Add fields introduced in Mastodon 4.4.0 to /api/v2/instance response (#4240)
# Description

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4240
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-09 12:32:14 +02:00
tobi
32738d83a8 [bugfix] Update GetURL to extract url from Link objects with href (#4249)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request updates our parsing of the `url` property in incoming ActivityPub items to also include Link items, and not just bare URIs.

The first discovered url is still used as the *gtsmodel.Account or *gtsmodel.Status `url` property, so this change only really affects our dereference URL anti-spoof check thingy.

~~Should fix https://codeberg.org/superseriousbusiness/gotosocial/issues/4248 but I need to run it and test it myself first to be sure.~~

Fixes https://codeberg.org/superseriousbusiness/gotosocial/issues/4248

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4249
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-09 12:32:00 +02:00
kim
b13a6437ff [chore] move s3 storage key prefixing into the storage library itself (#4246)
This is just a useful feature that it seemed more semantically correct to have in the storage library itself! Still, thank you to @vdyotte for the original change :)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4246
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-06 16:35:39 +02:00
kim
77eddea3af [chore] updates code.superseriousbusiness.org/oauth2/v4 to ssb-v4.5.3-1 (#4245)
A brief note on the above change: Go does not seem to like version tagging outside of `v?[0-9\.]` formatting, so it translates `ssb-v4.5.3-1` to `v4.5.4-0.20250606121655-9d54ef189d42` and as such sees it as a "downgrade" compared to the previous `v4.9.0`. which functionally isn't a problem, everything still behaves as it should, but it means people can't just run `go get repo@latest` for this particular dependency.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4245
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-06-06 15:14:37 +02:00
tobi
a37dd59d1f [chore] blocklist -> allowlist config typo fix (#4242)
D'oh! Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4239

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4242
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-05 11:30:13 +02:00
tobi
118d4e4d03 [bugfix] Assume default code challenge method of s256 (#4241)
Bumps our oauth2 dependency, and uses *default* code challenge method of S256 instead of plain.

Fixes https://codeberg.org/superseriousbusiness/gotosocial/issues/4238

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4241
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-05 11:29:36 +02:00
tobi
43f1c6d872 [feature] Add config option to expose custom emojis without auth (#4233)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Does as it says on the tin! Should make things a bit easier for clients that don't provide an access token to the custom emojis endpoint.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/2430

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4233
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-03 23:30:42 +02:00
Emelia
be6d80c020 [chore] Remove insecure PKCE Code Challenge Method for plain (#4232)
# Description

As I noted in https://codeberg.org/superseriousbusiness/gotosocial/pulls/2224 the PKCE code challenge method of "plain" is insecure and its usage is not recommend. In Mastodon and Hollo, we do not support it, as indicated by the `code_challenge_methods_supported` value here: https://mastodon.social/.well-known/oauth-authorization-server

This pull request removes the support for PKCE code challenge method "plain".

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

I do get test failures locally, due to file sizes for media being different, but that's definitely unrelated to this change, as far as I can tell there is zero test coverage this part of the GTS code.

Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4232
Co-authored-by: Emelia <thisismissem@noreply.codeberg.org>
Co-committed-by: Emelia <thisismissem@noreply.codeberg.org>
2025-06-03 10:04:15 +02:00
tobi
6d511d696b [bugfix] Fix nil ptr for audio attachments with no preview in web (#4227)
Fixes a cheeky little nil pointer bug that I wrote.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4227
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-06-02 12:52:51 +02:00
nicole mikołajczyk
5097e6d278 [feature] /api/v1/follow_requests/outgoing (#4224)
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>

# Description

This pull request adds a new endpoint which returns a list of pending follow requests requested by the user. The test is adapted from the GET /api/v1/follow_requests test.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4224
Co-authored-by: nicole mikołajczyk <git@mkljczk.pl>
Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
2025-06-02 11:46:17 +02:00
Nicole Mikołajczyk
ee180a2359 [bugfix] fix GetAccountFollowRequestingIDs query (#4222)
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>

# Description

This pull request fixes a bug encountered when playing around with GTS code.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4222
Co-authored-by: Nicole Mikołajczyk <git@mkljczk.pl>
Co-committed-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-06-01 11:24:04 +02:00
famfo
025ca487cf [feature/internal/httpclient] add option to configure outgoing protocol (#4134)
# Description

Adds a configuration option to set the outgoing transport of HTTP requests for testing purposes.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.
  - Note: `go fmt` yes, golangci-lint fails, can't load any configuration

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4134
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2025-05-31 19:15:39 +02:00
kim
faed35c938 [performance] cache mute check results (#4202)
This separates our the user mute handling from the typeconverter code, and creates a new "mutes" filter type (in a similar vein to the visibility filter) subpkg with its own result cache. This is a heavy mix of both chore given that mute calculation shouldn't have been handled in the conversion to frontend API types, and a performance bonus since we don't need to load and calculate so many things each time, just the single result each time with all necessary invalidation handled by database cache hooks.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4202
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-31 17:30:57 +02:00
kim
a82d574acc [feature] make client-side nonce calculation multi-threaded (#4219)
# Description

Thank you in part to f0x for nerd-sniping me into banging this together :p

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4219
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-31 13:45:32 +02:00
Daenney
3b46eb6a9e [chore] Upgrade to SQLite 3.50 (#4218)
# Description

Upgrades ncruces/go-sqlite3 to 0.26 which includes SQLite 3.50.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4218
Co-authored-by: Daenney <daenney@noreply.codeberg.org>
Co-committed-by: Daenney <daenney@noreply.codeberg.org>
2025-05-31 13:43:33 +02:00
Nicole Mikołajczyk
d9e8d844e1 [docs] fix typo in swagger description for ListsGETHandler (#4217)
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>

# Description

This pull request fixes a typo.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4217
Co-authored-by: Nicole Mikołajczyk <git@mkljczk.pl>
Co-committed-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-05-31 13:42:58 +02:00
vdyotte
0e698a49fb [feature] Add S3 key prefix (#4200)
Been running these changes on on my live instance without any issues as far as I can tell. It's been playing nice with multiple instances in the same bucket.

# Description

This lets users prefix their object storage files.
Useful for when you want to host multiple GTS instances inside
the same bucket. Providers like Backblaze limit the number of buckets
you can have on your account so grouping by prefix may be more desirable
in this situation.

closes #1371

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4200
Co-authored-by: vdyotte <vdyotte@gmail.com>
Co-committed-by: vdyotte <vdyotte@gmail.com>
2025-05-30 14:12:29 +02:00
tobi
3ff6f6e421 [bugfix/frontend] Fix text-shadow on dark mode themes (#4216)
Just deals with a few remaining straggler bits of css fuckery that I introduced in https://codeberg.org/superseriousbusiness/gotosocial/pulls/4201

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4216
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-30 12:14:17 +02:00
tobi
2c73bb3602 [feature/frontend] Respect color scheme preference for highlighted code blocks (#4201)
That's it! It just conditionally imports prism light or prism dark depending on the theme.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4201
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-30 11:06:08 +02:00
tobi
6c1b674278 [feature/frontend] Add four new monospace themes (#4199)
This pull request adds four new themes with auto light/dark switching options too!

Tested for color contrast etc in firefox with all three local test rig accounts.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4199
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-29 11:48:34 +02:00
kim
f3c4ea0106 [chore] thread_id migration tweaks (#4198)
# Description

- add a `migrations run` sub command to allow simply starting / stopping the db service, useful if you want to run *only* the migrations, both for testing or if you have a speedier box you want to run them on
- tweaks to log messages
- moved more stages outside of transactions, on sqlite if the transactions were getting too lengthy it could occasionally show an `sqlite: disk i/o error`

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4198
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-28 11:36:14 +02:00
kim
143febb318 [chore] update dependencies (#4196)
- go.opentelemetry.io/contrib/exporters/autoexport v0.60.0 -> v0.61.0
- go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0 -> v0.61.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4196
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-26 16:13:55 +02:00
kim
311d9a1697 [chore] migration to update statuses.thread_id to be notnull (#4160)
# Description

This is quite a complex database migration that updates the `statuses.thread_id` column to be notnull, in order that statuses always be threaded, which will be useful in various pieces of upcoming work. This is unfortunately a migration that acts over the entire statuses table, and is quite complex in order to ensure that all existing statuses get correctly threaded together, and where possible fix any issues of statuses in the same thread having incorrect thread_ids.

TODO:
- ~~update testrig models to all be threaded~~
- ~~update code to ensure thread_id is always set~~
- ~~run on **a copy** of an sqlite production database~~
- ~~run on **a copy** of a postgres production database~~

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4160
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-26 15:33:42 +02:00
tobi
fd64a1e264 [feature] Add "Instance Info" settings panel section, with domain blocks + allows (#4193)
This pull request adds a new read-only, user-level "instance info" section to the settings panel, which presents api/v2/instance info in a nice readable format, and also gives the user authenticated access to the blocklist and allowlist of the domain.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3711
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4193
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-26 13:28:55 +02:00
kim
326e04283a [feature] update proof-of-work to allow setting required rounds (#4186)
# Description

This updates our proof-of-work middleware, NoLLaMas, to work on a more easily configurable algorithm (thank you f0x for bringing this to my attention!). Instead of requiring that a solution with pre-determined number of '0' chars be found, it now pre-computes a result with a pre-determined nonce value that it expects the client to iterate up-to. (though with some level of jitter applied, to prevent it being too-easily gamed). This allows the user to configure roughly how many hash-encode rounds they want their clients to have to complete.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4186
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-26 11:57:50 +02:00
kim
b6ff55662e [chore] update dependencies (#4188)
Update dependencies:
- github.com/gin-gonic/gin v1.10.0 -> v1.10.1
- github.com/gin-contrib/sessions v1.10.3 -> v1.10.4
- github.com/jackc/pgx/v5 v5.7.4 -> v5.7.5
- github.com/minio/minio-go/v7 v7.0.91 -> v7.0.92
- github.com/pquerna/otp v1.4.0 -> v1.5.0
- github.com/tdewolff/minify/v2 v2.23.5 -> v2.23.8
- github.com/yuin/goldmark v1.7.11 -> v1.7.12
- go.opentelemetry.io/otel{,/*} v1.35.0 -> v1.36.0
- modernc.org/sqlite v1.37.0 -> v1.37.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4188
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-22 16:27:55 +02:00
tobi
20aad9be0f [chore/woodpecker] don't make test depend on lint (#4189)
Just remove the dependency `test` has on `lint`, as it's not actually dependent on it, and has different triggers.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4189
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-22 15:54:58 +02:00
tobi
00e58c60cd [feature] Add ListenBrainz functionality on the web view (#4184)
This pull request adds a very simple ad-hoc ListenBrainz widget to the frontend web view, with progressive enhancement (in all fail states it just falls back to rendering the field as normal).

This necessitated adding the ListenBrainz API endpoint to the `connect-src` part of our Content-Security-Policy header. We might want to tweak this to only add that endpoint to `connect-src` for profiles, and then only for profiles that include a ListenBrainz field, but this would require significant dicking about with the middleware, and checks inside the app logic, such that it might not be worthwhile (after all, we control all the scripts right now anyway).

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4184
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-22 12:34:39 +02:00
Daenney
d5c9c4adc1 [chore] Upgrade to Go 1.24 (#4187)
* Set `go.mod` to 1.24 now that it's been out for 3 months.
* Update all the test to use `testing.T.Context()`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187
Co-authored-by: Daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
2025-05-22 12:26:11 +02:00
tobi
ec4d4d0115 [feature] Allow exposing allows, implement /api/v1/domain_blocks and /api/v1/domain_allows (#4169)
- adds config flags `instance-expose-allowlist` and `instance-expose-allowlist-web` to allow instance admins to expose their allowlist via the web + api.
- renames `instance-expose-suspended` and `instance-expose-suspended-web` to  `instance-expose-blocklist` and `instance-expose-blocklist-web`.
- deprecates the `suspended` filter on `/api/v1/instance/peers` endpoint and adds `blocked` and `allowed` filters
- adds the `flat` query param to `/api/v1/instance/peers` to allow forcing return of a flat list of domains
- implements `/api/v1/instance/domain_blocks` and `/api/v1/instance/domain_allows` endpoints with or without auth depending on config
- rejigs the instance about page to include a general section on domain permissions, with block and allow subsections (and appropriate links)

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3847
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4150

Prerequisite to https://codeberg.org/superseriousbusiness/gotosocial/issues/3711

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4169
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-20 11:47:40 +02:00
kim
3a29a59e55 [bugfix] fix case of failed timeline preload causing lockups (#4182)
- moves preloader Done() function calling to be handled entirely by the preloader, not the caller
- adds tests for multiple preload success / failure / clear states

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4182
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-17 11:52:49 +00:00
kim
3cff4b2d7d [chore] various federatingdb tweaks (#4178)
after seeing a potential reported federating worker lockup i decided to start digging into the federatingdb code. this PR encompasses:
- removes one of our last unused interface types `federatingdb.DB{}`, replacing it with a struct type `*federatingdb.DB{}`
- in `transport.dereferenceLocal()` differentiates between an unsupported lookup type and ErrNoEntries to reduce unnecessary calls, and reduce potential lockups that may occur while trying to call our own endpoints that then call `federatingdb.Lock()`
- removes a bunch of the locks on follow state changes since the DB already synchronizes that
- removes the unnecessary `pub.Clock{}` struct field and type passed to the transport controller

frankly it would be great if we could remove the locking in `federatingdb.Lock()` and instead handle it ourselves as it gets very confusing trying to figure out what functions will have locks held. but i guess that's one for when we move further away from the go-fed/activity/pub package usage.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4178
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-15 09:40:48 +00:00
Phil Hagelberg
cfe6336b6e [chore] Change default database in example config to sqlite, update docs. (#4174)
As discussed in Matrix chat.

* Change DB in example config to sqlite.
* Clarify config settings which only apply to postgres.
* Update getting started docs; no need to change example config any more.
* In "single board computers" mention SD card corruption risk.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [X] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [X] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [X] I/we have not leveraged AI to create the proposed changes.
- [X] I/we have performed a self-review of added code.
- [X] I/we have made any necessary changes to documentation.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4174
Co-authored-by: Phil Hagelberg <phil@hagelb.org>
Co-committed-by: Phil Hagelberg <phil@hagelb.org>
2025-05-14 13:25:52 +00:00
Jackson
3ba49aed45 [feature] Configurable max profile fields (#4175)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Profile fields, right? So I made them a configurable amount and show them on the instance features. Closes #1876

All changes I did are described in the commits. I tried to cover as much as possible, but I don't know this codebase to know what I've missed. I have tested it manually and it works (settings page, `/api/v1/instances`, server-side validation).

Not done:
- An "Add profile fields" button, so that instances with a high profile fields count (e.g. 100) aren't an issue when trying to skip the profile fields (in some form, accessibility)
- Updating the swagger docs that specify a specific amount of profile fields for the updating endpoint (not sure how to proceed with that)
- Unchecked checklist items

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [X] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [X] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [X] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [X] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [X] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Notes about checklist:
- ["Approval" to work on this reference](https://matrix.to/#/!mlPctfMHjyopbOnliM:superseriousbusiness.org/$P0Z1Qmny6GNIgxhre69gll8KSD690HC8nVvNpXmu3nU?via=superseriousbusiness.org&via=matrix.org&via=tchncs.de)
- `golangci-lint run` output ignored due to complaining about ffmpeg and some other code I didn't touch

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4175
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: Jackson <jackson@jacksonchen666.com>
Co-committed-by: Jackson <jackson@jacksonchen666.com>
2025-05-14 13:25:21 +00:00
tobi
ca12742a7a [chore] Deprecate with_approval, always (client API), approvalRequired, always (fedi API) (#4173)
This pull request deprecates `with_approval` and `always` on the client API side, and `approvalRequired` and `always` on the fedi API side, replacing them with `automatic_approval` and `manual_approval` and `automaticApproval` and `manualApproval`, respectively.

Back-compat is kept with these deprecated fields, and they're still serialized to the client API and fedi APIs respectively, in addition to the new non-deprecated properties.

This will stay the case until v0.21.0 when they'll be removed.

For the sake of not doing a massive database migration, the fields are still named `Always` and `WithApproval` in storage. I think this is probably fine!

Part of https://codeberg.org/superseriousbusiness/gotosocial/issues/4026
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4173
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-13 14:48:11 +00:00
tobi
5925644ad3 [chore] Update woodpecker to catch len(fromJSON(CI_PIPELINE_FILES)) == 0 (#4177)
This'll hopefully catch some straggler occurrences of the tests not wanting to run.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4177
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-13 11:23:30 +00:00
tobi
3fedff3a5a [chore] Tidy up previous interaction policy migrations (#4171)
This pull request tidies up some previous migrations by making sure there's a proper snapshot in the migrations folder of what interaction policies looked like at the time the migration was written, rather than using the moving target `internal/gtsmodel`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4171
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-12 16:22:45 +00:00
Daenney
d3c67ad642 [chore] Use Codeberg API for get_latest_snapshot (#4151)
# Description

Switches the script to use the Codeberg API to retrieve the hash.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4151
2025-05-11 15:14:06 +00:00
tobi
8480a75808 [feature] Notify accounts when a status they've interacted with has been edited (#4157)
This pull request adds sending notifications to local accounts that have interacted with a status, if we receive or create a new edit for that status.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3991
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4157
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-11 13:38:13 +00:00
Iivari Äikäs
6b6946f42a [bugfix] Fix a11y property warning from authorization page (#4166)
Use correct input-field identifier for authorization page email label. This seemed to be only instance where label was broken, other labels either had correct for-identifier or enclosed the input which they are labeling.

closes #4165

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4166
Co-authored-by: Iivari Äikäs <iivari.aikas@gmail.com>
Co-committed-by: Iivari Äikäs <iivari.aikas@gmail.com>
2025-05-11 11:51:30 +00:00
Taavi Väänänen
61137e6c41 [bugfix] Remove unnecessary whitespace from trusted-proxies warning (#4168)
closes #4167

Co-authored-by: Taavi Väänänen <hi@taavi.wtf>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4168
Co-authored-by: Taavi Väänänen <codeberg@taavi.wtf>
Co-committed-by: Taavi Väänänen <codeberg@taavi.wtf>
2025-05-11 11:50:57 +00:00
Frederic Thevenet
7bd4bed558 [feature/frontend] Add id attributes to 'about user' section to allow for reordering using css (#4164)
# Description

This pull request adds `id` attributes to elements in the "About" section of the user page so that it is easy to look them up using css.
It also move the screen reader only elements for some these so that they are re-ordered alongside their parent element.

closes #4163

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4164
Co-authored-by: Frederic Thevenet <thevenet.fred@free.fr>
Co-committed-by: Frederic Thevenet <thevenet.fred@free.fr>
2025-05-10 19:46:41 +00:00
kim
d2f13e7564 [chore] update direct Go dependencies (#4162)
- update gruf/go-stroage v0.2.0 -> v0.2.1
- update KimMachineGun/automemlimit v0.7.1 -> v0.7.2
- update miekg/dns v1.1.65 -> v1.1.66
- update ncruces/go-sqlite3 v0.25.1 -> v0.25.2
- update spf13/cast v1.7.1 -> v1.8.0
- update tdewolff/minify/v2 v2.23.1 -> v2.23.5
- update x/crypto v0.37.0 -> v0.38.0
- update x/image v0.26.0 -> v0.27.0
- update x/net v0.39.0 -> v0.40.0
- update x/oauth2 v0.29.0 -> v0.30.0
- update x/sys v0.32.0 -> v0.33.0
- update x/text v0.24.0 -> v0.25.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4162
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-10 14:27:25 +00:00
tobi
8c1511a494 [chore] Poke at bundle_licenses.sh a bit to make the output slightly easier on the eye (#4159)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4159
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-09 16:14:10 +00:00
kim
cfa83fb44c [chore] include a monstrous all_licenses.txt in our web assets (#4155)
Should fix https://codeberg.org/superseriousbusiness/gotosocial/issues/4153

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4155
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-09 10:32:20 +00:00
tobi
700b7eaab7 [feature] Add extra opengraph meta tags (#4154)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Update our opengraph meta tag code stuff:

- Use `audio` and `video` types where appropriate.
- Include fall back to `image` types.
- Include `twitter:card=summary` or `twitter:card=summary_large_image` where appropriate (closes https://codeberg.org/superseriousbusiness/gotosocial/issues/2776)
- Include avatar description where possible.
- Include mime type for media.
- Set `modified_time` properly based on latest edit time.

Examples

Status with one image attachment, that's been edited:

```html
<meta property="og:locale" content="en">
<meta property="og:type" content="article">
<meta property="og:title" content="Post by Kip Van Den Bos, salad enjoyer, @tobi@goblin.technology">
<meta property="og:url" content="https://goblin.technology/@tobi/statuses/01JE3BQPNHWNHSNM0KS78X321Q">
<meta property="og:site_name" content="goblin.technology">
<meta property="og:description" content="cowards: &#34;I&#39;ll be a few minutes late, sorry!&#34; me:">
<meta property="og:article:publisher" content="https://goblin.technology/@tobi">
<meta property="og:article:author" content="https://goblin.technology/@tobi">
<meta property="og:article:modified_time" content="2025-04-22T07:24:49.773Z">
<meta property="og:article:published_time" content="2024-12-02T09:37:58.449Z">
<meta property="og:image" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01JE3BPJ1TGMV6H6E8VY0ED5XA.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1224">
<meta property="og:image:height" content="368">
<meta property="og:image:alt" content="Screenshot of a signal conversation where I wrote &#34;Just gonna smash out a quick poo&#34; and my friend responded with a sad face.">
<meta property="og:image" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01J4YBM16ES6C1ENKZC8MC04BD.gif">
<meta property="og:image:type" content="image/gif">
<meta property="og:image:width" content="38">
<meta property="og:image:height" content="49">
<meta property="og:image:alt" content="Avatar for tobi: A 90&#39;s style gif of a black and white skull chattering happily.">
<meta property="og:image" content="https://goblin.technology/fileserver/01BPSX2MKCRVMD4YN4D71G9CP5/attachment/original/01J387PFPNKQWWNY9YQM67WA1T.gif">
<meta property="og:image:type" content="image/gif">
<meta property="og:image:alt" content="Little green peglin goblin bouncing happily.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01JE3BPJ1TGMV6H6E8VY0ED5XA.png">
<meta name="twitter:image:alt" content="Screenshot of a signal conversation where I wrote &#34;Just gonna smash out a quick poo&#34; and my friend responded with a sad face.">
```

Status with one audio file (with thumbnail):

```html
<meta property="og:locale" content="en">
<meta property="og:type" content="article">
<meta property="og:title" content="Post by Kip Van Den Bos, salad enjoyer, @tobi@goblin.technology">
<meta property="og:url" content="https://goblin.technology/@tobi/statuses/01JSV5BQ585HB4R8NPK4ANTG91">
<meta property="og:site_name" content="goblin.technology">
<meta property="og:description" content="service top anthem imo">
<meta property="og:article:publisher" content="https://goblin.technology/@tobi">
<meta property="og:article:author" content="https://goblin.technology/@tobi">
<meta property="og:article:modified_time" content="2025-04-27T08:21:00.712Z">
<meta property="og:article:published_time" content="2025-04-27T08:21:00.712Z">
<meta property="og:audio" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01JSV5AJ4RF3E6DATCSW8SAY93.mp3">
<meta property="og:audio:secure_url" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01JSV5AJ4RF3E6DATCSW8SAY93.mp3">
<meta property="og:audio:type" content="audio/mpeg">
<meta property="og:audio:alt" content="Sanctified by Nine Inch Nails, from Pretty Hate Machine">
<meta property="og:image" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/small/01JSV5AJ4RF3E6DATCSW8SAY93.webp">
<meta property="og:image:type" content="image/webp">
<meta property="og:image:width" content="500">
<meta property="og:image:height" content="500">
<meta property="og:image:alt" content="Sanctified by Nine Inch Nails, from Pretty Hate Machine">
<meta property="og:image" content="https://goblin.technology/fileserver/016T5Q3SQKBT337DAKVSKNXXW1/attachment/original/01J4YBM16ES6C1ENKZC8MC04BD.gif">
<meta property="og:image:type" content="image/gif">
<meta property="og:image:width" content="38">
<meta property="og:image:height" content="49">
<meta property="og:image:alt" content="Avatar for tobi: A 90&#39;s style gif of a black and white skull chattering happily.">
<meta property="og:image" content="https://goblin.technology/fileserver/01BPSX2MKCRVMD4YN4D71G9CP5/attachment/original/01J387PFPNKQWWNY9YQM67WA1T.gif">
<meta property="og:image:type" content="image/gif">
<meta property="og:image:alt" content="Little green peglin goblin bouncing happily.">
<meta name="twitter:card" content="summary">
```

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4154
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-08 11:11:25 +00:00
kim
4c96e2571d [feature] make nollamas difficulty configurable (#4119)
Makes the NoLLaMas proof-of-work scraper deterrence difficulty configurable.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4119
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-07 11:59:39 +00:00
tobi
1f0c261fd2 [bugfix] Fix indentation on multi-line alt text in web view (#4149)
This pull request closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3403 by searching for alt or title attributes in HTML, looking for the shortest indent (if any) at the start of multiline content of said attributes, and remove that shortest indent from each line. This is a bit more fiddly than the "easy" way of doing it, but it has the advantage that it preserves user-added indents at the start of lines of alt text.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4149
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-07 11:48:21 +00:00
tobi
7e105f98ed [chore/frontend] Put fonts in folders, update ecks pee to atkinson-hyperlegible next/mono (#4148)
Juggles our fonts around a bit to use subdirs for font families, and also updates atkinson hyperlegible to atkinson hyperlegible next, which includes monospace fonts.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4148
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-07 09:39:46 +00:00
filipesm
b2a469d6b6 [docs] Clarify that boosting local-only posts maintains local-only status, in the documentation (#4145)
# Description

I would also really like to know if local-only posts can be accessed publicly via URL? I can add it to the PR when I know.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4145
Co-authored-by: filipesm <hello@filipesm.eu>
Co-committed-by: filipesm <hello@filipesm.eu>
2025-05-06 20:28:47 +00:00
kim
6acf56cde9 [feature] support nested configuration files, and setting ALL configuration variables by CLI and env (#4109)
This updates our configuration code generator to now also include map marshal and unmarshalers. So we now have much more control over how things get read from pflags, and stored / read from viper configuration. This allows us to set ALL configuration variables by CLI and environment now, AND support nested configuration files. e.g.

```yaml
advanced:
    scraper-deterrence = true

http-client:
    allow-ips = ["127.0.0.1"]
```

is the same as

```yaml
advanced-scraper-deterrence = true

http-client-allow-ips = ["127.0.0.1"]
```

This also starts cleaning up of our jumbled Configuration{} type by moving the advanced configuration options into their own nested structs, also as a way to show what it's capable of. It's worth noting however that nesting only works if the Go types are nested too (as this is how we hint to our code generator to generate the necessary flattening code :p).

closes #3195

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4109
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-06 15:51:45 +00:00
tobi
7d74548a91 [docs] Various little docs updates (#4144)
Just various little docs fixes, including adding registry prefix `docker.io/` to Docker container tags.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4126

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4144
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-06 14:28:40 +00:00
tobi
ebf64eb0db [bugfix] fix statuses not being notified (#4143)
It was the colon what done it muy lorde

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4143
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-06 14:19:58 +00:00
kim
8264b63337 [bugfix] ensure timeline limit query is respected (#4141)
# Description

Fixes a bug in the new timeline code in which the limit query parameter wasn't always being fulfilled, in which case some clients like Tusky would then assume it didn't need to add a "load more" placeholder view even when there were more statuses to be loaded. This also fiddles around a bit in the logging middleware handler to add some more code comments, and add logging of full request URIs when it is safe to do so.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4141
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-06 13:30:23 +00:00
kim
e464de1322 [bugfix] broken nootel function signatures (#4142)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4142
Reviewed-by: Daenney <daenney@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-06 13:26:20 +00:00
tobi
cf93d3af0a [feature] Add description_limit to /api/v2/instance, increase default limit to 5k (#4140)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4131 by adding `description_limit` to the `api/v2/instance` response. Also increases default sizes to default status length to allow people to more easily describe things like screenshots of text.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4140
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-06 09:58:47 +00:00
nopjmp
57fc267b5c [feature] add ability to change s3 bucket lookup type (#4120)
# Description

This pull request implements the ability to specify the S3 bucket lookup type that is passed to the minio-go library. By default, minio-go uses a regex on the endpoint to see if it is a host that supports DNS access or not. Tigris and others are moving away from path style bucket access to DNS style bucket access using subdomains.

This keeps the default as 'auto' to allow existing users to not need to modify their configurations.

closes #3942

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4120
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: nopjmp <nop@unearthly.dev>
Co-committed-by: nopjmp <nop@unearthly.dev>
2025-05-06 09:54:50 +00:00
Daenney
90a5425fe9 [chore] Add Go runtime and host metrics (#4137)
Daenney is a dummy and forgot to add these when he revamped the OTEL stuff.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4137
Co-authored-by: Daenney <daenney@noreply.codeberg.org>
Co-committed-by: Daenney <daenney@noreply.codeberg.org>
2025-05-06 08:18:05 +00:00
tobi
4a6b357501 [bugfix] Fixes to tablist, fileinput, checkbox (#4139)
Some fixes to various frontend things:

- Fix signup checkbox being height 0 on webkit - closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4136
- Fix wonky file input on chrome and webkit - closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4138
- Make tablist in interaction policies keyboard accessible with proper left/right + focus handling, see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tablist_role

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4139
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-06 08:06:52 +00:00
tobi
73aa62581e [chore] fix testrig with new otel setup (#4135)
Follow-up to https://codeberg.org/superseriousbusiness/gotosocial/pulls/4110

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4135
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-05 17:28:01 +00:00
Daenney
ecbdc4227b [chore] Simplify the OTEL setup (#4110)
# Description

This simplifies our OTEL setup by:

* Getting rid of some deprecated things.
* Using `autoexport` and letting things get configured by the `OTEL_` environment variables.
* Removing all the unnecessary config options.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4110
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: Daenney <daenney@noreply.codeberg.org>
Co-committed-by: Daenney <daenney@noreply.codeberg.org>
2025-05-05 16:22:45 +00:00
tobi
ad71066973 [chore] Update goreleaser (#4133)
Updates gotosocial-woodpecker-build to a version that includes goreleaser v2.9.0, which should work properly with "gitea" aka forgejo (ie., codeberg).

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4133
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-05 14:18:21 +00:00
daenney
83184da6e7 [chore/github] Add an end of mirror notice (#4128)
# Description

Adds a small notice to the Github README with when we intend to stop mirroring.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4128
Co-authored-by: daenney <daenney@noreply.codeberg.org>
Co-committed-by: daenney <daenney@noreply.codeberg.org>
2025-05-05 12:44:28 +00:00
tobi
89df9f3b21 [bugfix] Prevent multiple mentions being created for one mention (#4127)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request fixes an issue where multiple mentions were being created for one statuses, when delivered to multiple inboxes on an instance, but only the final mention ended up actually being used. Also adds tests to make sure that a notification is received when a status is edited to include a mention.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4127
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-05 09:22:03 +00:00
tobi
f3f1854359 [bugfix] Fix no notification if mention edited into status (#4102)
This pull request adds mention notifications if a mention was edited into a status after its initial publication.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3869

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4102
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-04 09:45:10 +00:00
tobi
056c67f396 [chore/cicd] Account for force pushes in conditional runs (#4121)
CI_PIPELINE_FILES seems to be empty on force pushes to an open pull request, so this PR just accounts for that and runs all steps if it's the case, as we can't tell then what's actually changed.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4121
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-04 07:58:17 +00:00
kim
211192c482 [chore] more NoLLaMas proof-of-work tweaking (#4096)
- replaces the sha256 calculation with an alternative implementation that seems to use more uniform time-taken across different platforms
- goes back to the simpler difficulty calculation without a "partial" difficulty level

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4096
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-05-03 16:45:25 +00:00
tobi
c15002d76e [bugfix] Ensure Account and TargetAccount set when doing UndoFollow (#4118)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4112 by ensuring that Account and TargetAccount are properly set on the follow passed through to UndoFollow.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4118
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-03 10:10:23 +00:00
cdn0x12
bad427e7f0 [chore/docs] fix relative link to scraper deterrence (#4111)
# Description

While working on the doc translation update, I found a broken link. So I;m opening this separate PR to keep it clean from the translation stuff. Marked as draft currently for checking for any other typos :)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4111
Co-authored-by: cdn0x12 <git@cdn0x12.dev>
Co-committed-by: cdn0x12 <git@cdn0x12.dev>
2025-05-03 09:28:43 +00:00
cdn0x12
4d6408015b [docs/zh] Update zh docs: synced to 6c879186 (#4117)
# Description

This PR updates the Chinese documentation to 6c879186 (the latest commit at present).

It also fixed a small typo in the original docs. Since the change is so minor, I didn't make a separate PR.

Last docs/zh update PR: #3884

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4117
Co-authored-by: cdn0x12 <git@cdn0x12.dev>
Co-committed-by: cdn0x12 <git@cdn0x12.dev>
2025-05-03 09:28:16 +00:00
tobi
6c87918635 [chore/cicd] Snapshot only if source code files have changed (#4115)
See https://codeberg.org/superseriousbusiness/gotosocial/issues/4113, follow up to https://codeberg.org/superseriousbusiness/gotosocial/pulls/4114

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4115
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-02 20:35:49 +00:00
tobi
bf10ca0203 [chore/cicd] conditional tests + linting for pull requests (#4114)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4113

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4114
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-02 20:26:09 +00:00
tobi
1480f22aea [bugfix/chore] Invalidate prepared statuses when account representation changes (#4107)
This pull requests adds logic to invalidate prepared statuses when an account's representation changes due to an update.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4104

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4107
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-05-02 16:01:30 +00:00
tobi
1bad36b637 [bugfix] Fix wrong URI used in dereferenceLocal (#4097)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Previously we were passing a *followers* URI into the federatingDB `Followers` function, which expects an *account* URI. This led to a nil body when doing internal dereferences (ie., while sending out messages). I think I probably wrote this bug when I refactored stuff a while ago.

This PR fixes that up by making the dereferenceLocal function more consistent, and falling back to an http dereference if nothing found. Clarifies behavior of the federatingdb.Get function as well, by commenting the shit out of it.

Also adds tests, precious tests.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4066

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4097
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-30 18:19:01 +00:00
tobi
90f5004db0 [chore] Update release CICD to point at "gitea" (#4100)
Updates our release flow to point at "gitea", which should work for Codeberg as well.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4100
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-30 12:10:09 +00:00
tobi
ac01652de9 [bugfix] Fix migration unsetting bot flag (#4098)
Fixes an issue in the migration where bot actor type was being incorrectly set to Person.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4086

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4098
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-30 11:17:20 +00:00
tobi
ef0f8a55c6 [bugfix] Fix nil ptr exception on creating user without running server first (#4094)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4049 by removing the silly defer statement. Adds a test too, and a warning in the docs.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4094
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-29 16:40:36 +00:00
kim
31628019fe [chore] tweak NoLLaMas proof-of-work algorithm (#4090)
# Description

- tweaks the NoLLaMas proof-of-work algorithm to further granularity on time spent computing solutions
- standardizes GoToSocial cookie security directive setting in a CookiePolicy{} type

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4090
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-04-29 13:57:26 +00:00
kim
14f15b321b [bugfix] don't prevent moved accounts from invalidating their old tokens (#4091)
# Description

Removes the move check from the invalidate token API handler, as moved accounts should be able to delete their old tokens.

closes #4067

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4091
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-04-29 13:43:01 +00:00
tobi
4fe5dfae56 [chore] nollamas: show tick + time taken on completion, use window.location.replace (#4088)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Tweak to show time taken when solving nollamas, and use a pulser rather than a spinner to indicate work being done.

Also use `window.location.replace` for doing the redirect instead of setting window.location.href: https://developer.mozilla.org/en-US/docs/Web/API/Location/replace

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4088
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-29 10:49:10 +00:00
kim
efc79528d2 [docs] small changes to the proof-of-work scraper deterrence docs (#4084)
- moves it to the advanced section
- adds it to the mkdocs config
- adds warning about it not covering RSS endpoints

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4084
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-04-29 08:59:28 +00:00
kim
d8c4d9fc5a [feature] proof of work scraper deterrence (#4043)
This adds a proof-of-work based scraper deterrence to GoToSocial's middleware stack on profile and status web pages. Heavily inspired by https://github.com/TecharoHQ/anubis, but massively stripped back for our own usecase.

Todo:
- ~~add configuration option so this is disabled by default~~
- ~~fix whatever weirdness is preventing this working with CSP (even in debug)~~
- ~~use our standard templating mechanism going through apiutil helper func~~
- ~~probably some absurdly small performance improvements to be made in pooling re-used hex encode / hash encode buffers~~ the web endpoints aren't as hot a path as API / ActivityPub, will leave as-is for now as it is already very minimal and well optimized
- ~~verify the cryptographic assumptions re: using a portion of token as challenge data~~ this isn't a serious application of cryptography, if it turns out to be a problem we'll fix it, but it definitely should not be easily possible to guess a SHA256 hash from the first 1/4 of it even if mathematically it might make it a bit easier
- ~~theme / make look nice??~~
- ~~add a spinner~~
- ~~add entry in example configuration~~
- ~~add documentation~~

Verification page originally based on https://github.com/LucienV1/powtect

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4043
Reviewed-by: tobi <tsmethurst@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-04-28 20:12:27 +00:00
Nicole Mikołajczyk
2b82fa7481 [chore/docs] add symmetry to the politics (#4081)
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4081
Co-authored-by: Nicole Mikołajczyk <git@mkljczk.pl>
Co-committed-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-04-28 18:20:09 +00:00
tobi
2d91eed4ed [chore] Remove unused import (#4077)
Remove an unused import that was causing the testrig not to build properly.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4077
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-28 14:19:58 +00:00
tobi
4c8ff7d1b2 [chore/docs] Put some politics in the code (#4076)
The code didn't have enough politics so this fixes that.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4076
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-28 13:28:59 +00:00
tobi
afb4279d27 [docs] Move docs links to codeberg (#4074)
Update more links from github -> codeberg in the docs.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4074
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-28 12:08:51 +00:00
kim
436765a6a2 bump dependencies: minio-go, go-sqlite3, goldmark, otel, x/image/webp (#4075)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4075
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-04-28 11:20:24 +00:00
tobi
457ca3c9d3 [chore] Update build to use new woodpecker dind container, bump version numbers (#4073)
As described!

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4073
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-28 09:31:51 +00:00
tobi
7dae3364fa [chore] Override woodpecker plugin for snapshot + release to get tags (#4069)
We need tags to do snapshots + releases properly! Another cheeky little difference from drone.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4069
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-27 22:07:59 +00:00
tobi
8bc0b06105 [chore] Fix CI/CD snapshot / release (#4068)
🤦

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4068
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-27 21:33:39 +00:00
İ. Göktuğ Kayaalp
d3e9a9e563 [docs] clearer structure for "combining blocks and allows" section (#4065)
# Description

This patch moves figures around in `admin/federation_modes.md` in order to make the text more approachable. Reading it, I found that I dwelled long on the chart, not thinking that there would be an easier to read explanation below, so I thought it'd make sense to swap the places. I also felt like the warning at the bottom was important enough that it'd better be up near the top of the section, highlighting the importance of understanding the explanation below.

I did not see a commit message style guide in project docs so I improvised based on recent commit messages

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [X] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [X] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code.
- [ ] I/we have written code that is legible and maintainable by others.
- [ ] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [ ] I/we have run tests and they pass locally with the changes.
- [ ] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4065
Co-authored-by: İ. Göktuğ Kayaalp <self@gkayaalp.com>
Co-committed-by: İ. Göktuğ Kayaalp <self@gkayaalp.com>
2025-04-27 20:27:23 +00:00
daenney
d5c3f44bb9 [chore] Disable default issue template 2025-04-27 13:55:11 +00:00
Daenney
9b92175239 [chore] Bring back the issue and PR templates 2025-04-27 14:57:17 +02:00
Daenney
93c3c153f0 [chore] Rewrite all remaining Github links 2025-04-27 13:40:22 +02:00
tobi
5bfccdad3c [chore] add woodpecker ci/cd pipelines (#4061)
Removes our now unused drone stuff and adds pipelines for our new woodpecker instance.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4061
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-27 11:22:35 +00:00
Daenney
346962beb5 [chore] Fix daenney being bad at sed (#4060)
Co-authored-by: Daenney <daenney@users.noreply.github.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4060
Co-authored-by: Daenney <daenney@noreply.codeberg.org>
Co-committed-by: Daenney <daenney@noreply.codeberg.org>
2025-04-26 19:19:52 +00:00
Daenney
ab10266bff [feature] Move to code.superseriousbusiness.org 2025-04-26 15:38:43 +02:00
Daenney
152bcb43b6 [chore] Set up Github to be a mirror 2025-04-26 15:38:43 +02:00
tobi
85eb192669
[chore] fix testrig build (#4059) 2025-04-26 15:24:15 +02:00
tobi
f7323c065a
[feature] Update attachment format, receive + send focalPoint prop + use it on the frontend (#4052)
* [feature] Update attachment format, receive + send `focalPoint` prop + use it on the frontend

* whoops

* boop

* restore function signature of ExtractAttachments
2025-04-26 15:03:05 +02:00
kim
6a6a499333
[performance] rewrite timelines to rely on new timeline cache type (#3941)
* start work rewriting timeline cache type

* further work rewriting timeline caching

* more work integration new timeline code

* remove old code

* add local timeline, fix up merge conflicts

* remove old use of go-bytes

* implement new timeline code into more areas of codebase, pull in latest go-mangler, go-mutexes, go-structr

* remove old timeline package, add local timeline cache

* remove references to old timeline types that needed starting up in tests

* start adding page validation

* fix test-identified timeline cache package issues

* fix up more tests, fix missing required changes, etc

* add exclusion for test.out in gitignore

* clarify some things better in code comments

* tweak cache size limits

* fix list timeline cache fetching

* further list timeline fixes

* linter, ssssssssshhhhhhhhhhhh please

* fix linter hints

* reslice the output if it's beyond length of 'lim'

* remove old timeline initialization code, bump go-structr to v0.9.4

* continued from previous commit

* improved code comments

* don't allow multiple entries for BoostOfID values to prevent repeated boosts of same boosts

* finish writing more code comments

* some variable renaming, for ease of following

* change the way we update lo,hi paging values during timeline load

* improved code comments for updated / returned lo , hi paging values

* finish writing code comments for the StatusTimeline{} type itself

* fill in more code comments

* update go-structr version to latest with changed timeline unique indexing logic

* have a local and public timeline *per user*

* rewrite calls to public / local timeline calls

* remove the zero length check, as lo, hi values might still be set

* simplify timeline cache loading, fix lo/hi returns, fix timeline invalidation side-effects missing for some federated actions

* swap the lo, hi values 🤦

* add (now) missing slice reverse of tag timeline statuses when paging ASC

* remove local / public caches (is out of scope for this work), share more timeline code

* remove unnecessary change

* again, remove more unused code

* remove unused function to appease the linter

* move boost checking to prepare function

* fix use of timeline.lastOrder, fix incorrect range functions used

* remove comments for repeat code

* remove the boost logic from prepare function

* do a maximum of 5 loads, not 10

* add repeat boost filtering logic, update go-structr, general improvements

* more code comments

* add important note

* fix timeline tests now that timelines are returned in page order

* remove unused field

* add StatusTimeline{} tests

* add more status timeline tests

* start adding preloading support

* ensure repeat boosts are marked in preloaded entries

* share a bunch of the database load code in timeline cache, don't clear timelines on relationship change

* add logic to allow dynamic clear / preloading of timelines

* comment-out unused functions, but leave in place as we might end-up using them

* fix timeline preload state check

* much improved status timeline code comments

* more code comments, don't bother inserting statuses if timeline not preloaded

* shift around some logic to make sure things aren't accidentally left set

* finish writing code comments

* remove trim-after-insert behaviour

* fix-up some comments referring to old logic

* remove unsetting of lo, hi

* fix preload repeatBoost checking logic

* don't return on status filter errors, these are usually transient

* better concurrency safety in Clear() and Done()

* fix test broken due to addition of preloader

* fix repeatBoost logic that doesn't account for already-hidden repeatBoosts

* ensure edit submodels are dropped on cache insertion

* update code-comment to expand CAS accronym

* use a plus1hULID() instead of 24h

* remove unused functions

* add note that public / local timeline requester can be nil

* fix incorrect visibility filtering of tag timeline statuses

* ensure we filter home timeline statuses on local only

* some small re-orderings to confirm query params in correct places

* fix the local only home timeline filter func
2025-04-26 09:56:15 +00:00
tobi
ffde1b150f
[chore] Move deps to code.superseriousbusiness.org (#4054) 2025-04-25 15:15:36 +02:00
tobi
68ed7aba25
[chore] Update activity to v1.14.0 (#4038) 2025-04-24 11:20:03 +02:00
Ember
768ee70b88
[docs] Mention where to run the command to grant CREATE permissions (#4050) 2025-04-24 11:00:20 +02:00
tobi
ab2044ef02
[chore/frontend] Update skulk, caniuse (#4044) 2025-04-23 17:44:25 +02:00
tobi
9241a0c337
[chore/frontend] rejig server picker recommendations (#4042) 2025-04-22 17:00:46 +02:00
dependabot[bot]
d6232663e3
Bump http-proxy-middleware from 2.0.7 to 2.0.9 in /web/source (#4041) 2025-04-22 10:58:08 +00:00
dependabot[bot]
355482baf6
[chore]: Bump golang.org/x/net from 0.38.0 to 0.39.0 (#4034) 2025-04-22 10:57:59 +00:00
dependabot[bot]
d1abbd0290
[chore]: Bump github.com/gin-contrib/sessions from 1.0.2 to 1.0.3 (#4033)
Bumps [github.com/gin-contrib/sessions](https://github.com/gin-contrib/sessions) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/gin-contrib/sessions/releases)
- [Changelog](https://github.com/gin-contrib/sessions/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/sessions/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/sessions
  dependency-version: 1.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 12:35:14 +02:00
dependabot[bot]
356c2adddc
[chore]: Bump golang.org/x/oauth2 from 0.27.0 to 0.29.0 (#4035)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.27.0 to 0.29.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.27.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 12:33:25 +02:00
dependabot[bot]
c670493ad9
[chore]: Bump github.com/tdewolff/minify/v2 from 2.23.0 to 2.23.1 (#4036)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.23.0 to 2.23.1.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.23.0...v2.23.1)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-version: 2.23.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 12:32:55 +02:00
dependabot[bot]
f170bbcd49
[chore]: Bump github.com/yuin/goldmark from 1.7.8 to 1.7.10 (#4037)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.8 to 1.7.10.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.8...v1.7.10)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-version: 1.7.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 12:32:39 +02:00
tobi
075cae3d55
[chore/frontend] Reorder JS a little bit to avoid visible text changes (#4039) 2025-04-22 12:20:54 +02:00
tobi
0992ffc057
[bugfix] Use util.IsNil for checking DomainPermission (#4040) 2025-04-22 12:20:45 +02:00
tobi
a87be80c90
[feature/frontend] add autocomplete + other helpful attributes to auth html pages (#4029)
* [feature/frontend] add autocomplete + other helpful attributes to auth html pages

* add autocorrect="off"
2025-04-20 17:46:25 +02:00
tobi
e9f6d186dc
[bugfix] Fix '+'-separated scopes not being recognized (#4028)
* [bugfix] Fix '+'-separated scopes not being recognized

* comment
2025-04-19 21:57:50 +02:00
tobi
d308fd0d0a
[chore] Little settings panel report view tweak (#4025) 2025-04-19 13:36:35 +02:00
tobi
2863561c89
[chore] Update robots.txt with latest ai bullshit (#4024) 2025-04-19 13:34:20 +02:00
kim
14899733c8
[bugfix] new token API issues (#4022)
* fix incorrect endpoint being registered for /token/{id}

* update the maximum page value for tokens endpoint to 100

* update the available tokens page options

* set a default limit of 25 to match the first available settings panel option

* ensure OnInvalidateToken() hook is called during token delete
2025-04-18 17:37:50 +02:00
tobi
2fce027808
[feature/frontend] Hide "engagement" stats, edits, and other info under a little drop down to unclutter status info bar (#4021)
* dick about with stats a bit

* more dicking abuot

* lil tweaks

* more about-dicking

* weee

* comments

* fixie uppie
2025-04-18 17:36:26 +02:00
tobi
d694666436
[chore] Don't push latest Docker image on prerelease (#4017) 2025-04-15 17:18:46 +02:00
tobi
245d6db979
[chore/bugfix] fix import file on click (#4016) 2025-04-15 11:17:45 +02:00
tobi
0ce9bed3d1
[chore/frontend] Fix id on recent posts/media heading (#4015) 2025-04-15 10:20:29 +02:00
tobi
2b98432ca2
[chore] Change "federating with" to "knows of" (#4014) 2025-04-15 10:19:06 +02:00
tobi
5b2fe1f9a0
[chore/performance] Reuse Intl.DateTimeFormat for formatting times (#4013) 2025-04-15 10:04:47 +02:00
tobi
b510f3c539
[bugfix/frontend] Fix photoswipe layout issues, keyboard shortcuts (#4010)
* fix photoswipe layout issues (chrome)

* aaaaaaaaaaaaaa

* wwwwwwwwwwww
2025-04-14 15:12:21 +02:00
kim
f5ce219844
[bugfix] websocket header token not always returned (#4009)
* always include headerToken response if provided, because Chrome *sigh*

* wording

* Update internal/api/client/streaming/stream.go

Co-authored-by: Ilia Pozdnyakov <iliazeus@proton.me>

---------

Co-authored-by: Ilia Pozdnyakov <iliazeus@proton.me>
2025-04-14 15:12:09 +02:00
kim
67fc1fd904
ensure 'none' gets included in serializable visibilities (#4007) 2025-04-14 13:33:37 +01:00
kim
36758ea0de
[bugfix] media v2 endpoint fix unset url (#4008)
* update semantics of when media URL is left unset

* fix test
2025-04-14 13:32:49 +01:00
tobi
a44065726c
[chore] Update + add fonts for additional scripts, use locally installed font if available (#3997)
* [chore] Update + add fonts for additional scripts, use locally installed font if available

* update comments
2025-04-14 12:57:58 +02:00
kim
a07ca92752
don't panic on non-fully populated status edits, it may not always be possible (#4006) 2025-04-14 11:22:05 +01:00
tobi
6ff0d3355c
[feature/frontend] Add visibility icon for posts (#4005) 2025-04-14 10:18:18 +01:00
dependabot[bot]
f8d17a7e76
[chore]: Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 (#4003)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.1 to 1.22.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.1...v1.22.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 09:46:09 +02:00
dependabot[bot]
df5d8b42da
[chore]: Bump github.com/miekg/dns from 1.1.64 to 1.1.65 (#4001)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.64 to 1.1.65.
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.64...v1.1.65)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  dependency-version: 1.1.65
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 09:44:34 +02:00
dependabot[bot]
94963b0f24
[chore]: Bump github.com/jackc/pgx/v5 from 5.7.3 to 5.7.4 (#4002)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.3 to 5.7.4.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.3...v5.7.4)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-version: 5.7.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 09:44:11 +02:00
dependabot[bot]
51b9ef5c34
[chore]: Bump github.com/gin-contrib/gzip from 1.2.2 to 1.2.3 (#4000)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/gin-contrib/gzip/releases)
- [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/gzip/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/gzip
  dependency-version: 1.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 09:43:56 +02:00
Phil Hagelberg
c803620531
[docs] Remind the user that password resets don't work without restarting. (#3998)
Every time I reset the password, I assume that something went wrong,
because I forget that the server will not pick up on the reset
password until it's been restarted according to the docs:

https://docs.gotosocial.org/en/latest/admin/cli/#gotosocial-admin-account-password

A reminder here would help reduce confusion.
2025-04-13 23:03:09 +02:00
tobi
c8a780e12a
[bugfix] Fix setting bot on/off (#3986)
* [bugfix] Fix setting bot on/off

* read client messages in tests

* test fix
2025-04-11 15:36:40 +01:00
tobi
eb4114bf12
[chore] Fix header insets (#3987) 2025-04-11 15:50:14 +02:00
OniriCorpe
b51aa23458
[docs] add a command to know if the system is compatible with the standard builds (#3980) 2025-04-11 12:42:18 +02:00
heddxh
1e59795ff4
[docs] add instruction about postgres permission (#3981) 2025-04-11 12:41:50 +02:00
tobi
be9e307418
[chore] render avatar in photoswipe slide, remove repeated alt text (#3985)
* [chore] render avatar in photoswipe slide, remove repeated alt text

* bwap bwap
2025-04-11 12:05:26 +02:00
tobi
e032c959e1
[feature] Implement /oauth/revoke for token revocation (#3983) 2025-04-10 16:24:17 +02:00
kim
b1a4d54c14
[chore] add IPPrefixes type so we don't need separate rate limit parsed field (#3982)
* add IPPrefixes type so we don't need separate rate limit parsed field

* sshhhh please linter, mommy's working
2025-04-09 17:32:13 +01:00
tobi
19cfa8d126
[bugfix] Fix a couple accessibility issues with :focus elements (#3979)
* [bugfix/frontend] Fix accessibility/focus issues in settings + web ui

* fix little error

* tweaks
2025-04-09 14:14:20 +02:00
tobi
365b575341
[feature] add TOTP two-factor authentication (2FA) (#3960)
* [feature] add TOTP two-factor authentication (2FA)

* use byteutil.S2B to avoid allocations when comparing + generating password hashes

* don't bother with string conversion  for consts

* use io.ReadFull

* use MustGenerateSecret for backup codes

* rename util functions
2025-04-07 16:14:41 +02:00
tobi
6f24205a26
[bugfix] Don't assume "manuallyApprovesFollowers": true if not set (#3978)
* [bugfix] Don't assume `"manuallyApprovesFollowers": true` if not set

* whoops, tests
2025-04-07 12:52:24 +01:00
dependabot[bot]
bce643286c
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.85 to 7.0.89 (#3977)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.85 to 7.0.89.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.85...v7.0.89)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.89
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:05:51 +01:00
dependabot[bot]
e0ea77b730
[chore]: Bump github.com/tdewolff/minify/v2 from 2.22.4 to 2.23.0 (#3974)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.22.4 to 2.23.0.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.22.4...v2.23.0)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-version: 2.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:05:22 +01:00
dependabot[bot]
920e20c2d2
[chore]: Bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#3975)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.37.0.
- [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:04:56 +01:00
dependabot[bot]
4232d61782
[chore]: Bump codeberg.org/gruf/go-mutexes from 1.5.1 to 1.5.2 (#3976)
Bumps codeberg.org/gruf/go-mutexes from 1.5.1 to 1.5.2.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-mutexes
  dependency-version: 1.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:04:45 +01:00
dependabot[bot]
2cc5d6269d
[chore]: Bump codeberg.org/gruf/go-structr from 0.9.0 to 0.9.6 (#3973)
Bumps codeberg.org/gruf/go-structr from 0.9.0 to 0.9.6.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-structr
  dependency-version: 0.9.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:03:57 +01:00
tobi
e263d23622
[bugfix] Change email Date header to use RFC2822 (#3972) 2025-04-06 14:55:35 +02:00
tobi
8ae2440da3
[chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections (#3928)
* [chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections

* fiddle with it! (that's what she said)

* remove unused cache fields

* sillyness

* fix tiny whoopsie
2025-04-06 14:39:40 +02:00
tobi
650be1e8d0
[feature] Allow deleting avatar + header via settings panel (#3970) 2025-04-05 15:25:21 +02:00
tobi
b184432331
[feature] Allow editing domain blocks/allows, fix comment import (#3967)
* start implementing editing of existing domain permissions

* [feature] Allow editing domain blocks/allows, fix comment import

* [bugfix] Use "comment" via /api/v1/instance

* fix the stuff
2025-04-04 18:29:22 +02:00
kim
db4b857159
[chore] bump ncruces/go-sqlite3 to v0.25.0 (#3966) 2025-04-04 17:34:38 +02:00
Kelson Vibber
6473886c8e
[bugfix] Fix Atkinson Hyperlegible font embedding on Ecks Pee theme. (#3964)
Most browsers just take the second src line and they're fine, but Tor
has trouble displaying the woff version on Linux. With two separate lines
it doesn't fall back correctly.
2025-04-03 09:43:21 +02:00
tobi
57c5f68e1a
[bugfix] Fix update users query in migration (#3963) 2025-04-02 12:39:38 +02:00
kim
b0873972ec
[chore] bump golang.org/x/net@v0.38.0, github.com/gin-contrib/cors@v1.7.4, github.com/spf13/viper@v1.20.1, github.com/tdewolff/minify/v2@v2.22.4 (#3959) 2025-04-01 18:21:59 +02:00
kim
fdf23a91de
update modernc.org/sqlite to v1.37.0-concurrrency-workaround (#3958) 2025-04-01 16:24:11 +01:00
kim
9c31e213ca
add a security.md stub, until (if) we determine a fancier security process :waves hands like a ghost: (#3955) 2025-03-31 19:58:09 +01:00
tobi
0850a8f646
[docs] NLnet Grant Application - NGI Zero Commons 2025 (#3954) 2025-03-31 15:59:14 +02:00
tobi
3949117be0
[feature] Use blurhashes in frontend, tidy up gallery view a bit (#3948)
* [feature] Use blurhashes in frontend, tidy up gallery view a bit

* weeeeeeeeeeeeeeeee

* beep boop
2025-03-31 15:51:17 +02:00
Leonid Shevtsov
85fb63f46f
[docs] Fix Swagger URL for the "edit status" operation (#3932) 2025-03-30 10:21:08 +02:00
kim
13e7ac3e6a
bump ffmpreg to v0.6.7 (#3947) 2025-03-28 11:45:31 +00:00
kim
d49abd7bd7
bump modernc.org/sqlite to v1.36.2-concurrency-workaround (#3945) 2025-03-27 11:23:23 +00:00
tobi
b6e481d63e
[feature] Allow user to choose "gallery" style layout for web view of profile (#3917)
* [feature] Allow user to choose "gallery" style web layout

* find a bug and squish it up and all day long you'll have good luck

* just a sec

* [performance] reindex public timeline + tinker with query a bit

* fiddling

* should be good now

* last bit of finagling, i'm done now i prommy

* panic normally
2025-03-26 15:59:39 +00:00
kim
f46e490c30
[chore] bumps our spf13/viper version (#3943)
* bumps our spf13/viper version

* fixes the one breaking change
2025-03-26 11:44:24 +00:00
Daenney
1bf40e755c
feat: Relax URL matching (#3925)
* feat: Relax URL matching

Instead of only linkifying things with an explicit http or https scheme,
the xurls.Relaxed also matches links with known TLDs. This means that
text like 'banana.com' will also be matched, despite the missing
http/https scheme. This also works to linkify email addresses, which is
handy.

This should also ensure we catch links without a scheme for the purpose
of spam checking.
2025-03-24 14:13:32 +01:00
tobi
27171a78de
[feature] Parse funkwhale Album as Statusable to allow barebones interacting with bandwagon (#3931)
* bump activity version

* parse funkwhale / bandwagon album as statusable
2025-03-24 10:56:42 +00:00
dependabot[bot]
4af8d1a2cb
[chore]: Bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 (#3927)
Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 10:54:29 +00:00
dependabot[bot]
f7e5f31c6b
[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.3 to 2.22.3 (#3933)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.3 to 2.22.3.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.21.3...v2.22.3)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 10:53:20 +00:00
dependabot[bot]
a844f322ee
[chore]: Bump github.com/miekg/dns from 1.1.63 to 1.1.64 (#3936)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.63 to 1.1.64.
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.63...v1.1.64)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 10:50:19 +00:00
dependabot[bot]
18c8f85a30
[chore]: Bump github.com/jackc/pgx/v5 from 5.7.2 to 5.7.3 (#3935)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.2 to 5.7.3.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.2...v5.7.3)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 10:50:09 +00:00
dependabot[bot]
a2caa5fdbb
[chore]: Bump golang.org/x/net from 0.36.0 to 0.37.0 (#3934)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.37.0.
- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 10:49:57 +00:00
tobi
808031ca01
[chore] Add extra org.opencontainers.image labels to docker build (#3930)
* [chore] Add extra `org.opencontainers.image` tags to docker build

* add more labels, fuck it
2025-03-23 11:39:34 +01:00
kim
e7b4690318
bumps modernc.org/sqlite to v1.36.1-concurrency-workaround (#3926) 2025-03-21 09:37:54 +01:00
tobi
cecb1fd009
[bugfix] Fix set obfuscate = null error in adoptPerm (#3922)
* [chore] More tests for domain allow + block subscriptions

* [bugfix] Fix set `obfuscate = null` error in adoptPerm

* fmt
2025-03-19 12:06:50 +01:00
tobi
657e064bf6
[bugfix] Avoid nil ptr if maintenance router can't be started (#3919) 2025-03-18 13:32:08 +01:00
tobi
59aac290e4
[performance] reindex public timeline + tinker with query a bit (#3918) 2025-03-18 12:49:21 +01:00
tobi
d5847e2d2b
[feature] Application creation + management via API + settings panel (#3906)
* [feature] Application creation + management via API + settings panel

* fix docs links

* add errnorows test

* use known application as shorter

* add comment about side effects
2025-03-17 14:06:17 +00:00
tobi
d3c3d34aae
[feature/frontend] Add visibility icon for posts (#3908) 2025-03-14 13:57:55 +01:00
tobi
85ee7cca47
[chore] Tweak "nothing here!" message (#3907) 2025-03-14 10:17:49 +00:00
dependabot[bot]
daf60f69a0
Bump @babel/helpers from 7.23.1 to 7.26.10 in /web/source (#3901)
Bumps [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) from 7.23.1 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-helpers)

---
updated-dependencies:
- dependency-name: "@babel/helpers"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 10:30:30 +01:00
dependabot[bot]
da462afce2
[chore]: Bump golang.org/x/net from 0.35.0 to 0.36.0 (#3905)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 10:30:01 +01:00
kim
f30bb549aa
update go-structr to v0.9.0 with new Timeline{} cache type (#3903) 2025-03-12 20:33:35 +00:00
tobi
6c5d369b05
[docs] Update swagger docs command (#3897) 2025-03-11 09:05:33 +01:00
tobi
0c49d5abb8
[bugfix] Fix panic when opening instance actor in web view (#3898) 2025-03-11 09:05:23 +01:00
kim
bad12a62e6
bumps our uptrace/bun dependencies to v1.2.11 (#3895) 2025-03-10 19:40:16 +00:00
kim
95f88e5d93
[chore] add warning message when wazero compiler not supported (#3894)
* add warning message when wazero compiler not supported, update supported platforms in README

* whoops don't return a reason string for arm64, since it should always be supported
2025-03-10 17:21:56 +00:00
tobi
0c72282559
[performance] Optimize local timeline + local status count queries (#3892)
* [performance] Optimize local timeline + local status count queries

* remove if not exists from create view
2025-03-10 13:52:19 +01:00
CDN
3db5bfa0f2
[docs/zh] update zh docs: synced to 98c4cae + fix typo (#3884)
* [docs/zh] update zh docs: synced to 98c4cae8

* fix typo

* sync the support matrix in README

* update mkdocs.yml: add new article
2025-03-10 10:24:37 +01:00
dependabot[bot]
252a17a691
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#3888) 2025-03-10 09:23:45 +00:00
dependabot[bot]
85e17b3e78
[chore]: Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#3890) 2025-03-10 09:23:19 +00:00
dependabot[bot]
719c925299
[chore]: Bump golang.org/x/crypto from 0.35.0 to 0.36.0 (#3887)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/crypto/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 10:22:28 +01:00
tobi
35e94c8abd
[bugfix] Fix length for type varchar must be at least 1 on Postgres (#3885) 2025-03-09 16:44:12 +01:00
CDN
98c4cae89a
[chore] update links in CONTRIBUTING.md (#3881) 2025-03-08 18:48:11 +01:00
tobi
d8113c11e4
[feature] Parse content warning to HTML, serialize via client API as plaintext (#3876)
* [feature] Parse content warning as HTML, serialize via API to plaintext

* tidy up some cruft

* whoops

* oops

* i'm da joker baybee

* clemency muy lorde

* rename some of the text functions for clarity

* jiggle the opts

* fiddle de deee

* hopefully the last test fix i ever have to do in my beautiful life
2025-03-07 14:04:34 +00:00
ewwwin
424f62dd70
[bugfix] Store and expose status content type (#3870)
* Add ContentType to internal models

* Add ContentType to API models StatusSource and StatusEdit

* Add helpers to convert between API/internal StatusContentType

* Write status content type on create/edit

* Add migration

* Update API docs

go run github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps --output docs/api/swagger.yaml

* ensure ContentType is updated anywhere Text is

* Update docs, take care of TODOs

* Set ContentType in more places where Text is set

* We don't actually use ContentType on the API status model

* Update StatusSource test

* Remove unused helper function I copied

* Revert change to StatusContentType swagger annotation

I'm going to include this in a follow-on PR instead.

* Add test for updating content type in edits

* Return a value from processContentType instead of modifying the existing status

Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad

* Add test for handling of statuses with no stored content type

* repurpose an existing test status instead of adding a new one to avoid breaking other tests

* Add test to ensure newly created statuses always have content type saved

* Do include content type on status API model actually

This is mostly important when deleting and redrafting.

The comment on `apimodel.Status.Text` implies that it's not sent except in response to status deletion, but actually this doesn't seem to be the case; it also appears to be present in responses to creations and normal fetches and stuff. So I'm treating `ContentType` the same here.

* Update new tests to check content type on API statuses

* Check content type of API statuses in all tests where text is checked

* update other api tests with status content type field

* Add test ensuring text and content type are returned when deleting a status

* Convert processContentType to free function and remove unused parameter

* check for the correct value in the deletion test

* Be explicit about this test status having an empty content type

* Use omitempty consistently on API models

* clean up the final diff a bit

* one more swagger regen for the road

* Handle nil statuses in processContentType

* Don't pass processContentType the entire edit form, it doesn't need it

* Move processContentType to common.go and use for creation as well

* Remove unused parameters to ContentTypeToAPIContentType
2025-03-06 16:31:52 +00:00
tobi
69461c461b
[bugfix] Return useful err on server start failure (#3879)
* [bugfix] Return useful err on `server start` failure

* remove scheduler started func

* remove tryUntil
2025-03-05 19:12:53 +01:00
tobi
829143d263
[feature] Add token review / delete to backend + settings panel (#3845) 2025-03-04 10:01:25 +00:00
jade arson.
ee60732cf7
[chore] fixed email template to align with the new "Log in" button + separate page (#3871) 2025-03-04 09:46:33 +01:00
tobi
ab7ec43988
[bugfix] Fix app migration (#3868)
* [bugfix] Fix app migration

* use temporary index during migration

* create temporary index for the migration

* include local = true in temporary index

* tweak migration a bit for SPEED
2025-03-03 19:00:44 +01:00
kim
24da574684
[bugfix] fix refreshed additional media info being ignored (#3867)
* fix refreshed additional media info being ignored when force flag already set

* also update to always iterate through all additional info fields

* make similar changes for emoji, even if not necessary, just to keep in-sync
2025-03-03 16:14:27 +00:00
tobi
1b37944f8b
[feature] Refactor tokens, allow multiple app redirect_uris (#3849)
* [feature] Refactor tokens, allow multiple app redirect_uris

* move + tweak handlers a bit

* return error for unset oauth2.ClientStore funcs

* wrap UpdateToken with cache

* panic handling

* cheeky little time optimization

* unlock on error
2025-03-03 15:03:36 +00:00
kim
c80810eae8
bumps go-ffmpreg to v0.6.6 (#3866) 2025-03-03 10:51:30 +00:00
kim
67a2b3650c
bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
dependabot[bot]
ddd9210614
[chore]: Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#3860)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.21.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.5...v1.21.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:21:50 +00:00
kim
861b5cd920
bump our fork of modernc.org/sqlite to tag v1.36.0-concurrency-workaround (#3864) 2025-03-03 10:09:34 +00:00
dependabot[bot]
0e2e8e54ab
[chore]: Bump github.com/ncruces/go-sqlite3 from 0.23.0 to 0.24.0 (#3862)
Bumps [github.com/ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/ncruces/go-sqlite3/releases)
- [Commits](https://github.com/ncruces/go-sqlite3/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: github.com/ncruces/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 09:51:42 +00:00
tobi
8488ac9286
[chore] migrate oauth2 -> codeberg (#3857) 2025-03-02 16:42:51 +01:00
tobi
49c12636c6
[chore] go-swagger -> codeberg (#3856) 2025-03-02 16:15:48 +01:00
tobi
d8bb1c391b
[chore] Update exif terminator version with codeberg libraries (#3855) 2025-03-02 15:44:02 +01:00
tobi
5d0e3d9c35
[chore] github.com/superseriousbusiness/httpsig -> codeberg.org/superseriousbusiness/httpsig (#3854) 2025-03-02 13:28:38 +01:00
tobi
e2e185d10b
[chore] github.com/superseriousbusiness/activity -> codeberg.org/superseriousbusiness/activity (#3853) 2025-03-02 12:48:00 +01:00
tobi
4c9901fc03
[chore] little frontend tweaks (#3852)
* [chore] little frontend tweaks

* beep boop

* poke

* clarify server time
2025-03-02 11:27:30 +01:00
Luca Matei Pintilie
e78e817057
[feature] add microformat support (#3848)
Related: #2959

Signed-off-by: Luca Matei Pintilie <luca@lucamatei.com>
2025-03-01 13:06:08 +01:00
dependabot[bot]
a7485ae251
[chore]: Bump github.com/go-jose/go-jose/v4 from 4.0.2 to 4.0.5 (#3831)
Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.0.2 to 4.0.5.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v4.0.2...v4.0.5)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 11:43:05 +01:00
CDN
b4bb97225e
[feature/frontend] use localized time string in status & poll info page (#3821) 2025-03-01 11:41:32 +01:00
Xavier Vello
0118e03cda
[feature] Implement CSV import for mutes (#3696)
* Implement CSV import for mutes

* update swagger.yaml

* update documentation

* add ImportTestSuite.TestImportMutes

* fix comment typo
2025-03-01 11:37:40 +01:00
Vyr Cossont
d73acc70d5
Document importing posts (#3844) 2025-02-28 16:10:16 -08:00
VirtualWolf
46862171e0
[feature] Added an extra CSS class name to the About This Instance and Register an Account sections in the root index template to allow for easier targeting with custom CSS. (#3843) 2025-02-27 10:26:55 +01:00
tobi
1f38b7b48f
[chore] Remove duplicate swagger docs build in Dockerfile (#3842)
* [chore] Use vendored swagger in Docker container

* skip the swagger step altogether actually, it's already done by goreleaser anyway
2025-02-26 21:12:26 +01:00
tobi
8bc502ba62
[chore] Update KimMachineGun/automemlimit (#3841) 2025-02-26 21:10:13 +01:00
tobi
eb720241da
[feature] Enforce OAuth token scopes (#3835)
* move tokenauth to apiutil

* enforce scopes

* docs

* update test models, remove deprecated "follow"

* file header

* tests

* tweak scope matcher

* simplify...

* fix tests

* log user out of settings panel in case of oauth error
2025-02-26 13:04:55 +01:00
dependabot[bot]
f734a94c1c
[chore]: Bump golang.org/x/crypto from 0.33.0 to 0.34.0 (#3824)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.33.0 to 0.34.0.
- [Commits](https://github.com/golang/crypto/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 12:48:37 +01:00
dependabot[bot]
e1ec904dd3
[chore]: Bump github.com/google/go-cmp from 0.6.0 to 0.7.0 (#3826)
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 12:48:22 +01:00
dependabot[bot]
d2cf9de726
[chore]: Bump github.com/tetratelabs/wazero from 1.8.2 to 1.9.0 (#3827)
Bumps [github.com/tetratelabs/wazero](https://github.com/tetratelabs/wazero) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/tetratelabs/wazero/releases)
- [Commits](https://github.com/tetratelabs/wazero/compare/v1.8.2...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/tetratelabs/wazero
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 12:48:02 +01:00
mkljczk
96d39155f2
[docs] Fix swagger operation descriptions (#3830)
* Fix swagger operation descriptions

Signed-off-by: mkljczk <git@mkljczk.pl>

* generate a swagger file

Signed-off-by: mkljczk <git@mkljczk.pl>

---------

Signed-off-by: mkljczk <git@mkljczk.pl>
2025-02-25 12:47:48 +01:00
Elliot Blackburn
1c049ba295
[docs] correct docker version format (#3832)
The documentation explains that the release tag is in the format of `vX.Y.Z` for container images. This does not appear to be correct when looking at the image tags in dockerhub. It seems the `v` prefix has been dropped at some point, or was never in place.
2025-02-25 12:47:07 +01:00
Privacy_Dragon
d8f96f81d6
[chore] Fix typo in common.tsx (#3834) 2025-02-25 12:46:41 +01:00
tobi
fd670c6a27
[feature] Use ETag for robots.txt to prevent mishaps (#3829)
* [feature] Use ETag for robots.txt to prevent mishaps

* check incoming if-none-match header
2025-02-24 11:17:18 +01:00
tobi
c9de6c9a1e
[docs] Update interactionPolicy (#3703)
* [docs] Update interactionPolicy

* Update docs/federation/posts.md

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* brush up docs

* boobs

* finish up

---------

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2025-02-22 13:26:49 +01:00
tobi
8829ee187a
[feature] Add page-specific class per template (#3814)
* [feature] Add page-specific class per template

* cheeky bit cheaper
2025-02-20 15:09:28 +01:00
kim
a03a35a5d6
[bugfix] update fedi api to support multiple separate votes in same multiple choice poll (#3809) 2025-02-20 11:13:07 +01:00
tobi
2f5629143d
[chore] Step minio down to 7.0.85 (#3808) 2025-02-19 19:18:01 +01:00
tobi
96716e4f43
[feature] Forward-compatibility with Approval objects (#3807)
* vendor

* [feature] Forward-compatibility with Approval objects

* vendor the thing

* fix leetle bug

* lil syntax tweak for beloved kimb
2025-02-19 18:09:54 +01:00
kim
e220c6a894
adds more code comments and some small code formatting tweaks (#3799) 2025-02-17 11:44:41 +00:00
dependabot[bot]
c73497b58c
[chore]: Bump github.com/spf13/cobra from 1.8.1 to 1.9.1 (#3805)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 11:43:32 +00:00
dependabot[bot]
f35c1cf67a
[chore]: Bump golang.org/x/net from 0.34.0 to 0.35.0 (#3804)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.34.0 to 0.35.0.
- [Commits](https://github.com/golang/net/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 11:43:10 +00:00
dependabot[bot]
46e473f86e
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.85 to 7.0.86 (#3803)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.85 to 7.0.86.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.85...v7.0.86)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 11:42:50 +00:00
tobi
5dc8009e30
[chore/performance] Batch migration queries (#3798)
* separate enum migrations into their own individual transactions

* pee poo

* some performance tweaks and adding more comments

* batch

---------

Co-authored-by: kim <grufwub@gmail.com>
2025-02-15 12:43:12 +01:00
kim
ebbdeee0bb
bump modernc.org/sqlite to v1.35.0-concurrency-workaround (#3797) 2025-02-14 16:54:10 +00:00
tobi
879ca2d2f8
[bugfix] Drop status indices AFTER updating visibility (#3795)
* [bugfix] Drop status indices AFTER updating visibility

* rename to status vis indices just to indicate they're only used in the statuses hook func

---------

Co-authored-by: kim <grufwub@gmail.com>
2025-02-14 12:52:04 +00:00
dependabot[bot]
1ee56d66ce
[chore] Bump elliptic from 6.6.0 to 6.6.1 in /web/source (#3791)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.6.0 to 6.6.1.
- [Commits](https://github.com/indutny/elliptic/compare/v6.6.0...v6.6.1)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-13 14:10:33 +01:00
tobi
dfcb7862a9
[bugfix] Return 404 when web context target status hidden (#3792) 2025-02-13 14:10:13 +01:00
kim
24f6760c0e
[chore] bump ncruces go-sqlite3 => v0.23.0 (#3785)
* bump ncruces go-sqlite3 => v0.23.0

* whoops, add missing vendor changes...
2025-02-13 09:53:40 +01:00
Vyr Cossont
fccb0bc102
[feature] Implement backfilling statuses thru scheduled_at (#3685)
* 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-12 09:49:33 -08:00
kim
37dbf319b1
[performance] improved enum migrations (#3782)
* updates the enum migration to perform a singular update for all values, using an SQL case statement

* fix logging

* fix code comment

* well i guess we'll get rid of the useful but unused function then, linter. fine, i see how it is!

* append to byte buffer instead of WriteString() to shut the linter up (i know you're reading this, linter)
2025-02-11 16:58:44 +01:00
alemi.dev
d0de3ad492
[bug] respect X-Robots-Tag and robots.txt on api/v1/instance and nodeinfo (#3756)
* feat: check X-Robots-Tag

when accessing /api/v1/instance or /nodeinfo endpoints respect
X-Robots-Tag

* chore: go fmt ./...

* Check robots.txt as well, add tests

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2025-02-11 13:16:14 +01:00
tobi
2c95fd4115
[bugfix] Suggest lowercase username when creating via OIDC (#3780) 2025-02-11 09:42:35 +01:00
dependabot[bot]
4ac5447ad6
[chore]: Bump golang.org/x/crypto from 0.32.0 to 0.33.0 (#3771) 2025-02-10 15:52:55 +00:00
dependabot[bot]
bb6d2f8ee8
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.84 to 7.0.85 (#3772) 2025-02-10 15:30:29 +00:00
dependabot[bot]
576da4cf01
[chore]: Bump golang.org/x/image from 0.23.0 to 0.24.0 (#3773) 2025-02-10 15:10:30 +00:00
dependabot[bot]
edcc8ea4ed
[chore]: Bump golang.org/x/oauth2 from 0.25.0 to 0.26.0 (#3775)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.25.0 to 0.26.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 15:47:00 +01:00
tobi
787bdc1488
[feature] make account sign-up / backlog limits configurable (#3768) 2025-02-10 15:46:36 +01:00
tobi
ce7ba8f498
[bugfix] Fix POST to create account endpoint (#3767) 2025-02-09 13:52:52 +01:00
tobi
128fcc871c
[bugfix] Fix missing hasChanged func (#3764) 2025-02-09 12:23:16 +01:00
tobi
05e89af4ec
[chore/frontend] Tweak display of "edited" in web UI a bit (#3766) 2025-02-09 12:23:06 +01:00
CDN
42bbbaadb2
[feature/frontend] add light mode color scheme of base css, adapt to prefers-color-scheme (#3765) 2025-02-09 12:22:41 +01:00
Vyr Cossont
a6d1f5bf2c
[bugfix] Reduce Web Push record size (#3762) 2025-02-09 11:13:28 +01:00
CDN
62f25ea08a
[docs/zh] Update zh docs: synced to e10de84 (#3763)
* [docs/zh] Update zh docs: synced to e10de84

* [docs/zh] update mkdocs config of zh docs

* [docs/zh] update repo docs translations (README, ROADMAP, CONTRIBUTING) + update swagger schema metadata of docs/zh
2025-02-09 11:13:08 +01:00
CDN
2aa3524739
[chore] fix typo in docs (#3758)
* [chore] fix link reference in docs/admin/settings.md

* [docs] fix typo in docs/federation/posts.md
2025-02-09 11:12:46 +01:00
pnwmatt
e10de8464a
[bug] Add missing group property to the Account model (#3746)
* Stub out account's Group parameter

* Fix typo in Contributing documentation

* Update swagger and match style

* Update the swagger command to mimic test/swagger.sh

* Fix tests for new `group` param in Account model

* More test changes for new `group` param in Account

* Continuing test changes for `group` param stubbing

* Another round of `group` stubbing for tests
2025-02-08 13:04:30 +01:00
tobi
00bd0f7658
[chore] Update drone + goreleaser (#3742) 2025-02-06 16:23:30 +01:00
kim
1276cde4b3
temporary fix for tetratelabs/wazero#2365 armv8 compiler support bug (#3741) 2025-02-06 12:44:40 +00:00
kim
1a8e42eeb3
[chore] update readme support matrix (#3738)
* this updates our support matrix to better reflect latest wazero changes (thanks @ncruces!)

* be more specific

* whoops, remove the BSD section being referenced for the linux builds

* fix markdown link, fix wording
2025-02-06 12:12:33 +00:00
Dominik Süß
dd094e4012
[chore] update otel libraries (#3740)
* chore: update otel dependencies

* refactor: combine tracing & metrics in observability package

* chore: update example tracing compose file
2025-02-06 12:14:37 +01:00
tobi
baed591a1d
[feature] Use X-Robots-Tag headers to instruct scrapers/crawlers (#3737)
* [feature] Use `X-Robots-Tag` headers to instruct scrapers/crawlers

* use switch for RobotsHeaders
2025-02-05 12:47:13 +01:00
tobi
bfb81f5bac
[bugfix] wrong nodeinfo version (tobi is a boob) (#3735) 2025-02-04 16:52:54 +00:00
tobi
07d2770995
[feature] Change instance-stats-randomize to instance-stats-mode with multiple options; implement nodeinfo 2.1 (#3734)
* [feature] Change `instance-stats-randomize` to `instance-stats-mode` with multiple options; implement nodeinfo 2.1

* swaggalaggadingdong
2025-02-04 16:52:42 +01:00
kim
e1781ff52e
adds support for build specifically without wasm ffmpeg (#3732) 2025-02-03 12:42:06 +00:00
kim
a24048fc05
bumps our fork of modernc.org/sqlite to v1.34.5 (#3731) 2025-02-03 12:13:51 +00:00
tobi
053d820845
[bugfix] Don't panic on delivery of Activity with no object (#3730) 2025-02-03 11:52:24 +00:00
dependabot[bot]
acd3e80ae1
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.81 to 7.0.84 (#3728)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.81 to 7.0.84.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.81...v7.0.84)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 10:39:40 +00:00
Vyr Cossont
27844b7da2
[feature] Implement Web Push notification policy (#3721)
* Web Push: add policy column to subscriptions

* Web Push: add policy to API

* Web Push: test notification policy

* go-fmt unrelated file (how did this get thru?)
2025-02-03 10:25:53 +00:00
dependabot[bot]
8b74cad422
[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.2 to 2.21.3 (#3727)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.2 to 2.21.3.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.21.2...v2.21.3)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 10:12:49 +00:00
dependabot[bot]
c086d4048c
[chore]: Bump github.com/KimMachineGun/automemlimit from 0.6.1 to 0.7.0 (#3726)
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.6.1 to 0.7.0.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.6.1...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 10:12:35 +00:00
dependabot[bot]
a6d852d1c5
[chore]: Bump golang.org/x/oauth2 from 0.24.0 to 0.25.0 (#3725)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 10:11:55 +00:00
jade arson.
77f25e21d7
[chore] disallow /nodeinfo/ too (#3729) 2025-02-03 10:09:14 +01:00
Vyr Cossont
f5eee56bb1
[bugfix] Swagger: fix media_ids[] param for creating statuses (#3722) 2025-02-01 17:14:49 -08:00
tobi
a55bd6d2bd
[feature] Add instance-stats-randomize config option (#3718)
* [feature] Add `instance-stats-randomize` config option

* don't use cache (overkill)
2025-01-31 19:27:18 +01:00
tobi
c47b9bd1d1
[chore] Add "object" uri to outgoing Accept + Reject messages (#3717) 2025-01-31 17:09:11 +01:00
Vyr Cossont
fc895ade02
[chore] Web Push: Use server URL for VAPID sub claim (#3716)
webpush-go now supports sending `https://` as well as `mailto:` URLs for VAPID sub claims, so we can revert 464d920cfd now and save fetching the instance contact email or making up a dummy email if there wasn't one configured.
2025-01-31 14:57:32 +00:00
tobi
8a9422aa78
[bugfix] shut down LE server nicely (#3714)
* [bugfix] shut down LE server nicely
2025-01-31 13:45:39 +01:00
Vyr Cossont
b9e0689359
[bugfix] Extend parser to handle more non-Latin hashtags (#3700)
* Allow marks after NFC normalization

Includes regression test for the Tamil example from #3618

* Disallow just numbers + marks + underscore as hashtag
2025-01-31 11:42:55 +01:00
Vyr Cossont
ab758cc233
[feature] Add system message wrappers for pending replies and placeholder attachments (#3713)
Fixes #3712
2025-01-31 11:40:39 +01:00
kim
493de5c005
[bugfix] fix boost of account ID check (#3709) 2025-01-30 18:14:35 +01:00
kim
527587155a
check boosted account ID when performing usermute checks (#3708) 2025-01-30 15:05:15 +00:00
Marcus Jaschen
b3ecfe1e0a
[docs] remove -X POST from curl commands (#3665)
Daniel, author of curl, explains why `-X POST` is not
necessary and considered bad behavior:

https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/ for
2025-01-30 13:56:08 +01:00
kim
91cef3495d
[bugfix] Missing emoji urls (#3707)
* filter out emoji that are uncached when converting to frontend models

* some very small fixups

* remove TODO notice
2025-01-30 13:52:03 +01:00
kim
1ab960bf15
[bugfix] harden checks for remotes masquerading as local, and return correct local account redirects early (#3706) 2025-01-30 10:40:21 +01:00
tobi
d16e4fa34d
[feature] Use maintenance router to serve 503 while server is starting/migrating (#3705)
* [feature] Use maintenance router to serve 503 while server is starting/migrating

* love you linter, kissies
2025-01-29 16:57:04 +01:00
kim
61141ac232
[chore] remove type switch in Create() and instead move to FederatedCallbacks() (#3697)
* remove type switch in Create() and instead move to FederatedCallbacks()

* add missing (my bad!) federating wrapped callbacks behaviour

* add missing license header 😇

* fix create flag test to use correct function
2025-01-28 20:22:23 +00:00
tobi
bfe8144fda
[bugfix] Allow processing null ID emojis (#3702)
* [bugfix] Allow processing null ID emojis

* document emojis

* blah

* typo

* array thingy
2025-01-28 13:32:37 +01:00
tobi
65fb8abd42
[feature] Implement deliveryRecipientPreSort to prioritize delivery to mentioned accounts (#3668)
* weeeeenus

* update to latest activity

* update to use latest release tag of superseriousbusiness/activity

---------

Co-authored-by: kim <grufwub@gmail.com>
2025-01-27 19:22:15 +01:00
tobi
9048290948
[chore] skip trusted-proxies warning if ip excepted from rate limiting (#3699)
* [chore] skip `trusted-proxies` warning if ip excepted from rate limiting

* weep

* typo

* fix env parsing test
2025-01-27 19:21:13 +01:00
kim
726d2ba483
[chore] some tidy ups (#3677)
* small formatting changes (no logic)

* improve code comments

* fix import cycle

* shutup stinky linter
2025-01-27 15:54:59 +00:00
kim
3617e27afa
bumps uptrace/bun deps to v1.2.8 (#3698) 2025-01-27 15:54:51 +00:00
Vivian Lim ⭐
7b7fc528f1
[feature/frontend] Add login button to index page which reiterates info about clients (#3377)
* Add login button to index page which reiterates info about clients

* bit of CSS fiddling, move apps from front page to login info

* fix indentation

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2025-01-27 14:24:31 +01:00
tobi
702d49207f
[bugfix] Fix top-level posts with a mention being counted as replies when doing exclude_replies (#3689)
* [bugfix] Fix top-level posts with a mention being counted as replies

* add index for new reply exclusion query
2025-01-27 11:10:18 +00:00
dependabot[bot]
a773768718
[chore]: Bump github.com/SherClockHolmes/webpush-go from 1.3.0 to 1.4.0 (#3694)
Bumps [github.com/SherClockHolmes/webpush-go](https://github.com/SherClockHolmes/webpush-go) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/SherClockHolmes/webpush-go/releases)
- [Commits](https://github.com/SherClockHolmes/webpush-go/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/SherClockHolmes/webpush-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 11:08:13 +00:00
dependabot[bot]
3428bc9633
[chore]: Bump github.com/miekg/dns from 1.1.62 to 1.1.63 (#3695)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.62 to 1.1.63.
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.62...v1.1.63)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 11:07:16 +00:00
dependabot[bot]
5c96702cb5
[chore]: Bump github.com/gin-contrib/gzip from 1.1.0 to 1.2.2 (#3693)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.1.0 to 1.2.2.
- [Release notes](https://github.com/gin-contrib/gzip/releases)
- [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/gzip/compare/v1.1.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/gzip
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 11:06:46 +00:00
tobi
2a46681147
[chore] Allow suppressing trusted-proxies warning by disabling rate limiting (#3686) 2025-01-26 11:21:57 +00:00
Vyr Cossont
3ab2d8621b
[docs] Swagger: fix filter context params by moving enum list from the list type to the item type (#3684)
Reported by `@modulus:matrix.org`
2025-01-26 09:51:28 +01:00
tobi
4c052c85f5
[bugfix] Rename domain perm sub migration to unique date (#3679)
* [bugfix] Rename domain perm sub migration to unique date

* add repeat migration
2025-01-24 18:09:55 +01:00
tobi
71b50353eb
[feature] Process incoming Undo Announce properly (#3676)
* [feature] Process incoming Undo Announce properly

* test undo announce
2025-01-24 17:36:34 +01:00
kim
3720251fca
[feature] show status edits on frontend (#3678)
* add 'edited-at' field to status info web template

* make the edited-at text italic

* small change in phrasing
2025-01-24 16:02:13 +01:00
Vyr Cossont
5b765d734e
[feature] Push notifications (#3587)
* Update push subscription API model to be Mastodon 4.0 compatible

* Add webpush-go dependency

# Conflicts:
#	go.sum

* Single-row table for storing instance's VAPID key pair

* Generate VAPID key pair during startup

* Add VAPID public key to instance info API

* Return VAPID public key when registering an app

* Store Web Push subscriptions in DB

* Add Web Push sender (similar to email sender)

* Add no-op push senders to most processor tests

* Test Web Push notifications from workers

* Delete Web Push subscriptions when account is deleted

* Implement push subscription API

* Linter fixes

* Update Swagger

* Fix enum to int migration

* Fix GetVAPIDKeyPair

* Create web push subscriptions table with indexes

* Log Web Push server error messages

* Send instance URL as Web Push JWT subject

* Accept any 2xx code as a success

* Fix malformed VAPID sub claim

* Use packed notification flags

* Remove unused date columns

* Add notification type for update notifications

Not used yet

* Make GetVAPIDKeyPair idempotent

and remove PutVAPIDKeyPair

* Post-rebase fixes

* go mod tidy

* Special-case 400 errors other than 408/429

Most client errors should remove the subscription.

* Improve titles, trim body to reasonable length

* Disallow cleartext HTTP for Web Push servers

* Fix lint

* Remove redundant index on unique column

Also removes redundant unique and notnull tags on ID column since these are implied by pk

* Make realsender.go more readable

* Use Tobi's style for wrapping errors

* Restore treating all 5xx codes as temporary problems

* Always load target account settings

* Stub `policy` and `standard`

* webpush.Sender: take type converter as ctor param

* Move webpush.MockSender and noopSender into testrig
2025-01-23 16:47:30 -08:00
tobi
9333bbc4d0
[feature] Serve bot accounts over AP as Service instead of Person (#3672)
* pepis

* oopsie doopsie

* bollocks
2025-01-23 18:18:23 +01:00
tobi
b42cb7a802
[feature] Add warning about trusted-proxies to make config easier (#3675)
* [feature] Add warning about `trusted-proxies` to make config easier

* thank you linter, hugs and kisses to you
2025-01-23 15:48:09 +01:00
tobi
1472d92a8d
[feature] Add published property to outgoing AP Actor representations (#3671) 2025-01-23 14:42:31 +00:00
kim
0a99901c65
[performance] reduce InboxForward->Create calls by partially implementing Exists() (#3647)
* alphabetical reordering

* keep a cache of activity IDs we have handled creates for

* reduce number of inbox forwarding create calls by partially implementing Exists()

* increase cache size, since all we're storing is string keys
2025-01-22 13:42:12 +01:00
dependabot[bot]
5c0514e83c
[chore]: Bump github.com/coreos/go-oidc/v3 from 3.11.0 to 3.12.0 (#3662) 2025-01-20 10:15:27 +00:00
tobi
37fd7c7a6a
[bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655) 2025-01-20 10:56:00 +01:00
dependabot[bot]
9835d3e65d
[chore]: Bump github.com/gin-contrib/cors from 1.7.2 to 1.7.3 (#3661) 2025-01-20 09:47:07 +00:00
dependabot[bot]
77ea30542b
[chore]: Bump golang.org/x/net from 0.33.0 to 0.34.0 (#3660) 2025-01-20 09:03:10 +00:00
dependabot[bot]
cfe6ac5a42
[chore]: Bump github.com/jackc/pgx/v5 from 5.7.1 to 5.7.2 (#3663)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.1 to 5.7.2.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 10:01:46 +01:00
dependabot[bot]
0096222c0e
[chore]: Bump github.com/gin-contrib/sessions from 1.0.1 to 1.0.2 (#3664)
Bumps [github.com/gin-contrib/sessions](https://github.com/gin-contrib/sessions) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/gin-contrib/sessions/releases)
- [Changelog](https://github.com/gin-contrib/sessions/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/sessions/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/sessions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 10:01:17 +01:00
tobi
634d4f408f
[bugfix] Fix existing perm adoption (#3651)
* [bugfix] Fix existing perm adoption

* go fmt

* test, small log fix
2025-01-18 18:55:27 +01:00
kim
81b66ad7e3
update ncruces/go-sqlite3 v0.21.3 -> v0.22.0, gruf/go-ffmpreg v0.6.4 -> v0.6.5 (#3646) 2025-01-14 18:30:55 +00:00
kim
b8ef9fc4bc
bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) 2025-01-14 14:23:28 +00:00
kim
e77c7e16b6
[chore] better dns validation (#3644)
* add seperate PunifyValidate() function for properly validating domain names when converting to punycode

* rename function, strip port from domain validation
2025-01-14 14:23:18 +00:00
dependabot[bot]
b95498b8c2
[chore]: Bump mvdan.cc/xurls/v2 from 2.5.0 to 2.6.0 (#3643)
Bumps [mvdan.cc/xurls/v2](https://github.com/mvdan/xurls) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/mvdan/xurls/releases)
- [Commits](https://github.com/mvdan/xurls/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: mvdan.cc/xurls/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 13:11:20 +00:00
dependabot[bot]
4d423102c1
[chore]: Bump github.com/gin-contrib/gzip from 1.0.1 to 1.1.0 (#3639)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/gin-contrib/gzip/releases)
- [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/gzip/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/gzip
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 13:10:39 +00:00
kim
8cfae010a9
[bugfix] migration to cleanup dropped status edits (#3637)
* add migration to cleanup dropped status edits from previous bug, relinking with statuses

* don't use bun.Ident where not needed

* fix join statement

* fix query to work for both postgres and sqlite

* actually update by the currently set status ID field 🤦
2025-01-09 00:02:22 +00:00
tobi
8daa4dae34
[bugfix] More permissive CSV parsing for perm subs, text parse fix (#3638)
* [bugfix] More permissive CSV parsing for perm subs, text parse fix

* wee

* change the way dry works, slightly

* me oh my, i'm just a little guy

* we're just normal men
2025-01-08 22:38:27 +01:00
tobi
451803b230
[feature] Fetch + create domain permissions from subscriptions nightly (#3635)
* 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
2025-01-08 11:29:40 +01:00
kim
c013892ca2
[chore] replace statuses.updated_at column with statuses.edited_at (#3636)
* update statuses table to replace updated_at column with edited_at

* code comment

* better code comments, fix setting of status + edit + mention + poll database times

* fix log to logf call

* fix status.EditIDs not being carried over in dereferencer.encrichStatus()

* move status.EditID setting into handleStatusEdit()
2025-01-08 11:29:23 +01:00
tobi
e9bb7ddd3a
[feature] Create/update/remove domain permission subscriptions (#3623)
* [feature] Create/update/remove domain permission subscriptions

* lint

* envparsing

* remove errant fmt.Println

* create drafts, subs, exclude, from snapshot models

* name etag column correctly

* remove count column

* lint
2025-01-05 13:20:33 +01:00
Daenney
77f1e79532
[chore] Update robots.txt with more AI bots (#3634) 2025-01-03 11:46:59 +00:00
kim
29da5b35a5
[bugfix] more little edit fixes (#3633)
* fix slice size calculation

* stop attached status edit slice getting cached
2024-12-31 10:44:07 +01:00
Daenney
6b727404be
[bugfix] Advertise audio/mpeg as supported (#3632)
This will be either an mp1, mp2 or mp3 file. In practice it'll probably
be mp3, but this handles mp1 too for good measure. We don't advertise
audio/mp1 as a supported media type since best I can tell that was never
a MIME type that's been used.

This also changes the returned MIME-type for mp2 and mp3 to audio/mpeg,
to match what's expected and supported by most things nowadays.

Fixes: #3531
2024-12-28 11:02:12 +01:00
kim
0784aa3218
[bugfix] small editing tweaks (#3631)
* ensure edited_at isn't set on boost wrapper statuses

* improve handling of remote status updated_at to fix previous cases

* formatting

* add remote status published / updated field validation checks, handle appropriately in handleStatusEdit()

* specifically allowed updated to be equal to published

* only check creation date change when an existing status
2024-12-24 21:16:49 +00:00
kim
fe8d5f2307
[feature] add support for clients editing statuses and fetching status revision history (#3628)
* start adding client support for making status edits and viewing history

* modify 'freshest' freshness window to be 5s, add typeutils test for status -> api edits

* only populate the status edits when specifically requested

* start adding some simple processor status edit tests

* add test editing status but adding a poll

* test edits appropriately adding poll expiry handlers

* finish adding status edit tests

* store both new and old revision emojis in status

* add code comment

* ensure the requester's account is populated before status edits

* add code comments for status edit tests

* update status edit form swagger comments

* remove unused function

* fix status source test

* add more code comments, move media description check back to media process in status create

* fix tests, add necessary form struct tag
2024-12-23 17:54:44 +00:00
Daenney
1aa7f70660
[chore] Stub /api/v1/announcements implementation (#3630)
* [chore] Stub /api/v1/announcements implementation

This implements the /api/v1/announcements endpoint by simply returning
an empty array. This indicates there are no instance announcements.

Some clients retrieve this endpoint and get surprised by a 404. It tends
to be harmless, but results in some unnecessary logging when trying to
debug other things.

* [fix] Forgot some swagger

* [fix] Fix swagger some more
2024-12-23 16:43:50 +01:00
Daenney
9ae0c7b363
[chore] Update ncruces/go-sqlite3 to 0.21.3 (#3629)
This includes some additional locking fixes for the BSDs.
2024-12-20 21:37:19 +00:00
CDN
f78002f915
[bugfix] Load instance-wide custom css in page stylesheets template (#3601)
* [bugfix] Load instance-wide custom css in page stylesheets template

* [chore] remove redunt import
2024-12-18 10:47:17 +01:00
kim
eb77ceeed6
update gruf/go-ffmpreg to v0.6.4 (#3627) 2024-12-18 00:27:24 +00:00
kim
c953f57e55
update ncruces/go-sqlite3 to v0.21.2 (#3626) 2024-12-17 23:16:20 +00:00
kim
9697df0955
bump ncruces/go-sqlite3 to v0.21.1 (#3625) 2024-12-16 11:37:53 +00:00
kim
ec00dbd496
bump gruf/go-ffmpreg to v0.6.3 (#3624) 2024-12-16 11:36:01 +00:00
kim
8504043024
bump gruf/go-ffmpreg to v0.6.2 (#3622) 2024-12-12 22:02:20 +00:00
kim
fb12bbb10b
bump ncruces/go-sqlite3 to v0.21.0 (#3621) 2024-12-12 19:44:53 +00:00
dependabot[bot]
60acdb21a9
Bump nanoid from 3.3.7 to 5.0.9 in /web/source (#3615) 2024-12-10 10:24:31 +00:00
dependabot[bot]
fd3b1e64da
[chore] Bump nanoid from 4.0.2 to 5.0.9 in /web/source (#3614)
Bumps [nanoid](https://github.com/ai/nanoid) from 4.0.2 to 5.0.9.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/4.0.2...5.0.9)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 10:52:54 +01:00
tobi
acdd495c70
[chore] Log during potentially long migrations (#3613)
* [chore] Log during potentially long migrations

* remove unneeded log lines
2024-12-09 15:53:56 +01:00
dependabot[bot]
d9e722dea3
[chore]: Bump golang.org/x/net from 0.31.0 to 0.32.0 (#3610)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/net/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 12:18:35 +01:00
STFN
4fbe06e332
[docs] Add missing --config-path arg in backup documentation (#3607) 2024-12-09 11:40:33 +01:00
dependabot[bot]
f72e753a21
[chore]: Bump golang.org/x/image from 0.22.0 to 0.23.0 (#3608) 2024-12-09 10:38:20 +00:00
dependabot[bot]
a4e82cb7cc
[chore]: Bump golang.org/x/text from 0.20.0 to 0.21.0 (#3611)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 11:00:25 +01:00
tobi
9477fd7eba
[feature] Allow partial-word hashtags using non-breaking spaces (#3606)
* [feature] Allow partial-word hashtags using non-breaking spaces

* update docs
2024-12-08 16:03:00 +01:00
Patrycja
642f5230e6
[chore] stub /api/v1/accounts/{id}/featured_tags endpoint (#3598)
* [chore] stub /api/v1/accounts/{id}/featured_tags endpoint

* fix swagger parsing issue

---------

Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-12-08 13:47:07 +01:00
kim
23fc70f4e6
[feature] add support for receiving federated status edits (#3597)
* add support for extracting Updated field from Statusable implementers

* add support for status edits in the database, and update status dereferencer to handle them

* remove unused AdditionalInfo{}.CreatedAt

* remove unused AdditionalEmojiInfo{}.CreatedAt

* update new mention creation to use status.UpdatedAt

* remove mention.UpdatedAt, fixes related to NewULIDFromTime() change

* add migration to remove Mention{}.UpdatedAt field

* add migration to add the StatusEdit{} table

* start adding tests, add delete function for status edits

* add more of status edit migrations, fill in more of the necessary edit delete functionality

* remove unused function

* allow generating gotosocial compatible ulid via CLI with `go run ./cmd/gen-ulid`

* add StatusEdit{} test models

* fix new statusedits sql

* use model instead of table name

* actually remove the Mention.UpdatedAt field...

* fix tests now new models are added, add more status edit DB tests

* fix panic wording

* add test for deleting status edits

* don't automatically set `updated_at` field on updated statuses

* flesh out more of the dereferencer status edit tests, ensure updated at field set on outgoing AS statuses

* remove media_attachments.updated_at column

* fix up more tests, further complete the dereferencer status edit tests

* update more status serialization tests not expecting 'updated' AS property

* gah!! json serialization tests!!

* undo some gtscontext wrapping changes

* more serialization test fixing 🥲

* more test fixing, ensure the edit.status_id field is actually set 🤦

* fix status edit test

* grrr linter

* add edited_at field to apimodel status

* remove the choice of paging on the timeline public filtered test (otherwise it needs updating every time you add statuses ...)

* ensure that status.updated_at always fits chronologically

* fix more serialization tests ...

* add more code comments

* fix envparsing

* update swagger file

* properly handle media description changes during status edits

* slight formatting tweak

* code comment
2024-12-05 13:35:07 +00:00
kim
3e18d97a6e
[feature] unending polls (#3592)
* adds support for unending polls to be created locally

* remove unused argument
2024-12-04 10:35:48 +01:00
kim
79f2e85f51
[chore] bumps modernc/sqlite version to v1.34.2 on our custom fork (#3599) 2024-12-04 10:33:09 +01:00
CDN
55d6731497
[chore] Update frontend bug report issue title prefix (#3596) 2024-12-03 15:22:19 +01:00
CDN
732b03a742
[bugfix] Load instance-wide custom css unconditionally in thread details page (#3595) 2024-12-03 15:21:47 +01:00
dependabot[bot]
a597e1ed85
[chore]: Bump codeberg.org/gruf/go-ffmpreg from 0.6.0 to 0.6.1 (#3591)
Bumps codeberg.org/gruf/go-ffmpreg from 0.6.0 to 0.6.1.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-ffmpreg
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 12:54:14 +00:00
Victor Dyotte
9609c4550d
[feature] Add global instance CSS customization setting (#3352)
Allow instance admins to add custom CSS that will affect
every page of their instance.

This is done with a new CustomCSS instance setting that
works pretty much exactly like the Users CustomCSS property.
This custom CSS is then requested for every page load.
User styles/themes take precedence over this CSS.

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-12-02 12:24:48 +01:00
CDN
dce85a2b7a
[feature/themes] Add auto-switching themes for blurple/brutalist/solarized (#3588) 2024-12-02 10:50:32 +01:00
CDN
44b7bc71b6
[docs/zh] Update zh docs: synced to da4db81bcf (#3589) 2024-12-02 10:48:53 +01:00
Phil Hagelberg
dbef5ee03b
[chore] Replace Semaphore recommendation with Pinafore. (#3586)
Neither Semaphore nor Pinafore are under active development, but
Semaphore has archived its repository while Pinafore still gets
occasional minor maintenance.

Enafore has newer features, but it has accessibility bugs affecting
screen readers that prevent it from being recommended at this time.
2024-12-02 10:47:05 +01:00
dependabot[bot]
936b269b05
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.80 to 7.0.81 (#3590)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.80 to 7.0.81.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.80...v7.0.81)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 10:44:43 +01:00
kim
c9d36f7e45
[performance] use new instance of bun.DB *after* migrations to reduce number of in-memory model schema (#3578)
* use new instance of bun.DB *after* migrations to reduce number of model schema in-memory

* update sqlite address comment
2024-11-29 15:03:10 +00:00
kim
d9f67efae5
send out poll votes as separate create activities given that no other AP servers support multiple objects in a single activity (#3582) 2024-11-28 15:37:37 +00:00
kim
3cc50491c2
pulls in the latest exif-terminator version with bugfix and performance optimizations (#3583) 2024-11-28 15:14:49 +00:00
kim
312cb8b9c7
[chore] rename New___(string) int signature functions to Parse___(string) int (#3580)
* rename New___(string) int {} signature functions to Parse___(string) int {}

* remove test output
2024-11-28 12:54:22 +01:00
tobi
65917f5bb9
[bugfix] Log + ignore unknown notification types (#3577)
* [bugfix] Log + ignore unknown notification types

* pass context to ParseNotificationTypes
2024-11-27 17:22:45 +00:00
kim
61f8f1e0e3
pull in ncruces/go-sqlite3 v0.20.3 with tetratelabs/wazero v1.8.2 (#3574) 2024-11-26 16:25:48 +00:00
Vyr Cossont
6a8af42647
[bugfix] Allow unsetting filter expiration dates (#3560)
* Regression tests for #3497 (v1 and v2)
* use Nullable type for v2 form.expires_in

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-11-26 08:23:00 -08:00
tobi
5c818debb2
[chore] Sign the bloody thing, fix the other bloody thing (#3572) 2024-11-25 18:21:19 +01:00
kim
3fceb5fc1a
bumps uptrace/bun dependencies to v1.2.6 (#3569) 2024-11-25 15:42:37 +00:00
kim
a444adee97
[bugfix] notification types missing from link header (#3571)
* ensure notification types get included in link header query for notifications

* fix type query keys
2024-11-25 15:33:21 +00:00
tobi
c454b1b488
[chore] Bump tooling versions, bump go -> v1.23.0 (#3258)
* [chore] Bump tooling versions, bump go -> v1.23.0

* undo silly change

* sign

* bump go version in go.mod

* allow overflow in imaging

* goreleaser deprecation notices

* bump versions

* undo accidental rebase change

* update container versions to just use latest major version

* update swagger to our release with go1.23 fix

* update goreleaser to use our vendored swagger version

---------

Co-authored-by: kim <grufwub@gmail.com>
2024-11-25 16:15:33 +01:00
VirtualWolf
da4db81bcf
[docs] Added note to documentation about mutuals-only posts not being functional. (#3557) 2024-11-25 14:50:41 +01:00
kim
cac9d65029
[performance] convert enum strings to ints (#3558)
* convert statuses.visibility and notifications.notification_type columns from type string -> int for performance / space savings

* fix test trying to compare string to int

* fix instance count query using string literal instead of gtsmodel const type

* ensure a default value is always set

* also migrate the account settings and sin bin status tables

* initialize maps outside loops and place into singular enum mapping creation func

* use int16 for enum types

* update sinbinstatus creation to be from a snapshot at initial creation

* add snapshot of poll type at creation time
2024-11-25 14:48:59 +01:00
dependabot[bot]
934e895ec0
[chore]: Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#3564)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 11:14:48 +00:00
Daenney
2ed409888b
[chore] Update gorilla/websocket (#3561)
The maintainers messed with the v1.5.2 tag which causes Go checksum
validation problems as the Go module proxy saw and recorded the original
hash.

This updates to 1.5.3 which doesn't have the issue.
2024-11-25 10:50:03 +00:00
dependabot[bot]
ae1a98558a
[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.1 to 2.21.2 (#3567)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.21.1...v2.21.2)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 10:45:54 +00:00
tobi
301543616b
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes

* fix typescript complaining

* lint

* make filenames more consistent

* test own domain excluded
2024-11-21 13:09:58 +00:00
tobi
c2029df9bc
[feature] Allow emoji shortcode to be 1-character length (#3556)
* [feature] Allow emoji shortcode to be 1-character length

* testerino fixeroni

* spaghet
2024-11-21 12:13:55 +01:00
dependabot[bot]
daf55ba6a5
[chore] Bump cross-spawn from 7.0.3 to 7.0.6 in /web/source (#3552)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 11:06:41 +01:00
Jannis
9ace025da1
[bugfix] post counters should not include direct messages (#3554)
* [bugfix] post counters should not include direct messages #3504

The fix is relativly simple, it just adds a line to the relevant
function which excludes all private posts.

* Formating fix

* mb
2024-11-21 11:06:06 +01:00
Thomas Karpiniec
ffa67ac1ae
[docs] Include link to a live instance in README (#3549) 2024-11-19 15:37:32 +00:00
dependabot[bot]
e892bc375d
[chore]: Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 (#3537)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.23.0 to 0.24.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 17:47:01 +00:00
dependabot[bot]
d850248891
[chore]: Bump golang.org/x/image from 0.21.0 to 0.22.0 (#3533)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/image/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 16:38:27 +00:00
kim
aeacbe3962
[chore] pin otel library versions (#3538)
* pin otel library versions to v1.29.0

* bump otel deps to v1.32.0 (without actually bumping, hehe)
2024-11-11 16:38:19 +00:00
Daenney
58f916e821
docs: Clarify object store configuration (#3527)
Clarify what to (not) put in `s3-storage-endpoint`
2024-11-11 15:54:42 +00:00
kim
e3c2b790fd
[performance] minimise log field allocations (#3529)
* when appending log field only do so by minimal amount

* move slice utils to separate package to fix import cycle, add GrowJust() and AppendJust() functions

* fix GrowJust() not returning slice of same length

* improved xslices tests

* make AppendJust() test check for slice contents, fix AppendJust() final copying behaviour

* add a +1 with field growth to try minimise allocation for log 'msg' field
2024-11-11 15:45:19 +00:00
dependabot[bot]
98eef328ea
[chore]: Bump golang.org/x/net from 0.30.0 to 0.31.0 (#3536)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/net/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 15:15:24 +00:00
kim
29007b1b88
[chore] update bun libraries to v1.2.5 (#3528)
* update bun libraries to v1.2.5

* pin old v1.29.0 of otel
2024-11-08 13:51:23 +00:00
kim
45e1609377
bump ncruces/go-sqlite3 to v0.20.2 (#3524) 2024-11-07 00:16:28 +00:00
kim
b84637801a
[chore] update go ffmpreg to v0.6.0 (#3515)
* pull in go-ffmpreg v0.6.0

* add code comment

* grrr linter

* set empty module name when calling ffmpeg / ffprobe
2024-11-06 14:38:13 +01:00
kim
6f4cb2f14e
[bugfix] sets the max value placeholders to MaxInt32 instead of MaxInt (#3517)
* sets the max value placeholders to MaxInt32 instead of MaxInt

* update tests
2024-11-05 22:16:06 +00:00
tobi
e855a0288b
[chore] update docs assets path (#3514) 2024-11-05 14:56:37 +01:00
CDN
38a08cd25a
[docs] add zh docs (#3507)
* [docs] add zh docs

* [docs] add lang dropdown

* [docs] update mkdocs zh config

* [docs] migrate assets

* [docs] update overrides dir in mkdocs zh config

* [docs] exclude locales director in main mkdocs config

* [docs] rename assets to public to avoid conflicting with template

* [docs] extra_css change followup

* [docs] add theme.palette.toggle.icon back into mkdocs zh config

* [docs] fix zh readme reference + migrate language-specific repo markdown to docs

* [docs] translate remaining repo docs + update reference

* [docs] update zh index.md reference

* [docs/zh] wording alignment
2024-11-05 14:36:43 +01:00
tobi
e953d80dff
[bugfix] Fix setting immediate expires_at value on filter endpoints (#3513)
* [bugfix] Fix setting immediate `expires_at` value on filter endpoints

* update wording

* update wording

* oh my
2024-11-05 13:29:51 +01:00
kim
53aaeb18d4
previously we were using the ffmpeg runner for ffprobe 🤦 (#3512) 2024-11-05 10:50:56 +00:00
kim
f3b2eca8b8
[feature] add support for hinting via api/v_/instance preferred image / video max sizes (#3505)
* add support for hinting via api/v_/instance endpoints a preferred image / video size limit

* fix tests expecting old default values
2024-11-04 15:00:10 +01:00
kim
8f288f1689
[bugfix] determine mime-type to use during ffprobe evaluation stage, don't bother checking against file extension (#3506)
* determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension

* set mjpeg content-type

* fix up tests expecting differing default values
2024-11-04 14:58:15 +01:00
dependabot[bot]
d2820a1470
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.79 to 7.0.80 (#3511)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.79 to 7.0.80.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.79...v7.0.80)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 12:03:54 +01:00
Jim Tittsler
17fdce268c
[docs] Fix typos (#3498) 2024-11-03 11:16:48 +01:00
Sqx. Flann van der Eik
49eb8f602e
[chore] Fix minor typo in About template (#3502) 2024-10-31 00:26:26 +01:00
Markus Unterwaditzer
cad76b8a25
[docs] Clarify what Visibility Level means (#3500)
* Clarify what Visibility Level means

* attempt to rephrase a bunch more for consistency
2024-10-30 15:28:07 +01:00
dependabot[bot]
3b037d165c
[chore] Bump elliptic from 6.5.7 to 6.6.0 in /web/source (#3495)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.0.
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-29 15:36:49 +01:00
dependabot[bot]
c8647f701c
[chore] Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /web/source (#3481)
Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 22:28:03 +01:00
dependabot[bot]
1954ccba50
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.78 to 7.0.79 (#3488)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.78 to 7.0.79.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.78...v7.0.79)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 14:44:04 +01:00
kim
7ec6509e11
[bugfix] support classifying correct video codec without audio as webm (#3494)
* for webm support video:[vp8,vp9,av1] and audio:[NONE,vorbis,opus]

* improved unsupported data type error output
2024-10-28 14:09:21 +01:00
kim
e86592bc32
[chore] pull in go-ffmpreg v0.4.1 (#3485)
* pull in go-ffmpreg v0.4.1

* bring back GTS_WAZERO_COMPILATION_CACHE
2024-10-28 10:55:48 +00:00
dependabot[bot]
8f4a96c7cd
[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.0 to 2.21.1 (#3489)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.0 to 2.21.1.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.21.0...v2.21.1)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 10:07:58 +00:00
kim
51cb6cae16
update go-sqlite3 => v0.20.0 (#3483) 2024-10-25 16:09:18 +00:00
kim
d8a83860bc
[bugfix] incorrect /api/v_/instance domain uri fields (#3477)
* update instance v1 / v2 endpoints to set uri / domain correctly (i.e. account domain)

* fix tests relying on old instance behaviour
2024-10-22 14:47:28 +00:00
tobi
8a93300ac4
[feature] Add image descriptions for default avatar + header; don't allow editing default desc (#3473) 2024-10-21 14:04:50 +02:00
dependabot[bot]
e9299e1174
[chore]: Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#3469)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 11:40:19 +02:00
dependabot[bot]
f301ec65f1
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.37 to 2.21.0 (#3468)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.37 to 2.21.0.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.20.37...v2.21.0)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 11:39:43 +02:00
dependabot[bot]
ea1bf5f8a3
[chore]: Bump github.com/yuin/goldmark from 1.7.6 to 1.7.8 (#3470)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.6 to 1.7.8.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.6...v1.7.8)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 11:37:00 +02:00
tobi
fab7d17031
[bugfix] Fix filter title unique constraint (#3458) 2024-10-19 11:04:07 +02:00
tobi
0d0314b98d
[chore] Fix loop issue in streaming 🤦 (#3457) 2024-10-18 16:57:50 +02:00
tobi
602c858379
[chore] Thumbnail only first frame of animated media (#3448) 2024-10-18 15:44:08 +02:00
tobi
ffc86f9092
[bugfix] Fix occasionally streaming empty messages (#3456) 2024-10-18 15:43:09 +02:00
Daenney
9f6a1f7e79
[chore] Set some additional git attributes (#3454)
* .go files are now tagged with diff=go for better diffs
* go.sum is tagged with generated which suppresses the diff
* go.sum is tagged with merge=ours to reduce merge conflicts

go.mod isn't tagged with generated since it's useful to see it on
dependency bump PRs.
2024-10-17 16:24:03 +00:00
Sqx. Flann van der Eik
2a437685fc
[docs/bugfix] Fix access to /dev and /tmp in AppArmor profile (#3444) 2024-10-16 14:34:08 +02:00
Markus Unterwaditzer
a48cce82b9
[chore] Upgrade golangci-lint, ignore existing int overflow warnings (#3420)
* [chore] Bump tooling versions, bump go -> v1.23.0

* undo silly change

* sign

* bump go version in go.mod

* allow overflow in imaging

* goreleaser deprecation notices

* [chore] Upgrade golangci-lint, ignore existing int overflow warnings

There is a new lint for unchecked int casts. Integer overflows are bad,
but the old code that triggers this lint seems to be perfectly fine.
Instead of disabling the lint entirely for new code as well, grandfather
in existing code.

* fix golangci-lint documentation link

* revert unrelated changes

* revert another unrelated change

* get rid of remaining nolint:gosec

* swagger updates

* apply review feedback

* fix wrong formatting specifier thing

* fix the linter for real

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-10-16 14:13:58 +02:00
tobi
3e8c4951e1
[docs] remove duplicate entry from supported platforms (#3442) 2024-10-15 13:37:16 +02:00
kim
3ad49f7718
updates exported interface types to match ncruces/go-sqlite3/driver methods (#3440) 2024-10-14 20:28:59 +00:00
tobi
4fcea3d6ae
[chore] Hopefully final tweak to changelog generation (#3437) 2024-10-14 16:02:16 +02:00
tobi
400fd8c62b
[docs] Document experimental, unsupported nowasm tag (#3436)
* [docs] Document experimental, unsupported `nowasm` tag

* change some awkward wording
2024-10-14 14:06:19 +02:00
kim
6a76b9d609
[feature/OFFICIALLY UNSUPPORTED] add nowasm build tag to disable building with WebAssembly (#3429)
* add experimental build-tag 'nowasm' which uses local ffmpeg / ffprobe

* updated experimental support message

* add comment to build script explaining build tag

* add nowasm build tags to moderncsqlite files
2024-10-14 11:59:12 +02:00
dependabot[bot]
157ee3193d
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.77 to 7.0.78 (#3431)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.77 to 7.0.78.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.77...v7.0.78)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 11:46:02 +02:00
dependabot[bot]
be3b8076ca
[chore]: Bump github.com/yuin/goldmark from 1.7.4 to 1.7.6 (#3430)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.4 to 1.7.6.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.4...v1.7.6)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 11:43:44 +02:00
tobi
020da28daa
[chore] Clarify supported platforms, add notes + docs (#3427)
* [chore] Don't build for OpenBSD, add support level notes + tips

* tweak a bit

* add supported platforms matrix
2024-10-14 11:41:55 +02:00
kim
2076f7d85f
[feature] for an sqlite database with journal mode != WAL, use maximum of 1 open conn (#3428) 2024-10-14 00:19:52 +02:00
tobi
096767bb3b
[chore/docs] Add /gotosocial/.cache to Docker container, document GTS_WAZERO_COMPILATION_CACHE (#3425)
* [chore/docs] Add `/gotosocial/.cache` to Docker container, document `GTS_WAZERO_COMPILATION_CACHE`

* update wazero artifact size guesstimate
2024-10-13 19:51:31 +00:00
Cy Pokhrel
3f68e13dc7
[docs] fix httpsig repo typo (#3426) 2024-10-13 21:44:18 +02:00
tobi
86fb00da10
[chore] Ensure current tag not set as GORELEASER_PREVIOUS_TAG (#3424)
* [chore] Ensure current tag not set as `GORELEASER_PREVIOUS_TAG`

* tweak tweak
2024-10-13 14:53:35 +02:00
tobi
ab1cb12057
[chore/bugfix] goreleaser make previous_tag cmd busybox-compatible (#3423)
* [chore/bugfix] goreleaser make previous_tag cmd busybox-compatible

* Please muy lorde
2024-10-12 16:54:37 +02:00
tobi
4716840c4e
[chore] goreleaser - use custom previous tag (#3422) 2024-10-12 16:26:21 +02:00
tobi
c77faee057
[chore] Update goreleaser, add release notes template (#3421) 2024-10-12 14:01:57 +00:00
Markus Unterwaditzer
95a316236e
[bugfix] Account.last_status_at is a date, not datetime (#3419)
* [bugfix] Account.last_status_at is a date, not datetime

Fix #3418

* update swagger
2024-10-12 10:02:26 +02:00
tobi
77d755e330
[chore] Don't cc Accept of likes to followers (#3417) 2024-10-11 15:22:05 +02:00
tobi
1c895f314c
[bugfix] Check interaction policies properly on incoming Likes (#3416) 2024-10-11 15:21:56 +02:00
tobi
cb9008fb41
[bugfix] Ensure pending_approval set on statuses + status faves (#3415)
* [bugfix] Ensure pending_approval set on statuses + status faves

* set PendingApproval on boosts

* assume not pending approval
2024-10-11 15:21:45 +02:00
tobi
a504d8a105
[chore] Create modernc sqlite builds alongside default wasm; add openbsd builds (#3413) 2024-10-10 16:15:02 +00:00
tobi
a69142a403
[bugfix/frontend] Don't show replies to hidden parents; return 404 if no "main" thread (#3411) 2024-10-09 12:33:53 +02:00
tobi
1bc59a0a33
[bugfix] Add missing </a> on about page (#3410) 2024-10-09 11:46:43 +02:00
tobi
e8fd40f3ca
[bugfix] Fix replies not being stored pending approval (#3409) 2024-10-09 11:02:10 +02:00
kim
2c3f1f4ddb
[chore] update go-sqlite3 to v0.19.0 (#3406) 2024-10-08 11:15:09 +02:00
tobi
1e421cb912
[feature] Distribute + ingest Accepts to followers (#3404) 2024-10-08 08:51:13 +00:00
dependabot[bot]
99f535f99b
[chore]: Bump golang.org/x/image from 0.20.0 to 0.21.0 (#3399) 2024-10-07 12:25:52 +00:00
dependabot[bot]
33bd97a535
[chore]: Bump golang.org/x/net from 0.29.0 to 0.30.0 (#3402) 2024-10-07 12:02:26 +00:00
kim
bd1866ad8a
update go-ffmpreg to v0.3.1 (pulls in latest wazero too) (#3398) 2024-10-06 20:53:03 +00:00
tobi
02470db5f6
[chore/themes] Tweak colors on new themes (#3397) 2024-10-06 13:05:13 +02:00
tobi
c023bd30f3
[bugfix] Only allow boosting post from non-interaction-policy-aware instance if public or unlisted (#3396) 2024-10-05 19:15:02 +02:00
tobi
18e2f69e85
[bugfix] Return 501 (not implemented) if user tries to schedule post (#3395) 2024-10-05 19:14:53 +02:00
tobi
f0376635ad
[chore] Change order of error checking after PostInbox (#3394)
Check for malformed errors embedded inside error *first*, then check for gtserror.WithCode.
2024-10-05 17:08:42 +02:00
tobi
5c055afa08
[feature/frontend] Add Moonlight hunt theme (#3393)
* [feature/frontend] Add Moonlight Hunt theme

* make almost see through a bit less see through

* update
2024-10-05 15:12:40 +02:00
tobi
c33b1e89c1
[bugfix] Update select of pending interaction requests to account for potential nil URI (#3392) 2024-10-05 12:27:53 +02:00
tobi
36abd568b1
[docs] Make protocol config option really explicit (#3391) 2024-10-05 12:09:58 +02:00
tobi
37a3d224a7
[bugfix] Account for nil reply when serializing int req (#3389) 2024-10-05 11:36:01 +02:00
tobi
d3d6e3f920
[bugfix] Don't try to add nil filtered statuses to context (#3388) 2024-10-04 19:23:18 +02:00
tobi
8bd8c6fb45
[bugfix] Include own account in conversation when no other accounts involved (#3387) 2024-10-04 19:22:52 +02:00
kim
f550f596fa
[performance] remove the pragma optimize analysis limit on connection close (#3386) 2024-10-04 19:05:42 +02:00
cui fliter
23b6d2cc64
fix: fix slice init length (#3382) 2024-10-03 17:22:26 +00:00
tobi
3f7dc10449
[docs] Update smtp docs to mention starttls + port 587 (#3378)
* [docs] Update smtp docs to mention starttls + port 587

* remove misleading ssl bit

* further tweaks
2024-10-02 10:59:29 +00:00
kim
c17abea921
update go-structr to v0.8.11 (#3380) 2024-10-02 10:58:20 +00:00
dependabot[bot]
e3019eada4
[chore]: Bump go.uber.org/automaxprocs from 1.5.3 to 1.6.0 (#3376)
Bumps [go.uber.org/automaxprocs](https://github.com/uber-go/automaxprocs) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/uber-go/automaxprocs/releases)
- [Changelog](https://github.com/uber-go/automaxprocs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/automaxprocs/compare/v1.5.3...v1.6.0)

---
updated-dependencies:
- dependency-name: go.uber.org/automaxprocs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 12:58:44 +02:00
dependabot[bot]
188d28f054
[chore]: Bump github.com/ncruces/go-sqlite3 from 0.18.3 to 0.18.4 (#3375)
Bumps [github.com/ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) from 0.18.3 to 0.18.4.
- [Release notes](https://github.com/ncruces/go-sqlite3/releases)
- [Commits](https://github.com/ncruces/go-sqlite3/compare/v0.18.3...v0.18.4)

---
updated-dependencies:
- dependency-name: github.com/ncruces/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 12:46:23 +02:00
tobi
43e443f9f3
[bugfix] Carry-over "PinnedAt" when refreshing status (#3373) 2024-09-29 14:46:52 +02:00
kim
095663f5cc
[bugfix] visibility after implicit approval not getting invalidated (#3370)
* replicate issue

* update go-structr to v0.8.10 with internal linked-list fix, small tweaks to caching of interaction requests

* remove debug function

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-09-28 22:47:46 +02:00
kim
18b7e00fef
[chore] use string formatting package agnostic way of printing request attempts ptr (#3371) 2024-09-28 22:47:27 +02:00
Daenney
504b3a9162
[docs] Don't run SQLite on networked storage (#3369)
* [docs] Don't run SQLite on networked storage

This updates our documentation to include warnings against running
SQLite on networked storage.

It also slightly reorganises and consolidates some admonitions on the
Getting Started page because it was getting a bit too busy with repeated
information.

* [docs] Reword a few things
2024-09-28 22:45:43 +02:00
tobi
7978d88a01
[chore] Update apparmor example file (#3368) 2024-09-28 16:58:39 +02:00
kim
3f9a1dbfff
update modernc/sqlite to v1.33.1 (with our concurrency workaround) (#3367) 2024-09-27 22:53:36 +00:00
kim
6f3583559f
[bugfix] better handle ogg container format (#3365) 2024-09-27 13:16:34 +02:00
kim
497ebd8c4e
[bugfix] fix media limit reader check (#3363)
* return nicer errors for frontend when media / emoji upload limit reached

* fix reader limit check

* add code comment
2024-09-27 13:15:53 +02:00
tobi
c1c8849322
[chore] final bits of fiddling with solarized (#3364)
* [chore] final bits of fiddling with solarized

* block quote
2024-09-27 13:14:47 +02:00
kim
2f582e2e33
update gruf / {go-cache, go-maps, go-kv} (#3361) 2024-09-27 10:26:50 +00:00
kim
58af95a1d5
[chore] bump go-byteutil v1.2.0 -> v1.3.0 (#3356)
* bump go-byteutil v1.2.0 -> v1.3.0 which has safer (as in long-term API consistency) byte <-> string conversions

* fix test relying on byteutil exported type no longer existing
2024-09-26 19:50:08 +00:00
kim
f3e2d36d64
[chore] update go-sched pkg (#3357)
* update go-sched to v1.2.4 which removes some now unused dependencies

* whoops, remove test output
2024-09-26 19:23:41 +00:00
tobi
82b9515a9d
[chore] Fix some contrast issues in themes; performance tweaks (#3358) 2024-09-26 17:00:13 +02:00
kim
53ee6aef08
[bugfix] s3 media uploaded without content-type (#3353)
* update go-storage dependency, for S3Storage manually call PutObject() so we can set content-type

* update calls to PutFile() to include the contentType
2024-09-26 14:43:10 +02:00
kim
b0fbc327f0
[chore] reduce number admin process workers (#3354) 2024-09-26 09:40:49 +02:00
tobi
713e73300c
[bugfix] Fix incorrect reply shown in interaction request (#3344) 2024-09-24 17:28:46 +00:00
tobi
de72855790
[chore] Roll otel deps back to v1.29.0 / v0.51.0 (#3337) 2024-09-24 12:26:26 +02:00
tobi
e59d2384e8
[chore/docs] More little tweaks (#3336)
* [chore/docs] More little tweaks

* width

* rule between theme figures (looks better on gh)

* weee
2024-09-23 18:53:33 +02:00
kim
dc4059e9a2
[bugfix] add support for media with rotation contained in stream side data (#3335)
* add support for media with embedded rotation data in stream side data list

* *grumble grumble* linter
2024-09-23 15:13:01 +00:00
tobi
9c1dfd093d
[docs] Add rainforest theme to readme.md (#3334) 2024-09-23 16:58:11 +02:00
tobi
459f925391
[docs] Update readme alpha -> beta, add more feature examples (#3333) 2024-09-23 16:41:57 +02:00
tobi
5bd6ad68e6
[bugfix/email] Don't use plainAuth when no smtp username/password provided (#3332)
* Do not use plainAuth when no user or password. Fixes #3320

* formatting

---------

Co-authored-by: Yonas Yanfa <yonas.y@gmail.com>
2024-09-23 16:07:13 +02:00
tobi
1ce854358d
[feature] Show info for pending replies, allow implicit accept of pending replies (#3322)
* [feature] Allow implicit accept of pending replies

* update wording
2024-09-23 14:42:19 +02:00
kim
2f13b72e2e
[chore] add nometrics build tagging to metrics API endpoint (#3331)
* add nometrics API endpoint code, to ensure prometheus NEVER compiled in unless wanted

* whoops, fix build tagging
2024-09-23 12:01:12 +00:00
kim
4592e29087
[chore] local instance count query caching, improved status context endpoint logging, don't log ErrHideStatus when timelining (#3330)
* ensure that errors checking status visibility / converting aren't dropped

* add some more context to error messages

* include calling function name in log entries

* don't error on timelining hidden status

* further code to ignore statusfilter.ErrHideStatus type errors

* remove unused error type

* add local instance status / domain / user counts

* add checks for localhost

* rename from InstanceCounts to LocalInstance

* improved code comment
2024-09-23 11:53:42 +00:00
kim
964262b169
[chore] header filter improvements (#3329)
* add error message to gin context on header blocked or not allowed

* remove the unused header filter tracking code (leaving OTEL TODOs in place)

* appease the linter
2024-09-23 11:36:56 +00:00
dependabot[bot]
862cc9e3c4
[chore]: Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4 (#3327)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 10:40:01 +02:00
tobi
4f8f6d9dac
[chore/frontend] Tweak blockquote formatting (#3326) 2024-09-21 18:36:32 +02:00
tobi
3edfc7eeef
[feature/frontend] Add solarized light + dark themes (#3325) 2024-09-21 15:43:22 +02:00
kim
77b095a8c3
[chore] ensure consistent caller name fetching regardless of compiler inlining (#3323)
* move logging levels into log package itself

* ensure inconsistent inlining doesn't mess with log calling function name

* remove unused global variable

* fix log level
2024-09-20 13:30:33 +00:00
tobi
747c251df6
[chore/frontend] Make ecks pee theme even more ecks pee er (#3324) 2024-09-20 15:24:15 +02:00
tobi
c378ad2bb3
[feature] Allow users to submit interaction_policy on new statuses (#3314)
* [feature] Parse `interaction_policy` on status submission

* beep boop

* swagger? i barely know er
2024-09-18 16:35:35 +00:00
tobi
f819229988
[chore] make csv export ordering determinate (#3318) 2024-09-18 10:23:28 +00:00
tobi
2f56455eed
[chore/frontend] Tweak status styling a little (#3317) 2024-09-18 11:51:12 +02:00
kim
8effc77788
[chore] improved federatingdb logging in cases of unknown iri / types (#3313)
* improved federatingdb logging in cases of unknown iri / types, add new log methods

* whoops; forgot to wrap log argument in serialize{} !

* use debug instead of warn level

* switch last entry to Debug
2024-09-17 21:35:47 +02:00
tobi
e337aa83b8
[bugfix] Fix pending approval check (#3316) 2024-09-17 21:35:13 +02:00
tobi
95614fb298
[bugfix] Fix incorrect policy value parsing (#3315) 2024-09-17 21:22:45 +02:00
tobi
4bd5e68b2b
[bugfix] Ensure id set on outgoing Reject + Accept (#3312) 2024-09-16 22:41:04 +02:00
tobi
d4d6631435
[bugfix] Be more lenient when parsing mastodown following.csv (#3311)
* [bugfix] Be more lenient when parsing mastodown following.csv

* use follow.Notify
2024-09-16 20:39:15 +02:00
kim
84279f6a6a
[performance] cache more database calls, reduce required database calls overall (#3290)
* improvements to caching for lists and relationship to accounts / follows

* fix nil panic in AddToList()

* ensure list related caches are correctly invalidated

* ensure returned ID lists are ordered correctly

* bump go-structr to v0.8.9 (returns early if zero uncached keys to be loaded)

* remove zero checks in uncached key load functions (go-structr now handles this)

* fix issues after rebase on upstream/main

* update the expected return order of CSV exports (since list entries are now down by entry creation date)

* rename some funcs, allow deleting list entries for multiple follow IDs at a time, fix up more tests

* use returning statements on delete to get cache invalidation info

* fixes to recent database delete changes

* fix broken list entries delete sql

* remove unused db function

* update remainder of delete functions to behave in similar way, some other small tweaks

* fix delete user sql, allow returning on err no entries

* uncomment + fix list database tests

* update remaining list tests

* update envparsing test

* add comments to each specific key being invalidated

* add more cache invalidation explanatory comments

* whoops; actually delete poll votes from database in the DeletePollByID() func

* remove added but-commented-out field

* improved comment regarding paging being disabled

* make cache invalidation comments match what's actually happening

* fix up delete query comments to match what is happening

* rename function to read a bit better

* don't use ErrNoEntries on delete when not needed (it's only needed for a RETURNING call)

* update function name in test

* move list exclusivity check to AFTER eligibility check. use log.Panic() instead of panic()

* use the poll_id column in poll_votes for selecting votes in poll ID

* fix function name
2024-09-16 16:46:09 +00:00
tobi
0567b319c6
[chore] Refactor federatingDB.Undo, avoid 500 errors on Undo Like (#3310) 2024-09-16 15:49:40 +00:00
tobi
71261c62c2
[chore] Reject replies to rejected replies (#3291)
* [chore] Reject replies to rejected replies

* tweak

* don't set URI for implicit Rejects
2024-09-16 14:08:42 +02:00
tobi
efd1a4f717
[bugfix] Use better plaintext representation of status for filtering (#3301)
* [bugfix] Use better plaintext representation of status for filtering

* add new deps to readme

* lint

* update tests

* update regexes

* address review comments

* remove now unused xxhash

* whoops, wrong logger

* Merge branch 'main' into status_filtering_bugfix

* put cache in caches struct

* pain
2024-09-16 14:00:23 +02:00
kim
6dd936fbe1
[bugfix/chore] Always set the status sensitive if media + content-warning present (#3308)
* always set the status sensitive flag to true if it has a content-warning with media

* whoops use attachment ids instead of mention ids ... 🤦
2024-09-16 13:38:12 +02:00
tobi
b2572b9e07
[chore] Bump otel deps -> v1.30.0/v0.52.0 (#3307) 2024-09-16 09:06:00 +00:00
dependabot[bot]
9046220979
[chore]: Bump golang.org/x/net from 0.28.0 to 0.29.0 (#3303)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.28.0 to 0.29.0.
- [Commits](https://github.com/golang/net/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 09:27:05 +02:00
dependabot[bot]
ca729aa4a0
[chore]: Bump github.com/jackc/pgx/v5 from 5.6.0 to 5.7.1 (#3302)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.6.0 to 5.7.1.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.6.0...v5.7.1)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 09:26:41 +02:00
Vyr Cossont
f3311d6273
[bugfix] Hoist filterable text field extraction out of loop (#3297)
This doesn't change within the loop, so there's no point in repeating it.
2024-09-15 10:42:04 +02:00
Daenney
4fa0d41202
[chore] Update go-sqlite3 to 0.18.3 (#3295)
* [chore] Update go-sqlite3 to 0.18.3

* [chore] Fix getting the sqlite3.Conn
2024-09-14 16:36:25 +02:00
tobi
486852fb38
[feature/frontend] Add dark version of brutalist theme (#3294) 2024-09-14 16:09:59 +02:00
tobi
0c374d9864
[chore] Fix import/export links on settings panel (#3292) 2024-09-13 14:25:45 +02:00
tobi
20fe430ef9
[bugfix] Update home timeline query to ignore exclusive list entries (#3289)
* [bugfix] Update home timeline query to ignore exclusive list entries

* a
2024-09-11 10:55:25 +00:00
kim
d842069985
[docs/chore] update list of library deps on readme (#3288) 2024-09-11 10:59:55 +02:00
kim
6c0bd0e20e
update go-ffmpreg v0.2.5 -> v0.2.6 (#3287) 2024-09-10 19:10:19 +00:00
tobi
307d98e386
[feature] Process Reject of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271)
* [feature] Process `Reject` of interaction via fedi API, put rejected statuses in the "sin bin"

* update test

* move nil check back to `rejectStatusIRI`
2024-09-10 12:34:49 +00:00
kim
3254ef1923
[chore] status dereferencing improvements (#3255)
* search for mentions also by username,domain in status deref, handle deleted statuses in enrichStatusSafely()

* return d.enrichStatusSafely() directly
2024-09-10 12:33:32 +00:00
Vyr Cossont
540edef0c2
[feature] Implement exclusive lists (#3280)
Fixes #2616
2024-09-09 15:56:58 -07:00
tobi
5543fd5340
[feature/frontend] Add options to include Unlisted posts or hide all posts (#3272)
* [feature/frontend] Add options to include Unlisted posts or hide all posts

* finish up

* swagger

* move invalidate call into bundb package, avoid invalidating if not necessary

* rename show_web_statuses => web_visibility

* don't use ptr for webvisibility

* last bits
2024-09-09 18:07:25 +02:00
dependabot[bot]
7785fa54da
[chore]: Bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#3283) 2024-09-09 08:24:38 +00:00
dependabot[bot]
f3eebfcf80
[chore]: Bump golang.org/x/oauth2 from 0.22.0 to 0.23.0 (#3284) 2024-09-09 08:08:49 +00:00
Vyr Cossont
100d660797
[bugfix] Swagger: add missing filter_action param for v2 filter PUT (#3281) 2024-09-09 09:52:49 +02:00
dependabot[bot]
0595c83188
[chore]: Bump golang.org/x/image from 0.19.0 to 0.20.0 (#3285)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.19.0 to 0.20.0.
- [Commits](https://github.com/golang/image/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 09:51:48 +02:00
dependabot[bot]
6c0db21821
[chore]: Bump golang.org/x/text from 0.17.0 to 0.18.0 (#3286)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.17.0 to 0.18.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 09:51:35 +02:00
dependabot[bot]
1649bfbee2
[chore]: Bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3 (#3282)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 09:51:21 +02:00
tobi
b17010cf17
[bugfix] Fix temp table deletion causing runaway allocations (#3278)
* [bugfix] Fix temp table deletion causing runaway allocations

* move some vars around

* small fixes

* rely on conn max age to recycle temp tables

* fackin' ell m8
2024-09-08 16:14:56 +02:00
tobi
edbcf0fa6d
[chore] Change ecks pee font size to large (#3276) 2024-09-07 19:20:47 +02:00
tobi
3d0d048a01
[feature/frontend] Add brutalist b&w theme (#3275) 2024-09-07 18:59:58 +02:00
tobi
40dffb858d
[feature/frontend] ecks pee theme (#3274) 2024-09-07 18:59:41 +02:00
Daenney
0e2ee857ac
[chore] More AI blocking (#3273) 2024-09-07 17:21:36 +02:00
kim
6ee540a503
fix new processing media / emoji not being added to dereferencer maps (#3269) 2024-09-03 13:30:41 +00:00
tobi
7b7659f1fa
[chore/performance] Further reduce nil uncached queries (#3267)
* [chore/performance] Further reduce nil uncached queries

* more checks
2024-09-02 18:15:12 +02:00
tobi
0560c5ce89
[chore] Don't try to select zero uncached filters (#3266) 2024-09-02 17:13:54 +02:00
tobi
25a815a8a4
[chore/performance] Avoid unnecessary "uncached" queries (#3265)
* [chore/performance] Avoid unnecessary "uncached" queries

* go fmt
2024-09-02 14:00:17 +02:00
dependabot[bot]
f924297af1
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.75 to 7.0.76 (#3262)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.75 to 7.0.76.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.75...v7.0.76)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:08:54 +02:00
kim
0a1555521d
[performance] use single-threaded image transforms (#3252)
* use single-threaded image resizing in native code so we have more control over goroutines

* implement parallel-free versions of image transform functions also

* remove debug code
2024-08-31 10:41:38 +02:00
tobi
88a81fbcaf
[chore] Close copied request body in SignDelivery (#3254) 2024-08-30 17:00:55 +00:00
Daenney
1e0c858a05
[chore] Upgrade ncruces/go-sqlite3 to v0.18.1 (#3253)
Contains a fix for locking behaviour on the BSDs.
2024-08-30 17:02:24 +02:00
tobi
cd93a5baf3
[security] Implement allowFiles fs for better isolation of ffmpeg / ffprobe (#3251)
* [chore] Implement readOneFile fs

* further isolation

* remove fmt call

* tweaks
2024-08-30 14:03:59 +02:00
tobi
e10aa76612
[chore] Only call imaging.Resize when necessary, use even tinier blurhashes (#3247)
* [chore] Use `imaging.Fit`, use even tinier blurhashes

* avoid calling resize if not necessary

* update blurhashes + thumb
2024-08-29 17:43:14 +02:00
Daenney
277b043633
[chore] Update robots.txt with more AI scrapers (#3248) 2024-08-29 17:42:48 +02:00
tobi
1f3dfbf10c
[bugfix/frontend] Fix TypeError: gtsError is undefined (#3245) 2024-08-27 12:39:26 +02:00
tobi
2db5a51582
[chore/frontend] Present themes as dropdown instead of radio (#3244) 2024-08-27 12:16:45 +02:00
tobi
8a34e4c28f
[bugfix] Fix incorrect json-ld @context serialization (#3243) 2024-08-26 19:17:45 +02:00
kim
f4d69db36a
move WASM compilation stage much later in server init to reduce memory usage during db migrations (#3242) 2024-08-26 16:21:29 +00:00
tobi
28d57d1f13
[chore] Bump all otel deps (#3241) 2024-08-26 18:05:54 +02:00
dependabot[bot]
291bb68b47
[chore]: Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.2 (#3239)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.0 to 1.20.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.0...v1.20.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 10:41:21 +02:00
tobi
db59ca36b1
[chore] Remove unused "env" module (#3235) 2024-08-25 15:37:20 +00:00
tobi
2bd31ab710
[chore] Tiny tweak to ApprovedByURI (#3234) 2024-08-25 15:44:08 +02:00
tobi
d3887bf6cc
[bugfix] Let prometheus client do its own compression handling (#3232) 2024-08-25 13:25:32 +02:00
tobi
bef0dfc66c
[bugfix] Carry-over ApprovedByURI to avoid marking already-approved remote statuses as pending approval (#3231)
* [bugfix] Carry-over pendingApproval + approvedByURI to avoid pending already-approved remote statuses

* don't carry over pending_approval, not necessary

* comment
2024-08-25 12:18:39 +02:00
tobi
da3fa2d4a2
[chore/bugfix] Fix missing insertion of preapproved interaction requests (#3228) 2024-08-24 12:17:55 +00:00
dependabot[bot]
f35c124d14
Bump elliptic from 6.5.4 to 6.5.7 in /web/source (#3212)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.5.7.
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.5.7)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-24 13:34:13 +02:00
dependabot[bot]
a4c0a59193
Bump micromatch from 4.0.5 to 4.0.8 in /web/source (#3227) 2024-08-24 10:12:50 +00:00
tobi
f23f04e0b1
[feature] Interaction requests client api + settings panel (#3215)
* [feature] Interaction requests client api + settings panel

* test accept / reject

* fmt

* don't pin rejected interaction

* use single db model for interaction accept, reject, and request

* swaggor

* env sharting

* append errors

* remove ErrNoEntries checks

* change intReqID to reqID

* rename "pend" to "request"

* markIntsPending -> mark interactionsPending

* use log instead of returning error when rejecting interaction

* empty migration

* jolly renaming

* make interactionURI unique again

* swag grr

* remove unnecessary locks

* invalidate as last step
2024-08-24 11:49:37 +02:00
kim
8e5a72ac5c
[performance] ffmpeg ffprobe wrapper improvements (#3225)
* use a single instance of wazero runtime and compiled modules

* remove test output 🤦

* undo process-{media,emoji} changes

* update test runner to include wazero compilation cache

* sign drone.yml

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-08-23 17:15:35 +02:00
tobi
53fccb8af8
[feature] Use local_only field, deprecate federated field (#3222)
* [feature] Use `local_only` field, deprecate `federated` field

* use `deprecated` comment for form.Federated

* nolint
2024-08-22 19:47:10 +02:00
tobi
ffcf6e73f7
[bugfix/frontend] Small safari + gnome web fixes (#3219)
* [bugfix/frontend] Small safari + gnome web fixes

* wee

* update comment
2024-08-21 10:43:43 +02:00
tobi
9b2f14b131
[bugfix/frontend] Fix error on submitting domain perm with enter key (#3218) 2024-08-20 18:56:42 +02:00
kim
889d4756ea
[performance] use native Go code to probe JPEGs (#3206)
* use native Go code to probe JPEGs

* add note about copying from github.com/disintegration/imaging

* add more code comments
2024-08-19 13:38:10 +00:00
kim
e1154453bb
[chore] update default http client timeout to 30s (#3214) 2024-08-19 14:56:43 +02:00
dependabot[bot]
c78c3d5ed9
[chore]: Bump github.com/miekg/dns from 1.1.61 to 1.1.62 (#3209) 2024-08-19 11:35:08 +00:00
dependabot[bot]
c28a18b680
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.74 to 7.0.75 (#3208) 2024-08-19 10:37:44 +00:00
dependabot[bot]
6ff8376d96
[chore]: Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0 (#3210) 2024-08-19 10:13:46 +00:00
kim
ae14aa004d
[bugfix] permit unspecified orientation data (#3205) 2024-08-16 14:10:03 +02:00
kim
586639ccf0
update go-sqlite3 to v0.18.0 (#3204) 2024-08-15 00:30:58 +00:00
kim
09f24e0446
update go-ffmpreg to v0.2.5 (pulls in latest tetratelabs/wazero) (#3203) 2024-08-15 00:08:55 +00:00
kim
6fe96a5611
update go-fastcopy to v1.1.3 (#3200) 2024-08-14 16:56:56 +00:00
kim
f8d5b9f49c
update go-structr to v0.8.8 (#3199) 2024-08-14 12:08:24 +00:00
kim
9cd27b412d
[security] harden account update logic (#3198)
* on account update, ensure that public key has not changed

* change expected error message

* also support the case of changing account keys when expired (not waiting for handshake)

* tweak account update hardening logic, add tests for updating account with pubkey expired

* add check for whether incoming data was via federator, accepting keys if so

* use freshest window for federated account updates + comment about it
2024-08-13 15:37:09 +00:00
kim
5212a1057e
[bugfix] relax missing preferred_username, instead using webfingered username (#3189)
* support no preferred_username, instead using webfingered username

* add tests for the new preferred_username behaviour
2024-08-13 09:01:50 +00:00
kim
4cb3e4d3e6
[bugfix] incorrect AP serialize function used serializing worker data (#3196) 2024-08-12 18:23:24 +02:00
dependabot[bot]
871d062bd6
[chore]: Bump golang.org/x/image from 0.18.0 to 0.19.0 (#3191) 2024-08-12 10:12:52 +00:00
dependabot[bot]
745b80259f
[chore]: Bump golang.org/x/net from 0.27.0 to 0.28.0 (#3194)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.27.0 to 0.28.0.
- [Commits](https://github.com/golang/net/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 11:49:45 +02:00
kim
865b3aeaac
[bugfix] updated pinned counts on status delete (#3188)
* include pinned status when incrementing / decrementing status counts

* remove the pinned increment on status creation

* code comments

* microoptimize decr
2024-08-11 11:23:36 +02:00
kim
4a3ece0c6c
[bugfix] ensure testrig package only compiled-in when debug enabled (#3185)
* ensure testrig package only compiled-in (including init) when debug enabled

* add code comment to testrig init to indicate WebAssembly compilation
2024-08-09 10:53:29 +00:00
kim
f77005128a
[performance] move thumbnail generation to go code where possible (#3183)
* wrap thumbnailing code to handle generation natively where possible

* more code comments!

* add even more code comments!

* add code comments about blurhash generation

* maintain image rotation if contained in exif data

* move rotation before resizing

* ensure pix_fmt actually selected by ffprobe, check for alpha layer with gifs

* use linear instead of nearest-neighbour for resizing

* work with image "orientation" instead of "rotation". use default 75% quality for both webp and jpeg generation

* add header to new file

* use thumb extension when getting thumb mime type

* update test models and tests with new media processing

* add suggested code comments

* add note about thumbnail filter count reducing memory usage
2024-08-08 17:12:13 +00:00
John Winston
94c615d417
[feature] Add db-postgres-connection-string option (#3178)
* handle db-url

* lint and add doc

* add more doc

* fix config test

* return error

* change name from db-url to db-postgres-connection-string
2024-08-08 14:00:19 +02:00
tobi
b19cfee7ae
[feature] Use gifv type for short soundless mp4 videos (#3182) 2024-08-08 08:12:16 +00:00
kim
3045782b49
updates our ffmpreg version, heh (#3181) 2024-08-07 15:38:02 +02:00
Leah Neukirchen
4697271cef
[bugfix] send back Sec-Websocket-Protocol header for streaming WebSocket (#3169)
* [bugfix] send back Sec-Websocket-Protocol header for streaming WebSocket

Chrome expects the selected Sec-Websocket-Protocol to be sent back
on the WebSocket upgrade request (RFC6455 1.9).

* fiddle a bit to avoid getting headers multiple times

* add some explanatory notes

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-08-06 11:52:27 +02:00
dependabot[bot]
b78be9fd4a
[chore]: Bump golang.org/x/oauth2 from 0.21.0 to 0.22.0 (#3171)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:52:20 +00:00
kim
b85a9983d0
[bugfix] fix emoji recaching operations (#3167)
* 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-08-03 19:05:38 +02:00
tobi
fa59c3713c
[chore] Add media-ffmpeg-pool-size config var (#3164) 2024-08-03 16:40:26 +02:00
tobi
09f239d7e3
[chore/frontend] Update namerole rendering on skinny devices (#3166) 2024-08-03 16:39:07 +02:00
Daenney
9b50151f17
[feature] Beef up our AI opt-outs (#3165)
* [chore] Synchronise our robots.txt with upstream

* [feature] Add headers to escape AI crawlers

This adds 2 headers that a number of AI crawlers respect to signal that
content should not be included in their datasets.
2024-08-02 18:22:39 +02:00
kim
e5e996b28a
[bugfix] close files before error return (#3163)
* close files before error return

* use defer statements

* shuffle around some defers
2024-08-02 15:11:24 +01:00
kim
0f734a2410
[chore] move PopulateAccountStats() nil check often performed into function itself (#3158)
* move PopulateAccountStats() nil check often performed into function itself

* fix test to take in mind we don't repopulate account stats if not-nil
2024-08-02 13:15:11 +01:00
kim
94e87610c4
[chore] add back exif-terminator and use only for jpeg,png,webp (#3161)
* add back exif-terminator and use only for jpeg,png,webp

* fix arguments passed to terminateExif()

* pull in latest exif-terminator

* fix test

* update processed img

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-08-02 12:46:41 +01:00
tobi
7b5917d6ae
[feature] Allow import of following and blocks via CSV (#3150)
* [feature] Import follows + blocks via settings panel

* test import follows
2024-08-02 12:41:46 +01:00
tobi
697261da53
[chore] Take account of rotation data when calculating full size image dimensions (#3159)
* [chore] Take account of rotation data when calculating full size image dimensions

* boobies
2024-07-31 18:43:39 +00:00
Vyr Cossont
fd837776e2
[feature] Implement Mastodon-compatible roles (#3136)
* Implement Mastodon-compatible roles

- `Account.role` should only be available through verify_credentials for checking current user's permissions
- `Account.role` now carries a Mastodon-compatible permissions bitmap and a marker for whether it should be shown to the public
- `Account.roles` added for *public* display roles (undocumented but stable since Mastodon 4.1)
- Web template now uses only public display roles (no user-visible change here, we already special-cased the `user` role)

* Handle verify_credentials case for default role

* Update JSON exact-match tests

* Address review comments

* Add blocks bit to admin permissions bitmap
2024-07-31 09:26:09 -07:00
tobi
2f7d654380
[docs] Update system requirements, move things around a bit (#3157) 2024-07-31 15:12:47 +01:00
tobi
38f041cea1
[feature] Allow users to export data via the settings panel (#3140)
* [feature] Allow users to export data via the settings panel

* rename/move some stuff
2024-07-31 15:03:34 +01:00
CDN
43519324b3
[feature] Object store custom URL (S3) (#3046)
* tweaks

* boobs

* fix variable name + typo

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-31 13:44:18 +01:00
rdelaage
26022c2733
Fix no rows in result set error in emoji list command (#3152)
Co-authored-by: Romain de Laage <romain.delaage@rdelaage.ovh>
2024-07-30 18:12:06 +01:00
kim
0b4a951b48
[performance] limit ffprobe read time to at most 1s after start of file (#3155) 2024-07-30 16:18:29 +02:00
kim
87cff71af9
[feature] persist worker queues to db (#3042)
* persist queued worker tasks to database on shutdown, fill worker queues from database on startup

* ensure the tasks are sorted by creation time before pushing them

* add migration to insert WorkerTask{} into database, add test for worker task persistence

* add test for recovering worker queues from database

* quick tweak

* whoops we ended up with double cleaner job scheduling

* insert each task separately, because bun is throwing some reflection error??

* add specific checking of cancelled worker contexts

* add http request signing to deliveries recovered from database

* add test for outgoing public key ID being correctly set on delivery

* replace select with Queue.PopCtx()

* get rid of loop now we don't use it

* remove field now we don't use it

* ensure that signing func is set

* header values weren't being copied over 🤦

* use ptr for httpclient.Request in delivery

* move worker queue filling to later in server init process

* fix rebase issues

* make logging less shouty

* use slices.Delete() instead of copying / reslicing

* have database return tasks in ascending order instead of sorting them

* add a 1 minute timeout to persisting worker queues
2024-07-30 13:58:31 +02:00
tobi
42932f9820
[chore] replace UniqueStrings with Deduplicate (#3154) 2024-07-30 12:20:06 +02:00
kim
47c26818d6
[chore] add some more slice related utility functions + remove duplicated functions (#3149) 2024-07-30 11:29:32 +02:00
Vyr Cossont
a237e2b295
[feature] Implement following hashtags (#3141)
* Implement followed tags API

* Insert statuses with followed tags into home timelines

* Test following and unfollowing tags

* Correct Swagger path params

* Trim conversation caches

* Migration for followed_tags table

* Followed tag caches and DB implementation

* Lint and tests

* Add missing tag info endpoint, reorganize tag API

* Unwrap boosts when timelining based on tags

* Apply visibility filters to tag followers

* Address review comments
2024-07-29 19:26:31 +01:00
kim
368c97f0f8
[bugfix] take into account rotation when generating thumbnail (#3147)
* take into account rotation when generating thumbnail, simplify ffprobe output to show only fields we need

* only show rotation side data

* remove unnecessary comment

* fix code comments

* remove debug logging
2024-07-28 21:10:41 +02:00
kim
58f8082795
[bugfix] moves file rename to earlier in media pipeline so ffmpeg calls ALWAYS have extension (#3146) 2024-07-28 10:31:49 +02:00
tobi
87ee64afa0
[chore] log delivery worker stop/start at debug level (#3145) 2024-07-27 13:43:18 +02:00
kim
ecc114fc00
[chore] replaces nested ifs with switch cases, removes defer 'onFail()' being passed to funcs (#3143) 2024-07-27 11:09:02 +02:00
kim
d9e70b942f
ensure ffmpeg muxer gets set correctly by setting input file extension before clean (#3142) 2024-07-26 16:30:24 +01:00
tobi
ecfea10e35
[bugfix] Use punycode for host part of resource query param when doing webfinger requests (#3133)
* [bugfix] use punycode when webfingering

* account for punycode when checking if final URI matches expected

* hmm

* fix test
2024-07-26 13:11:07 +02:00
tobi
8ab2b19a94
[feature] Federate interaction policies + Accepts; enforce policies (#3138)
* [feature] Federate interaction policies + Accepts; enforce policies

* use Acceptable type

* fix index

* remove appendIRIStrs

* add GetAccept federatingdb function

* lock on object IRI
2024-07-26 12:04:28 +02:00
tobi
f8d399cf6a
[docs] Add separate migration section + instructions for moving to GtS and not just away (#3139)
* [docs] Add separate migration section + instructions for moving to GtS and not just away

* update headings
2024-07-24 19:07:36 +02:00
tobi
c9b6220fef
[chore] Add interaction filter to complement existing visibility filter (#3111)
* [chore] Add interaction filter to complement existing visibility filter

* pass in ptr to visibility and interaction filters to Processor{} to ensure shared

* use int constants for for match type, cache db calls in filterctx

* function name typo 😇

---------

Co-authored-by: kim <grufwub@gmail.com>
2024-07-24 12:27:42 +01:00
kim
63fc9b6c3e
[chore] renames the GTS caches to DB caches (#3127)
* renames the `GTS` caches to `DB` caches, as it better references what they are

* change remaining Caches.GTS uses to Caches.DB
2024-07-24 10:41:43 +02:00
tobi
325b4a2b4a
[feature] Allow user to set "bot" flag; show bot icon on profile (#3135)
* [feature] Allow user to set "bot" flag; show bot icon on profile

* tweak

* update customs
2024-07-24 10:40:56 +02:00
Vyr Cossont
db0a47126e
[bugfix] Serialize empty conversation account list as empty list, not null (#3137) 2024-07-24 10:40:01 +02:00
tobi
6533531cf1
[chore] Add some log lines to recent migrations warning not to interrupt (#3134)
* [chore] Add some log lines to recent migrations warning not to interrupt

* arse
2024-07-23 23:06:20 +02:00
Vyr Cossont
86a59db711
Remove content and related fields from boosts (#3131)
These duplicate the content of the target and aren't necessary for anything.

- Stops copying some fields from target when boosting or processing a remote boost
- Adds a migration to null out existing duplicate data
- Updates tests
2024-07-23 20:51:57 +01:00
Vyr Cossont
2d921d9d7c
Explicitly propagate filter results from statuses to their boosts in API responses (#3130)
Related to #3128
2024-07-23 20:51:07 +01:00
Vyr Cossont
8fdd358f4b
[feature] Conversations API (#3013)
* Implement conversations API

* Sort and page conversations by last status ID

* Appease linter

* Fix deleting conversations and statuses

* Refactor to make migrations automatic

* Lint

* Update tests post-merge

* Fixes from live-fire testing

* Linter caught a format problem

* Refactor tests, fix cache

* Negative test for non-DMs

* Run conversations advanced migration on testrig startup as well as regular server startup

* Document (lack of) side effects of API method for deleting a conversation

* Make not-found check less nested for readability

* Rename PutConversation to UpsertConversation

* Use util.Ptr instead of IIFE

* Reduce cache used by conversations

* Remove unnecessary TableExpr/ColumnExpr

* Use struct tags for both unique constraints on Conversation

* Make it clear how paging with GetDirectStatusIDsBatch should be used

* Let conversation paging skip conversations it can't render

* Use Bun NewDropTable

* Convert delete raw query to Bun

* Convert update raw query to Bun

* Convert latestConversationStatusesTempTable raw query partially to Bun

* Convert conversationStatusesTempTable raw query partially to Bun

* Rename field used to store result of MaxDirectStatusID

* Move advanced migrations to their own tiny processor

* Catch up util function name with main

* Remove json.… wrappers

* Remove redundant check

* Combine error checks

* Replace map with slice of structs

* Address processor/type converter comments

- Add context info for errors
- Extract some common processor code into shared methods
- Move conversation eligibility check ahead of populating conversation

* Add error context when dropping temp tables
2024-07-23 20:44:31 +01:00
kim
31294f7c78
[bugfix] media.Processor{}.GetFile() returning 404s on first call, correctly loading on 2nd (#3129)
* refactor file handling a tiny bit

* whoops

* make processing media / emoji defers a bit clear to see that it's the "on finished processing" path

* some wording

* add some debug logging

* add mutex locks for processing remote media

* try removing freshness check

* fix derefMedia not being allocated

* fix log format string

* handle case of empty file paths (i.e. not stored)

* remove media / emoji once finished processing from dereferencer maps

* whoops, fix the cached / force checks

* move url parsing outside of 'process___Safely()' funcs to prevalidate url

* use emoji.ShortcodeDomain()

* update RefreshEmoji() to also match RefreshMedia() changes

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-22 18:45:48 +01:00
dependabot[bot]
5338825d2b
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.73 to 7.0.74 (#3125)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.73 to 7.0.74.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.73...v7.0.74)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 14:12:51 +01:00
kim
c635080a0b
[feature] add flac support (#3121)
* add flac support to the ffprobe format/stream -> filetype parser

* also add audio/flac for flac (not just x-flac)

* update tests

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-21 14:42:51 +02:00
tobi
027a93facc
[feature/frontend] Respect prefers-reduced-motion for avatars, headers, and emojis (#3118)
* [feature/frontend] Respect `prefers-reduced-motion` for avatars, headers, and emojis

* go fmt

* fix tests

* use static version of instance thumbnail when appropriate

* use prefers-reduced-motion

* simplify account conversion a bit

* fix c&p error
2024-07-21 14:22:08 +02:00
kim
b415337d40
[bugfix] update common get target account / status doing refresh async (#3124) 2024-07-21 14:04:19 +02:00
tobi
8a2fb48ef4
[chore] Remove duplicate <hr> (#3123)
* [chore] Remove duplicate `<hr>`

* update test
2024-07-21 11:30:22 +02:00
kim
409b3987ac
update go-ffmpreg to v0.2.3 (#3120) 2024-07-20 14:14:58 +01:00
tobi
ad700c5029
[chore/frontend] Use smaller webp images for logo and default avatars (#3119) 2024-07-20 14:02:22 +01:00
kim
50c9b5498b
[feature] use webp for thumbnails (#3116)
* update to use webp for thumbnails

* bump webp quality up to 40% from 12% (it's a bit different to jpeg quality setting)

* update to use yuva colorspace, and use thumbnail=n=10 to select frame

* fix missing comma in ffmpeg args

* add links to appropriate ffmpeg docs

* update tests

* add file size tests for thumbnails

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-19 17:28:43 +02:00
kim
f5a44ccad4
[docs] update README with our corporate sponsorship policy (#3112)
* update README with our corporate sponsorship policy

* move location of corporate sponsorship

* tweaks after discussion

* update to maintain consistency
2024-07-19 14:14:07 +02:00
tobi
2b895f822a
[chore] Fix typo (#3113) 2024-07-17 22:04:52 +02:00
kim
72ba5666a6
[chore] media pipeline improvements (#3110)
* don't set emoji / media image paths on failed download, migrate FileType from string to integer

* fix incorrect uses of util.PtrOr, fix returned frontend media

* fix migration not setting arguments correctly in where clause

* fix not providing default with not null column

* whoops

* ensure a default gets set for media attachment file type

* remove the exclusive flag from writing files in disk storage

* rename PtrOr -> PtrOrZero, and rename PtrValueOr -> PtrOrValue to match

* slight wording changes

* use singular / plural word forms (no parentheses), is better for screen readers

* update testmodels with unknown media type to have unset file details, update attachment focus handling converting to frontend, update tests

* store first instance in ffmpeg wasm pool, fill remaining with closed instances
2024-07-17 15:26:33 +00:00
tobi
0aadc2db2a
[feature] Allow users to set default interaction policies per status visibility (#3108)
* [feature] Allow users to set default interaction policies

* use vars for default policies

* avoid some code repetition

* unfuck form binding

* avoid bonkers loop

* beep boop

* put policyValsToAPIPolicyVals in separate function

* don't bother with slices.Grow

* oops
2024-07-17 16:46:52 +02:00
kim
401098191b
give read-only access to /dev for ffmpeg to access /dev/urandom (#3109) 2024-07-16 13:32:48 +01:00
kim
de45c0be60
[feature] more filetype support! (#3107)
* add more supported file types to our media processor that ffmpeg supports, update supported mime type lists

* add code comments to the supported mime types slice

* don't check for zero value string, just parse

* remove some unneeded consts which make the code a bit harder to read

* fix test expected instance media mime types, use compact ffprobe json, simple media processing by type

* final tweaks to media processing code

* don't use safe divide where we don't need to
2024-07-15 15:24:53 +01:00
tobi
9efb11d848
[feature/frontend] Add player for audio files; use thumbnail for poster (#3099)
* [feature/frontend] Audio player for audio media types

* use video preview images for previews instead of video itself

* don't preload

* update tests for new zork status

* collapse media gallery into single row when small
2024-07-15 10:47:57 +01:00
dependabot[bot]
16421f7576
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.34 to 2.20.37 (#3106) 2024-07-15 09:15:31 +00:00
dependabot[bot]
b8a291c430
[chore]: Bump github.com/coreos/go-oidc/v3 from 3.10.0 to 3.11.0 (#3104) 2024-07-15 09:14:50 +00:00
tobi
9adcce9494
[chore] add step-by-step logging to long migration (#3102) 2024-07-15 11:12:56 +02:00
tobi
e2ed6ef024
[chore] Go mod tidy / vendor (#3100) 2024-07-13 16:23:25 +02:00
tobi
c83e96b8a7
[chore/frontend] Tweak threading a bit, inform about hidden replies (#3097)
* [chore/frontend] Tweak threading a bit, inform about hidden replies

* whoops

* round off bottom of replies col-header if no replies visible
2024-07-13 12:26:16 +02:00
tobi
bbbdf01213
[bugfix] Fix panic in isStatusHomeTimelineable (#3096) 2024-07-13 11:07:01 +02:00
tobi
aeb65bceae
[feature/frontend] Better visual separation between "main" thread and "replies" (#3093)
* [feature/frontend] Better web threading model

* fix test

* bwap

* tweaks

* more tweaks to wording

* typo

* indenting

* adjust wording

* aaa
2024-07-12 20:36:03 +02:00
kim
cde2fb6244
[feature] support processing of (many) more media types (#3090)
* 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-07-12 09:39:47 +00:00
tobi
5bc567196b
[chore] Add interaction policy gtsmodels (#3075)
* [chore] introduce interaction policy gts models

* update migration a smidge

* fix copy paste typo

* update migration

* use int for InteractionType
2024-07-11 15:44:29 +01:00
snow
8f8093aea4
[bugfix] Don't throw error when parent statuses are missing (#2011) (#3088)
* [bugfix] Don't throw error when parent statuses are missing (#2011)

* Split missing parent status case from error check
2024-07-10 14:38:25 +01:00
Daenney
ad93e57d08
[choore] Update robots.txt (#3092)
Recategorises a pair of scrapers according to their use.
2024-07-10 15:10:34 +02:00
Daenney
1de41f64f2
[chore] Bump ncruces/go-sqlite3 to 0.17.1 (#3085)
More linkanme fixes.
2024-07-08 22:03:00 +02:00
tobi
9a7c8926f5
[chore/frontend] Put ActivityPub logo on index page (#3087)
* [chore/frontend] Put ActivityPub logo on index page

* tidy up

* embiggen the logo a bit

* use light logo instead

* ensmallen link container
2024-07-08 18:12:33 +02:00
tobi
d70f4e166d
[feature/frontend] Allow setting alt-text for avatar + header (#3086) 2024-07-08 15:47:03 +02:00
dependabot[bot]
43c480aec4
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.72 to 7.0.73 (#3083) 2024-07-08 07:59:07 +00:00
dependabot[bot]
ae349dd6a5
[chore]: Bump golang.org/x/net from 0.26.0 to 0.27.0 (#3082) 2024-07-08 07:58:46 +00:00
tobi
bbbf6ebe37
[frontend] Better autocapitalize/spellcheck settings on forms (#3077) 2024-07-08 09:38:27 +02:00
dependabot[bot]
5769722c58
[chore]: Bump github.com/microcosm-cc/bluemonday from 1.0.26 to 1.0.27 (#3081) 2024-07-08 07:34:39 +00:00
dependabot[bot]
a81455e81c
[chore]: Bump golang.org/x/crypto from 0.24.0 to 0.25.0 (#3080) 2024-07-08 07:33:11 +00:00
tobi
1a66ea8998
[chore] upstep activity to v1.7.0-gts (#3074) 2024-07-06 15:57:11 +02:00
Daenney
49009fbd8f
[chore] Update ncruces/go-sqlite3 to 0.17 (#3072)
This fixes some linkname shenanigans previous versions of the library
were using. It's now safe to upgrade to Go 1.23 and beyond once they
become available.
2024-07-05 12:06:03 +02:00
Vyr Cossont
be5e532cd2
[bugfix] Handle ErrHideStatus when preparing timeline statuses (#3071) 2024-07-04 19:29:28 -07:00
Daenney
02d6e2e3bc
[feature] Set some security related headers (#3065)
* Set frame-ancestors in the CSP
   This ensures we can't be loaded/embedded in an iframe. It also sets the
   older X-Frame-Options for fallback.
* Disable MIME type sniffing
* Set Referrer-Policy
   This sets the policy such that browsers will never send the Referer
   header along with a request, unless it's a request to the same protocol,
   host/domain and port. Basically, only send it when navigating through
   our own UI, but not anything external.

   The default is strict-origin-when-cross-origin when unset, which sends
   the Referer header for requests unless it's going from HTTPS to HTTP
   (i.e a security downgrade, hence the 'strict').
2024-07-04 10:07:02 +02:00
Vyr Cossont
fde0c6bc8c
[chore] Allow gtsmodel to depend on util (#3068)
Convert one free function into a gtsmodel.Emoji method so that util does not depend on gtsmodel and can be used from it in the future
2024-07-03 15:53:54 -07:00
Daenney
27bcc1fcbd
[docs] Update how to enable http2 on nginx (#3066)
Since 1.25.1 the newer 'http2 on;' syntax should be used. The previous
syntax still works, but throws warnings when testing the configuration
with 'nginx -t'.

This also updates the certbot template to match what's currently
generated. It removes ipv6only=on as that's the default on a listen
directive binding on a wildcard IPv6 address.
2024-07-03 20:45:46 +02:00
dependabot[bot]
9c44d6aa47
[chore]: Bump github.com/yuin/goldmark from 1.7.3 to 1.7.4 (#3059)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.3 to 1.7.4.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.3...v1.7.4)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 13:41:55 +02:00
CDN
235bea04fd
[bugfix] update SignupURL routing in email template. (#3055) 2024-06-30 01:08:13 +02:00
f0x52
a76670a471
[bugfix] use instance configured emoji maxsize on emoji update validation (#3056) 2024-06-30 01:06:44 +02:00
Daenney
137ef5a9ff
[feature] Default to WASM-based SQLite driver (#3053)
* [feature] Default to WASM-based SQLite driver

With 0.16 out this switches our default SQLite driver to the WASM-based
solution instead. So far the driver seems to perform just as well.
Switching our default should result in it getting a bit more testing
during the 0.17 development cycle.

* add the ol' john hancock

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-06-29 09:35:57 +02:00
tobi
86786ae5b3
[bugfix] Fix typo in instance cache copyF (#3052) 2024-06-28 16:43:00 +02:00
tobi
2ddeb9b514
[chore] Add envparsing test for advanced-header-filter-mode (#3051) 2024-06-28 15:28:00 +02:00
tobi
a650f30197
[docs] Tidy up API auth docs a little bit (#3050) 2024-06-28 15:27:47 +02:00
dependabot[bot]
0baab758c7
[chore]: Bump golang.org/x/image from 0.17.0 to 0.18.0 (#3044)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.17.0 to 0.18.0.
- [Commits](https://github.com/golang/image/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 22:06:24 +02:00
kim
21bb324156
[chore] media and emoji refactoring (#3000)
* start updating media manager interface ready for storing attachments / emoji right away

* store emoji and media as uncached immediately, then (re-)cache on Processing{}.Load()

* remove now unused media workers

* fix tests and issues

* fix another test!

* fix emoji activitypub uri setting behaviour, fix remainder of test compilation issues

* fix more tests

* fix (most of) remaining tests, add debouncing to repeatedly failing media / emojis

* whoops, rebase issue

* remove kim's whacky experiments

* do some reshuffling, ensure emoji uri gets set

* ensure marked as not cached on cleanup

* tweaks to media / emoji processing to handle context canceled better

* ensure newly fetched emojis actually get set in returned slice

* use different varnames to be a bit more obvious

* move emoji refresh rate limiting to dereferencer

* add exported dereferencer functions for remote media, use these for recaching in processor

* add check for nil attachment in updateAttachment()

* remove unused emoji and media fields + columns

* see previous commit

* fix old migrations expecting image_updated_at to exists (from copies of old models)

* remove freshness checking code (seems to be broken...)

* fix error arg causing nil ptr exception

* finish documentating functions with comments, slight tweaks to media / emoji deref error logic

* remove some extra unneeded boolean checking

* finish writing documentation (code comments) for exported media manager methods

* undo changes to migration snapshot gtsmodels, updated failing migration to have its own snapshot

* move doesColumnExist() to util.go in migrations package
2024-06-26 16:01:16 +01:00
tobi
fa710057c8
[docs] restructure federation section (#3038) 2024-06-25 12:04:45 +02:00
dependabot[bot]
03c5d016a7
[chore]: Bump github.com/gorilla/feeds from 1.1.2 to 1.2.0 (#3035) 2024-06-24 09:04:27 +00:00
COxDE
863c67cb04
[docs] fix: traefik redirect regex (#3032) 2024-06-24 10:53:38 +02:00
dependabot[bot]
b9864e83a0
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.71 to 7.0.72 (#3037) 2024-06-24 08:07:15 +00:00
dependabot[bot]
ddef307622
[chore]: Bump github.com/yuin/goldmark from 1.7.2 to 1.7.3 (#3034) 2024-06-24 08:06:44 +00:00
ghose
14fda0dbbf
[feature/frontend] Rain Forest Theme (#3021)
* Create sweet-home.css

new green-ish theme

* Rain Forest theme v1

changes since *draft* version:

* lighter green for links (better contrast ratio)
* higher «show more/less» button contrast
* post's border thinner and darker (papaya)
* lighter "glow" (shadow)
* button has not shadow
* polls themed (dark blues)
* papaya scrollbar
* code box border thinner (not rounded)
* accesibility tested in firefox dev options (no issues)
* release ready v1.0

* Rename rain-forest.css to rain-forest.css

delete "theme" folder and move to "themes"
2024-06-23 15:43:05 +02:00
Daenney
4604224c4d
[chore] Update our robots.txt (#3033)
This syncs our copy with the current state of the ai.robots.txt
repository. Upstream has tightened their scope to be AI-only, whereas
before it included a bunch of SEO and "web intelligence" marketing
stuff. I've kept those but moved them into their own section.
2024-06-23 15:34:21 +02:00
Julian
c2738474d5
[bugfix] add Date and Message-ID headers for email (#3031)
* [bugfix] add Date and Message-ID headers for email

This should make spam filters more happy, as most of them grant some
negative score for not having those headers. Also the Date is convenient
for the user receiving the mail.

* make golangci-lint happy
2024-06-22 23:36:30 +02:00
kim
15e0bf6e5a
[chore] update github.com/ncruces/go-sqlite3 -> v0.16.3 (#3029) 2024-06-22 11:59:29 +02:00
kim
e543fbc80e
update remaining gruf libraries relying on linkname (#3028) 2024-06-21 18:36:58 +00:00
kim
9143ac6fb4
updates go-mutexes to no longer rely on unsafe linkname (#3027) 2024-06-21 17:35:32 +01:00
kim
b93087ceb4
[chore] update go-structr and go-mangler to no longer rely on modern-go/reflect2 (#3026)
* updates go-structr and go-mangler to no longer rely on modern-go/reflect2 (*phew* now we're go1.23 safe)

* update go-structr version

* bump go-structr to improve memory usage (v. slightly) in certain conditions
2024-06-21 16:43:17 +01:00
kim
7b1ccbd65a
[feature] add worker task serialization logic (#2989)
* improved server shutdown with more precise shutdown of modules + deferring of ALL of it

* move delivery and workers into separate files

* add worker task model and Serialize() / Deserialize() methods for message types

* start adding message serialize / deserialize tests

* start adding test cases

* update body rewinding to rely on standard library mechanism of r.GetBody()

* remove request rewinding (http.Client{} should already handle this)

* standard library already handles rewinding

* improved code comment

* move the newPOST() function contents to prepare(), fits better with current API

* add Serialize() / Deserialize() implementations for Delivery{} type

* finish writing FromClientAPI sserialize / deserialize tests

* start adding FromFediAPI{} serialize / deserialize test cases

* fix FromFediAPI{} tests

* add tests for delivery message type

* fix repeat code

* missing license header

* use testrig status and accounts for marshal / unmarshaling tests

* add a specific test for checking account RSA keys are preserved
2024-06-20 17:06:20 +00:00
tobi
4ce5c37df5
[bugfix] rename include_types[] to types[] (#3023) 2024-06-18 18:18:35 +02:00
tobi
d2b3d37724
[feature/frontend] Reports frontend v2 (#3022)
* use apiutil + paging in admin processor+handlers

* we're making it happen

* fix little whoopsie

* styling for report list

* don't youuuu forget about meee don't don't don't don't

* last bits

* sanitize content before showing in report statuses

* update report docs
2024-06-18 18:18:00 +02:00
Vyr Cossont
b08c1bd0cb
[feature] Implement types[] param for notifications (#3009)
Counterpart of exclude_types[].

Also updates Swagger spec for types[] to use the correct param name and enumerate possible values.

Fixes #3003
2024-06-17 20:50:50 +01:00
dependabot[bot]
7ab404d643
[chore]: Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#3016) 2024-06-17 08:13:40 +00:00
dependabot[bot]
cc64de4dcc
[chore]: Bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 (#3015) 2024-06-17 08:13:14 +00:00
dependabot[bot]
3a01377bcc
[chore]: Bump github.com/miekg/dns from 1.1.59 to 1.1.61 (#3014) 2024-06-17 08:12:25 +00:00
dependabot[bot]
b7dede2a47
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.33 to 2.20.34 (#3017) 2024-06-17 08:11:08 +00:00
dependabot[bot]
76d695d847
[chore]: Bump github.com/yuin/goldmark from 1.7.1 to 1.7.2 (#3018) 2024-06-17 08:10:11 +00:00
tobi
f1cbf6fb76
[docs] Update roadmap (#3011) 2024-06-16 14:35:00 +02:00
tobi
db803617db
[bugfix] avoid v. long notification clear query (#3007) 2024-06-14 10:14:55 +00:00
Vyr Cossont
b789fe2bc7
[feature] filter API v2: Restore keywords_attributes and statuses_attributes (#2995)
These filter API v2 features were cut late in development because the form encoding version is hard to implement correctly and because I thought no clients actually used `keywords_attributes`. Unfortunately, Phanpy does use `keywords_attributes`.
2024-06-14 10:11:41 +02:00
tobi
ee6e9b2795
[docs] Rework README a bit, import into docs (#3006) 2024-06-13 23:21:41 +02:00
Daenney
3c86bd890c
[chore] Silence memlimit package (#3002)
The memlimit package started to log any error returned by automemlimit.
This updates our implementation to call SetGoMemLimitWithOpts() instead
which uses the same defaults as automemlimit except for being
initialised with a noop logger.

We check the returned error for a particular substring, as when cgroups
isn't available even when running on a Linux system that's not a
problem. If it's anything but that error, we log it at the warning
level so that admins can still diagnose other cgroup related issues.

Fixes #2983

Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2024-06-13 19:02:48 +02:00
Martijn de Boer
38cd889f7b
[docs] Add optional instructions for replicating SQLite for disaster recovery (#2981)
* Add optional instructions for replicating SQLite for disaster recovery

* Remove references to MacOS from replicating-sqlite.md

Resolve comment on review

* Add mention for replicating SQLite in database_maintenance.md

Adds a reference to the replicating sqlite page under database maintenance
2024-06-13 15:09:51 +02:00
tobi
9d9013db4c
[chore] Update move test (#3005) 2024-06-13 15:08:43 +02:00
tobi
fbdfce3190
[chore] Don't render sign-up form when registrations closed (#3001) 2024-06-12 15:00:21 +01:00
dependabot[bot]
fef9b6a621
Bump braces from 3.0.2 to 3.0.3 in /web/source (#2999)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 15:00:12 +01:00
tobi
20877c1474
[bugfix] Ensure side effects handled for local unlocked follows (#2998) 2024-06-12 13:23:10 +01:00
Daenney
978b4176f1
[chore] Upgrade wasm-sqlite to v0.16.2 (#2997) 2024-06-12 13:21:34 +01:00
Vyr Cossont
dcf825bd87
[bugfix] Correct Swagger path for poll voting (#2996)
Updates the Swagger spec to match the router.

Fixes #2994
2024-06-12 11:16:46 +02:00
tobi
611f9de39b
[bugfix] Deref stats async, serve stub collections if handshaking (#2990)
* [bugfix] Deref stats async, allow peek if handshaking

* don't return totalItems when handshaking or hiding collections

* use GetLimit()

* use StubAccountStats
2024-06-11 11:54:59 +02:00
kim
fd6637df4a
[bugfix] boost and account recursion (#2982)
* fix possible infinite recursion if moved accounts are self-referential

* adds a defensive check for a boost being a boost of a boost wrapper

* add checks on input for a boost of a boost

* remove unnecessary check

* add protections on account move to prevent move recursion loops

* separate status conversion without boost logic into separate function to remove risk of recursion

* move boost check to boost function itself

* formatting

* use error 422 instead of 500

* use gtserror not standard errors package for error creation
2024-06-10 19:42:41 +01:00
tobi
ebdcb00d0a
[chore] Roll back use of (created) pseudo-header pending #2991 (#2992) 2024-06-10 19:42:26 +01:00
dependabot[bot]
69aba377bc
[chore]: Bump golang.org/x/image from 0.16.0 to 0.17.0 (#2985)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/image/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 08:10:25 +00:00
dependabot[bot]
a687f0634c
[chore]: Bump github.com/gorilla/websocket from 1.5.1 to 1.5.2 (#2987)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.5.1...v1.5.2)

---
updated-dependencies:
- dependency-name: github.com/gorilla/websocket
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 07:43:38 +00:00
dependabot[bot]
12c406d968
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.32 to 2.20.33 (#2984)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.32 to 2.20.33.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.20.32...v2.20.33)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 07:41:15 +00:00
dependabot[bot]
3babb6c0d2
[chore]: Bump golang.org/x/net from 0.25.0 to 0.26.0 (#2986)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0.
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 07:40:53 +00:00
dependabot[bot]
83ee766e34
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.70 to 7.0.71 (#2988)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.70 to 7.0.71.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.70...v7.0.71)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 07:40:16 +00:00
tobi
048339a6aa
[bugfix] Use re2 syntax for regex validation (#2978) 2024-06-08 12:32:28 +00:00
tobi
ce3b8aacf7
[chore] Warn about email/password change when using OIDC (#2975)
* [chore] Warn about email/password change when using OIDC

* go fmt
2024-06-07 15:21:57 +01:00
Daenney
cc4f773b0e
[chore] Update WASM go-sqlite3 to v0.16.1 (#2976)
This includes support for journal mode set to WAL on the BSDs.

Relates to: #1753, #2962
2024-06-07 15:06:43 +02:00
Vyr Cossont
afcfa48a7d
[feature] Implement filters_changed stream event (#2972) 2024-06-07 10:51:13 +02:00
Vyr Cossont
e605788b4b
[bugfix] Filter fixes (#2971)
* Add Filter.Expired convenience method, consistent with mutes

* Add missing Swagger for filter keyword/status delete and for 403s on moved accounts
2024-06-06 20:16:20 +02:00
Vyr Cossont
5e2d4fdb19
[feature] User muting (#2960)
* User muting

* Address review feedback

* Rename uniqueness constraint on user_mutes to match convention

* Remove unused account_id from where clause

* Add UserMute to NewTestDB

* Update test/envparsing.sh with new and fixed cache stuff

* Address tobi's review comments

* Make compiledUserMuteListEntry.expired consistent with UserMute.Expired

* Make sure mute_expires_at is serialized as an explicit null for indefinite mutes

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-06-06 16:38:02 +00:00
kim
b371c2db47
[bugfix] update media if more than just url changes (#2970)
* refactor status media handling into separate functions, handle case of changed metadata

* update fetchRemoteAccount{Avatar,Header} to use new refactored {load,update}Attachment() functions

* whoops, nearly marked avatars as headers :')

* reformatting to improve legibility
2024-06-06 15:35:50 +01:00
tobi
bcda048eab
[feature] Self-serve email change for users (#2957)
* [feature] Email change

* frontend stuff for changing email

* docs

* tests etc

* differentiate more clearly between local user+account and account

* populate user
2024-06-06 14:43:25 +01:00
tobi
131020faeb
drop date (#2969) 2024-06-06 12:50:56 +01:00
kim
5dcc954072
[feature] do not uncache status / emoji media if attached status is bookmarked (#2956)
* do not uncache status / emoji media if attached status is bookmarked

* add status bookmark and bookmark IDs caches

* update status bookmark tests

* move IsStatusBookmarkedBy() to StatusBookmark{} interface, rely on cache

* fix envparsing.sh test
2024-06-06 11:44:43 +01:00
tobi
6f26b32ec3
[bugfix] Don't nil emojis + fields on blocked accounts (#2968)
* [bugfix] Don't nil emojis + fields on blocked accounts

* comment

* swagger
2024-06-06 11:22:16 +01:00
kim
3b7faac604
[bugfix] concurrent map writes in dereferencer media processing maps (#2964)
* removes the avatar / header deref maps as we now have per-uri status / account locks, adds retries on data-races, adds separate emoji map mutex

* work with a copy of account / status for each retry loop

* revert to old data race behaviour, it gets too complicated otherwise

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-06-06 10:50:14 +02:00
tobi
9caf29bed2
[chore] Fiddle with CI tests; use wasmsqlite3 for CI tests (#2966)
* [chore] Update CI test stuff

* don't bother with ldflags

* use wasmsqlite3
2024-06-05 21:40:08 +02:00
Vyr Cossont
45fe295caa
Compile filter keyword regexps when touched through PutFilter or UpdateFilter (#2951)
Followup to #2903
2024-06-04 10:33:39 +01:00
kim
f17dd62ff5
[feature] log worker startup counts (#2958)
* log number of each worker kinds started, and log when stopped

* remove worker debug logging

* whoops, fix the count of media workers
2024-06-03 22:55:50 +01:00
kim
6ed6824d5d
bump go-structr to v0.8.5 to improve memory usage (#2955) 2024-06-03 12:03:35 +01:00
dependabot[bot]
addaba05c0
[chore]: Bump github.com/spf13/viper from 1.18.2 to 1.19.0 (#2954)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.18.2 to 1.19.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.18.2...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 10:52:54 +01:00
tobi
d79c2f2688
[feature/frontend] Add debug sections to settings panel (#2950)
* [feature/frontend] Add debug sections to settings panel

* max-width

* swagger
2024-06-03 11:20:53 +02:00
Vyr Cossont
04bcde08a1
[feature] Add from: search operator and account_id query param (#2943)
* Add from: search operator

* Fix whitespace in Swagger YAML comment

* Move query parsing into its own method

* Document search

* Clarify post search scope
2024-05-31 12:57:42 +02:00
Vyr Cossont
61a8d36255
[feature] Implement Filter API v2 (#2936)
* Use correct entity name

* We support server-side filters now

* Document filter v1 methods that can throw a 409

* Validate v1 filter phrase as filter title

* Always check v1 filter API status codes in tests

* Document keyword minimum requirement on filter API v1

* Make it possible to specify filter keyword update columns per filter keyword

* Implement v2 filter API

* Fix lint and tests

* Update Swagger spec

* Fix filter update test

* Update Swagger spec *correctly*

* Update actual files Swagger spec was generated from

* Remove keywords_attributes and statuses_attributes

* Add test for serialization of empty filter

* More helpful messages when object is owned by wrong account
2024-05-31 12:55:56 +02:00
tobi
4db596b8b9
[chore] little startup tweaks (#2941)
* [chore] little startup tweaks

* go fmt
2024-05-30 11:55:57 +02:00
Daenney
2fd69ec58b
[chore] Make worker run messages debug output (#2944)
On startup and shutdown of a worker, we log a message of the worker
being started together with a textual representation of a memory
address. Though this can be handy for developers to debug
startup/shutdown sequencing issues of the workers, it's typically not
very useful or informative for an admin. We can also output a lot of
these (on my system I get 265 lines of these during startup).

This changes the messages from Info to Debug, to not print them under
normal circumstances.
2024-05-30 11:00:47 +02:00
Daenney
b67937c213
[docs]: Document build tag for WASM SQLite (#2942)
Follow-up for #2863.
2024-05-30 11:00:25 +02:00
浮心物语
59fedfc4f9
[docs] Fix link in domain part (#2946) 2024-05-30 11:00:01 +02:00
kim
32e570abfd
[chore] improved startup / shutdown (#2925)
* improved server shutdown with more precise shutdown of modules + deferring of ALL of it

* make the same changes to the testrig server

* use testrig specific func

* update variable name to fix nilptr

* fix removal of setting db on state
2024-05-29 13:21:04 +02:00
Vyr Cossont
975e92b7f1
[feature] Implement profile API (#2926)
* Implement profile API

This Mastodon 4.2 extension provides capabilities missing from the existing Mastodon account update API: deleting an account's avatar or header.

See: https://docs.joinmastodon.org/methods/profile/

* Move profile media methods to media processor

* Remove check for moved account
2024-05-29 12:57:44 +02:00
tobi
f9a4a6120d
[feature] Debug admin endpoint to clear caches (#2940)
* [feature] Debug admin endpoint to clear caches

* go fmt
2024-05-29 12:56:17 +02:00
tobi
fa9a3075a5
[chore/bugfix] Don't cache MovedTo account (#2939) 2024-05-28 15:39:45 +02:00
tobi
4dc30f8687
[chore] make wasm sqlite3 available to goreleaser via env var (#2938) 2024-05-28 15:20:40 +02:00
tobi
a276b1ca06
[feature/frontend] Let admins send test email to validate SMTP config (#2934)
* [feature/frontend] Let admins send test email to validate SMTP config

* wee
2024-05-27 17:03:54 +00:00
kim
1e7b32490d
[experiment] add alternative wasm sqlite3 implementation available via 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-27 17:46:15 +02:00
tobi
cce21c11cb
[chore] Small styling + link issues (#2933) 2024-05-27 12:37:14 +02:00
tobi
5bee30d60c
[chore] Fix report email link (#2932) 2024-05-27 12:27:49 +02:00
dependabot[bot]
d96cca60a1
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.25 to 2.20.32 (#2927) 2024-05-27 09:36:09 +00:00
dependabot[bot]
0a18c0d802
[chore]: Bump github.com/jackc/pgx/v5 from 5.5.5 to 5.6.0 (#2929) 2024-05-27 09:35:41 +00:00
kim
3d3e99ae52
[performance] update storage backend and make use of seek syscall when available (#2924)
* update to use go-storage/ instead of go-store/v2/storage/

* pull in latest version from codeberg

* remove test output 😇

* 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()
2024-05-22 11:46:24 +02:00
dependabot[bot]
06b1e0173b
--- (#2923)
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 14:37:47 +01:00
kim
b092da6d28
[performance] cache v2 filter keyword regular expressions (#2903)
* add caching of filterkeyword regular expressions

* formatting

* fix WholeWord nil check
2024-05-21 14:20:19 +01:00
kim
6c0d93c6cb
[chore] dependabot updates (#2922)
* [chore]: Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.1

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* [chore]: Bump github.com/KimMachineGun/automemlimit from 0.6.0 to 0.6.1

Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.6.0...v0.6.1)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* [chore]: Bump github.com/tdewolff/minify/v2 from 2.20.20 to 2.20.24

Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.20 to 2.20.24.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.20.20...v2.20.24)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* [chore]: Bump github.com/go-swagger/go-swagger

Bumps [github.com/go-swagger/go-swagger](https://github.com/go-swagger/go-swagger) from 0.30.6-0.20240418033037-c46c303aaa02 to 0.31.0.
- [Release notes](https://github.com/go-swagger/go-swagger/releases)
- [Changelog](https://github.com/go-swagger/go-swagger/blob/master/.goreleaser.yml)
- [Commits](https://github.com/go-swagger/go-swagger/commits/v0.31.0)

---
updated-dependencies:
- dependency-name: github.com/go-swagger/go-swagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* [chore]: Bump github.com/gin-gonic/gin from 1.9.1 to 1.10.0

Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.9.1...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 14:17:22 +01:00
dependabot[bot]
16c1832793
[chore]: Bump github.com/gin-contrib/cors from 1.7.1 to 1.7.2 (#2912)
Bumps [github.com/gin-contrib/cors](https://github.com/gin-contrib/cors) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/gin-contrib/cors/releases)
- [Changelog](https://github.com/gin-contrib/cors/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/cors/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/cors
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2024-05-13 08:29:54 +00:00
dependabot[bot]
f817f96596
[chore]: Bump github.com/gin-contrib/sessions from 1.0.0 to 1.0.1 (#2916)
Bumps [github.com/gin-contrib/sessions](https://github.com/gin-contrib/sessions) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/gin-contrib/sessions/releases)
- [Changelog](https://github.com/gin-contrib/sessions/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/sessions/compare/v1.0.0...v1.0.1)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/sessions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 08:07:17 +00:00
dependabot[bot]
1ba9601472
[chore]: Bump golang.org/x/crypto from 0.22.0 to 0.23.0 (#2915)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.22.0 to 0.23.0.
- [Commits](https://github.com/golang/crypto/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 08:06:51 +00:00
dependabot[bot]
96eea416f3
[chore]: Bump golang.org/x/net from 0.24.0 to 0.25.0 (#2914)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/net/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 08:06:30 +00:00
kim
c06e6fb656
[performance] update go-structr and go-mutexes with memory usage improvements (#2909)
* update go-structr and go-mutexes with memory usage improvements

* bump to go-structr v0.8.4
2024-05-13 08:05:46 +00:00
tobi
578a4e0cf5
[bugfix] Reset emoji fields on upload error (#2905) 2024-05-07 19:48:12 +02:00
kim
f24ce34c3a
bump modernc.org/sqlite v1.29.8 -> v1.29.9 (concurrency workaround) (#2906) 2024-05-07 14:52:37 +01:00
kim
f456bd3401
update the total ratios calculation to include ALL caches (previously was missing a few!) (#2907) 2024-05-06 22:29:31 +01:00
kim
3554991444
update go-structr -> v0.8.2 which includes some minor memory usage improvements (#2904) 2024-05-06 19:44:22 +00:00
Vyr Cossont
45f4afe60e
feature: filters v2 server-side warning/hiding (#2793)
* Remove dead code

* Filter statuses when converting to frontend representation

* status.filtered is an array

* Make matching case-insensitive

* Remove TODOs that don't need to be done now

* Add missing filter check for notification

* lint: rename ErrHideStatus

* APIFilterActionToFilterAction not used yet

* swaggerino docseroni

* Address review comments

* Add apimodel.FilterActionNone

---------

Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-05-06 12:49:08 +01:00
dependabot[bot]
a0d066844f
[chore]: Bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#2900) 2024-05-06 11:14:04 +00:00
dependabot[bot]
8237e8d09e
[chore]: Bump codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0 (#2902)
Bumps codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-structr
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 08:51:06 +00:00
dependabot[bot]
a5f28fe0c9
[chore]: Bump github.com/gin-contrib/gzip from 1.0.0 to 1.0.1 (#2899)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/gin-contrib/gzip/releases)
- [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/gin-contrib/gzip/compare/v1.0.0...v1.0.1)

---
updated-dependencies:
- dependency-name: github.com/gin-contrib/gzip
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 08:50:47 +00:00
dependabot[bot]
c98ec6f89d
[chore]: Bump golang.org/x/image from 0.15.0 to 0.16.0 (#2898)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/image/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 08:50:03 +00:00
kim
d3f6960ba0
close + drain body if response body is too large (#2897) 2024-05-05 16:43:38 +01:00
tobi
6171dcbe51
[feature] Add HTTP header permission section to frontend (#2893)
* [feature] Add HTTP header filter section to frontend

* tweak naming a bit
2024-05-05 11:47:22 +00:00
tobi
35b1c54bde
[frontend] Do optimistic update when approving/rejecting/suspending account (#2892) 2024-05-02 17:57:53 +02:00
kim
a840f4d49d
add missing caches to the main cache sweep command (#2891) 2024-05-02 14:09:59 +01:00
tobi
ebec95a522
[bugfix] Lock when checking/creating notifs to avoid race (#2890)
* [bugfix] Lock when checking/creating notifs to avoid race

* test notif spam
2024-05-02 13:43:00 +01:00
tobi
725a21b027
[feature] Page through accounts as moderator (#2881)
* [feature] Page through accounts as moderator

* aaaaa

* use COLLATE "C" for Postgres to ensure same ordering as SQLite

* fix typo, test paging up

* don't show moderation / info for our instance acct
2024-05-01 14:11:22 +01:00
tobi
1edcb06afe
[bugfix] Tidy up remaining references to workers in cmd (#2889) 2024-05-01 12:55:00 +01:00
kim
2300d5e73b
[bugfix] function queue memory pools limitlessly grow (#2882)
* updates the simple queue memory pool to actually self-clean + limit growth

* update memory pool cleaning frequency
2024-05-01 13:30:43 +02:00
kim
eb61c783ed
[bugfix] flaky paging test (#2888) 2024-05-01 13:29:42 +02:00
kim
a8254a40e7
[bugfix] further paging mishaps (#2884)
* FURTHER paging shenanigans 🥲

* remove cursor logic from ToLinkURL()

* fix up paging tests

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-04-30 16:22:23 +02:00
kim
ec7c983e46
[bugfix] retry on http 500 errors *inclusive* (#2886) 2024-04-30 16:18:32 +02:00
kim
ec334ece20
[chore] include attemptno in httpclient logs (#2887)
* include request attempt number in httpclient logs

* slightly nicer attempt number formatting
2024-04-30 16:15:50 +02:00
Daenney
39b3a27c82
[docs] Remove last references to RPi (#2885)
This updates the documentation to remove the last stray references to
the copaganda Pi. It now uses the the term single-board computer. GtS
can run fine on all kinds of SBCs and isn't limited to that one
particular fruit version.
2024-04-30 14:27:44 +01:00
kim
4f87ef246c
[bugfix] paging rel links (#2883)
* fix paging so it uses correct cursor query parameter name

* improved code comment

* whoops, flip the cursoring 🤦

* fix the broken test
2024-04-30 12:19:33 +02:00
dependabot[bot]
bfc21e4850
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.19 to 2.20.20 (#2875) 2024-04-29 10:45:17 +00:00
dependabot[bot]
d3bac8bbec
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.69 to 7.0.70 (#2877) 2024-04-29 10:44:11 +00:00
tobi
40ece19055
[chore] Fix conflict in workers tests (#2880)
* [chore] Fix conflict in workers tests

* commenty-wenty
2024-04-29 11:43:18 +02:00
dependabot[bot]
1375a86919
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#2878) 2024-04-29 09:18:16 +00:00
dependabot[bot]
b2eecd9dc7
[chore]: Bump go.opentelemetry.io/otel/sdk from 1.25.0 to 1.26.0 (#2879) 2024-04-29 09:02:12 +00:00
kim
48b91ca239
[bugfix] Fix error string typo (#2873) 2024-04-26 15:20:56 +02:00
kim
c9c0773f2c
[performance] update remaining worker pools to use queues (#2865)
* start replacing client + federator + media workers with new worker + queue types

* refactor federatingDB.Delete(), drop queued messages when deleting account / status

* move all queue purging to the processor workers

* undo toolchain updates

* code comments, ensure dereferencer worker pool gets started

* update gruf libraries in readme

* start the job scheduler separately to the worker pools

* reshuffle ordering or server.go + remove duplicate worker start / stop

* update go-list version

* fix vendoring

* move queue invalidation to before wipeing / deletion, to ensure queued work not dropped

* add logging to worker processing functions in testrig, don't start workers in unexpected places

* update go-structr to add (+then rely on) QueueCtx{} type

* ensure more worker pools get started properly in tests

* fix remaining broken tests relying on worker queue logic

* fix account test suite queue popping logic, ensure noop workers do not pull from queue

* move back accidentally shuffled account deletion order

* ensure error (non nil!!) gets passed in refactored federatingDB{}.Delete()

* silently drop deletes from accounts not permitted to

* don't warn log on forwarded deletes

* make if else clauses easier to parse

* use getFederatorMsg()

* improved code comment

* improved code comment re: requesting account delete checks

* remove boolean result from worker start / stop since false = already running or already stopped

* remove optional passed-in http.client

* remove worker starting from the admin CLI commands (we don't need to handle side-effects)

* update prune cli to start scheduler but not all of the workers

* fix rebase issues

* remove redundant return statements

* i'm sorry sir linter
2024-04-26 13:50:46 +01:00
tobi
ba4f51ce2f
[chore] update Docker container to use new go swagger hash (#2872) 2024-04-26 12:12:24 +02:00
Daenney
83d24658a8
[chore] Update the flags passed to goreleaser (#2869)
* [chore] Update the flags passed to goreleaser

--rm-dist has been deprecated, the new flag is called --clean.

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-04-26 11:42:33 +02:00
Daenney
6c9bc26a6d
[chore] Update setting testrig loglevel (#2870)
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-26 11:31:26 +02:00
tobi
fd8a724e77
[chore] Bump go swagger (#2871)
* bump go swagger version

* bump swagger version
2024-04-26 11:31:10 +02:00
Daenney
3a369d834a
[chore] Upgrade our Go version to 1.22 (#2862)
* [chore] Upgrade our Go version to 1.22

With Go 1.22 having been released at the start of February, it's now
been a few months. No major issues have shown up, and the two point
release since then have primarily been security fixes plus some general
bug fixing.

This sets the required Go version to 1.22, as there's nothing in 1.22.1
or 1.22.2 that we would explicitly require. It sets the toolchain to the
latest point release, to ensure we pick up any fixes from there when
building releases etc.

* [chore] Update CI to Go 1.22

* [chore] Update golangci-lint to 1.25.7

Newer version should know about Go 1.22 and run fine.

* [chore] Update Docker container to Go 1.22

* [chore] Update Dockerfile to newer Alpine version

* sign drone.yml

* add missing license header

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-04-26 10:40:29 +02:00
tobi
aecf74951c
[chore] Settings refactor 2: the re-refactoring-ing (#2866)
* [chore] Bit more refactoring of settings panel

* fix up some remaining things

* groovy baby yeah!

* remove unused Suspense
2024-04-25 18:24:24 +02:00
tobi
7a1e639483
[chore] Refactor settings panel routing (and other fixes) (#2864) 2024-04-24 11:12:47 +01:00
dependabot[bot]
62788aa116
[chore]: Bump codeberg.org/gruf/go-mutexes from 1.4.0 to 1.4.1 (#2860)
Bumps codeberg.org/gruf/go-mutexes from 1.4.0 to 1.4.1.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-mutexes
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 13:43:45 +01:00
dependabot[bot]
a57dd15a8e
[chore]: Bump github.com/miekg/dns from 1.1.58 to 1.1.59 (#2861) 2024-04-22 09:11:53 +00:00
kim
12a7eba01f
[chore] bump modernc.org/sqlite to v1.29.8 (with our concurrency workaround) (#2855) 2024-04-22 11:02:11 +02:00
Daenney
dcab555a6b
[chore] Update robots.txt (#2856)
This updates the robots.txt based on the list of the ai.robots.txt
repository. We can look at automating that at some point.

It's worth pointing out that some robots, namely the ones by Bytedance,
are known to ignore robots.txt entirely.
2024-04-22 11:01:37 +02:00
dependabot[bot]
0db9e34b69
[chore]: Bump github.com/KimMachineGun/automemlimit from 0.5.0 to 0.6.0 (#2859) 2024-04-22 08:59:30 +00:00
tobi
b7c629a18a
[bugfix] Fix incorrect field name for status source, add helpful message (#2854)
* [bugfix] Fix incorrect field name for status source, add helpful message

* swagger

* yyammm
2024-04-18 13:22:55 +02:00
tobi
431505b3e4
[feature] Stub conversations endpoint (#2853) 2024-04-18 12:36:02 +02:00
tobi
34d0159ad5
[feature] Stub account mutes endpoint (#2852)
* [feature] Stub account mutes endpoint

* swagger? i barely know 'er!
2024-04-18 09:59:47 +01:00
kim
b3f2d44143
bump to modernc.org/sqlite v1.29.7 (#2850) 2024-04-17 17:10:51 +01:00
kim
c67bbe5ba0
update to set requesting account when deleting status (#2849) 2024-04-17 16:54:40 +01:00
tobi
cef9924d9a
[feature] Status source endpoint (#2848)
* [feature] statusSource endpoint

* finish up
2024-04-17 13:49:20 +01:00
tobi
ef16919d4a
[feature] Stub status history endpoint (#2847) 2024-04-17 13:06:49 +01:00
tobi
8cf685fbe9
[bugfix] Fix minor API issue w/ boosted statuses (#2846) 2024-04-17 12:41:40 +02:00
tobi
6de5717d7f
[bugfix] fix get all tokens (#2841) 2024-04-16 13:25:47 +02:00
tobi
3cceed11b2
[feature/performance] Store account stats in separate table (#2831)
* [feature/performance] Store account stats in separate table, get stats from remote

* test account stats

* add some missing increment / decrement calls

* change stats function signatures

* rejig logging a bit

* use lock when updating stats
2024-04-16 13:10:13 +02:00
kim
f79d50b9b2
[performance] cached oauth database types (#2838)
* update token + client code to use struct caches

* add code comments

* slight tweak to default mem ratios

* fix envparsing

* add appropriate invalidate hooks

* update the tokenstore sweeping function to rely on caches

* update to use PutClient()

* add ClientID to list of token struct indices
2024-04-15 14:22:21 +01:00
tobi
8b30709791
[chore] Turn accounts-registration-open false by default (#2839) 2024-04-15 14:41:15 +02:00
kim
1018cde107
[chore] bump bun library versions (#2837) 2024-04-15 12:01:20 +02:00
dependabot[bot]
6bb43f3f9b
[chore]: Bump golang.org/x/net from 0.23.0 to 0.24.0 (#2834) 2024-04-15 08:44:29 +00:00
dependabot[bot]
66e4510bf1
[chore]: Bump golang.org/x/crypto from 0.21.0 to 0.22.0 (#2835) 2024-04-15 08:34:49 +00:00
Bishochiparaa
fdd23cb9ed
[chore] Delete the unnecessary #, because this # lead to the wrong URL (#2830) 2024-04-14 09:31:45 +02:00
tobi
89e0cfd874
[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)
* update settings panels, add pending overview + approve/deny functions

* add admin accounts get, approve, reject

* send approved/rejected emails

* use signup URL

* docs!

* email

* swagger

* web linting

* fix email tests

* wee lil fixerinos

* use new paging logic for GetAccounts() series of admin endpoints, small changes to query building

* shuffle useAccountIDIn check *before* adding to query

* fix parse from toot react error

* use `netip.Addr`

* put valid slices in globals

* optimistic updates for account state

---------

Co-authored-by: kim <grufwub@gmail.com>
2024-04-13 13:25:10 +02:00
kim
1439042104
[performance] update GetAccountsByIDs() to use the new multi cache loader endpoint (#2828)
* update GetAccountsByIDs() to use the new multi cache loader endpoint

* fix broken import
2024-04-13 11:36:10 +02:00
tobi
a5c6dc9716
[bugfix] Include MIME email headers to avoid mangling non-ascii text (#2827) 2024-04-12 15:18:14 +01:00
dependabot[bot]
c097745c38
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#2818)
Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 11:46:18 +02:00
kim
db2dcc3455
[chore] update go-structr => v0.6.2 (fixes nested field ptr following) (#2822)
* update go-structr => v0.6.1 (fixes nested field ptr following)

* bump to v0.6.2
2024-04-11 11:46:08 +02:00
tobi
9fb8a78f91
[feature] New user sign-up via web page (#2796)
* [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-11 11:45:53 +02:00
kim
a483bd9e38
[performance] massively improved ActivityPub delivery worker efficiency (#2812)
* add delivery worker type that pulls from queue to httpclient package

* finish up some code commenting, bodge a vendored activity library change, integrate the deliverypool changes into transportcontroller

* hook up queue deletion logic

* support deleting queued http requests by target ID

* don't index APRequest by hostname in the queue

* use gorun

* use the original context's values when wrapping msg type as delivery{}

* actually log in the AP delivery worker ...

* add uncommitted changes

* use errors.AsV2()

* use errorsv2.AsV2()

* finish adding some code comments, add bad host handling to delivery workers

* slightly tweak deliveryworkerpool API, use advanced sender multiplier

* remove PopCtx() method, let others instead rely on Wait()

* shuffle things around to move delivery stuff into transport/ subpkg

* remove dead code

* formatting

* validate request before queueing for delivery

* finish adding code comments, fix up backoff code

* finish adding more code comments

* clamp minimum no. senders to 1

* add start/stop logging to delivery worker, some slight changes

* remove double logging

* use worker ptrs

* expose the embedded log fields in httpclient.Request{}

* ensure request context values are preserved when updating ctx

* add delivery worker tests

* fix linter issues

* ensure delivery worker gets inited in testrig

* fix tests to delivering messages to check worker delivery queue

* update error type to use ptr instead of value receiver

* fix test calling Workers{}.Start() instead of testrig.StartWorkers()

* update docs for advanced-sender-multiplier

* update to the latest activity library version

* add comment about not using httptest.Server{}
2024-04-11 11:45:35 +02:00
dependabot[bot]
15733cddb2
[chore]: Bump github.com/yuin/goldmark from 1.7.0 to 1.7.1 (#2819)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 12:04:27 +01:00
dependabot[bot]
4d16c3adaf
[chore]: Bump golang.org/x/oauth2 from 0.18.0 to 0.19.0 (#2816)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.18.0 to 0.19.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 12:04:11 +01:00
tobi
e20c7c21e1
[docs] update deployment considerations docs with latest findings (#2821)
* [docs] update deployment considerations docs with latest findings

* simplify single-board computer section
2024-04-10 12:03:43 +02:00
tobi
6db7d014dc
[bugfix] Ensure side effects for local -> local follows get processed (#2820) 2024-04-08 11:51:51 +02:00
kim
85bc140b58
[bugfix] temporarily replace modernc.org/sqlite-v1.29.5 with gitlab.com/NyaaaWhatsUpDoc/sqlite-v1.29.5-concurrency-workaround (#2811) 2024-04-05 11:58:28 +02:00
kim
83e7847cdf
fix possible nil panic (#2809) 2024-04-04 16:45:59 +01:00
Daenney
236604bd6b
[chore] Log less output on failed test (#2804)
* [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-04-04 16:42:42 +01:00
Daenney
8ed1b8142c
[bugfix] Sort follows chronologically (#2801)
The id on the follows table is not a ULID, but a random ID. Sorting on
them results in a completely random order. Instead, sort on created_at,
which sould result in a stable and intended sort order.

Fixes: #2769

Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2024-04-03 14:06:39 +01:00
kim
15ede4c1ea
[bugfix] improved authenticate post inbox error handling (#2803)
* improved PostInboxScheme() error handling / logging in case of failed auth

* dumbass kim. returning err instead of errWithCode...

* add checks for the slightly changed error handling in tests, add notes in codebase about the odd way of working
2024-04-03 13:57:07 +01:00
tobi
65b5366031
[bugfix] Set domain for empty-domain Friendica accounts (#2800) 2024-04-02 13:40:54 +01:00
kim
e664d0918b
[bugfix] Set the Host header within the signing transport (#2799) 2024-04-02 14:28:36 +02:00
kim
d61d5c8a6a
[bugfix] httpclient not signing subsequent redirect requests (#2798)
* move http request signing to transport

* actually hook up the http roundtripper ...

* add code comments for the new gtscontext functions
2024-04-02 13:12:26 +02:00
tobi
4bbdef02f1
[chore] Try to parse public key as both Actor + bare key (#2710)
* [chore] Try to parse public key as both Actor + bare key

* fix weird test fail
2024-04-02 11:30:10 +01:00
kim
adf345f1ec
[chore] bump go structr cache version -> v0.6.0 (#2773)
* update go-structr library -> v0.6.0, add necessary wrapping types + code changes to support these changes

* update readme with go-structr package changes

* improved wrapping of the SliceCache type

* add code comments for the cache wrapper types

* remove test.out 😇

---------

Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2024-04-02 12:03:40 +02:00
tobi
f05874be30
[feature] Option to hide followers/following (#2788) 2024-04-02 10:42:24 +01:00
tobi
29972e2c93
[feature] Add enable command to mirror existing disable command; update docs (#2792)
* [feature] add `enable` CLI command to mirror existing `disable` command

* update docs
2024-04-02 10:29:46 +01:00
tobi
be259b13a7
[chore] Vendor mkdocs fonts; update docs dependencies (#2789)
* [chore] Update docs dependencies

* update rtd deps

* aaaa

* why can't you just be normal!

* vendor social plugin fonts
2024-03-29 10:52:46 +01:00
dependabot[bot]
72b38c2f12
[chore] Bump express from 4.18.2 to 4.19.2 in /web/source (#2790)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 10:48:44 +01:00
tobi
4f66dba139
[bugfix] Serve correct URI for AP following collection (#2787) 2024-03-28 12:10:16 +01:00
tobi
ac3f195b56
[chore/frontend] Adjust contrast, mute blurple a bit (#2785) 2024-03-26 11:02:09 +00:00
tobi
8953f57d88
[feature] User-selectable preset CSS themes for accounts (#2777)
* [feature] User-selectable preset themes

* docs, more theme stuff

* lint, tests

* fix css name

* correct some little issues

* add another theme

* fix poll background

* okay last theme i swear

* make retrieval of apimodel themes more conventional

* preallocate stylesheet slices
2024-03-25 17:32:24 +00:00
tobi
b7b42e832a
[feature] Add healthcheck endpoints /livez and /readyz (#2783)
* [feature] Add healthcheck endpoints `/livez` and `/readyz`

* use select that returns no data
2024-03-25 17:05:14 +00:00
tobi
36f79e650c
[bugfix] Avoid empty public/local timeline queries (#2784) 2024-03-25 16:20:45 +00:00
dependabot[bot]
29031d1e27
[chore]: Bump github.com/gin-contrib/sessions from 0.0.5 to 1.0.0 (#2782) 2024-03-25 11:00:36 +00:00
dependabot[bot]
a24936040c
[chore]: Bump github.com/coreos/go-oidc/v3 from 3.9.0 to 3.10.0 (#2779) 2024-03-25 10:58:34 +00:00
dependabot[bot]
5f43419a87
[chore]: Bump github.com/gin-contrib/cors from 1.7.0 to 1.7.1 (#2778) 2024-03-25 10:43:08 +00:00
dependabot[bot]
40ee470536
[chore]: Bump github.com/gin-contrib/gzip from 0.0.6 to 1.0.0 (#2781) 2024-03-25 10:31:19 +00:00
tobi
7f4a0a1aeb
[chore] Move local account settings to separate db table (#2770)
* [chore] Move local account settings to separate database model

* don't use separate settings_id
2024-03-22 14:03:46 +01:00
kim
0767647056
[bugfix] add all possible busy result codes to the sqlite errBusy catching check (#2775) 2024-03-22 13:26:02 +01:00
dependabot[bot]
967558947a
[chore]: Bump modernc.org/sqlite from 1.29.4 to 1.29.5 (#2768)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.4 to 1.29.5.
- [Commits](https://gitlab.com/cznic/sqlite/commits/v1.29.5)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-21 11:14:24 +00:00
dependabot[bot]
51e8879779
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.18 to 2.20.19 (#2767) 2024-03-18 10:05:26 +00:00
dependabot[bot]
003d62465f
Bump follow-redirects from 1.15.4 to 1.15.6 in /web/source (#2763) 2024-03-18 09:57:09 +00:00
dependabot[bot]
8570793dfb
[chore]: Bump golang.org/x/oauth2 from 0.17.0 to 0.18.0 (#2766) 2024-03-18 09:56:42 +00:00
dependabot[bot]
fae7627a1b
[chore]: Bump github.com/technologize/otel-go-contrib (#2765) 2024-03-18 09:54:32 +00:00
tobi
0362d49da0
[bugfix] Parse links that contain non-ascii characters (#2762) 2024-03-15 17:26:53 +00:00
Daenney
e6e696ae22
[docs] Add IPv6 example for rate limit exceptions (#2761) 2024-03-15 13:13:57 +01:00
Vyr Cossont
4a56f31047
[chore] Swagger: add missing paging params to bookmarks list (#2759)
No code changes.
2024-03-15 11:43:24 +01:00
Blake Smith
15578835a8
[chore] Different error message for net/mail parsing on go 1.21.8 and above (#2760)
go 1.21.8 fixed some minor issues in net/mail that causes the test suite to fail
for some mail validation cases. Although we're not on go 1.21.8 yet, make the test
forward and backwards compatible.

See: 263c059b09
2024-03-15 11:36:43 +01:00
Vyr Cossont
efbc8151db
[chore] Swagger: correct names and formats for several array params (#2758)
No code changes.
2024-03-15 11:31:58 +01:00
tobi
9b94b1faa2
[docs] Add database maintenance section; update info message on ANALYZE run (sqlite) (#2756)
* [chore] Limit size of ANALYZE run after migration (sqlite)

* add basic db maintenance tips

* update docs, analyze

* amend info message a wee bit

* update docs/admin/database_maintenance.md wording

Co-authored-by: Daenney <daenney@users.noreply.github.com>

---------

Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-14 17:40:36 +00:00
tobi
1fe4cdaf46
[bugfix] Don't return 500 when searching for unpermitted status (#2753) 2024-03-14 17:57:54 +01:00
kim
459e75a9db
[bugfix] only check replyTo visibility during permission checks IF status is local (#2757) 2024-03-14 17:55:35 +01:00
tobi
92bf1f779b
[chore] Expose move endpoint again, small settings panel fixes (#2752) 2024-03-13 14:45:50 +01:00
tobi
ab2d063fcb
[feature] Process outgoing Move from clientAPI (#2750)
* prevent moved accounts from taking create-type actions

* update move logic

* federate move out

* indicate on web profile when an account has moved

* [docs] Add migration docs section

* lock while checking + setting move state

* use redirectFollowers func for clientAPI as well

* comment typo

* linter? i barely know 'er!

* Update internal/uris/uri.go

Co-authored-by: Daenney <daenney@users.noreply.github.com>

* add a couple tests for move

* fix little mistake exposed by tests (thanks tests)

* ensure Move marked as successful

* attach shared util funcs to struct

* lock whole account when doing move

* move moving check to after error check

* replace repeated text with error func

* linterrrrrr!!!!

* catch self follow case

---------

Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-13 13:53:29 +01:00
Vyr Cossont
13b9fd5f92
[bugfix]: Add missing Link headers in Swagger spec (#2751)
* Adds Link headers to all endpoints that use it for paging
* Fixes the return type for listing what accounts someone follows
2024-03-13 12:23:26 +01:00
kim
c27049ad15
[chore] bump modernc.org/sqlite v1.28.0 -> v1.29.4 (#2749) 2024-03-12 18:21:59 +01:00
tobi
1bcdf1da3b
[feature] Process incoming Move activity (#2724)
* [feature] Process incoming account Move activity

* fix targetAcct typo

* put move origin account on fMsg

* shift more move functionality back to the worker fn

* simplify error logic
2024-03-12 14:34:08 +00:00
Daenney
5e871e81a8
[chore] Update usage of OTEL libraries (#2725)
* otel to 1.24
* prometheus exporter to 0.46
* bunotel to 1.1.17

Also:
* Use schemaless URL for metrics
* Add software version to tracing schema
2024-03-11 15:34:34 +01:00
dependabot[bot]
8e88ee8d9c
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.67 to 7.0.69 (#2748) 2024-03-11 10:51:13 +00:00
dependabot[bot]
5a56f4f8fb
[chore]: Bump github.com/go-jose/go-jose/v3 from 3.0.1 to 3.0.3 (#2733) 2024-03-11 10:36:13 +00:00
dependabot[bot]
d115f9ebc4
[chore]: Bump github.com/jackc/pgx/v5 from 5.5.3 to 5.5.5 (#2747) 2024-03-11 10:13:33 +00:00
dependabot[bot]
e24efcac8b
[chore]: Bump github.com/gin-contrib/cors from 1.5.0 to 1.7.0 (#2745) 2024-03-11 10:12:06 +00:00
tobi
4c155aa847
[bugfix] Fix whitespace move_id issue (#2742) 2024-03-10 13:27:31 +01:00
tobi
de3c15a425
[bugfix] Don't error when populating MovedTo if account not found (#2741)
* [bugfix] Don't error when populating MovedTo if account not found

* test the thing
2024-03-10 11:59:55 +01:00
CDN
56c7c5dee2
[chore] seperate snapshot from release in goreleaser (#2740) 2024-03-10 11:10:30 +01:00
tobi
ebdee5aed8
[chore] Downgrade sqlite v1.29.2 -> v1.28.0 (#2736)
* [chore] Downgrade sqlite v1.29.2 -> v1.29.0

* go down to v1.28.0
2024-03-08 11:45:15 +01:00
tobi
7050df2572
[docs] Add note about privileged ports (#2735) 2024-03-08 10:09:06 +01:00
kim
016923b4dc
[bugfix] add workaround for Xsqlite_interrupt() permanently breaking connection (#2731) 2024-03-07 14:56:33 +01:00
Vyr Cossont
74e84cf8fa
[docs/chore] Swagger fixes for filters (#2730)
* Swagger: filtersV1Get should return an array

* Swagger: context must use multi format
2024-03-07 11:28:57 +01:00
Vyr Cossont
5159664a51
[chore] Fix a Swagger warning that only manifests during Go client code generation (#2729) 2024-03-06 18:44:58 +01:00
Vyr Cossont
fc3741365c
[bugfix] Fix Swagger spec and add test script (#2698)
* Add Swagger spec test script

* Fix Swagger spec errors not related to statuses with polls

* Add API tests that post a status with a poll

* Fix creating a status with a poll from form params

* Fix Swagger spec errors related to statuses with polls (this is the last error)

* Fix Swagger spec warnings not related to unused definitions

* Suppress a duplicate list update params definition that was somehow causing wrong param names

* Add Swagger test to CI

- updates Drone config
- vendorizes go-swagger
- fixes a file extension issue that caused the test script to generate JSON instead of YAML with the vendorized version

* Put `Sample: ` on its own line everywhere

* Remove unused id param from emojiCategoriesGet

* Add 5 more pairs of profile fields to account update API Swagger

* Remove Swagger prefix from dummy fields

It makes the generated code look weird

* Manually annotate params for statusCreate operation

* Fix all remaining Swagger spec warnings

- Change some models into operation parameters
- Ignore models that already correspond to manually documented operation parameters but can't be trivially changed (those with file fields)

* Documented that creating a status with scheduled_at isn't implemented yet

* sign drone.yml

* Fix filter API Swagger errors

* fixup! Fix filter API Swagger errors

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-03-06 18:05:45 +01:00
tobi
68c8fe67cc
[chore/bugfix] Little DB fixes (#2726) 2024-03-06 15:40:37 +01:00
tobi
b22e213e15
[feature/chore] Add Move database functions + cache (#2647)
* [feature/chore] Add Move database functions + cache

* add move mem ratio to envparsing.sh

* update comment
2024-03-06 11:18:57 +01:00
Vyr Cossont
61a2b91f45
[feature] Filters v1 (#2594)
* Implement client-side v1 filters

* Exclude linter false positives

* Update test/envparsing.sh

* Fix minor Swagger, style, and Bun usage issues

* Regenerate Swagger

* De-generify filter keywords

* Remove updating filter statuses

This is an operation that the Mastodon v2 filter API doesn't actually have, because filter statuses, unlike keywords, don't have options: the only info they contain is the status ID to be filtered.

* Add a test for filter statuses specifically

* De-generify filter statuses

* Inline FilterEntry

* Use vertical style for Bun operations consistently

* Add comment on Filter DB interface

* Remove GoLand linter control comments

Our existing linters should catch these, or they don't matter very much

* Reduce memory ratio for filters
2024-03-06 11:15:58 +01:00
dependabot[bot]
7bc536d1f7
[chore]: Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#2714)
* [chore]: Bump github.com/stretchr/testify from 1.8.4 to 1.9.0

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* cast the exxpected test values as float32 to bypass (possible) testify suite regression

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kim <grufwub@gmail.com>
2024-03-04 15:05:24 +00:00
kim
d85727e184
[bugfix] check remote status permissibility (#2703)
* add more stringent checks for remote status permissibility

* add check for inreplyto of a remote status being a boost

* do not permit inReplyTo boost wrapper statuses

* change comment wording

* fix calls to NewFederator()

* add code comments for NotPermitted() and SetNotPermitted()

* improve comment

* check that existing != nil before attempting delete

* ensure replying account isn't suspended

* use a debug log instead of info. check for boost using ID

* shorten log string length. make info level

* add note that replying to boost wrapper status shouldn't be able to happen anyways

* update to use onFail() function
2024-03-04 12:30:12 +00:00
8273 changed files with 3431264 additions and 914512 deletions

View file

@ -1,197 +0,0 @@
---
### Drone configuration file for GoToSocial.
### Connects to https://drone.superseriousbusiness.org to perform testing, linting, and automatic builds/pushes to docker.
###
### For documentation on drone, see: https://docs.drone.io/
### For documentation on drone docker pipelines in particular: https://docs.drone.io/pipeline/docker/overview/
kind: pipeline
type: docker
name: default
steps:
# We use golangci-lint for linting.
# See: https://golangci-lint.run/
- name: lint
image: golangci/golangci-lint:v1.55.0
volumes:
- name: go-build-cache
path: /root/.cache/go-build
- name: golangci-lint-cache
path: /root/.cache/golangci-lint
- name: go-src
path: /go
commands:
- golangci-lint run
when:
event:
include:
- pull_request
- name: test
image: golang:1.21-alpine
volumes:
- name: go-build-cache
path: /root/.cache/go-build
- name: go-src
path: /go
commands:
- apk update --no-cache && apk add git
- CGO_ENABLED=0 GTS_DB_TYPE="sqlite" GTS_DB_ADDRESS=":memory:" go test ./...
- CGO_ENABLED=0 ./test/envparsing.sh
when:
event:
include:
- pull_request
- name: web-setup
image: node:18-alpine
when:
event:
include:
- pull_request
volumes:
- name: yarn_cache
path: /tmp/cache
commands:
- yarn --cwd ./web/source install --frozen-lockfile --cache-folder /tmp/cache
- yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup
- name: web-lint
image: node:18-alpine
when:
event:
include:
- pull_request
depends_on:
- web-setup
commands:
- yarn --cwd ./web/source lint
- name: web-build
image: node:18-alpine
when:
event:
include:
- pull_request
depends_on:
- web-setup
commands:
- yarn --cwd ./web/source build
- name: snapshot
image: superseriousbusiness/gotosocial-drone-build:0.4.0 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
- name: docker
path: /var/run/docker.sock
environment:
DOCKER_USERNAME: gotosocial
DOCKER_PASSWORD:
from_secret: gts_docker_password
S3_ACCESS_KEY_ID:
from_secret: gts_s3_access_key_id
S3_SECRET_ACCESS_KEY:
from_secret: gts_s3_secret_access_key
S3_HOSTNAME: "https://s3.superseriousbusiness.org"
S3_BUCKET_NAME: "gotosocial-snapshots"
commands:
# Create a snapshot build with GoReleaser.
- git fetch --tags
- goreleaser release --rm-dist --snapshot
# Login to Docker, push Docker image snapshots + manifests.
- /go/dockerlogin.sh
- docker push superseriousbusiness/gotosocial:snapshot-armv6
- docker push superseriousbusiness/gotosocial:snapshot-armv7
- docker push superseriousbusiness/gotosocial:snapshot-arm64v8
- docker push superseriousbusiness/gotosocial:snapshot-amd64
- docker manifest create superseriousbusiness/gotosocial:snapshot superseriousbusiness/gotosocial:snapshot-armv6 superseriousbusiness/gotosocial:snapshot-armv7 superseriousbusiness/gotosocial:snapshot-amd64 superseriousbusiness/gotosocial:snapshot-arm64v8
- docker manifest push superseriousbusiness/gotosocial:snapshot
# Publish binary .tar.gz snapshots to S3.
- /go/snapshot_publish.sh
when:
event:
include:
- push
branch:
include:
- main
- name: release
image: superseriousbusiness/gotosocial-drone-build:0.4.0 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
- name: docker
path: /var/run/docker.sock
environment:
DOCKER_USERNAME: gotosocial
DOCKER_PASSWORD:
from_secret: gts_docker_password
GITHUB_TOKEN:
from_secret: github_token
commands:
- git fetch --tags
- /go/dockerlogin.sh
- goreleaser release --rm-dist
when:
event:
include:
- tag
# We can speed up builds significantly by caching build artifacts between runs.
# See: https://docs.drone.io/pipeline/docker/syntax/volumes/host/
volumes:
- name: go-build-cache
host:
path: /drone/gotosocial/go-build
- name: golangci-lint-cache
host:
path: /drone/gotosocial/golangci-lint
- name: go-src
host:
path: /drone/gotosocial/go
- name: docker
host:
path: /var/run/docker.sock
trigger:
repo:
- superseriousbusiness/gotosocial
- NyaaaWhatsUpDoc/gotosocial
- f0x52/gotosocial
---
kind: pipeline
type: docker
name: cron
trigger:
event:
- cron
cron:
- nightly
clone:
disable: true
steps:
- name: mirror
image: superseriousbusiness/gotosocial-drone-build:0.4.0
environment:
ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial
TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial
CODEBERG_USER: gotosocialbot
CODEBERG_EMAIL: admin@gotosocial.org
CODEBERG_TOKEN:
from_secret: gts_codeberg_token
commands:
- /go/codeberg_clone.sh
---
kind: signature
hmac: 00f69df57e8852d610f8d570c504aae22d315c2a0ff4808ef8f191554745c5ae
...

4
.gitattributes vendored
View file

@ -1 +1,3 @@
/vendor/ linguist-generated *.go diff=golang
go.sum linguist-generated merge=ours
/vendor/ linguist-generated

View file

@ -0,0 +1,76 @@
name: Bug Report
description: Create a report to help us improve
title: "[bug] Issue Title"
labels: [bug]
assignees: []
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please be cautious with the sensitive information/logs while filing the issue.
- type: markdown
attributes:
value: |
⚠️ If you're reporting an interoperability issue with a **closed source**
ActivityPub/Mastodon client or server, please report the issue to the
developers of that client or server instead. Without access to their
source debugging the issue is difficult for us. Since GoToSocial is
open source, developers of closed source implementations can run a copy
and autonomously debug the issue. We'll gladly address any bugs they
raise with us.
- type: textarea
id: desc
attributes:
label: Describe the bug with a clear and concise description of what the bug is.
validations:
required: true
- type: input
id: GoToSocial-Version
attributes:
label: What's your GoToSocial Version?
description: Enter the Version of your GoToSocial Installation
placeholder: e.g. v0.3.4
validations:
required: true
- type: input
id: GoToSocial-Arch
attributes:
label: GoToSocial Arch
description: What architecture do you use and did you do a Binary or Docker installation?
placeholder: e.g. arm64 Docker or arm64 Binary
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Enter exactly what happened.
validations:
required: false
- type: textarea
id: what-expected
attributes:
label: What you expected to happen?
description: Enter what you expected to happen.
validations:
required: false
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce it?
description: As minimally and precisely as possible.
validations:
required: false
- type: textarea
id: anything-else
attributes:
label: Anything else we need to know?
validations:
required: false

View file

@ -0,0 +1 @@
blank_issues_enabled: false

View file

@ -0,0 +1,44 @@
name: Feature request
description: Suggest an idea for this project
title: "[feature] Issue Title"
labels: [enhancement]
assignees:
-
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: desc
attributes:
label: Is your feature request related to a problem ?
description: Give a clear and concise description of what the problem is.
placeholder: ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: prop-solution
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
description: A clear and concise description of any alternative solutions or features you've considered. If nothing, please enter `NONE`
validations:
required: true
- type: textarea
id: additional-ctxt
attributes:
label: Additional context.
description: Add any other context or screenshots about the feature request here.
validations:
required: false

View file

@ -0,0 +1,67 @@
name: Frontend Bug Report
description: Report an issue related to the web frontend
title: "[bug/frontend] Issue Title"
labels: ["bug", "frontend"]
assignees: []
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please be cautious with the sensitive information/logs while filing the issue.
- type: textarea
id: desc
attributes:
label: Describe the bug with a clear and concise description of what the bug is. Please include screenshots of any visual issues.
validations:
required: true
- type: input
id: GoToSocial-Version
attributes:
label: What's your GoToSocial Version?
description: Enter the Version of your GoToSocial Installation
placeholder: e.g. v0.3.4
validations:
required: true
- type: input
id: Browser-Version
attributes:
label: Browser version
description: What browser(s) and versions are you using that show this bug?
placeholder: Firefox 103.0b9 (64-bit)
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Enter exactly what happened.
validations:
required: false
- type: textarea
id: what-expected
attributes:
label: What you expected to happen?
description: Enter what you expected to happen.
validations:
required: false
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce it?
description: As minimally and precisely as possible.
validations:
required: false
- type: textarea
id: anything-else
attributes:
label: Anything else we need to know?
validations:
required: false

View file

@ -0,0 +1,6 @@
---
name: Other
about: A different type of issue or question.
labels:
- question
---

View file

@ -15,7 +15,7 @@ Please put an x inside each checkbox to indicate that you've read and followed i
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
- [ ] I/we have read the [GoToSocial contribution guidelines](https://github.com/superseriousbusiness/gotosocial/blob/main/CONTRIBUTING.md). - [ ] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [ ] I/we have not leveraged AI to create the proposed changes. - [ ] I/we have not leveraged AI to create the proposed changes.
- [ ] I/we have performed a self-review of added code. - [ ] I/we have performed a self-review of added code.

2
.github/FUNDING.yml vendored
View file

@ -1,2 +0,0 @@
open_collective: gotosocial
liberapay: GoToSocial

View file

@ -1,67 +0,0 @@
name: Frontend Bug Report
description: Report an issue related to the web frontend
title: "[bug] Issue Title"
labels: ["bug", "frontend"]
assignees: []
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please be cautious with the sensitive information/logs while filing the issue.
- type: textarea
id: desc
attributes:
label: Describe the bug with a clear and concise description of what the bug is. Please include screenshots of any visual issues.
validations:
required: true
- type: input
id: GoToSocial-Version
attributes:
label: What's your GoToSocial Version?
description: Enter the Version of your GoToSocial Installation
placeholder: e.g. v0.3.4
validations:
required: true
- type: input
id: Browser-Version
attributes:
label: Browser version
description: What browser(s) and versions are you using that show this bug?
placeholder: Firefox 103.0b9 (64-bit)
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Enter exactly what happened.
validations:
required: false
- type: textarea
id: what-expected
attributes:
label: What you expected to happen?
description: Enter what you expected to happen.
validations:
required: false
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce it?
description: As minimally and precisely as possible.
validations:
required: false
- type: textarea
id: anything-else
attributes:
label: Anything else we need to know?
validations:
required: false

View file

@ -1,76 +0,0 @@
name: Bug Report
description: Create a report to help us improve
title: "[bug] Issue Title"
labels: [bug]
assignees: []
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please be cautious with the sensitive information/logs while filing the issue.
- type: markdown
attributes:
value: |
⚠️ If you're reporting an interoperability issue with a **closed source**
ActivityPub/Mastodon client or server, please report the issue to the
developers of that client or server instead. Without access to their
source debugging the issue is difficult for us. Since GoToSocial is
open source, developers of closed source implementations can run a copy
and autonomously debug the issue. We'll gladly address any bugs they
raise with us.
- type: textarea
id: desc
attributes:
label: Describe the bug with a clear and concise description of what the bug is.
validations:
required: true
- type: input
id: GoToSocial-Version
attributes:
label: What's your GoToSocial Version?
description: Enter the Version of your GoToSocial Installation
placeholder: e.g. v0.3.4
validations:
required: true
- type: input
id: GoToSocial-Arch
attributes:
label: GoToSocial Arch
description: What architecture do you use and did you do a Binary or Docker installation?
placeholder: e.g. arm64 Docker or arm64 Binary
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Enter exactly what happened.
validations:
required: false
- type: textarea
id: what-expected
attributes:
label: What you expected to happen?
description: Enter what you expected to happen.
validations:
required: false
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce it?
description: As minimally and precisely as possible.
validations:
required: false
- type: textarea
id: anything-else
attributes:
label: Anything else we need to know?
validations:
required: false

View file

@ -1,8 +0,0 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''
---

View file

@ -1,44 +0,0 @@
name: Feature request
description: Suggest an idea for this project
title: "[feature] Issue Title"
labels: [enhancement]
assignees:
-
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: desc
attributes:
label: Is your feature request related to a problem ?
description: Give a clear and concise description of what the problem is.
placeholder: ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: prop-solution
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
description: A clear and concise description of any alternative solutions or features you've considered. If nothing, please enter `NONE`
validations:
required: true
- type: textarea
id: additional-ctxt
attributes:
label: Additional context.
description: Add any other context or screenshots about the feature request here.
validations:
required: false

5
.github/README.md vendored Normal file
View file

@ -0,0 +1,5 @@
# GoToSocial
This is a mirror. You can find us on https://codeberg.org/superseriousbusiness/gotosocial.
We will **stop mirroring** to Github after 0.20 is released. This will likely be sometime **in August**.

View file

@ -1,15 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
commit-message:
prefix: "[chore]"
labels:
- "chore"

30
.github/workflows/autoclose.yaml vendored Normal file
View file

@ -0,0 +1,30 @@
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
permissions:
issues: write
pull-requests: write
jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: issue
if: ${{ github.event.issue.id != '' }}
run: |
gh issue close $ISSUE --comment "This repository is a mirror. Please open issues on https://codeberg.org/superseriousbusiness/gotosocial." --reason "not planned"
gh issue lock $ISSUE
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
- name: pr
if: ${{ github.event.pull_request.id != '' }}
run: |
gh pr close $PULL_REQUEST --comment "This repository is a mirror. Please open PRs on https://codeberg.org/superseriousbusiness/gotosocial."
gh pr lock $PULL_REQUEST
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST: ${{ github.event.pull_request.html_url }}

12
.gitignore vendored
View file

@ -4,6 +4,10 @@
# exclude built documentation, since readthedocs will build it for us anyway # exclude built documentation, since readthedocs will build it for us anyway
/docs/_build /docs/_build
# exclude kim's commonly used
# test stdout file location
test.out
# exclude coverage report # exclude coverage report
cp.out cp.out
@ -19,6 +23,9 @@ dist/
# exclude the copy of swagger.yaml moved into assets during packaging # exclude the copy of swagger.yaml moved into assets during packaging
web/assets/swagger.yaml web/assets/swagger.yaml
# exclude the copy of all_licenses.txt moved into assets during packaging
web/assets/all_licenses.txt
# exludes docker-volume from exemple/docker-compose # exludes docker-volume from exemple/docker-compose
example/docker-compose/docker-volume example/docker-compose/docker-volume
@ -37,5 +44,6 @@ shell.nix
/.idea/ /.idea/
/.fleet/ /.fleet/
# ignore cache dir from mkdocs serve # ignore cached pngs from mkdocs serve,
/.cache # while preserving cached fonts.
/docs/.cache/plugin/social/*.png

View file

@ -4,82 +4,98 @@
# #
# For GoToSocial we mostly take the default linters, but we add a few to catch style issues as well. # For GoToSocial we mostly take the default linters, but we add a few to catch style issues as well.
version: "2"
# options for analysis running # options for analysis running
run: run:
# include test files or not, default is true # include test files or not, default is true
tests: false tests: false
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
linters: linters:
# enable some extra linters, see here for the list: https://golangci-lint.run/usage/linters/ # enable some extra linters, see here for the list: https://golangci-lint.run/usage/linters/
enable: enable:
- gocritic - gocritic
- gofmt
- goheader - goheader
- gosec - gosec
- nilerr - nilerr
- revive - revive
# https://golangci-lint.run/usage/linters/#linters-configuration
settings:
# https://golangci-lint.run/usage/linters/#goheader
goheader:
template: |-
GoToSocial
Copyright (C) GoToSocial Authors admin@gotosocial.org
SPDX-License-Identifier: AGPL-3.0-or-later
# https://golangci-lint.run/usage/linters/#linters-configuration This program is free software: you can redistribute it and/or modify
linters-settings: it under the terms of the GNU Affero General Public License as published by
# https://golangci-lint.run/usage/linters/#goheader the Free Software Foundation, either version 3 of the License, or
goheader: (at your option) any later version.
template: |-
GoToSocial
Copyright (C) GoToSocial Authors admin@gotosocial.org
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
# https://golangci-lint.run/usage/linters/#govet # https://golangci-lint.run/usage/linters/#govet
govet: govet:
disable: disable:
- composites - composites
# https://golangci-lint.run/usage/linters/#revive # https://golangci-lint.run/usage/linters/#revive
revive: revive:
rules: rules:
# Enable most default rules. # Enable most default rules.
# See: https://github.com/mgechev/revive/blob/master/defaults.toml # See: https://github.com/mgechev/revive/blob/master/defaults.toml
- name: blank-imports - name: blank-imports
- name: context-as-argument - name: context-as-argument
- name: context-keys-type - name: context-keys-type
- name: dot-imports - name: dot-imports
- name: error-naming - name: error-naming
- name: error-return - name: error-return
- name: error-strings - name: error-strings
- name: exported - name: exported
- name: if-return - name: if-return
- name: increment-decrement - name: increment-decrement
- name: var-naming - name: var-naming
- name: var-declaration - name: var-declaration
- name: package-comments - name: package-comments
- name: range - name: range
- name: receiver-naming - name: receiver-naming
- name: time-naming - name: time-naming
- name: unexported-return - name: unexported-return
- name: indent-error-flow - name: indent-error-flow
- name: errorf - name: errorf
- name: empty-block - name: empty-block
- name: superfluous-else - name: superfluous-else
- name: unreachable-code - name: unreachable-code
# Disable below rules. # Disable below rules.
- name: redefines-builtin-id - name: redefines-builtin-id
disabled: true # This one is just annoying. disabled: true
- name: unused-parameter - name: unused-parameter
disabled: true # We often pass parameters to fulfil interfaces. disabled: true
# https://golangci-lint.run/usage/linters/#staticcheck - name: var-naming
staticcheck: arguments:
# Enable all checks, but disable SA1012: nil context passing. - []
# See: https://staticcheck.io/docs/configuration/options/#checks - []
checks: ["all", "-SA1012"] - - skip-package-name-checks: true
# https://golangci-lint.run/usage/linters/#staticcheck
staticcheck:
# Enable all checks, but disable SA1012: nil context passing.
# See: https://staticcheck.io/docs/configuration/options/#checks
checks:
- SA*
- -SA1012
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
formatters:
enable:
- gofmt
exclusions:
generated: lax

View file

@ -1,18 +1,30 @@
# https://goreleaser.com # Version 2 of GoReleaser: https://goreleaser.com/errors/version/
version: 2
project_name: gotosocial project_name: gotosocial
# https://goreleaser.com/scm/gitea/#urls
gitea_urls:
api: https://codeberg.org/api/v1
download: https://codeberg.org
# https://goreleaser.com/customization/hooks/
before: before:
# https://goreleaser.com/customization/hooks/
hooks: hooks:
# generate the swagger.yaml file using go-swagger and bundle it into the assets directory # generate the swagger.yaml file using go-swagger and bundle it into the assets directory
- swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml - go run ./vendor/github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml
- sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" web/assets/swagger.yaml - sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" web/assets/swagger.yaml
# Install web deps + bundle web assets # Install web deps + bundle web assets
- yarn --cwd ./web/source install - yarn --cwd ./web/source install
- yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup - yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup
- yarn --cwd ./web/source build - yarn --cwd ./web/source build
# Bundle all licenses into web/assets/all_licenses.txt
- ./scripts/bundle_licenses.sh
# https://goreleaser.com/customization/build/
builds: builds:
# https://goreleaser.com/customization/build/ # DEFAULT WASM BINARY BUILDS
- -
id: gotosocial
main: ./cmd/gotosocial main: ./cmd/gotosocial
binary: gotosocial binary: gotosocial
ldflags: ldflags:
@ -34,6 +46,39 @@ builds:
goos: goos:
- linux - linux
- freebsd - freebsd
- netbsd
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
# NOWASM BINARY BUILDS
-
id: gotosocial_nowasm
main: ./cmd/gotosocial
binary: gotosocial
ldflags:
- -s
- -w
- -extldflags
- -static
- -X main.Version={{.Version}}
tags:
- netgo
- osusergo
- static_build
- kvformat
- timetzdata
- nowasm
- >-
{{ if and (index .Env "DEBUG") (.Env.DEBUG) }}debugenv{{ end }}
env:
- CGO_ENABLED=0
goos:
# moderncsqlite doesn't
# build for netbsd right
# now so leave it out.
- linux
- freebsd
goarch: goarch:
- 386 - 386
- amd64 - amd64
@ -43,7 +88,8 @@ builds:
- 6 - 6
- 7 - 7
ignore: ignore:
# build freebsd only for amd64 # Don't build BSDs
# for arm/32-bit.
- goos: freebsd - goos: freebsd
goarch: arm64 goarch: arm64
- goos: freebsd - goos: freebsd
@ -51,22 +97,33 @@ builds:
- goos: freebsd - goos: freebsd
goarch: 386 goarch: 386
mod_timestamp: "{{ .CommitTimestamp }}" mod_timestamp: "{{ .CommitTimestamp }}"
# https://goreleaser.com/customization/docker/
dockers: dockers:
# https://goreleaser.com/customization/docker/ # DEFAULT WASM DOCKER BUILDS
- -
use: buildx use: buildx
goos: linux goos: linux
goarch: amd64 goarch: amd64
id: amd64
ids:
- gotosocial
image_templates: image_templates:
- "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64" - "{{ if not .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64{{ end }}" # Use version tag (eg., `0.19.0`, `0.19.0-rc1`) for proper releases and prereleases.
- "superseriousbusiness/{{ .ProjectName }}:latest-amd64" - "{{ if and (not .Prerelease) (not .IsSnapshot) }}superseriousbusiness/{{ .ProjectName }}:latest-amd64{{ end }}" # Only use `latest` for proper releases, not prereleases or snapshots.
- "superseriousbusiness/{{ .ProjectName }}:snapshot-amd64" - "{{ if .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:snapshot-amd64{{ end }}" # Only use `snapshot` for snapshot builds triggered by merge to main.
build_flag_templates: build_flag_templates:
- "--platform=linux/amd64" - "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title=GoToSocial"
- "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.authors=GoToSocial Authors"
- "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.description=Fast, fun, small ActivityPub server."
- "--label=org.opencontainers.image.url=https://docs.gotosocial.org"
- "--label=org.opencontainers.image.documentation=https://docs.gotosocial.org/en/latest/getting_started/installation/container/"
- "--label=org.opencontainers.image.source=https://codeberg.org/superseriousbusiness/gotosocial"
- "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.licenses=AGPL-3.0-or-later"
extra_files: extra_files:
- web - web
- go.mod - go.mod
@ -77,87 +134,57 @@ dockers:
use: buildx use: buildx
goos: linux goos: linux
goarch: arm64 goarch: arm64
id: arm64v8
ids:
- gotosocial
image_templates: image_templates:
- "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8" - "{{ if not .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8{{ end }}" # Use version tag (eg., `0.19.0`, `0.19.0-rc1`) for proper releases and prereleases.
- "superseriousbusiness/{{ .ProjectName }}:latest-arm64v8" - "{{ if and (not .Prerelease) (not .IsSnapshot) }}superseriousbusiness/{{ .ProjectName }}:latest-arm64v8{{ end }}" # Only use `latest` for proper releases, not prereleases or snapshots.
- "superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8" - "{{ if .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8{{ end }}" # Only use `snapshot` for snapshot builds triggered by merge to main.
build_flag_templates: build_flag_templates:
- "--platform=linux/arm64/v8" - "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title=GoToSocial"
- "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.authors=GoToSocial Authors"
- "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.description=Fast, fun, small ActivityPub server."
- "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.url=https://docs.gotosocial.org"
extra_files: - "--label=org.opencontainers.image.documentation=https://docs.gotosocial.org/en/latest/getting_started/installation/container/"
- web - "--label=org.opencontainers.image.source=https://codeberg.org/superseriousbusiness/gotosocial"
- go.mod
- go.sum
- cmd
- internal
-
use: buildx
goos: linux
goarch: arm
goarm: 6
image_templates:
- "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv6"
- "superseriousbusiness/{{ .ProjectName }}:latest-armv6"
- "superseriousbusiness/{{ .ProjectName }}:snapshot-armv6"
build_flag_templates:
- "--platform=linux/arm/v6"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
extra_files:
- web
- go.mod
- go.sum
- cmd
- internal
-
use: buildx
goos: linux
goarch: arm
goarm: 7
image_templates:
- "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv7"
- "superseriousbusiness/{{ .ProjectName }}:latest-armv7"
- "superseriousbusiness/{{ .ProjectName }}:snapshot-armv7"
build_flag_templates:
- "--platform=linux/arm/v7"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.licenses=AGPL-3.0-or-later"
extra_files: extra_files:
- web - web
- go.mod - go.mod
- go.sum - go.sum
- cmd - cmd
- internal - internal
# https://goreleaser.com/customization/docker_manifest/
docker_manifests: docker_manifests:
- name_template: superseriousbusiness/{{ .ProjectName }}:{{ .Version }} # Use version tag (eg., `0.19.0`, `0.19.0-rc1`) for proper releases and prereleases.
- name_template: "{{ if not .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:{{ .Version }}{{ end }}"
image_templates: image_templates:
- superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64
- superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8
- superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv6 # Only use `latest` for proper releases, not prereleases or snapshots.
- superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv7 - name_template: "{{ if and (not .Prerelease) (not .IsSnapshot) }}superseriousbusiness/{{ .ProjectName }}:latest{{ end }}"
- name_template: superseriousbusiness/{{ .ProjectName }}:latest
image_templates: image_templates:
- superseriousbusiness/{{ .ProjectName }}:latest-amd64 - superseriousbusiness/{{ .ProjectName }}:latest-amd64
- superseriousbusiness/{{ .ProjectName }}:latest-arm64v8 - superseriousbusiness/{{ .ProjectName }}:latest-arm64v8
- superseriousbusiness/{{ .ProjectName }}:latest-armv6 # Only use `snapshot` for snapshot builds triggered by merge to main.
- superseriousbusiness/{{ .ProjectName }}:latest-armv7 - name_template: "{{ if .IsSnapshot }}superseriousbusiness/{{ .ProjectName }}:snapshot{{ end }}"
- name_template: superseriousbusiness/{{ .ProjectName }}:snapshot
image_templates: image_templates:
- superseriousbusiness/{{ .ProjectName }}:snapshot-amd64 - superseriousbusiness/{{ .ProjectName }}:snapshot-amd64
- superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8 - superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8
- superseriousbusiness/{{ .ProjectName }}:snapshot-armv6
- superseriousbusiness/{{ .ProjectName }}:snapshot-armv7 # https://goreleaser.com/customization/archive/
archives: archives:
# https://goreleaser.com/customization/archive/ # DEFAULT WASM BUILD
- -
id: binary-release id: gotosocial
builds:
- gotosocial
files: files:
# standard release files # standard release files
- LICENSE - LICENSE
@ -169,6 +196,24 @@ archives:
# example config files # example config files
- example/config.yaml - example/config.yaml
- example/gotosocial.service - example/gotosocial.service
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 \"v1\") }}{{ .Amd64 }}{{ end }}"
# NOWASM BUILD
-
id: gotosocial_nowasm
builds:
- gotosocial_nowasm
files:
# standard release files
- LICENSE
- README.md
- CHANGELOG*
# web stuff minus source
- web/assets
- web/template
# example config files
- example/config.yaml
- example/gotosocial.service
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 \"v1\") }}{{ .Amd64 }}{{ end }}_nowasm"
- -
id: web-assets id: web-assets
files: files:
@ -178,13 +223,126 @@ archives:
- web/template - web/template
meta: true meta: true
name_template: "{{ .ProjectName }}_{{ .Version }}_web-assets" name_template: "{{ .ProjectName }}_{{ .Version }}_web-assets"
# https://goreleaser.com/customization/checksum/
checksum: checksum:
# https://goreleaser.com/customization/checksum/
name_template: 'checksums.txt' name_template: 'checksums.txt'
# https://goreleaser.com/customization/snapshots/
snapshot: snapshot:
# https://goreleaser.com/customization/snapshots/ version_template: "{{ incpatch .Version }}-SNAPSHOT"
name_template: "{{ incpatch .Version }}-SNAPSHOT"
# https://goreleaser.com/customization/source/
source: source:
# https://goreleaser.com/customization/source/
enabled: true enabled: true
name_template: "{{ .ProjectName }}-{{ .Version }}-source-code" name_template: "{{ .ProjectName }}-{{ .Version }}-source-code"
# https://goreleaser.com/customization/release/
release:
# https://goreleaser.com/customization/release/#gitea
gitea:
owner: superseriousbusiness
name: gotosocial
draft: true
prerelease: auto
header: |
Here's version {{ .Version }} of GoToSocial.
Please read the migration notes carefully for instructions on how to upgrade to this version.
## Release highlights
- Pee pee
- Poo poo
- Wee wee
## Migration notes
### Upgrading
To upgrade to {{ .Tag }} from a previous release:
#### Binary/tar
1. Stop GoToSocial.
2. **Back up your database!** If you're running on SQLite, this is as simple as copying your `sqlite.db` file, eg., `cp sqlite.db sqlite.db.backup`. On Postgres you can do this with [pg_dump](https://www.postgresql.org/docs/current/backup-dump.html).
3. Download and untar the new release, **including the web assets and html templates**, not just the binary.
4. Edit your config.yaml file if necessary (see below).
5. Start GoToSocial.
6. Wait patiently for any migrations to run, **do not interrupt migrations or you could leave your db in a broken state and will have to restore from backup**!
7. Enjoy your updated instance.
#### Docker
1. Stop GoToSocial.
2. **Back up your database!** If you're running on SQLite, this is as simple as copying your `sqlite.db` file, eg., `cp sqlite.db sqlite.db.backup`. On Postgres you can do this with [pg_dump](https://www.postgresql.org/docs/current/backup-dump.html).
3. Pull the new docker container with `docker pull docker.io/superseriousbusiness/gotosocial:{{ .Version }}` or `docker pull docker.io/superseriousbusiness/gotosocial:latest` if this is a stable release and not a release candidate.
4. Edit your config.yaml file or environment variables if necessary (see below).
5. Start GoToSocial.
6. Wait patiently for any migrations to run, **do not interrupt migrations or you could leave your db in a broken state and will have to restore from backup**!
7. Enjoy your updated instance.
### config.yaml
The configuration file has changed since the previous release.
- Changed `pee pee` to `poo poo`.
- Changed `wee wee` to `more wee wee`.
You can see a diff of the config file here: https://codeberg.org/superseriousbusiness/gotosocial/compare/{{ .PreviousTag }}...{{ .Tag }}#diff-c071e03510b2c57e193a44503fd9528a785f0f411497cc75841a9f8d0b1ac622
### Database Migrations
⚠️⚠️⚠️
This release may contain database migrations which will run the first time you start up this new version.
Be sure not to interrupt this migration process.
This will take anywhere between a couple seconds and ten minutes or more (on slower hardware).
**Please be patient!**
⚠️⚠️⚠️
### Which release archive/container should I use?
GoToSocial releases binary builds for 64-bit Linux, FreeBSD, and NetBSD operating systems. We also release Docker builds for 64-bit Linux.
| OS | Architecture | Support level | Binary archive | Docker |
| ------- | ----------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Linux | x86-64/AMD64 (64-bit) | 🟢 Full | [linux_amd64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_linux_amd64.tar.gz) | `docker.io/superseriousbusiness/gotosocial:{{ .Version }}` |
| Linux | Armv8/ARM64 (64-bit) | 🟢 Full | [linux_arm64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_linux_arm64.tar.gz) | `docker.io/superseriousbusiness/gotosocial:{{ .Version }}` |
| FreeBSD | x86-64/AMD64 (64-bit) | 🟢 Full | [freebsd_amd64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_freebsd_amd64.tar.gz) | Not provided |
| FreeBSD | Armv8/ARM64 (64-bit) | 🟢 Full | [freebsd_arm64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_freebsd_arm64.tar.gz) | Not provided |
| NetBSD | x86-64/AMD64 (64-bit) | 🟢 Full | [netbsd_amd64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_netbsd_amd64.tar.gz) | Not provided |
| NetBSD | Armv8/ARM64 (64-bit) | 🟢 Full | [netbsd_arm64.tar.gz](https://codeberg.org/superseriousbusiness/gotosocial/releases/download/{{ .Tag }}/gotosocial_{{ .Version }}_netbsd_arm64.tar.gz) | Not provided |
#### `nowasm`
For your convenience, we also provide **UNSUPPORTED, EXPERIMENTAL BUILDS**, created using the `nowasm` tag, in the downloads list below. There is no Docker build for `nowasm`.
GoToSocial releases built with `nowasm` use the Go-native, modernc version of SQLite instead of the WASM one, and will use *on-system ffmpeg and ffprobe binaries* for media processing.
Using a `nowasm` build is currently the only way to run GoToSocial on a 32-bit system.
For more information on running a `nowasm` build, see the [nowasm](https://docs.gotosocial.org/en/latest/advanced/builds/nowasm/) documentation page.
# https://goreleaser.com/customization/changelog/
changelog:
use: gitea
groups:
- title: Features and performance
regexp: '^.*\[(?:feature|performance).*\].*$'
order: 0
- title: Bug fixes
regexp: '^.*\[bug.*\].*$'
order: 1
- title: Chores & version bumps
regexp: '^.*\[chore.*\].*$'
order: 2
- title: Documentation
regexp: '^.*\[doc.*\].*$'
order: 3
- title: Other
order: 999

View file

@ -6,9 +6,9 @@
version: 2 version: 2
build: build:
os: "ubuntu-20.04" os: ubuntu-22.04
tools: tools:
python: "mambaforge-4.10" # https://docs.readthedocs.io/en/stable/guides/conda.html#making-builds-faster-with-mamba python: "mambaforge-22.9" # https://docs.readthedocs.io/en/stable/guides/conda.html#making-builds-faster-with-mamba
mkdocs: mkdocs:
configuration: "mkdocs.yml" configuration: "mkdocs.yml"

13
.vscode/settings.json vendored
View file

@ -10,5 +10,14 @@
}, },
"eslint.workingDirectories": ["web/source"], "eslint.workingDirectories": ["web/source"],
"eslint.lintTask.enable": true, "eslint.lintTask.enable": true,
"eslint.lintTask.options": "${workspaceFolder}/web/source" "eslint.lintTask.options": "${workspaceFolder}/web/source",
} "eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}

137
.woodpecker/pr.yaml Normal file
View file

@ -0,0 +1,137 @@
# https://woodpecker-ci.org/docs/usage/workflow-syntax#when---global-workflow-conditions
when:
- event: pull_request
steps:
# Lint the Go code only if
# some Go files have changed.
#
# CI_PIPELINE_FILES is undefined if
# files changed > 500, and empty on
# force pushes, so account for this
# and run step to be safe.
lint:
when:
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
- evaluate: >-
(not ("CI_PIPELINE_FILES" in $env)) ||
CI_PIPELINE_FILES == "[]" ||
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" }) ||
len(fromJSON(CI_PIPELINE_FILES)) == 0
# We use golangci-lint for linting.
# See: https://golangci-lint.run/
image: golangci/golangci-lint:v2.3.1
pull: true
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
backend_options:
docker:
user: 1000:1000
# https://woodpecker-ci.org/docs/usage/volumes
volumes:
- /woodpecker/gotosocial/go-build-cache:/.cache/go-build
- /woodpecker/gotosocial/go-pkg-cache:/go/pkg
- /woodpecker/gotosocial/golangci-lint-cache:/.cache/golangci-lint
# https://woodpecker-ci.org/docs/usage/environment
environment:
GOFLAGS: "-buildvcs=false"
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
commands:
- golangci-lint run
# Test the Go code only if
# some Go files have changed.
#
# CI_PIPELINE_FILES is undefined if
# files changed > 500, and empty on
# force pushes, so account for this
# and run step to be safe.
test:
when:
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
- evaluate: >-
(not ("CI_PIPELINE_FILES" in $env)) ||
CI_PIPELINE_FILES == "[]" ||
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" || # startsWith "vendor/" }) ||
len(fromJSON(CI_PIPELINE_FILES)) == 0
image: golang:1.24-alpine
pull: true
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
backend_options:
docker:
user: 1000:1000
# https://woodpecker-ci.org/docs/usage/volumes
volumes:
- /woodpecker/gotosocial/go-build-cache:/.cache/go-build
- /woodpecker/gotosocial/go-pkg-cache:/go/pkg
- /woodpecker/gotosocial/wazero-compilation-cache:/.cache/wazero
- /woodpecker/gotosocial/test-tmp:/tmp
# https://woodpecker-ci.org/docs/usage/environment
environment:
CGO_ENABLED: "0"
GTS_WAZERO_COMPILATION_CACHE: "/.cache/wazero"
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
commands:
- >-
go test
-ldflags="-s -w -extldflags '-static'"
-tags="netgo osusergo static_build kvformat timetzdata"
-failfast
-timeout=30m
./...
- ./test/envparsing.sh
- ./test/swagger.sh
# Validate the web code only
# if web source has changed.
#
# CI_PIPELINE_FILES is undefined if
# files changed > 500, and empty on
# force pushes, so account for this
# and run step to be safe.
web:
when:
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
- evaluate: >-
(not ("CI_PIPELINE_FILES" in $env)) ||
CI_PIPELINE_FILES == "[]" ||
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "web/source/" }) ||
len(fromJSON(CI_PIPELINE_FILES)) == 0
image: node:lts-alpine
pull: true
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
backend_options:
docker:
user: 1000:1000
# https://woodpecker-ci.org/docs/usage/volumes
volumes:
- /woodpecker/gotosocial/node_modules:/woodpecker/src/codeberg.org/superseriousbusiness/gotosocial/web/source/node_modules
- /woodpecker/gotosocial/yarn-cache:/.cache/yarn
- /woodpecker/gotosocial/web-dist-test:/woodpecker/src/codeberg.org/superseriousbusiness/gotosocial/web/assets/dist
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
commands:
# Install web dependencies.
- yarn --cwd ./web/source install --frozen-lockfile --cache-folder /.cache/yarn
- yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup
# Lint web source.
- yarn --cwd ./web/source lint
# Ensure build works.
- yarn --cwd ./web/source build

54
.woodpecker/release.yaml Normal file
View file

@ -0,0 +1,54 @@
# https://woodpecker-ci.org/docs/usage/workflow-syntax#when---global-workflow-conditions
when:
- event: tag
# https://goreleaser.com/ci/woodpecker/
# https://woodpecker-ci.org/docs/usage/workflow-syntax#clone
clone:
git:
image: woodpeckerci/plugin-git
settings:
tags: true
steps:
release:
# https://codeberg.org/superseriousbusiness/gotosocial-woodpecker-build
image: superseriousbusiness/gotosocial-woodpecker-build:0.12.1
pull: true
# https://woodpecker-ci.org/docs/usage/volumes
volumes:
- /woodpecker/gotosocial/go-build-cache-root:/root/.cache/go-build
- /woodpecker/gotosocial/go-pkg-cache-root:/go/pkg
- /var/run/docker.sock:/var/run/docker.sock
# https://woodpecker-ci.org/docs/usage/environment
# https://woodpecker-ci.org/docs/usage/secrets#usage
environment:
# Needed for goreleaser to
# push manifests + containers.
DOCKER_USERNAME: gotosocial
DOCKER_PASSWORD:
from_secret: gts_docker_password
# Needed for goreleaser
# to publish the release.
# https://goreleaser.com/scm/gitea/
GITEA_TOKEN:
from_secret: codeberg_token
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
commands:
- git fetch --tags
- /go/dockerlogin.sh
# When releasing, compare commits to the most recent tag that is not the
# current one AND is not a release candidate tag (ie., no "rc" in the name).
#
# The CI_COMMIT_TAG env var should point to the tag that triggered this build.
# See: https://woodpecker-ci.org/docs/usage/environment
#
# Note, this may cause annoyances when doing backport releases, for example,
# releasing v0.10.1 when we've already released v0.15.0 or whatever, but
# they should only be superficial annoyances related to the release notes.
- GORELEASER_PREVIOUS_TAG=$(git tag -l | grep -v "rc\|${CI_COMMIT_TAG}" | sort -V -r | head -n 1) goreleaser release --clean

76
.woodpecker/snapshot.yaml Normal file
View file

@ -0,0 +1,76 @@
# https://woodpecker-ci.org/docs/usage/workflow-syntax#when---global-workflow-conditions
when:
- event: push
branch: main
# https://goreleaser.com/ci/woodpecker/
# https://woodpecker-ci.org/docs/usage/workflow-syntax#clone
clone:
git:
image: woodpeckerci/plugin-git
settings:
tags: true
steps:
snapshot:
# Snapshot only if some interesting
# source code files have changed.
#
# CI_PIPELINE_FILES is undefined if
# files changed > 500, so account for
# this and snapshot anyway if so.
when:
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
- evaluate: >-
(not ("CI_PIPELINE_FILES" in $env)) ||
CI_PIPELINE_FILES == "[]" ||
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" || # startsWith "vendor/" || # startsWith "web/" || # == "Dockerfile" }) ||
len(fromJSON(CI_PIPELINE_FILES)) == 0
# https://codeberg.org/superseriousbusiness/gotosocial-woodpecker-build
image: superseriousbusiness/gotosocial-woodpecker-build:0.12.1
pull: true
# https://woodpecker-ci.org/docs/usage/volumes
volumes:
- /woodpecker/gotosocial/go-build-cache-root:/root/.cache/go-build
- /woodpecker/gotosocial/go-pkg-cache-root:/go/pkg
- /var/run/docker.sock:/var/run/docker.sock
# https://woodpecker-ci.org/docs/usage/environment
# https://woodpecker-ci.org/docs/usage/secrets#usage
environment:
# Needed to push snapshot
# manifests + containers.
DOCKER_USERNAME: gotosocial
DOCKER_PASSWORD:
from_secret: gts_docker_password
# Needed for snapshot script
# to publish artifacts to S3.
S3_ACCESS_KEY_ID:
from_secret: gts_s3_access_key_id
S3_SECRET_ACCESS_KEY:
from_secret: gts_s3_secret_access_key
S3_HOSTNAME: "https://s3.superseriousbusiness.org"
S3_BUCKET_NAME: "gotosocial-snapshots"
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
commands:
# Create a snapshot build with GoReleaser.
- git fetch --tags
- goreleaser release --clean --snapshot
# Login to Docker, push Docker image snapshots + manifests.
- /go/dockerlogin.sh
- docker push superseriousbusiness/gotosocial:snapshot-arm64v8
- docker push superseriousbusiness/gotosocial:snapshot-amd64
- |
docker manifest create superseriousbusiness/gotosocial:snapshot \
superseriousbusiness/gotosocial:snapshot-amd64 \
superseriousbusiness/gotosocial:snapshot-arm64v8
- docker manifest push superseriousbusiness/gotosocial:snapshot
# Publish binary .tar.gz snapshots to S3.
- /go/snapshot_publish.sh

View file

@ -18,22 +18,23 @@ These contribution guidelines were adapted from / inspired by those of Gitea (ht
- [Docker](#docker) - [Docker](#docker)
- [With GoReleaser](#with-goreleaser) - [With GoReleaser](#with-goreleaser)
- [Manually](#manually) - [Manually](#manually)
- [Stylesheet / Web dev](#stylesheet--web-dev) - [Stylesheet / Web dev](#stylesheet-web-dev)
- [Live Reloading](#live-reloading) - [Live Reloading](#live-reloading)
- [Project Structure](#project-structure) - [Project Structure](#project-structure)
- [Finding your way around the code](#finding-your-way-around-the-code) - [Finding your way around the code](#finding-your-way-around-the-code)
- [Style / Linting / Formatting](#style--linting--formatting) - [Style / Linting / Formatting](#style-linting-formatting)
- [Testing](#testing) - [Testing](#testing)
- [Standalone Testrig with Semaphore](#standalone-testrig-with-semaphore) - [Standalone Testrig with Pinafore](#standalone-testrig-with-pinafore)
- [Configuring the Standalone Testrig](#configuring-the-standalone-testrig)
- [Running automated tests](#running-automated-tests) - [Running automated tests](#running-automated-tests)
- [SQLite](#sqlite) - [SQLite](#sqlite)
- [Postgres](#postgres) - [Postgres](#postgres)
- [CLI Tests](#cli-tests) - [CLI Tests](#cli-tests)
- [Federation](#federation) - [Federation](#federation)
- [Updating Swagger docs](#updating-swagger-docs) - [Updating Swagger docs](#updating-swagger-docs)
- [CI/CD configuration](#cicd-configuration) - [CI/CD configuration](#ci-cd-configuration)
- [Release Checklist](#release-checklist) - [Other Useful Stuff](#other-useful-stuff)
- [What if something goes wrong?](#what-if-something-goes-wrong) - [Running migrations on a Postgres DB backup locally](#running-migrations-on-a-postgres-db-backup-locally)
## Introduction ## Introduction
@ -41,11 +42,11 @@ This document contains important information that will help you to write a succe
## Bug reports and feature requests ## Bug reports and feature requests
Currently, we use Github's issue system for tracking bug reports and feature requests. Currently, we use Codeberg's issue system for tracking bug reports and feature requests.
You can view all open issues [here](https://github.com/superseriousbusiness/gotosocial/issues "The Github Issues page for GoToSocial"). You can view all open issues [here](https://codeberg.org/superseriousbusiness/gotosocial/issues "The Codeberg Issues page for GoToSocial").
Before opening a new issue, whether bug or feature request, **please search carefully through both open and closed issues to make sure it hasn't been addressed already**. You can use Github's keyword issue search for this. If your issue is a duplicate of an existing issue, it will be closed. Before opening a new issue, whether bug or feature request, **please search carefully through both open and closed issues to make sure it hasn't been addressed already**. You can use Codeberg's keyword issue search for this. If your issue is a duplicate of an existing issue, it will be closed.
Before you open a feature request issue, please consider the following: Before you open a feature request issue, please consider the following:
@ -99,7 +100,7 @@ If you see something in the documentation that's missing, wrong, or unclear, fee
We support a [Conda](https://docs.conda.io/en/latest/)-based workflow for hacking, building & publishing the documentation. Here's how you can get started locally: We support a [Conda](https://docs.conda.io/en/latest/)-based workflow for hacking, building & publishing the documentation. Here's how you can get started locally:
* Install [`miniconda`](https://docs.conda.io/en/latest/miniconda.html) * Install [`miniconda`](https://www.anaconda.com/docs/getting-started/miniconda/main)
* Create your conda environment: `conda env create -f ./docs/environment.yml` * Create your conda environment: `conda env create -f ./docs/environment.yml`
* Activate the environment: `conda activate gotosocial-docs` * Activate the environment: `conda activate gotosocial-docs`
* Serve locally: `mkdocs serve` * Serve locally: `mkdocs serve`
@ -110,32 +111,34 @@ When adding a new page, you need to include it in the [`mkdocs.yml`](mkdocs.yml)
If you don't use Conda, you can read the `docs/environment.yml` to see which dependencies are required and `pip install` them manually. It's advisable to do this in a virtual environment, which you can create with something like `python3 -m venv /path-to/store-the-venv`. You can then call `/path-to/store-the-venv/bin/pip`, `/path-to/store-the-venv/bin/mkdocs` etc. If you don't use Conda, you can read the `docs/environment.yml` to see which dependencies are required and `pip install` them manually. It's advisable to do this in a virtual environment, which you can create with something like `python3 -m venv /path-to/store-the-venv`. You can then call `/path-to/store-the-venv/bin/pip`, `/path-to/store-the-venv/bin/mkdocs` etc.
In order to upgrade dependencies, use `conda update --update-all` in the activated environment. You can then update the `environment.yml` with `conda env export --from-history -f ./docs/environment.yml`, though you'll need to fix the `channels`. Beware that `conda env export` will also drop the `pip` dependencies, so make sure to add those back. In order to upgrade dependencies, use `conda update --update-all` in the activated environment. You can then update the `environment.yml` with:
```sh
conda env export -n gotosocial-docs --from-history --override-channels -c conda-forge -c nodefaults -f ./docs/environment.yml
```
Beware that `conda env export` will add a `prefix` entry to the environment.yml file, and drop the `pip` dependencies, so make sure to remove the prefix and add the `pip` dependencies back in.
## Development ## Development
### Golang forking quirks ### Golang forking quirks
One of the quirks of Golang is that it relies on the source management path being the same as the one used within `go.mod` and in package imports within individual Go files. This makes working with forks a bit awkward. One of the quirks of Golang is that it relies on the source management path being the same as the one used within `go.mod` and in package imports within individual Go files. This makes working with forks a bit awkward. The solution to this is to fork, then clone the upstream repository, then set `origin` of the upstream repository to that of your fork.
Let's say you fork GoToSocial to `github.com/yourgithubname/gotosocial`, and then clone that repository to `~/go/src/github.com/yourgithubname/gotosocial`. You will probably run into errors trying to run tests or build, so you might change your `go.mod` file so that the module is called `github.com/yourgithubname/gotosocial` instead of `github.com/superseriousbusiness/gotosocial`. But then this breaks all the imports within the project. Nightmare! So now you have to go through the source files and painstakingly replace `github.com/superseriousbusiness/gotosocial` with `github.com/yourgithubname/gotosocial`. This works OK, but when you decide to make a pull request against the original repo, all the changed paths are included! Argh!
The correct solution to this is to fork, then clone the upstream repository, then set `origin` of the upstream repository to that of your fork.
See [this blog post](https://blog.sgmansfield.com/2016/06/working-with-forks-in-go/) for more details. See [this blog post](https://blog.sgmansfield.com/2016/06/working-with-forks-in-go/) for more details.
In case this post disappears, here are the steps (slightly modified): In case this post disappears, here are the steps (slightly modified):
> >
> Fork the repository on GitHub or set up whatever other remote git repo you will be using. In this case, I would go to GitHub and fork the repository. > Fork the repository on Codeberg or set up whatever other remote git repo you will be using. In this case, I would go to Codeberg and fork the repository.
> >
> Now clone the upstream repo (not the fork): > Now clone the upstream repo (not the fork):
> >
> `mkdir -p ~/go/src/github.com/superseriousbusiness && git clone git@github.com:superseriousbusiness/gotosocial ~/go/src/github.com/superseriousbusiness/gotosocial` > `mkdir -p ~/go/src/code.superseriousbusiness.org && git clone git@codeberg.org:superseriousbusiness/gotosocial ~/go/src/code.superseriousbusiness.org/gotosocial`
> >
> Navigate to the top level of the upstream repository on your computer: > Navigate to the top level of the upstream repository on your computer:
> >
> `cd ~/go/src/github.com/superseriousbusiness/gotosocial` > `cd ~/go/src/code.superseriousbusiness.org/gotosocial`
> >
> Rename the current origin remote to upstream: > Rename the current origin remote to upstream:
> >
@ -143,7 +146,7 @@ In case this post disappears, here are the steps (slightly modified):
> >
> Add your fork as origin: > Add your fork as origin:
> >
> `git remote add origin git@github.com/yourgithubname/gotosocial` > `git remote add origin git@codeberg.org:username/gotosocial`
> >
Be sure to run `git fetch` before building the project for the first time. Be sure to run `git fetch` before building the project for the first time.
@ -152,9 +155,9 @@ Be sure to run `git fetch` before building the project for the first time.
#### Binary #### Binary
To get started, you first need to have Go installed. GtS is currently using Go 1.21, so you should take that too. See [here](https://golang.org/doc/install) for installation instructions. To get started, you first need to have Go installed. Check the top of the `go.mod` file to see which version of Go you need to install, and see [here](https://golang.org/doc/install) for installation instructions.
Once you've got go installed, clone this repository into your Go path. Normally, this should be `~/go/src/github.com/superseriousbusiness/gotosocial`. Once you've got Go installed, clone this repository into your Go path. Normally, this should be `~/go/src/code.superseriousbusiness.org/gotosocial`.
Once you've installed the prerequisites, you can try building the project: `./scripts/build.sh`. This will build the `gotosocial` binary. Once you've installed the prerequisites, you can try building the project: `./scripts/build.sh`. This will build the `gotosocial` binary.
@ -170,7 +173,7 @@ nodemon -e go --signal SIGTERM --exec "go run ./cmd/gotosocial --host localhost
#### Docker #### Docker
For both of the below methods, you need to have [Docker buildx](https://docs.docker.com/buildx/working-with-buildx/) installed. For both of the below methods, you need to have [Docker buildx](https://docs.docker.com/build/concepts/overview/#buildx) installed.
##### With GoReleaser ##### With GoReleaser
@ -182,21 +185,19 @@ Normally, these processes are handled by Drone (see CI/CD above). However, you c
To do this, first [install GoReleaser](https://goreleaser.com/install/). To do this, first [install GoReleaser](https://goreleaser.com/install/).
Then install GoSwagger as described in [the Swagger section](#updating-swagger-docs). Then install Node and Yarn as described in [Stylesheet / Web dev](#stylesheet-web-dev).
Then install Node and Yarn as described in [Stylesheet / Web dev](#stylesheet--web-dev).
Finally, to create a snapshot build, do: Finally, to create a snapshot build, do:
```bash ```bash
goreleaser --rm-dist --snapshot goreleaser release --clean --snapshot
``` ```
If all goes according to plan, you should now have a number of multiple-architecture binaries and tars inside the `./dist` folder, and snapshot Docker images should be built (check your terminal output for version). If all goes according to plan, you should now have a number of multiple-architecture binaries and tars inside the `./dist` folder, and snapshot Docker images should be built (check your terminal output for version).
##### Manually ##### Manually
If you prefer a simple approach to building a Docker container, with fewer dependencies (go-swagger, Node, Yarn), you can also just build in the following way: If you prefer a simple approach to building a Docker container, with fewer dependencies (Node, Yarn), you can also just build in the following way:
```bash ```bash
./scripts/build.sh && docker buildx build -t superseriousbusiness/gotosocial:latest . ./scripts/build.sh && docker buildx build -t superseriousbusiness/gotosocial:latest .
@ -204,6 +205,8 @@ If you prefer a simple approach to building a Docker container, with fewer depen
The above command first builds the `gotosocial` binary, then invokes Docker buildx to build the container image. The above command first builds the `gotosocial` binary, then invokes Docker buildx to build the container image.
If you get an error while doing the build that looks like `"/web/assets/swagger.yaml": not found`, then you need to (re)generate the Swagger docs once, see [Updating Swagger docs](#updating-swagger-docs) for the command.
If you want to build a docker image for a different CPU architecture without setting up buildx (for example for ARMv7 aka 32-bit ARM), first modify the Dockerfile by adding the following lines to the top (but don't commit this!): If you want to build a docker image for a different CPU architecture without setting up buildx (for example for ARMv7 aka 32-bit ARM), first modify the Dockerfile by adding the following lines to the top (but don't commit this!):
```dockerfile ```dockerfile
@ -379,7 +382,7 @@ We use [golangci-lint](https://golangci-lint.run/) for linting, which allows us
If you make a PR that doesn't pass the linter, it will be rejected. As such, it's good practice to run the linter locally before pushing or opening a PR. If you make a PR that doesn't pass the linter, it will be rejected. As such, it's good practice to run the linter locally before pushing or opening a PR.
To do this, first install the linter following the instructions [here](https://golangci-lint.run/usage/install/#local-installation). To do this, first install the linter following the instructions [here](https://golangci-lint.run/welcome/install/).
Then, you can run the linter with: Then, you can run the linter with:
@ -391,13 +394,13 @@ If there's no output, great! It passed :)
### Testing ### Testing
GoToSocial provides a [testrig](https://github.com/superseriousbusiness/gotosocial/tree/main/testrig) with a number of mock packages you can use in integration tests. GoToSocial provides a [testrig](https://codeberg.org/superseriousbusiness/gotosocial/tree/main/testrig) with a number of mock packages you can use in integration tests.
One thing that *isn't* mocked is the Database interface because it's just easier to use an in-memory SQLite database than to mock everything out. One thing that *isn't* mocked is the Database interface because it's just easier to use an in-memory SQLite database than to mock everything out.
#### Standalone Testrig with Semaphore #### Standalone Testrig with Pinafore
You can launch a testrig as a standalone server running at localhost, which you can connect to using something like [Semaphore](https://github.com/NickColley/semaphore/). You can launch a testrig as a standalone server running at localhost, which you can connect to using something like [Pinafore](https://github.com/nolanlawson/pinafore/).
To do this, first build the gotosocial binary with `DEBUG=1 ./scripts/build.sh`. To do this, first build the gotosocial binary with `DEBUG=1 ./scripts/build.sh`.
@ -407,14 +410,14 @@ Then, launch the testrig with the `DEBUG` environment variable set by invoking t
DEBUG=1 ./gotosocial testrig start DEBUG=1 ./gotosocial testrig start
``` ```
To run Semaphore locally in dev mode, first clone the [Semaphore](https://github.com/NickColley/semaphore/) repository, and then run the following commands in the cloned directory: To run Pinafore locally in dev mode, first clone the [Pinafore](https://github.com/nolanlawson/pinafore/) repository, and then run the following commands in the cloned directory:
```bash ```bash
yarn # install dependencies yarn # install dependencies
yarn run dev yarn run dev
``` ```
The Semaphore instance will start running on `localhost:4002`. The Pinafore instance will start running on `localhost:4002`.
To connect to the testrig, navigate to `http://localhost:4002` and enter your instance name as `localhost:8080`. To connect to the testrig, navigate to `http://localhost:4002` and enter your instance name as `localhost:8080`.
@ -422,10 +425,35 @@ At the login screen, enter the email address `zork@example.org` and password `pa
Note the following constraints: Note the following constraints:
- Since the testrig uses an in-memory database, the database will be destroyed when the testrig is stopped. - Since the testrig uses an in-memory database by default, the database will be destroyed when the testrig is stopped.
- If you stop the testrig and start it again, any tokens or applications you created during your tests will also be removed. As such, you need to log out and in again every time you stop/start the rig. - If you stop the testrig and start it again, by default any tokens or applications you created during your tests will also be removed. As such, you need to log out and in again every time you stop/start the rig.
- The testrig does not make any actual external HTTP calls, so federation will not work from a testrig. - The testrig does not make any actual external HTTP calls, so federation will not work from a testrig.
##### Configuring the Standalone Testrig
By default the standalone testrig uses an in-memory SQLite database, which is filled with test data when starting up, and is cleared when shutting down, but you can tweak this (and a few other settings) with environment variables:
- `GTS_LOG_LEVEL` - you can set this to `trace` if you want to see all DB queries.
- `GTS_TESTRIG_SKIP_DB_SETUP` - set this to any value to skip the creation of tables and population of test data when the testrig starts.
- `GTS_TESTRIG_SKIP_DB_TEARDOWN` - set this to any value to skip the deletion of tables and test data when the testrig stops.
- `GTS_STORAGE_BACKEND` - this uses in-memory storage by default, but you can set this to `s3` to use a locally-running Minio etc for testing.
- `GTS_DB_TYPE` - you can change this to `postgres` to test against a locally-running Postgres intance.
- `GTS_DB_ADDRESS` - this is set to `:memory:` by default. You can change this to use an sqlite.db file somewhere, or set it to a Postgres address.
- `GTS_DB_PORT`, `GTS_DB_USER`, `GTS_DB_PASSWORD`, `GTS_DB_DATABASE`, `GTS_DB_TLS_MODE`, `GTS_DB_TLS_CA_CERT` - you can set these if you change `GTS_DB_ADDRESS` to `postgres` and don't use `GTS_DB_POSTGRES_CONNECTION_STRING`.
- `GTS_DB_POSTGRES_CONNECTION_STRING` - use this to provide a Postgres connection string if you don't want to set all the db env variables mentioned in the previous point.
Using these variables you can also (albeit awkwardly) test migrations from one schema to another.
For example, to test SQLite migrations:
1. Switch to main branch.
2. Build the debug binary, and then start the testrig with `DEBUG=1 GTS_LOG_LEVEL=trace GTS_DB_ADDRESS=./sqlite.test.db GTS_TESTRIG_SKIP_DB_TEARDOWN=1 ./gotosocial testrig start`. This instructs the testrig to use trace logging, use an actual file for the SQLite db, and to skip tearing it down when finished.
3. Stop the testrig.
4. The file `sqlite.test.db` now contains the schema and test models from the main branch.
5. Switch to the branch with the migration you want to test.
6. Build the debug binary, and then start the testrig with `DEBUG=1 GTS_LOG_LEVEL=trace GTS_DB_ADDRESS=./sqlite.test.db GTS_TESTRIG_SKIP_DB_SETUP=1 ./gotosocial testrig start`. This instructs the testrig to use trace logging, and to use the already-populated sqlite.test.db file.
7. You should see logging for migrations.
#### Running automated tests #### Running automated tests
Tests can be run against both SQLite and Postgres. Tests can be run against both SQLite and Postgres.
@ -478,65 +506,59 @@ You'll additionally need functioning DNS for your two instance names, which you
GoToSocial uses [go-swagger](https://goswagger.io) to generate Swagger API documentation from code annotations. GoToSocial uses [go-swagger](https://goswagger.io) to generate Swagger API documentation from code annotations.
You can install go-swagger following the instructions [here](https://goswagger.io/install.html). If you change Swagger annotations on any of the API paths, you can generate a new Swagger file at `./docs/api/swagger.yaml`, and copy that file to web assets, by running:
If you change Swagger annotations on any of the API paths, you can generate a new Swagger file at `./docs/api/swagger.yaml` by running:
```bash ```bash
swagger generate spec --scan-models --exclude-deps -o docs/api/swagger.yaml go run ./vendor/github.com/go-swagger/go-swagger/cmd/swagger \
generate spec --scan-models --exclude-deps -o docs/api/swagger.yaml \
&& cp docs/api/swagger.yaml web/assets/swagger.yaml
``` ```
You shouldn't need to install go-swagger to run this command, as it's already included in the `vendor` folder.
### CI/CD configuration ### CI/CD configuration
GoToSocial uses [Drone](https://www.drone.io/) for CI/CD tasks like running tests, linting, and building Docker containers. GoToSocial uses [Woodpecker CI](https://woodpecker-ci.org/) for CI/CD tasks like running tests, linting, and building Docker containers.
These runs are integrated with GitHub, and will be run on opening a pull request or merging into main. These runs are integrated with Codeberg, and will be run on opening a pull request or merging into main.
The Drone instance for GoToSocial is [here](https://drone.superseriousbusiness.org/superseriousbusiness/gotosocial). The `woodpecker` pipeline files are in the `.woodpecker` directory of this repository — these define how and when Woodpecker should run.
The `drone.yml` file is [here](./.drone.yml) — this defines how and when Drone should run. Documentation for Drone is [here](https://docs.drone.io/). The Woodpecker instance for GoToSocial is [here](https://woodpecker.superseriousbusiness.org/repos/2).
It is worth noting that the `drone.yml` file must be signed by the Drone admin account to be considered valid. This must be done every time the file is changed. This is to prevent tampering and hijacking of the Drone instance. See [here](https://docs.drone.io/signature/). Documentation for Woodpecker is [here](https://woodpecker-ci.org/docs/intro).
To sign the file, first install and setup the [drone cli tool](https://docs.drone.io/cli/install/). Then, run: ## Other Useful Stuff
Various bits and bobs.
### Running migrations on a Postgres DB backup locally
It may be useful when testing or debugging migrations to be able to run them against a copy of a real instance's Postgres database locally.
Basic steps for this:
First dump the Postgres database on the remote machine, and copy the dump over to your development machine.
Now create a local Postgres container and mount the dump into it with, for example:
```bash ```bash
drone -t PUT_YOUR_DRONE_ADMIN_TOKEN_HERE -s https://drone.superseriousbusiness.org sign superseriousbusiness/gotosocial --save docker run -it --name postgres --network host -e POSTGRES_PASSWORD=postgres -v /path/to/db_dump:/db_dump postgres
``` ```
### Release Checklist In a separate terminal window, execute a command inside the running container to load the dump into the "postgres" database:
First things first: If this is a security hot-fix, we'll probably rush through this list, and make a prettier release a few days later. ```bash
docker exec -it --user postgres postgres psql -X -f /db_dump postgres
```
Now, with that out of the way, here's our Checklist. With the Postgres container still running, run GoToSocial and point it towards the container. Use the appropriate `GTS_HOST` (and `GTS_ACCOUNT_DOMAIN`) values for the instance you dumped:
```bash
GTS_HOST=example.org \
GTS_DB_TYPE=postgres \
GTS_DB_POSTGRES_CONNECTION_STRING=postgres://postgres:postgres@localhost:5432/postgres \
./gotosocial migrations run
```
GoToSocial follows [Semantic Versioning](https://semver.org/). When you're done messing around, don't forget to remove any containers that you started up, and remove any lingering volumes with `docker volume prune`, else you might end up filling your disk with unused temporary volumes.
So our first concern on the Checklist is:
- What version are we releasing?
Next we need to check:
- Do the assets have to be rebuilt and committed to the repository.
- Do the swagger docs have to be rebuilt?
On the project management side:
- Are there any issues that have to be moved to a different milestone?
- Are there any things on the [Roadmap](./ROADMAP.md) that can be ticked off?
Once we're happy with our Checklist, we can create the tag, and push it.
And the rest [is automation](./.drone.yml).
We can now head to GitHub, and add some personality to the release notes.
Finally, we make announcements on the all our channels that the release is out!
#### What if something goes wrong?
Sometimes things go awry.
We release a buggy release, we forgot something ­ something important.
If the release is so bad that it's unusable ­ or dangerous! ­ to a great part of our user-base, we can pull.
That is: Delete the tag.
Either way, once we've resolved the issue, we just start from the top of this list again. Version numbers are cheap. It's cheap to burn them.

View file

@ -1,25 +1,8 @@
# syntax=docker/dockerfile:1.3 # syntax=docker/dockerfile:1.3
# Dockerfile reference: https://docs.docker.com/engine/reference/builder/ # Dockerfile reference: https://docs.docker.com/engine/reference/builder/
# stage 1: generate up-to-date swagger.yaml to put in the final container # stage 1: generate the web/assets/dist bundles
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine AS swagger FROM --platform=${BUILDPLATFORM} node:lts-alpine AS bundler
RUN \
### Installs goswagger for building swagger definitions inside this container
go install "github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5" && \
# Makes swagger executable
chmod +x /go/bin/swagger
COPY go.mod /go/src/github.com/superseriousbusiness/gotosocial/go.mod
COPY go.sum /go/src/github.com/superseriousbusiness/gotosocial/go.sum
COPY cmd /go/src/github.com/superseriousbusiness/gotosocial/cmd
COPY internal /go/src/github.com/superseriousbusiness/gotosocial/internal
WORKDIR /go/src/github.com/superseriousbusiness/gotosocial
RUN /go/bin/swagger generate spec -o /go/src/github.com/superseriousbusiness/gotosocial/swagger.yaml --scan-models
# stage 2: generate the web/assets/dist bundles
FROM --platform=${BUILDPLATFORM} node:18-alpine AS bundler
COPY web web COPY web web
RUN yarn --cwd ./web/source install && \ RUN yarn --cwd ./web/source install && \
@ -27,8 +10,8 @@ RUN yarn --cwd ./web/source install && \
yarn --cwd ./web/source build && \ yarn --cwd ./web/source build && \
rm -rf ./web/source rm -rf ./web/source
# stage 3: build the executor container # stage 2: build the executor container
FROM --platform=${TARGETPLATFORM} alpine:3.17.2 as executor FROM --platform=${TARGETPLATFORM} alpine:3.21 AS executor
# switch to non-root user:group for GtS # switch to non-root user:group for GtS
USER 1000:1000 USER 1000:1000
@ -39,9 +22,10 @@ USER 1000:1000
# #
# See https://docs.docker.com/engine/reference/builder/#workdir # See https://docs.docker.com/engine/reference/builder/#workdir
# #
# First make sure storage exists + is owned by 1000:1000, then go back # First make sure storage + cache exist and are owned by 1000:1000,
# to just /gotosocial, where we'll run from # then go back to just /gotosocial, where we'll actually run from.
WORKDIR "/gotosocial/storage" WORKDIR "/gotosocial/storage"
WORKDIR "/gotosocial/.cache"
WORKDIR "/gotosocial" WORKDIR "/gotosocial"
# copy the dist binary created by goreleaser or build.sh # copy the dist binary created by goreleaser or build.sh
@ -49,7 +33,7 @@ COPY --chown=1000:1000 gotosocial /gotosocial/gotosocial
# copy over the web directories with templates, assets etc # copy over the web directories with templates, assets etc
COPY --chown=1000:1000 --from=bundler web /gotosocial/web COPY --chown=1000:1000 --from=bundler web /gotosocial/web
COPY --chown=1000:1000 --from=swagger /go/src/github.com/superseriousbusiness/gotosocial/swagger.yaml web/assets/swagger.yaml COPY --chown=1000:1000 ./web/assets/swagger.yaml /gotosocial/web/assets/swagger.yaml
VOLUME [ "/gotosocial/storage" ] VOLUME [ "/gotosocial/storage", "/gotosocial/.cache" ]
ENTRYPOINT [ "/gotosocial/gotosocial", "server", "start" ] ENTRYPOINT [ "/gotosocial/gotosocial", "server", "start" ]

415
README.md
View file

@ -1,20 +1,26 @@
<!--overview-start-->
# GoToSocial <!-- omit in toc --> # GoToSocial <!-- omit in toc -->
GoToSocial is an [ActivityPub](https://activitypub.rocks/) social network server, written in Golang. **Update regarding corporate sponsors: we are open to sponsorship arrangements with organizations that align with our values; see the conditions below**
🏳️‍🌈 GoToSocial is an [ActivityPub](https://activitypub.rocks/) social network server, written in Golang. 🏳️‍⚧️
With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to! With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to!
<p align="middle"> <p align="middle">
<img src="./docs/assets/sloth.png" width="300"/> <img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/sloth.webp" width="300"/>
</p> </p>
**GoToSocial is still [ALPHA SOFTWARE](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)**. It is already deployable and useable, and it federates cleanly with many other Fediverse servers (not yet all). However, many things are not yet implemented, and there are plenty of bugs! We foresee entering beta around the beginning of 2024. **GoToSocial is still [BETA SOFTWARE](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta)**. It is already deployable and useable, and it federates cleanly with many other Fediverse servers (not yet all). However, many things are not yet implemented, and there are plenty of bugs! We left alpha stage around September/October 2024, and we intend to exit beta some time around 2026.
Documentation is at [docs.gotosocial.org](https://docs.gotosocial.org). You can skip straight to the API documentation [here](https://docs.gotosocial.org/en/latest/api/swagger/). To build from source, check the [CONTRIBUTING.md](./CONTRIBUTING.md) file. Documentation is at [docs.gotosocial.org](https://docs.gotosocial.org). You can skip straight to the API documentation [here](https://docs.gotosocial.org/en/latest/api/swagger/).
Here's a screenshot of the instance landing page! To build from source, check the [CONTRIBUTING.md](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md) file.
![Screenshot of the landing page for the GoToSocial instance goblin.technology. It shows basic information about the instance; number of users and posts etc.](./docs/assets/instancesplash.png) Here's a screenshot of the instance landing page! Check out the project's [official account](https://gts.superseriousbusiness.org/@gotosocial) running on GoToSocial.
![Screenshot of the landing page for the GoToSocial instance goblin.technology. It shows basic information about the instance; number of users and posts etc.](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/instancesplash.png)
<!--overview-end-->
## Table of Contents <!-- omit in toc --> ## Table of Contents <!-- omit in toc -->
@ -23,46 +29,52 @@ Here's a screenshot of the instance landing page!
- [History and Status](#history-and-status) - [History and Status](#history-and-status)
- [Features](#features) - [Features](#features)
- [Mastodon API compatibility](#mastodon-api-compatibility) - [Mastodon API compatibility](#mastodon-api-compatibility)
- [Granular post settings](#granular-post-settings) - [Granular post visibility settings](#granular-post-visibility-settings)
- [Customizability for admins](#customizability-for-admins) - [Reply controls](#reply-controls)
- [Local-only posting](#local-only-posting)
- [RSS feed](#rss-feed)
- [Rich text formatting](#rich-text-formatting)
- [Themes and custom CSS](#themes-and-custom-css)
- [Easy to run](#easy-to-run) - [Easy to run](#easy-to-run)
- [Safety + security features](#safety--security-features) - [Safety + security features](#safety-security-features)
- [Various federation modes](#various-federation-modes) - [Various federation modes](#various-federation-modes)
- [OIDC integration](#oidc-integration) - [OIDC integration](#oidc-integration)
- [Backend-first design](#backend-first-design) - [Backend-first design](#backend-first-design)
- [Wishlist](#wishlist) - [Alternatives to GoToSocial](#alternatives-to-gotosocial)
- [Getting Started](#getting-started)
- [Third-Party Packaging](#third-party-packaging)
- [Distribution packaging](#distribution-packaging)
- [Self-hosting](#self-hosting)
- [Known Issues](#known-issues) - [Known Issues](#known-issues)
- [Client App Issues](#client-app-issues) - [Installing GoToSocial](#installing-gotosocial)
- [Federation Issues](#federation-issues) - [Supported Platforms](#supported-platforms)
- [Contributing](#contributing) - [64-bit](#64-bit)
- [Building](#building) - [BSDs](#bsds)
- [Releases](#releases) - [32-bit](#32-bit)
- [Stable](#stable) - [OpenBSD](#openbsd)
- [Snapshots](#snapshots) - [Stable Releases](#stable-releases)
- [Snapshot Releases](#snapshot-releases)
- [Docker](#docker) - [Docker](#docker)
- [Binary release .tar.gz](#binary-release-targz) - [Binary release .tar.gz](#binary-release-tar-gz)
- [From Source](#from-source)
- [Third-party Packaging](#third-party-packaging)
- [Contributing](#contributing)
- [Contact](#contact) - [Contact](#contact)
- [Credits](#credits) - [Credits](#credits)
- [Libraries](#libraries) - [Libraries](#libraries)
- [Image Attribution and Licensing](#image-attribution-and-licensing) - [Image Attribution and Licensing](#image-attribution-and-licensing)
- [Team](#team) - [Team](#team)
- [Special Thanks](#special-thanks) - [Special Thanks](#special-thanks)
- [Sponsorship + Funding](#sponsorship--funding) - [Sponsorship + Funding](#sponsorship-funding)
- [Crowdfunding](#crowdfunding) - [Crowdfunding](#crowdfunding)
- [Corporate Sponsorship](#corporate-sponsorship)
- [NLnet](#nlnet) - [NLnet](#nlnet)
- [License](#license) - [License](#license)
<!--body-1-start-->
## What is GoToSocial? ## What is GoToSocial?
GoToSocial provides a lightweight, customizable, and safety-focused entryway into the [Fediverse](https://en.wikipedia.org/wiki/Fediverse), and is comparable to (but distinct from) existing projects such as [Mastodon](https://joinmastodon.org/), [Pleroma](https://pleroma.social/), [Friendica](https://friendi.ca), and [PixelFed](https://pixelfed.org/). GoToSocial provides a lightweight, customizable, and safety-focused entryway into the [Fediverse](https://en.wikipedia.org/wiki/Fediverse), and is comparable to (but distinct from) existing projects such as [Mastodon](https://joinmastodon.org/), [Pleroma](https://pleroma.social/), [Friendica](https://friendi.ca), and [PixelFed](https://pixelfed.org/).
If you've ever used something like Twitter or Tumblr (or even Myspace!) GoToSocial will probably feel familiar to you: You can follow people and have followers, you make posts which people can favourite and reply to and share, and you scroll through posts from people you follow using a timeline. You can write long posts or short posts, or just post images, it's up to you. You can also, of course, block people or otherwise limit interactions that you don't want by posting just to your friends. If you've ever used something like Twitter or Tumblr (or even Myspace!) GoToSocial will probably feel familiar to you: You can follow people and have followers, you make posts which people can favourite and reply to and share, and you scroll through posts from people you follow using a timeline. You can write long posts or short posts, or just post images, it's up to you. You can also, of course, block people or otherwise limit interactions that you don't want by posting just to your friends.
![Screenshot of the web view of a profile in GoToSocial, showing header and avatar, bio, and numbers of followers/following.](./docs/assets/profile1.png) ![Screenshot of the web view of a profile in GoToSocial, showing header and avatar, bio, and numbers of followers/following.](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/profile1.png)
**GoToSocial does NOT use recommendation algorithms or collect data about you to suggest content or 'improve your experience'**. The timeline is chronological: whatever you see at the top of your timeline is there because it's *just been posted*, not because it's been selected as interesting (or controversial) based on your personal profile. **GoToSocial does NOT use recommendation algorithms or collect data about you to suggest content or 'improve your experience'**. The timeline is chronological: whatever you see at the top of your timeline is there because it's *just been posted*, not because it's been selected as interesting (or controversial) based on your personal profile.
@ -74,7 +86,7 @@ GoToSocial doesn't claim to be *better* than any other application, but it offer
Because GoToSocial uses [ActivityPub](https://activitypub.rocks/), you can hang out not just with people on your home server, but with people all over the [Fediverse](https://en.wikipedia.org/wiki/Fediverse), seamlessly. Because GoToSocial uses [ActivityPub](https://activitypub.rocks/), you can hang out not just with people on your home server, but with people all over the [Fediverse](https://en.wikipedia.org/wiki/Fediverse), seamlessly.
![the activitypub logo](docs/assets/ap_logo.svg) ![the activitypub logo](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/ap_logo.svg)
Federation means that your home server is part of a network of servers all over the world that all communicate using the same protocol. Your data is no longer centralized on one company's servers, but resides on your own server and is shared — as you see fit — across a resilient web of servers run by other people. Federation means that your home server is part of a network of servers all over the world that all communicate using the same protocol. Your data is no longer centralized on one company's servers, but resides on your own server and is shared — as you see fit — across a resilient web of servers run by other people.
@ -88,7 +100,11 @@ This project sprang up in February/March 2021 out of a dissatisfaction with the
It began as a solo project, and then picked up steam as more developers became interested and jumped on. It began as a solo project, and then picked up steam as more developers became interested and jumped on.
For a detailed view on what's implemented and what's not, and progress made towards [beta release](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta), please see [the roadmap document](./ROADMAP.md). The [FAQ](docs/faq.md) contains a higher-level overview. We made our first Alpha release in November 2021. We left Alpha and entered Beta in September/October 2024.
For a detailed view on what's implemented and what's not, and progress made towards [stable release](https://en.wikipedia.org/wiki/Software_release_life_cycle#Stable_release), please see [the roadmap document](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/ROADMAP.md).
---
## Features ## Features
@ -96,46 +112,147 @@ For a detailed view on what's implemented and what's not, and progress made towa
The Mastodon API has become the de facto standard for client communication with federated servers, so GoToSocial has implemented and extended the API with custom functionality. The Mastodon API has become the de facto standard for client communication with federated servers, so GoToSocial has implemented and extended the API with custom functionality.
Though most apps that implement the Mastodon API should work, GoToSocial works reliably with beautiful apps like: Though most apps that implement the Mastodon API should work, GoToSocial is tested and works reliably with beautiful apps like:
* [Tusky](https://tusky.app/) for Android * [Tusky](https://tusky.app/) for Android
* [Semaphore](https://semaphore.social/) in the browser * [Pinafore](https://pinafore.social/) in the browser
* [Feditext](https://github.com/feditext/feditext) (beta) on iOS, iPadOS and macOS * [Feditext](https://github.com/feditext/feditext) (beta) on iOS, iPadOS and macOS
If you've used Mastodon with any of these apps before, you'll find using GoToSocial a breeze. If you've used Mastodon with a third-party app before, you'll find using GoToSocial a breeze.
### Granular post settings ### Granular post visibility settings
It's important that when you post something, you can choose who sees it. It's important that when you post something, you can choose who sees it.
GoToSocial offers public/unlisted/friends-only/mutuals-only/and direct posts (slide in DMs! -- with consent). GoToSocial offers public, unlisted/unlocked, followers-only, and direct posts (slide in DMs! -- with consent).
It also allows you to customize how people interact with your posts: ### Reply controls
- Local-only posts. GoToSocial lets you choose who can reply to your posts, via [interaction policies](https://docs.gotosocial.org/en/latest/user_guide/settings/#default-interaction-policies). You can choose to let anyone reply to your posts, let only your friends reply, and more.
- Rebloggable/boostable toggle.
- 'Likeable' toggle.
- 'Replyable' toggle.
### Customizability for admins ![interaction policies settings](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/user-settings-interaction-policy-1.png)
Plenty of [config options](./example/config.yaml) for admins to play around with, including: ### Local-only posting
- Easily adjustable post length. Sometimes you only want to talk to people you share an instance with. GoToSocial supports this via local-only posting, which ensures that your post stays on your instance only, even if it gets boosted. They also do not show up in the web interface, and are not accessible publicly via URL. (Local-only posting is currently dependent on client support.)
- Media upload size settings.
### RSS feed
GoToSocial lets you opt-in to exposing your profile as an RSS feed, so that people can subscribe to your public feed without missing a post.
### Rich text formatting
With GoToSocial, you can write posts using the popular, easy-to-use Markdown markup language, which lets you produce rich HTML posts with support for blockquotes, syntax-highlighted code blocks, lists, inline links, and more.
![markdown-formatted post](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/markdown-post.png)
### Themes and custom CSS
Users can [choose from a variety of fun themes](https://docs.gotosocial.org/en/latest/user_guide/settings/#select-theme) for their profile, or even write their own [custom CSS](https://docs.gotosocial.org/en/latest/user_guide/settings/#custom-css).
It's also easy for admins to [add their own custom themes](https://docs.gotosocial.org/en/latest/admin/themes/) for users to choose from.
<details>
<summary>Show theme examples</summary>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-blurple-dark.png"/>
<figcaption>Blurple dark</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-blurple-light.png"/>
<figcaption>Blurple light</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-brutalist-light.png"/>
<figcaption>Brutalist light</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-brutalist-dark.png"/>
<figcaption>Brutalist dark</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-ecks-pee.png"/>
<figcaption>Ecks pee</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-midnight-trip.png"/>
<figcaption>Midnight trip</figcaption>
</figure>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-moonlight-hunt.png"/>
<figcaption>Moonlight hunt</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-rainforest.png"/>
<figcaption>Rainforest</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-soft.png"/>
<figcaption>Soft</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-solarized-dark.png"/>
<figcaption>Solarized dark</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-solarized-light.png"/>
<figcaption>Solarized light</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-sunset.png"/>
<figcaption>Sunset</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-hacker-dark.png"/>
<figcaption>Hacker dark</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-hacker-light.png"/>
<figcaption>Hacker light</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-programmer-socks-dark.png"/>
<figcaption>Programmer socks dark</figcaption>
</figure>
<hr/>
<figure>
<img src="https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/theme-programmer-socks-light.png"/>
<figcaption>Programmer socks light</figcaption>
</figure>
<hr/>
</details>
### Easy to run ### Easy to run
No external dependencies apart from a database (or just use SQLite!). Simply download the binary + assets (or Docker container), and run. GoToSocial uses only about 250-350MiB of RAM, and requires very little CPU power, so it plays nice with single-board computers, old laptops and tiny $5/month VPSes.
GoToSocial plays nice with lower-powered machines like Raspberry Pi, old laptops and tiny $5/month VPSes. ![Grafana graph showing GoToSocial heap in use hovering around 250MB and spiking occasionally to 400MB-500MB.](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/docs/overrides/public/getting-started-memory-graph.png)
No external dependencies apart from a database (or just use SQLite!).
Simply download the binary + assets (or Docker container), tweak your configuration, and run.
### Safety + security features ### Safety + security features
- Built-in, automatic support for secure HTTPS with [Let's Encrypt](https://letsencrypt.org/). - Strict privacy enforcement for posts, and strict blocking logic.
- Strict privacy enforcement for posts and strict blocking logic. - [Choose the visibility of posts on the web view of your profile](https://docs.gotosocial.org/en/latest/user_guide/settings/#visibility-level-of-posts-to-show-on-your-profile).
- Import and export allow lists and deny lists. Subscribe to community-created block lists (think Ad blocker, but for federation!). - [Import, export](https://docs.gotosocial.org/en/latest/admin/settings/#importexport), and [subscribe](https://docs.gotosocial.org/en/latest/admin/domain_permission_subscriptions) to community-created domain allow and domain block lists.
- HTTP signature authentication: GoToSocial requires [HTTP Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12) when sending and receiving messages, to ensure that your messages can't be tampered with and your identity can't be forged. - HTTP signature authentication: GoToSocial requires [HTTP Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12) when sending and receiving messages, to ensure that your messages can't be tampered with and your identity can't be forged.
- Built-in, automatic support for secure HTTPS with [Let's Encrypt](https://letsencrypt.org/).
- Support for two-factor authentication via time-based one-time passwords (Google authenticator, LastPass authenticator, etc).
### Various federation modes ### Various federation modes
@ -159,73 +276,89 @@ Instead, like Matrix.org's [Synapse](https://github.com/matrix-org/synapse) proj
On top of this API, web developers are encouraged to build any front-end implementation or mobile application that they wish, whether Tumblr-like, Facebook-like, Twitter-like, or something else entirely. On top of this API, web developers are encouraged to build any front-end implementation or mobile application that they wish, whether Tumblr-like, Facebook-like, Twitter-like, or something else entirely.
## Wishlist ---
These cool things will be implemented if time allows (because we really want them): ## Alternatives to GoToSocial
- **Groups** and group posting! Don't like GtS but still want to use the fediverse? Like GtS but prefer not to use beta software? There are lots of alternatives that might suit you better! Here are some that we know work well (alphabetical order):
- Reputation-based 'slow' federation.
- Community decision-making for federation and moderation actions.
- User-selectable custom templates for rendering public posts:
- Twitter-style
- Blogpost
- Gallery
- Etc.
## Getting Started - [Akkoma](https://akkoma.social/): Full-featured ActivityPub microblogging with emoji reacts and quote posts (Elixir).
- [Honk](https://humungus.tedunangst.com/r/honk/m/activitypub.7): Minimalist, opinionated microblogging with "No likes, no faves, no polls, no stars, no claps, no counts." (Go).
- [Iceshrimp.net](https://iceshrimp.dev/iceshrimp/Iceshrimp.NET): rewrite of Iceshrimp from the ground up (.Net).
- [Mastodon](https://joinmastodon.org/): Actively developed, widely recognized, scaleable ActivityPub microblogging instance (Ruby).
- [Snac2](https://codeberg.org/grunfink/snac2): Simple, minimalistic instance with very low system requirements (portable C).
All docs for installation and configuration are hosted at [docs.gotosocial.org](https://docs.gotosocial.org). ---
## Third-Party Packaging
Thank you so much to the cool people who have put time and energy into packaging GoToSocial!
### Distribution packaging
These packages are not maintained by GoToSocial, so please direct questions and issues to the repository maintainers (and donate to them!).
[![Packaging status](https://repology.org/badge/vertical-allrepos/gotosocial.svg)](https://repology.org/project/gotosocial/versions)
### Self-hosting
You can deploy your own instance of GoToSocial with the help of:
- [YunoHost GoToSocial Packaging](https://github.com/YunoHost-Apps/gotosocial_ynh) by [OniriCorpe](https://github.com/OniriCorpe).
- [Ansible Playbook (MASH)](https://github.com/mother-of-all-self-hosting/mash-playbook): The playbook supports a many services, including GoToSocial. [Documentation](https://github.com/mother-of-all-self-hosting/mash-playbook/blob/main/docs/services/gotosocial.md)
- GoToSocial Helm Charts:
- [GoToSocial Helm Chart](https://github.com/fSocietySocial/charts/tree/main/charts/gotosocial) by [0hlov3](https://github.com/0hlov3).
## Known Issues ## Known Issues
Since GoToSocial is still in alpha, there are plenty of bugs. We use [GitHub issues](https://github.com/superseriousbusiness/gotosocial/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to track these. The [FAQ](docs/faq.md) also describes some of the features that haven't been implemented yet. Since GoToSocial is still in beta, there are plenty of bugs. We use [Codeberg issues](https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378161) to track these.
### Client App Issues Since every ActivityPub server implementation has a slightly different interpretation of the protocol, some servers don't quite federate properly with GoToSocial yet. We're tracking these issues [with the federation label](https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378188). Eventually, we want to make sure that any implementation that can federate nicely with Mastodon should also be able to federate with GoToSocial.
GoToSocial works great with Tusky and Semaphore, but some other client applications still need work or have issues connecting to GoToSocial. We're tracking them [right here](https://github.com/superseriousbusiness/gotosocial/projects/5). It's our goal to make any app that's compatible with the Mastodon API work seamlessly with GoToSocial. ---
### Federation Issues ## Installing GoToSocial
Since every ActivityPub server implementation has a slightly different interpretation of the protocol, some servers don't quite federate properly with GoToSocial yet. We're tracking these issues [in this project](https://github.com/superseriousbusiness/gotosocial/projects/4). Eventually, we want to make sure that any implementation that can federate nicely with Mastodon should also be able to federate with GoToSocial. Check our [getting started](https://docs.gotosocial.org/en/latest/getting_started/) documentation! And have a peruse of our [releases page](https://codeberg.org/superseriousbusiness/gotosocial/releases).
## Contributing <!--releases-start-->
### Supported Platforms
You would like to contribute to GtS? Great! ❤️❤️❤️ Check out the issues page to see if there's anything you intend to jump in on, and read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for guidelines and setting up your dev environment. While we try to support a reasonable number of architectures and operating systems, it's not always possible to support a given platform due to library constraints or performance issues.
## Building Platforms that we don't officially support *may* still work, but we can't test or guarantee performance or stability.
Instructions for building GoToSocial from source are in the [CONTRIBUTING.md](./CONTRIBUTING.md) file. This is the current status of support offered by GoToSocial for different platforms (if something is unlisted it means we haven't checked yet so we don't know):
## Releases | OS | Architecture | Support level | Binary archive | Docker container |
| ------- | ----------------------- | ----------------------------------------- | -------------- | ---------------- |
| Linux | x86-64/AMD64 (64-bit) | 🟢 Full<sup>[1](#64-bit)</sup> | Yes | Yes |
| Linux | Armv8/ARM64 (64-bit) | 🟢 Full<sup>[1](#64-bit)</sup> | Yes | Yes |
| FreeBSD | x86-64/AMD64 (64-bit) | 🟢 Full<sup>[1](#64-bit),[2](#bsds)</sup> | Yes | No |
| FreeBSD | Armv8/ARM64 (64-bit) | 🟢 Full<sup>[1](#64-bit),[2](#bsds)</sup> | Yes | No |
| NetBSD | x86-64/AMD64 (64-bit) | 🟢 Full<sup>[1](#64-bit),[2](#bsds)</sup> | Yes | No |
| NetBSD | Armv8/ARM64 (64-bit) | 🟢 Full<sup>[1](#64-bit),[2](#bsds)</sup> | Yes | No |
| Linux | x86-32/i386 (32-bit) | 🟡 Partial<sup>[3](#32-bit)</sup> | Yes | Yes |
| Linux | Armv7/ARM32 (32-bit) | 🟡 Partial<sup>[3](#32-bit)</sup> | Yes | Yes |
| Linux | Armv6/ARM32 (32-bit) | 🟡 Partial<sup>[3](#32-bit)</sup> | Yes | Yes |
| OpenBSD | Any | 🔴 None<sup>[4](#openbsd)</sup> | No | No |
### Stable #### 64-bit
Notes on 64-bit CPU feature requirements:
- x86_64 requires the [x86-64-v2](https://en.wikipedia.org/wiki/X86-64-v2) level instruction sets. (CPUs manufactured after ~2010)
- ARM64 requires no specific features, ARMv8 CPUs (and later) have all required features.
If any of the above features are missing, performance of media processing (and possibly, SQLite) will suffer. In these situations, you may have some success building a binary yourself with the totally **unsupported, experimental** [nowasm](https://docs.gotosocial.org/en/latest/advanced/builds/nowasm/) tag.
#### BSDs
Mostly works, just [a few things to keep in mind](https://github.com/ncruces/go-sqlite3/wiki/Support-matrix) with WASM SQLite; check release notes carefully when installing on NetBSD or FreeBSD. If running with Postgres you should have no issues.
#### 32-bit
GtS doesn't work well on 32-bit systems like i386, or Armv6/v7, mainly due to performance of media decoding.
We don't recommend running GtS on 32-bit, but you may have some success either turning off remote media processing altogether, or building a binary yourself with the totally **unsupported, experimental** [nowasm](https://docs.gotosocial.org/en/latest/advanced/builds/nowasm/) tag.
For more guidance, check release notes when trying to install on 32-bit.
#### OpenBSD
Marked as unsupported due to performance issues (no WASM compiler, high memory usage when idle, crashes while processing media).
While we don't support running GtS on OpenBSD, you may have some success building a binary yourself with the totally **unsupported, experimental** [nowasm](https://docs.gotosocial.org/en/latest/advanced/builds/nowasm/) tag.
### Stable Releases
We package our stable releases for both binary builds and Docker containers, so that you don't have to build from source yourself. We package our stable releases for both binary builds and Docker containers, so that you don't have to build from source yourself.
Check our [releases page](https://github.com/superseriousbusiness/gotosocial/releases) and our [getting started](https://docs.gotosocial.org/en/latest/getting_started/) documentation. The Docker image `docker.io/superseriousbusiness/gotosocial:latest` will always correspond to the latest stable release. Since this tag is overwritten frequently, you may want to use Docker CLI flag `--pull always` to ensure that you always have the most up-to-date image every time you run using this tag. Alternatively, run `docker pull docker.io/superseriousbusiness/gotosocial:latest` manually just before use.
The Docker image `superseriousbusiness/gotosocial:latest` will always correspond to the latest stable release. Since this tag is overwritten frequently, you may want to use Docker CLI flag `--pull always` to ensure that you always have the most up-to-date image every time you run using this tag. Alternatively, run `docker pull superseriousbusiness/gotosocial:latest` manually just before use. ### Snapshot Releases
### Snapshots
We also make snapshot builds every time something is merged into the main branch, so you can run from whatever code is on main if you wish. We also make snapshot builds every time something is merged into the main branch, so you can run from whatever code is on main if you wish.
@ -233,30 +366,58 @@ Please be warned that you do so at your own risk! We try to keep main working pr
#### Docker #### Docker
To run from main using Docker, use the `snapshot` Docker tag. The Docker image `superseriousbusiness/gotosocial:snapshot` will always correspond to the latest commit on main. Since this tag is overwritten frequently, you may want to use Docker CLI flag `--pull always` to ensure that you always have the most up-to-date image every time you run using this tag. Alternatively, run `docker pull superseriousbusiness/gotosocial:snapshot` manually just before use. To run from main using Docker, use the `snapshot` Docker tag. The Docker image `docker.io/superseriousbusiness/gotosocial:snapshot` will always correspond to the latest commit on main that involves changes to Go code or web assets/source. Since this tag is overwritten frequently, you may want to use Docker CLI flag `--pull always` to ensure that you always have the most up-to-date image every time you run using this tag. Alternatively, run `docker pull docker.io/superseriousbusiness/gotosocial:snapshot` manually just before use.
#### Binary release .tar.gz #### Binary release .tar.gz
To run from main using a binary release, download the appropriate .tar.gz file for your architecture from our [self-hosted Minio S3 repository](https://minio.s3.superseriousbusiness.org/browser/gotosocial-snapshots). To run from main using a binary release, download the appropriate .tar.gz file for your architecture from our [self-hosted Minio S3 repository](https://minio.s3.superseriousbusiness.org/browser/gotosocial-snapshots).
Snapshot binary releases in the S3 bucket are keyed by Github commit hash. To get the latest one, sort by Last Modified, or check out the list of commits [here](https://github.com/superseriousbusiness/gotosocial/commits/main), copy the SHA of the latest one, and paste it in the Minio console filter. Snapshot binary releases are expired after 28 days, to keep our hosting costs down. Snapshot binary releases in the S3 bucket are keyed by commit hash. To get the latest one, sort by Last Modified, or check out the list of commits [here](https://codeberg.org/superseriousbusiness/gotosocial/commits/main), copy the SHA of the latest one, and paste it in the Minio console filter. Snapshot binary releases are expired after 28 days, to keep our hosting costs down.
### From Source
Instructions for building GoToSocial from source are in the [CONTRIBUTING.md](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md) file.
### Third-party Packaging
Thank you so much to the cool people who have put time and energy into packaging GoToSocial!
These packages are not maintained by GoToSocial, so please direct questions and issues to the repository maintainers (and donate to them!).
[![Packaging status](https://repology.org/badge/vertical-allrepos/gotosocial.svg)](https://repology.org/project/gotosocial/versions)
You can also deploy your own instance of GoToSocial with the help of:
- [YunoHost GoToSocial Packaging](https://github.com/YunoHost-Apps/gotosocial_ynh) by [OniriCorpe](https://github.com/OniriCorpe).
- [Ansible Playbook (MASH)](https://github.com/mother-of-all-self-hosting/mash-playbook): The playbook supports a many services, including GoToSocial. [Documentation](https://github.com/mother-of-all-self-hosting/mash-playbook/blob/main/docs/services/gotosocial.md)
- [GoToSocial Helm Chart](https://github.com/fSocietySocial/charts/tree/main/charts/gotosocial) by [0hlov3](https://github.com/0hlov3).
<!--releases-end-->
---
## Contributing
You would like to contribute to GtS? Great! ❤️❤️❤️ Check out the issues page to see if there's anything you intend to jump in on, and read the [CONTRIBUTING.md](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md) file for guidelines and setting up your dev environment.
---
## Contact ## Contact
For questions and comments, you can [join our Matrix space](https://matrix.to/#/#gotosocial-space:superseriousbusiness.org) at `#gotosocial-space:superseriousbusiness.org`. This is the quickest way to reach the devs. You can also mail [admin@gotosocial.org](mailto:admin@gotosocial.org). For questions and comments, you can [join our Matrix space](https://matrix.to/#/#gotosocial-space:superseriousbusiness.org) at `#gotosocial-space:superseriousbusiness.org`. This is the quickest way to reach the devs. You can also mail [admin@gotosocial.org](mailto:admin@gotosocial.org).
For bugs and feature requests, please check to see if there's [already an issue](https://github.com/superseriousbusiness/gotosocial/issues), and if not, open one or use one of the above channels to make a request (if you don't have a Github account). For bugs and feature requests, please check to see if there's [already an issue](https://codeberg.org/superseriousbusiness/gotosocial/issues), and if not, open one or use one of the above channels to make a request (if you don't have a Codeberg account).
---
## Credits ## Credits
<!--body-1-end-->
### Libraries ### Libraries
The following open source libraries, frameworks, and tools are used by GoToSocial, with gratitude 💕 The following open source libraries, frameworks, and tools are used by GoToSocial, with gratitude 💕
- [abema/go-mp4](https://github.com/abema/go-mp4); mp4 parsing. [MIT License](https://spdx.org/licenses/MIT.html).
- [buckket/go-blurhash](https://github.com/buckket/go-blurhash); used for generating image blurhashes. [GPL-3.0 License](https://spdx.org/licenses/GPL-3.0-only.html). - [buckket/go-blurhash](https://github.com/buckket/go-blurhash); used for generating image blurhashes. [GPL-3.0 License](https://spdx.org/licenses/GPL-3.0-only.html).
- [coreos/go-oidc](https://github.com/coreos/go-oidc); OIDC client library. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html). - [coreos/go-oidc](https://github.com/coreos/go-oidc); OIDC client library. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- [disintegration/imaging](https://github.com/disintegration/imaging); image resizing. [MIT License](https://spdx.org/licenses/MIT.html).
- [DmitriyVTitov/size](https://github.com/DmitriyVTitov/size); runtime model memory size calculations. [MIT License](https://spdx.org/licenses/MIT.html). - [DmitriyVTitov/size](https://github.com/DmitriyVTitov/size); runtime model memory size calculations. [MIT License](https://spdx.org/licenses/MIT.html).
- Gin: - Gin:
- [gin-contrib/cors](https://github.com/gin-contrib/cors); Gin CORS middleware. [MIT License](https://spdx.org/licenses/MIT.html). - [gin-contrib/cors](https://github.com/gin-contrib/cors); Gin CORS middleware. [MIT License](https://spdx.org/licenses/MIT.html).
@ -264,7 +425,6 @@ The following open source libraries, frameworks, and tools are used by GoToSocia
- [gin-contrib/sessions](https://github.com/gin-contrib/sessions); Gin sessions middleware. [MIT License](https://spdx.org/licenses/MIT.html). - [gin-contrib/sessions](https://github.com/gin-contrib/sessions); Gin sessions middleware. [MIT License](https://spdx.org/licenses/MIT.html).
- [gin-gonic/gin](https://github.com/gin-gonic/gin); speedy router engine. [MIT License](https://spdx.org/licenses/MIT.html). - [gin-gonic/gin](https://github.com/gin-gonic/gin); speedy router engine. [MIT License](https://spdx.org/licenses/MIT.html).
- [google/uuid](https://github.com/google/uuid); UUID generation. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html). - [google/uuid](https://github.com/google/uuid); UUID generation. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html).
- [google/wuffs](https://github.com/google/wuffs); png-stripping code. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- Go-Playground: - Go-Playground:
- [go-playground/form](https://github.com/go-playground/form); funky form mapping support. [MIT License](https://spdx.org/licenses/MIT.html). - [go-playground/form](https://github.com/go-playground/form); funky form mapping support. [MIT License](https://spdx.org/licenses/MIT.html).
- [go-playground/validator](https://github.com/go-playground/validator); struct validation. [MIT License](https://spdx.org/licenses/MIT.html). - [go-playground/validator](https://github.com/go-playground/validator); struct validation. [MIT License](https://spdx.org/licenses/MIT.html).
@ -277,18 +437,21 @@ The following open source libraries, frameworks, and tools are used by GoToSocia
- [gruf/go-cache](https://codeberg.org/gruf/go-cache); LRU and TTL caches. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-cache](https://codeberg.org/gruf/go-cache); LRU and TTL caches. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-debug](https://codeberg.org/gruf/go-debug); debug build tag. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-debug](https://codeberg.org/gruf/go-debug); debug build tag. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-errors](https://codeberg.org/gruf/go-errors); context-like error w/ value wrapping [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-errors](https://codeberg.org/gruf/go-errors); context-like error w/ value wrapping [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-fastcopy](https://codeberg.org/gruf/go-fastcopy); performant pooled I/O copying [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-fastcopy](https://codeberg.org/gruf/go-fastcopy); performant (buffer pooled) I/O copying [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-ffmpreg](https://codeberg.org/gruf/go-ffmpreg); embedded ffmpeg / ffprobe WASM binaries [GPL-3.0 License](https://spdx.org/licenses/GPL-3.0-only.html).
- [gruf/go-kv](https://codeberg.org/gruf/go-kv); log field formatting. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-kv](https://codeberg.org/gruf/go-kv); log field formatting. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-list](https://codeberg.org/gruf/go-list); generic doubly linked list. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-mutexes](https://codeberg.org/gruf/go-mutexes); safemutex & mutex map. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-mutexes](https://codeberg.org/gruf/go-mutexes); safemutex & mutex map. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-runners](https://codeberg.org/gruf/go-runners); workerpools and synchronization. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-runners](https://codeberg.org/gruf/go-runners); synchronization utilities. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-sched](https://codeberg.org/gruf/go-sched); task scheduler. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-sched](https://codeberg.org/gruf/go-sched); task scheduler. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-store](https://codeberg.org/gruf/go-store); file storage backend (local & s3). [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-split](https://codeberg.org/gruf/go-split); configuration string handling. [MIT License](https://spdx.org/licenses/MIT.html).
- [gruf/go-structr](https://codeberg.org/gruf/go-structr); struct caching w/ automated multiple indexing. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-storage](https://codeberg.org/gruf/go-storage); file storage backend (local & s3). [MIT License](https://spdx.org/licenses/MIT.html).
- [h2non/filetype](https://github.com/h2non/filetype); filetype checking. [MIT License](https://spdx.org/licenses/MIT.html). - [gruf/go-structr](https://codeberg.org/gruf/go-structr); struct caching + queueing with automated indexing by field. [MIT License](https://spdx.org/licenses/MIT.html).
- jackc: - jackc:
- [jackc/pgx](https://github.com/jackc/pgconn); Postgres driver. [MIT License](https://spdx.org/licenses/MIT.html). - [jackc/pgconn](https://github.com/jackc/pgconn); Postgres driver. [MIT License](https://spdx.org/licenses/MIT.html).
- [jackc/pgx](https://github.com/jackc/pgx); Postgres driver and toolkit. [MIT License](https://spdx.org/licenses/MIT.html). - [jackc/pgx](https://github.com/jackc/pgx); Postgres driver and toolkit. [MIT License](https://spdx.org/licenses/MIT.html).
- [KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit); cgroups memory limit checking. [MIT License](https://spdx.org/licenses/MIT.html). - [KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit); cgroups memory limit checking. [MIT License](https://spdx.org/licenses/MIT.html).
- [k3a/html2text](https://github.com/k3a/html2text); HTML-to-text conversion. [MIT License](https://spdx.org/licenses/MIT.html).
- [mcuadros/go-syslog](https://github.com/mcuadros/go-syslog); Syslog server library. [MIT License](https://spdx.org/licenses/MIT.html). - [mcuadros/go-syslog](https://github.com/mcuadros/go-syslog); Syslog server library. [MIT License](https://spdx.org/licenses/MIT.html).
- [microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday); HTML user-input sanitization. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html). - [microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday); HTML user-input sanitization. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html).
- [miekg/dns](https://github.com/miekg/dns); DNS utilities. [Go License](https://go.dev/LICENSE). - [miekg/dns](https://github.com/miekg/dns); DNS utilities. [Go License](https://go.dev/LICENSE).
@ -298,15 +461,17 @@ The following open source libraries, frameworks, and tools are used by GoToSocia
- [mvdan.cc/xurls](https://github.com/mvdan/xurls); URL parsing regular expressions. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html). - [mvdan.cc/xurls](https://github.com/mvdan/xurls); URL parsing regular expressions. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html).
- [oklog/ulid](https://github.com/oklog/ulid); sequential, database-friendly ID generation. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html). - [oklog/ulid](https://github.com/oklog/ulid); sequential, database-friendly ID generation. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- [open-telemetry/opentelemetry-go](https://github.com/open-telemetry/opentelemetry-go); OpenTelemetry API + SDK. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html). - [open-telemetry/opentelemetry-go](https://github.com/open-telemetry/opentelemetry-go); OpenTelemetry API + SDK. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- [pquerna/otp](https://github.com/pquerna/otp); One Time Password utilities. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- spf13: - spf13:
- [spf13/cobra](https://github.com/spf13/cobra); command-line tooling. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html). - [spf13/cobra](https://github.com/spf13/cobra); command-line tooling. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- [spf13/viper](https://github.com/spf13/viper); configuration management. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html). - [spf13/viper](https://github.com/spf13/viper); configuration management. [Apache-2.0 License](https://spdx.org/licenses/Apache-2.0.html).
- [stretchr/testify](https://github.com/stretchr/testify); test framework. [MIT License](https://spdx.org/licenses/MIT.html). - [stretchr/testify](https://github.com/stretchr/testify); test framework. [MIT License](https://spdx.org/licenses/MIT.html).
- superseriousbusiness: - superseriousbusiness:
- [superseriousbusiness/activity](https://github.com/superseriousbusiness/activity) forked from [go-fed/activity](https://github.com/go-fed/activity); Golang ActivityPub/ActivityStreams library. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html). - [superseriousbusiness/activity](https://code.superseriousbusiness.org/activity) forked from [go-fed/activity](https://github.com/go-fed/activity); Golang ActivityPub/ActivityStreams library. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html).
- [superseriousbusiness/exif-terminator](https://codeberg.org/superseriousbusiness/exif-terminator); EXIF data removal. [GNU AGPL v3 LICENSE](https://spdx.org/licenses/AGPL-3.0-or-later.html). - [superseriousbusiness/exif-terminator](https://code.superseriousbusiness.org/exif-terminator); EXIF data removal. [GNU AGPL v3 LICENSE](https://spdx.org/licenses/AGPL-3.0-or-later.html).
- [superseriousbusiness/httpsig](https://github.com/superseriousbusiness/httpsig) forked from [go-fed/httpsig](https://github.com/go-fed/httpsig); secure HTTP signature library. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html). - [superseriousbusiness/httpsig](https://code.superseriousbusiness.org/httpsig) forked from [go-fed/httpsig](https://github.com/go-fed/httpsig); secure HTTP signature library. [BSD-3-Clause License](https://spdx.org/licenses/BSD-3-Clause.html).
- [superseriousbusiness/oauth2](https://github.com/superseriousbusiness/oauth2) forked from [go-oauth2/oauth2](https://github.com/go-oauth2/oauth2); OAuth server framework and token handling. [MIT License](https://spdx.org/licenses/MIT.html). - [superseriousbusiness/oauth2](https://code.superseriousbusiness.org/oauth2) forked from [go-oauth2/oauth2](https://github.com/go-oauth2/oauth2); OAuth server framework and token handling. [MIT License](https://spdx.org/licenses/MIT.html).
- [temoto/robotstxt](https://github.com/temoto/robotstxt); robots.txt parsing. [MIT License](https://spdx.org/licenses/MIT.html).
- [tdewolff/minify](https://github.com/tdewolff/minify); HTML minification for Markdown-submitted posts. [MIT License](https://spdx.org/licenses/MIT.html). - [tdewolff/minify](https://github.com/tdewolff/minify); HTML minification for Markdown-submitted posts. [MIT License](https://spdx.org/licenses/MIT.html).
- [uber-go/automaxprocs](https://github.com/uber-go/automaxprocs); GOMAXPROCS automation. [MIT License](https://spdx.org/licenses/MIT.html). - [uber-go/automaxprocs](https://github.com/uber-go/automaxprocs); GOMAXPROCS automation. [MIT License](https://spdx.org/licenses/MIT.html).
- [ulule/limiter](https://github.com/ulule/limiter); http rate limit middleware. [MIT License](https://spdx.org/licenses/MIT.html). - [ulule/limiter](https://github.com/ulule/limiter); http rate limit middleware. [MIT License](https://spdx.org/licenses/MIT.html).
@ -314,6 +479,7 @@ The following open source libraries, frameworks, and tools are used by GoToSocia
- [wagslane/go-password-validator](https://github.com/wagslane/go-password-validator); password strength validation. [MIT License](https://spdx.org/licenses/MIT.html). - [wagslane/go-password-validator](https://github.com/wagslane/go-password-validator); password strength validation. [MIT License](https://spdx.org/licenses/MIT.html).
- [yuin/goldmark](https://github.com/yuin/goldmark); markdown parser. [MIT License](https://spdx.org/licenses/MIT.html). - [yuin/goldmark](https://github.com/yuin/goldmark); markdown parser. [MIT License](https://spdx.org/licenses/MIT.html).
<!--body-2-start-->
### Image Attribution and Licensing ### Image Attribution and Licensing
Sloth logo by [Anna Abramek](https://abramek.art/). Sloth logo by [Anna Abramek](https://abramek.art/).
@ -322,9 +488,10 @@ Sloth logo by [Anna Abramek](https://abramek.art/).
The Creative Commons Attribution-ShareAlike 4.0 International License license applies specifically to the following files and subdirectories of this repository: The Creative Commons Attribution-ShareAlike 4.0 International License license applies specifically to the following files and subdirectories of this repository:
- [sloth logo png](./web/assets/logo.png) - [sloth logo png](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/web/assets/logo.png)
- [sloth logo svg](./web/assets/logo.svg) - [sloth logo webp](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/web/assets/logo.webp)
- [all default avatars](./web/assets/default_avatars) - [sloth logo svg](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/web/assets/logo.svg)
- [all default avatars](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/web/assets/default_avatars)
Under the terms of the license, you are free to: Under the terms of the license, you are free to:
@ -339,7 +506,7 @@ In alphabetical order (... and order of smell):
- f0x \[[donate with liberapay](https://liberapay.com/f0x)\] - f0x \[[donate with liberapay](https://liberapay.com/f0x)\]
- kim \[check out my code @ [codeberg](https://codeberg.org/gruf), or find me @ [@kim](https://k.iim.gay/@kim)\] - kim \[check out my code @ [codeberg](https://codeberg.org/gruf), or find me @ [@kim](https://k.iim.gay/@kim)\]
- tobi \[[donate with liberapay](https://liberapay.com/GoToSocial/)\] - tobi \[[donate with liberapay](https://liberapay.com/GoToSocial/)\]
- maloki \[[@maloki@goblin.technology](https://goblin.technology/@maloki)\] - vyr
### Special Thanks ### Special Thanks
@ -347,9 +514,11 @@ A huge thank you to CJ from [go-fed](https://github.com/go-fed/activity): withou
Thanks to everyone who has used GtS, opened an issue, suggested something, given funding, and otherwise encouraged or supported the project! Thanks to everyone who has used GtS, opened an issue, suggested something, given funding, and otherwise encouraged or supported the project!
---
## Sponsorship + Funding ## Sponsorship + Funding
**Please note: GoToSocial has NO CORPORATE SPONSORS and does not desire corporate sponsorship. In addition, we do not take donations from any of the following: adult websites, affiliate and review websites, casinos and gambling, insurance and financial products (credit), pharmacy products, SEO services and social media buying, VPN and proxy services, and essay writing services. Donations from such sources will be automatically rejected.** **Update regarding corporate sponsors: we are open to sponsorship arrangements with organizations that align with our values; see the conditions below**
### Crowdfunding ### Crowdfunding
@ -365,17 +534,32 @@ Crowdfunded donations to our OpenCollective and Liberapay accounts go towards pa
💕 🦥 💕 Thank you! 💕 🦥 💕 Thank you!
### Corporate Sponsorship
GoToSocial is open to sponsorship arrangements with organizations that align with our values. To show our thanks for your support, we will display your logo, website, and a short tagline on the repository and documentation. The following caveats apply to sponsorships:
1. GoToSocial project direction will always remain 100% in the hands of the core team, and will never be dictated or influenced by corporate sponsorship. This is non-negotiable. Corporations are of course free of course to suggest / request features in the same manner as any other user, but they are not given special treatment.
2. Corporate sponsorship is dependent on your organization meeting our team's ethical guidelines. These are not a concrete set of rules but instead boil down to "is your company causing harm?". For example, those in the defense industry need not apply as the simple answer to that question is, "yes!".
If after reading this you are still interested in supporting us, that is wonderful! Please reach out to us at admin@gotosocial.org to further discuss :)
### NLnet ### NLnet
<img src="https://nlnet.nl/logo/NGI/NGIZero-green.hex.svg" width="75" alt="NGIZero logo"/> <img src="https://nlnet.nl/logo/NGI/NGIZero-green.hex.svg" width="75" alt="NGIZero logo"/>
Combined with the above crowdfunding sources, 2023 Alpha development of GoToSocial is also funded by a 50,000 EUR grant from the [NGI0 Entrust Fund](https://nlnet.nl/entrust/), via [NLnet](https://nlnet.nl/). See [here](https://nlnet.nl/project/GoToSocial/#ack) for more details. The successful grant application is archived [here](https://github.com/superseriousbusiness/gotosocial/blob/main/archive/nlnet/2022-next-generation-internet-zero.md). Combined with the above crowdfunding sources, 2023 Alpha development of GoToSocial was funded by a 50,000 EUR grant from the [NGI0 Entrust Fund](https://nlnet.nl/entrust/), via [NLnet](https://nlnet.nl/). See [here](https://nlnet.nl/project/GoToSocial/#ack) for more details. The successful grant application is archived [here](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/archive/nlnet/2022-next-generation-internet-zero.md).
2024 Beta development of GoToSocial is being funded by an additional 50,000 EUR grant from the [NGI0 Entrust Fund](https://nlnet.nl/entrust/), via [NLnet](https://nlnet.nl/).
---
## License ## License
![the gnu AGPL logo](https://www.gnu.org/graphics/agplv3-155x51.png) ![the gnu AGPL logo](https://www.gnu.org/graphics/agplv3-155x51.png)
GoToSocial is free software, licensed under the [GNU AGPL v3 LICENSE](LICENSE). We encourage forking and changing the code, hacking around with it, and experimenting. GoToSocial is free software, licensed under the [GNU AGPL v3 LICENSE](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/LICENSE). We encourage forking and changing the code, hacking around with it, and experimenting.
See [here](https://www.gnu.org/licenses/why-affero-gpl.html) for the differences between AGPL versus GPL licensing, and [here](https://www.gnu.org/licenses/gpl-faq.html) for FAQ's about GPL licenses, including the AGPL. See [here](https://www.gnu.org/licenses/why-affero-gpl.html) for the differences between AGPL versus GPL licensing, and [here](https://www.gnu.org/licenses/gpl-faq.html) for FAQ's about GPL licenses, including the AGPL.
@ -385,4 +569,5 @@ If you modify the GoToSocial source code, and run that modified code in a way th
Copyright (C) GoToSocial Authors Copyright (C) GoToSocial Authors
(I'm adding this here to take the crown of having the 1000th commit ~ kim) <!--I'm adding this here to take the crown of having the 1000th commit ~ kim-->
<!--body-2-end-->

View file

@ -1,10 +1,10 @@
# Roadmap to Beta <!-- omit in toc --> # Roadmap to Beta <!-- omit in toc -->
This document contains the roadmap for GoToSocial to be considered eligible for its first [beta release](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta). This document contains the roadmap for GoToSocial to be considered eligible for its first proper [stable release](https://en.wikipedia.org/wiki/Software_release_life_cycle#Stable_release).
All the info contained in this document is best-guess only. It's useful to have a rough timeline we can direct people to, but things will undoubtedly change along the way; don't hold us to anything in this doc! All the info contained in this document is best-guess only. It's useful to have a rough timeline we can direct people to, but things will undoubtedly change along the way; don't hold us to anything in this doc!
Thank you to [NLnet](https://nlnet.nl) for helping to fund the alpha phase of GoToSocial development and get us moving towards beta! Thank you to [NLnet](https://nlnet.nl) for helping to fund the alpha and beta phases of GoToSocial development!
Big thank you to all of our [Open Collective](https://opencollective.com/gotosocial) and [Liberapay](https://liberapay.com/gotosocial) contributors, who've helped us keep the lights on! 💕 Big thank you to all of our [Open Collective](https://opencollective.com/gotosocial) and [Liberapay](https://liberapay.com/gotosocial) contributors, who've helped us keep the lights on! 💕
@ -13,11 +13,12 @@ Big thank you to all of our [Open Collective](https://opencollective.com/gotosoc
- [Beta Aims](#beta-aims) - [Beta Aims](#beta-aims)
- [Timeline](#timeline) - [Timeline](#timeline)
- [Mid 2023](#mid-2023) - [Mid 2023](#mid-2023)
- [Mid/late 2023](#midlate-2023) - [Mid/late 2023](#mid-late-2023)
- [Late 2023](#late-2023)
- [Early 2024](#early-2024) - [Early 2024](#early-2024)
- [BETA Milestone](#beta-milestone) - [BETA milestone](#beta-milestone)
- [Remainder 2024 - early 2025](#remainder-2024---early-2025) - [Remainder 2024 - early 2025](#remainder-2024-early-2025)
- [On the way out of BETA to STABLE RELEASE](#on-the-way-out-of-beta-to-stable-release)
- [Wishlist](#wishlist)
## Beta Aims ## Beta Aims
@ -46,34 +47,53 @@ What follows is a rough timeline of features that will be implemented on the roa
### Mid 2023 ### Mid 2023
- [x] **Hashtags** -- implement federating hashtags and viewing hashtags to allow users to discover posts that they might be interested in. (Done! https://github.com/superseriousbusiness/gotosocial/pull/2032). - [x] **Hashtags** -- implement federating hashtags and viewing hashtags to allow users to discover posts that they might be interested in. (Done! https://codeberg.org/superseriousbusiness/gotosocial/pulls/2032).
### Mid/late 2023 ### Mid/late 2023
- [x] **Polls** -- implementing parsing, creating, and voting in polls. (Done! https://github.com/superseriousbusiness/gotosocial/pull/2330) - [x] **Polls** -- implementing parsing, creating, and voting in polls. (Done! https://codeberg.org/superseriousbusiness/gotosocial/pulls/2330)
- [x] **Mute posts/threads** -- opt-out of notifications for replies to a thread; no longer show a given post in your timeline. (Done! https://github.com/superseriousbusiness/gotosocial/pull/2278) - [x] **Mute posts/threads** -- opt-out of notifications for replies to a thread; no longer show a given post in your timeline. (Done! https://codeberg.org/superseriousbusiness/gotosocial/pulls/2278)
- [x] **Limited peering/allowlists** -- allow instance admins to limit federation with other instances by default. (Done! https://github.com/superseriousbusiness/gotosocial/pull/2200) - [x] **Limited peering/allowlists** -- allow instance admins to limit federation with other instances by default. (Done! https://codeberg.org/superseriousbusiness/gotosocial/pulls/2200)
### Early 2024 ### Early 2024
- [ ] **Move activity** -- use the ActivityPub `Move` activity to support migration of a user's profile across servers. - [x] **Move activity** -- use the ActivityPub `Move` activity to support migration of a user's profile across servers.
- [ ] **Sign-up flow** -- allow users to submit a sign-up request to an instance; allow admins to moderate sign-up requests. - [x] **Sign-up flow** -- allow users to submit a sign-up request to an instance; allow admins to moderate sign-up requests.
### BETA milestone ### BETA milestone
Completion of all above features indicates that we are now in the BETA phase of GoToSocial. We foresee this happening around Feb/March 2024. Completion of all above features indicates that we are now in the BETA phase of GoToSocial. We foresee this happening around Feb/March 2024. EDIT: It ended up happening in September/October 2024, whoops!
### Remainder 2024 - early 2025 ### Remainder 2024 - early 2025
These are provided in no specific order. These are provided in no specific order.
- [ ] **Non-replyable posts** -- design a non-replyable post path for GoToSocial based on https://github.com/mastodon/mastodon/issues/14762#issuecomment-1196889788; allow users to create non-replyable posts. - [x] **Filters v2** -- implement v2 of the filters API.
- [ ] **Block list subscriptions** -- allow instance admins to subscribe their instance to plaintext domain block lists (much of the work for this is already in place). - [x] **Mute accounts** -- mute accounts to prevent their posts showing up in your home timeline (optional: for limited period of time).
- [ ] **Direct conversation view** -- allow users to easily page through all direct-message conversations they're a part of. - [x] **Non-replyable posts** -- design a non-replyable post path for GoToSocial based on https://github.com/mastodon/mastodon/issues/14762#issuecomment-1196889788; allow users to create non-replyable posts.
- [ ] **Oauth token management** -- create / view / invalidate OAuth tokens via the settings panel. - [x] **Block + allow list subscriptions** -- allow instance admins to subscribe their instance to domain block/allow lists.
- [ ] **Status EDIT support** -- edit statuses that you've created, without having to delete + redraft. Federate edits out properly. - [x] **Direct conversation view** -- allow users to easily page through all direct-message conversations they're a part of.
- [x] **Oauth token management** -- create / view / invalidate OAuth tokens via the settings panel.
- [x] **Status EDIT support** -- edit statuses that you've created, without having to delete + redraft. Federate edits out properly.
- [ ] **Fediverse relay support** -- publish posts to relays, pull posts from relays. - [ ] **Fediverse relay support** -- publish posts to relays, pull posts from relays.
- [ ] **Two factor authentication (2fa)** -- allow users to enable 2FA for their account via the settings panel, enforce 2FA on login. - [x] **Two factor authentication (2fa)** -- allow users to enable 2FA for their account via the settings panel, enforce 2FA on login.
- [ ] **Moderation: Append content warning / mark-as-sensitive all content from an instance/account**. - [ ] **Moderation: Append content warning / mark-as-sensitive all content from an instance/account**.
More tbd! More tbd!
### On the way out of BETA to STABLE RELEASE
Tbd.
## Wishlist
These cool things will be implemented if time allows (because we really want them):
- **Groups** and group posting!
- Reputation-based 'slow' federation.
- Community decision-making for federation and moderation actions.
- User-selectable custom templates for rendering public posts:
- Twitter-style
- Blogpost
- Gallery
- Etc.

1
SECURITY.md Normal file
View file

@ -0,0 +1 @@
Please email security issues to: admin@gotosocial.org

View file

@ -95,7 +95,7 @@ todo
### Friendica ### Friendica
Unsure: Friendica and GoToSocial still don't federate properly with one another (https://github.com/superseriousbusiness/gotosocial/issues/169) so it's hard to test this. Unsure: Friendica and GoToSocial still don't federate properly with one another (https://codeberg.org/superseriousbusiness/gotosocial/issues/169) so it's hard to test this.
## What should GoToSocial do? ## What should GoToSocial do?

View file

@ -10,7 +10,7 @@ GoToSocial
> Website / wiki > Website / wiki
https://github.com/superseriousbusiness/gotosocial / https://docs.gotosocial.org https://codeberg.org/superseriousbusiness/gotosocial / https://docs.gotosocial.org
> Abstract: Can you explain the whole project and its expected outcome(s). (you have 1200 characters) > Abstract: Can you explain the whole project and its expected outcome(s). (you have 1200 characters)
@ -87,8 +87,8 @@ Thirdly, we want to make GtS as customizable as possible by allowing admins to e
The main technical challenges we foresee on the project are: The main technical challenges we foresee on the project are:
1. Ensuring compatibility with other AP servers (see here: https://github.com/superseriousbusiness/gotosocial/projects/4). 1. Ensuring compatibility with other AP servers (see federation issues: https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378188).
2. Ensuring compatibility with clients that use the Mastodon API (see here: https://github.com/superseriousbusiness/gotosocial/projects/5). 2. Ensuring compatibility with clients that use the Mastodon API (see client compatibility issues: https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378194).
3. Designing nuanced federation safety features that allow instance admins to screen federation without totally breaking it. This will require careful design discussions and lots of testing. 3. Designing nuanced federation safety features that allow instance admins to screen federation without totally breaking it. This will require careful design discussions and lots of testing.
4. Implementing our own open-source http signature library with a reference implementation of the latest draft of the http signature proposal: https://httpwg.org/http-extensions/draft-ietf-httpbis-message-signatures.html. 4. Implementing our own open-source http signature library with a reference implementation of the latest draft of the http signature proposal: https://httpwg.org/http-extensions/draft-ietf-httpbis-message-signatures.html.
5. Writing + maintaining our own extensions to the AP protocol (see below). 5. Writing + maintaining our own extensions to the AP protocol (see below).

View file

@ -10,7 +10,7 @@ GoToSocial
> Website / wiki > Website / wiki
https://github.com/superseriousbusiness/gotosocial / https://docs.gotosocial.org https://codeberg.org/superseriousbusiness/gotosocial / https://docs.gotosocial.org
> Abstract: Can you explain the whole project and its expected outcome(s). (you have 1200 characters) > Abstract: Can you explain the whole project and its expected outcome(s). (you have 1200 characters)
@ -20,7 +20,7 @@ GtS emphasizes user safety and privacy. Unlike other AP servers, it always requi
GtS values ease of deployment and maintenance; this means low system requirements, simple configuration, minimal external dependencies, and clear documentation. GtS makes it easy + affordable for self-hosting newcomers to set up a Fediverse server on low- (or even solar-) powered equipment they might have lying around at home. GtS values ease of deployment and maintenance; this means low system requirements, simple configuration, minimal external dependencies, and clear documentation. GtS makes it easy + affordable for self-hosting newcomers to set up a Fediverse server on low- (or even solar-) powered equipment they might have lying around at home.
GtS began development in Feb 2021. It is still in Alpha, and we hope to use NLNet funding to bring it up to the Beta phase. The project roadmap (https://github.com/superseriousbusiness/gotosocial/blob/main/ROADMAP.md) gives more information on what we have planned. GtS began development in Feb 2021. It is still in Alpha, and we hope to use NLNet funding to bring it up to the Beta phase. The project roadmap (https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/ROADMAP.md) gives more information on what we have planned.
> Have you been involved with projects or organisations relevant to this project before? And if so, can you tell us a bit about your contributions? (Optional) This can help us determine if you are the right person to undertake this effort. > Have you been involved with projects or organisations relevant to this project before? And if so, can you tell us a bit about your contributions? (Optional) This can help us determine if you are the right person to undertake this effort.
@ -45,7 +45,7 @@ Aside from GoToSocial, I've also made small PRs upstream to the ActivityPub libr
Currently, GoToSocial receives about €22/week from LiberaPay donations - https://liberapay.com/gotosocial. I have been paying my own costs for working on the project from my savings, which is unfortunately not sustainable for a lot longer. Currently, GoToSocial receives about €22/week from LiberaPay donations - https://liberapay.com/gotosocial. I have been paying my own costs for working on the project from my savings, which is unfortunately not sustainable for a lot longer.
The requested NLNet budget will be used to fund the remaining Alpha portion of development, and bring GoToSocial into the Beta phase (see the roadmap - https://github.com/superseriousbusiness/gotosocial/blob/main/ROADMAP.md). In practical terms, this means paying myself to work full time on the project for one year, and paying for contributions from other developers as well. The requested NLNet budget will be used to fund the remaining Alpha portion of development, and bring GoToSocial into the Beta phase (see the roadmap - https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/ROADMAP.md). In practical terms, this means paying myself to work full time on the project for one year, and paying for contributions from other developers as well.
To pay my living costs + rent I need to make about €2,000/month after tax, working full time. In Belgium, that equates to about €3,000/month, which is €36,000 for one year of work. Naively calculated at 40 hours / week, that's €18.75 per hour. To pay my living costs + rent I need to make about €2,000/month after tax, working full time. In Belgium, that equates to about €3,000/month, which is €36,000 for one year of work. Naively calculated at 40 hours / week, that's €18.75 per hour.
@ -83,8 +83,8 @@ Thirdly, we want to make GtS as customizable as possible by allowing admins to e
The main technical challenges we foresee on the project are: The main technical challenges we foresee on the project are:
1. Ensuring compatibility with other AP servers (see here: https://github.com/superseriousbusiness/gotosocial/projects/4). 1. Ensuring compatibility with other AP servers (see federation issues: https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378188).
2. Ensuring compatibility with clients that use the Mastodon API (see here: https://github.com/superseriousbusiness/gotosocial/projects/5). 2. Ensuring compatibility with clients that use the Mastodon API (see client compatibility issues: https://codeberg.org/superseriousbusiness/gotosocial/issues?labels=378194).
3. Designing nuanced federation safety features that allow instance admins to screen federation without totally breaking it. This will require careful design discussions and lots of testing. 3. Designing nuanced federation safety features that allow instance admins to screen federation without totally breaking it. This will require careful design discussions and lots of testing.
4. Implementing our own open-source http signature library with a reference implementation of the latest draft of the http signature proposal: https://httpwg.org/http-extensions/draft-ietf-httpbis-message-signatures.html. 4. Implementing our own open-source http signature library with a reference implementation of the latest draft of the http signature proposal: https://httpwg.org/http-extensions/draft-ietf-httpbis-message-signatures.html.
5. Writing + maintaining our own extensions to the AP protocol (see below). 5. Writing + maintaining our own extensions to the AP protocol (see below).

View file

@ -0,0 +1,123 @@
# NLnet Grant Application - NGI Zero Commons 2025
This document is the application on behalf of GoToSocial for funding from the [NLnet](https://nlnet.nl) [NGI Zero Commons fund](https://nlnet.nl/commonsfund/), April 2025. See [here](https://nlnet.nl/propose/).
## General Project Information
> Project Name
GoToSocial
> Website / wiki
https://codeberg.org/superseriousbusiness/gotosocial / https://docs.gotosocial.org
> Abstract: Can you explain the whole project and its expected outcome(s). (you have 1200 characters)
GoToSocial (GtS) is an ActivityPub social network server, which provides a lightweight, simple entryway into Fediverse hosting. It is comparable to (but distinct from) projects such as Mastodon, Friendica, and PixelFed.
GtS emphasizes user safety and privacy. Unlike other AP servers, it always requires http signatures, and makes a strong differentiation between 'public' and other kinds of posts. It also makes it very easy for admins to block instances they don't want to interact with, by allowing them to subscribe to block lists or allow lists, and to import blocks, ensuring that users stay safe.
GtS values ease of deployment and maintenance; this means low system requirements, simple configuration, minimal external dependencies, and clear documentation. GtS makes it easy + affordable for self-hosting newcomers to set up a Fediverse server on low- (or even solar-) powered equipment they might have lying around at home.
GtS began development in Feb 2021, and entered Beta in 2024. We hope to use NLnet funding to continue tuning performance and adding features as we work towards a 1.0 release.
> Have you been involved with projects or organisations relevant to this project before? And if so, can you tell us a bit about your contributions? (Optional) This can help us determine if you are the right person to undertake this effort. (max 2500 characters)
I have been working on GoToSocial since the beginning of the project, first independently, paying myself from my savings, and then thanks to two previous grants from NLnet. My colleague Kim has a similar trajectory, as they now work full time on the project, again thanks to NLnet.
Over the last years we have put many thousands of hours of work into the project: writing code and documentation, fixing bugs, communicating with contributors and doing code review, deploying infrastructure for project builds and discussion, doing project planning, and answering user questions.
Aside from our work on GoToSocial, we also maintain a fork of the Activity library (https://codeberg.org/superseriousbusiness/activity), a fork of the standalone Mastodon frontend customized for GoToSocial (https://codeberg.org/superseriousbusiness/masto-fe-standalone, deployed at https://masto-fe.superseriousbusiness.org), and Kim in particular maintains a large amount of libraries used by the project (https://codeberg.org/gruf), particularly go-ffmpreg (https://codeberg.org/gruf/go-ffmpreg).
## Requested Support
> Explain what the requested budget will be used for?
> Does the project have other funding sources, both past and present?
> (If you want, you can in addition attach a budget at the bottom of the form)
> Explain costs for hardware, human labor (including rates used), travel cost to technical meetings, etc. (max 2500 characters, be concise)
GoToSocial has received two NLnet grants previously, one in 2022-2023, for 50k euros, and another one in 2024-2025, for 75k euros, which we shared between the two of us. These grants went towards paying living costs for myself and Kim (rent, groceries, utilities, taxes, etc), while we both worked full time on the project.
For our first grant we underbudgeted our own costs and ended up underpaying ourselves. We better estimated the second grant, but still had some issues doing more work than we budgeted for, taking account of bug fixes, extra features, and release coordination.
With the benefit of experience, this time we intend to budget more sensibly so that we don't end up going into our overdrafts before the end of each milestone, hence we are asking for a larger amount of funding: 100k euros in total, or 50k euros each per year. This amount of money is comparable to the rate for a mid/senior-level developer in the countries we live in, and should allow us to pay our costs without panic.
Happily, we receive a decent amount of money per month via OpenCollective (https://opencollective.com/gotosocial), which allows us to pay for costs (Greenhost.net) for our CI/CD + snapshot distribution server. It also allows us to pay our freelance colleague f0x for the contributions they are able to make when school is not too busy. As such, NLnet money does not need to be used for anything besides mine and Kim's living costs.
This year, we would like to use the NGI Zero Commons grant to fund development of the following efforts (more tbd):
- Add functionality to allow users and admins to configure cleanup of old statuses and accounts from the database, to keep database sizes smaller.
- Implement better threading support when statuses are deleted (ie., store + show status tombstones).
- Improve search performance and add full-text-search (SQLite, Postgres).
- Add additional in-memory caches for frontend object types (statuses, notifications, etc) to reduce database calls and improve response times.
- Add support for subscribing to relays, and allowing GoToSocial itself to act as a relay, improving connectivity with other instances.
- Add additional federation controls (silence/mute/limit instances).
- Add an opt-in profile directory to make it easier to discover accounts on an instance.
- Implement admin panel section to track unreachable instances, so that admins can tell whether another instance has shut down, and take appropriate action.
> Compare your own project with existing or historical efforts
> E.g. what is new, more thorough or otherwise different. (max 4000 characters, be concise)
ActivityPub is now a popular protocol, with a proliferation of AP implementations like Mastodon, Akkoma, Lemmy, Misskey (and its many forks), Pixelfed, WriteFreely, Wordpress, and more, each with its own focus and purpose. As strong as many of these implementations are, however, they are not without their downsides.
For instance, Mastodon and Pixelfed both lean more towards replicating existing corporate social media efforts (Twitter and Instagram respectively), which is offputting for many users. These two implementations are also complex to install and maintain, which puts many would-be admins off hosting their own servers, and leads to a concentration of users on developer-run servers like mastodon.social and pixelfed.social, which breaks the promise of decentralization.
Other ActivityPub-enabled microblogging softwares like Honk and Snac2 have fewer moving parts and lower system requirements, which has led to a surge of deployments of Snac2 in particular. However, their implementation of the Mastodon client API (the de-facto client API of the fediverse, for better or worse), misses some features, and the barebones admin functionality is not user-friendly for people unaccustomed to using the command line.
In addition, some other fediverse projects have a heavy front-end UI which results in a poor experience on low-bandwidth connections or low-powered devices.
GoToSocial's continued aim is to strike a balance between featureful but fairly resource-intensive AP implementations like Mastodon, and lighter and simpler AP implementations like Snac2 and Honk.
Firstly, GtS is small, easy to run, and very well documented. It uses about 200-300MiB of memory on average, so it can be deployed on tiny VPSs for cheap, and on single-board computers. It has no dependencies on things like ffmpeg or on-system SQLite, as everything is virtualized inside the single binary using WASM/Wazero. This means that people who want to run GoToSocial don't need to install or maintain anything else on the host, and it is very easy for third parties like Yunohost to package and distribute.
Secondly, the admin/settings panel offers admins and users the ability to easily customize their profiles and adjust the way that their instance looks, feels, and federates, and to handle day-to-day admin tasks like reviewing reports, blocking or allowing other instances, etc. The web view of profiles is rendered in simple HTML + CSS; Javascript is not required, but is used for progressive enhancement if available. This makes it relatively easy to view a GoToSocial profile on a mobile device with poor connection, on a lower-end laptop etc.
Thirdly, it provides strong safety features thanks to strict block implementation, always-on HTTP signature authentication, interaction controls, and allowing users to choose what visibility of level of posts can be viewed on their profile. The allowlist subscription functionality we added in 2024 is also critical here, as it allows groups of instances to easily federate only with each other, forming "islands" that can be more easily moderated than fully open federation.
Fourthly, we have been -- and continue to be -- fastidious with our Mastodon client API implementation, which means that GoToSocial can be used with a wide variety of clients that provide different experiences to the user. It even works with apps for Pixelfed, so user's can use a GoToSocial account for 'gram-style media-only posting.
> What are significant technical challenges you expect to solve during the project, if any? (optional but recommended, max 5000 characters)
Many of the technical challenges we expect to overcome during this development period are specific to the development efforts we will undertake as part of this grant:
- Status cleanup: Ensure that cleanup processes are capable of being regularly scheduled asynchronously, while not consuming all available server resources (with what will likely involve scanning the entirety of our largest database table!). This may require some clever indexing and/or marking of statuses as expirable in advance.
- Status tombstones: figure out whether we can write a migration to retroactively rethread old statuses that have become unlinked due to deletes.
- Relay support: figure out whether adding support for relay mode will require a separate relay binary, and if so, refactor sections of the codebase into libraries that can be shared by that binary.
- Relay support: make sure GoToSocial can subscribe to both existing relay services, as well as GoToSocial relays (this will probably involve lots of dipping into the codebases of existing relay services like fedi buzz, to figure out what they're doing). And vice versa: ensure that existing fedi implementations with relay support can subscribe to GoToSocial relays.
- Relay support: make sure that DB sizes and memory usage don't become too burdensome given the amount of statuses that relays are likely to process compared to a vanilla instance.
- Profile directory: ensure "discoverable" flag is respected; optimize required new database queries to ensure they use existing indexes (or figure out which new ones need to be created).
- Search support: ensure that the same functionality and performance is offered by both Postgres and SQLite; possibly refactor our database wrappers and migration code for this.
- Unreachable instances: develop a reasonable heuristic to determine whether an instance is unreachable; work out the best way of storing this information in the database and presenting it to admins via the settings panel.
Other technical challenges we will (continue to) address in the near future are not related to any specific milestone task:
- Ensure continued compatibility of GoToSocial with other fedi software projects.
- Ensure continued compatibility of GoToSocial with Mastodon API client apps.
- Refactor old parts of the codebase to increase readability and remove bugs.
- Make performance tweaks to the codebase wherever necessary (reduce CPU usage, improve memory usage).
- Increase coverage of our test suites.
- Continue to support seamless database migration from old versions of GoToSocial to newer ones.
- Refactor some of the frontend settings panel code to maximize code reuse and minimize compiled javascript size, before adding lots of new functionality.
- Move our CI/CD infrastructure and code repository from Github to Codeberg with minimal disruption to our work.
> Describe the ecosystem of the project, and how you will engage with relevant actors and promote the outcomes. E.g. which actors will you involve? Who should run or deploy your solution to make it a success? (max 2500 characters, be concise)
Much of the work we do involves debugging and solving interoperability issues with other federated softwares, which requires keeping communication channels open with the maintainers of those, and figuring out who needs to change what in order for the issue to be resolved. We've done that a lot over the last year or so:
- Fixed interop with Bandwagon: https://github.com/EmissarySocial/bandwagon/issues/152
- Fixed interop with Iceshrimp: https://codeberg.org/superseriousbusiness/gotosocial/issues/1947
- Coordinated interop with Mastodon: https://codeberg.org/superseriousbusiness/gotosocial/pulls/3703
- Fixed federation with Gancio: https://codeberg.org/superseriousbusiness/gotosocial/issues/3875
- Alerted Pixelfed of AP serialization issues: https://github.com/pixelfed/pixelfed/issues/5642
- Cajoled Bluesky into adding user-agent headers: https://github.com/bluesky-social/atproto/issues/3504
- Help out Writefreely with http signature request issues: https://github.com/writefreely/writefreely/issues/661#issuecomment-1951367449
- Debug federation with Lemmy along with one of the Lemmy devs: https://codeberg.org/superseriousbusiness/gotosocial/issues/2697
For GoToSocial-specific extensions to ActivityPub, we've also diligently documented what we've done so far, and exposed a GoToSocial namespace so that remote softwares can easily incorporate GtS extensions if they want to: https://docs.gotosocial.org/en/latest/federation/interaction_policy/, https://gotosocial.org/ns.
This is all part and parcel of our goal for GoToSocial to be a "good citizen" in terms of how it federates, and how we fit into the larger ActivityPub microblogging ecosystem. We intend to keep doing this!
## Attachments
> Attachments: add any additional information about the project that may help us to gain more insight into the proposed effort, for instance a more detailed task description, a justification of costs or relevant endorsements. Attachments should only contain background information, please make sure that the proposal without attachments is self-contained and concise. Don't waste too much time on this. Really.

22
cmd/gen-ulid/main.go Normal file
View file

@ -0,0 +1,22 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import "code.superseriousbusiness.org/gotosocial/internal/id"
func main() { println(id.NewULID()) }

View file

@ -24,23 +24,39 @@ import (
"text/tabwriter" "text/tabwriter"
"time" "time"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb" "code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/state" userprocessor "code.superseriousbusiness.org/gotosocial/internal/processing/user"
"github.com/superseriousbusiness/gotosocial/internal/validate" "code.superseriousbusiness.org/gotosocial/internal/state"
"code.superseriousbusiness.org/gotosocial/internal/util"
"code.superseriousbusiness.org/gotosocial/internal/validate"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )
var (
// check function conformance
_ action.GTSAction = Create
_ action.GTSAction = List
_ action.GTSAction = Confirm
_ action.GTSAction = Promote
_ action.GTSAction = Demote
_ action.GTSAction = Enable
_ action.GTSAction = Disable
_ action.GTSAction = Password
)
func initState(ctx context.Context) (*state.State, error) { func initState(ctx context.Context) (*state.State, error) {
var state state.State var state state.State
state.Caches.Init() state.Caches.Init()
state.Caches.Start() if err := state.Caches.Start(); err != nil {
state.Workers.Start() return nil, fmt.Errorf("error starting caches: %w", err)
}
// Set the state DB connection // Only set state DB connection.
// Don't need Actions or Workers for this (yet).
dbConn, err := bundb.NewBunDBService(ctx, &state) dbConn, err := bundb.NewBunDBService(ctx, &state)
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating dbConn: %w", err) return nil, fmt.Errorf("error creating dbConn: %w", err)
@ -52,14 +68,13 @@ func initState(ctx context.Context) (*state.State, error) {
func stopState(state *state.State) error { func stopState(state *state.State) error {
err := state.DB.Close() err := state.DB.Close()
state.Workers.Stop()
state.Caches.Stop() state.Caches.Stop()
return err return err
} }
// Create creates a new account and user // Create creates a new account and user
// in the database using the provided flags. // in the database using the provided flags.
var Create action.GTSAction = func(ctx context.Context) error { func Create(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -116,7 +131,7 @@ var Create action.GTSAction = func(ctx context.Context) error {
} }
// List returns all existing local accounts. // List returns all existing local accounts.
var List action.GTSAction = func(ctx context.Context) error { func List(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -154,7 +169,7 @@ var List action.GTSAction = func(ctx context.Context) error {
// Confirm sets a user to Approved, sets Email to the current // Confirm sets a user to Approved, sets Email to the current
// UnconfirmedEmail value, and sets ConfirmedAt to now. // UnconfirmedEmail value, and sets ConfirmedAt to now.
var Confirm action.GTSAction = func(ctx context.Context) error { func Confirm(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -185,14 +200,18 @@ var Confirm action.GTSAction = func(ctx context.Context) error {
user.Approved = func() *bool { a := true; return &a }() user.Approved = func() *bool { a := true; return &a }()
user.Email = user.UnconfirmedEmail user.Email = user.UnconfirmedEmail
user.ConfirmedAt = time.Now() user.ConfirmedAt = time.Now()
user.SignUpIP = nil
return state.DB.UpdateUser( return state.DB.UpdateUser(
ctx, user, ctx, user,
"approved", "email", "confirmed_at", "approved",
"email",
"confirmed_at",
"sign_up_ip",
) )
} }
// Promote sets admin + moderator flags on a user to true. // Promote sets admin + moderator flags on a user to true.
var Promote action.GTSAction = func(ctx context.Context) error { func Promote(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -229,7 +248,7 @@ var Promote action.GTSAction = func(ctx context.Context) error {
} }
// Demote sets admin + moderator flags on a user to false. // Demote sets admin + moderator flags on a user to false.
var Demote action.GTSAction = func(ctx context.Context) error { func Demote(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -266,7 +285,7 @@ var Demote action.GTSAction = func(ctx context.Context) error {
} }
// Disable sets Disabled to true on a user. // Disable sets Disabled to true on a user.
var Disable action.GTSAction = func(ctx context.Context) error { func Disable(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -294,7 +313,43 @@ var Disable action.GTSAction = func(ctx context.Context) error {
return err return err
} }
user.Disabled = func() *bool { d := true; return &d }() user.Disabled = util.Ptr(true)
return state.DB.UpdateUser(
ctx, user,
"disabled",
)
}
// Enable sets Disabled to false on a user.
func Enable(ctx context.Context) error {
state, err := initState(ctx)
if err != nil {
return err
}
defer func() {
// Ensure state gets stopped on return.
if err := stopState(state); err != nil {
log.Error(ctx, err)
}
}()
username := config.GetAdminAccountUsername()
if err := validate.Username(username); err != nil {
return err
}
account, err := state.DB.GetAccountByUsernameDomain(ctx, username, "")
if err != nil {
return err
}
user, err := state.DB.GetUserByAccountID(ctx, account.ID)
if err != nil {
return err
}
user.Disabled = util.Ptr(false)
return state.DB.UpdateUser( return state.DB.UpdateUser(
ctx, user, ctx, user,
"disabled", "disabled",
@ -302,7 +357,7 @@ var Disable action.GTSAction = func(ctx context.Context) error {
} }
// Password sets the password of target account. // Password sets the password of target account.
var Password action.GTSAction = func(ctx context.Context) error { func Password(ctx context.Context) error {
state, err := initState(ctx) state, err := initState(ctx)
if err != nil { if err != nil {
return err return err
@ -341,8 +396,47 @@ var Password action.GTSAction = func(ctx context.Context) error {
} }
user.EncryptedPassword = string(encryptedPassword) user.EncryptedPassword = string(encryptedPassword)
log.Info(ctx, "Updating password; you must restart the server to use the new password.")
return state.DB.UpdateUser( return state.DB.UpdateUser(
ctx, user, ctx, user,
"encrypted_password", "encrypted_password",
) )
} }
// Disable2FA disables 2FA for target account.
func Disable2FA(ctx context.Context) error {
state, err := initState(ctx)
if err != nil {
return err
}
defer func() {
// Ensure state gets stopped on return.
if err := stopState(state); err != nil {
log.Error(ctx, err)
}
}()
username := config.GetAdminAccountUsername()
if err := validate.Username(username); err != nil {
return err
}
account, err := state.DB.GetAccountByUsernameDomain(ctx, username, "")
if err != nil {
return err
}
user, err := state.DB.GetUserByAccountID(ctx, account.ID)
if err != nil {
return err
}
err = userprocessor.TwoFactorDisable(ctx, state, user)
if err != nil {
return err
}
fmt.Printf("2fa disabled\n")
return nil
}

View file

@ -18,95 +18,181 @@
package media package media
import ( import (
"bufio"
"context" "context"
"errors" "errors"
"fmt" "fmt"
"os" "os"
"path"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db" "code.superseriousbusiness.org/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb" "code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/paging" "code.superseriousbusiness.org/gotosocial/internal/paging"
"github.com/superseriousbusiness/gotosocial/internal/state" "code.superseriousbusiness.org/gotosocial/internal/state"
"codeberg.org/gruf/go-byteutil"
"codeberg.org/gruf/go-fastpath/v2"
) )
// check function conformance.
var _ action.GTSAction = ListAttachments
var _ action.GTSAction = ListEmojis
// ListAttachments lists local, remote, or all attachment paths.
func ListAttachments(ctx context.Context) error {
list, err := setupList(ctx)
if err != nil {
return err
}
defer func() {
// Ensure lister gets shutdown on exit.
if err := list.shutdown(); err != nil {
log.Errorf(ctx, "error shutting down: %v", err)
}
}()
// List attachment media paths from db.
return list.ListAttachmentPaths(ctx)
}
// ListEmojis lists local, remote, or all emoji filepaths.
func ListEmojis(ctx context.Context) error {
list, err := setupList(ctx)
if err != nil {
return err
}
defer func() {
// Ensure lister gets shutdown on exit.
if err := list.shutdown(); err != nil {
log.Errorf(ctx, "error shutting down: %v", err)
}
}()
// List emoji media paths from db.
return list.ListEmojiPaths(ctx)
}
type list struct { type list struct {
dbService db.DB
state *state.State state *state.State
page paging.Page
localOnly bool localOnly bool
remoteOnly bool remoteOnly bool
out *bufio.Writer
} }
// Get a list of attachment using a custom filter func (l *list) ListAttachmentPaths(ctx context.Context) error {
func (l *list) GetAllAttachmentPaths(ctx context.Context, filter func(*gtsmodel.MediaAttachment) string) ([]string, error) { // Page reused for iterative
res := make([]string, 0, 100) // attachment queries, with
// predefined limit.
var page paging.Page
page.Limit = 500
// Storage base path, used for path building.
basePath := config.GetStorageLocalBasePath()
for { for {
// Get the next page of media attachments up to max ID. // Get next page of media attachments up to max ID.
attachments, err := l.dbService.GetAttachments(ctx, &l.page) medias, err := l.state.DB.GetAttachments(ctx, &page)
if err != nil && !errors.Is(err, db.ErrNoEntries) { if err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, fmt.Errorf("failed to retrieve media metadata from database: %w", err) return fmt.Errorf("failed to fetch media from database: %w", err)
} }
// Get current max ID. // Get current max ID.
maxID := l.page.Max.Value maxID := page.Max.Value
// If no attachments or the same group is returned, we reached the end. // If no media or the same group is returned, we reached end.
if len(attachments) == 0 || maxID == attachments[len(attachments)-1].ID { if len(medias) == 0 || maxID == medias[len(medias)-1].ID {
break break
} }
// Use last ID as the next 'maxID' value. // Use last ID as the next 'maxID'.
maxID = attachments[len(attachments)-1].ID maxID = medias[len(medias)-1].ID
l.page.Max = paging.MaxID(maxID) page.Max.Value = maxID
for _, a := range attachments { switch {
v := filter(a) case l.localOnly:
if v != "" { // Only print local media paths.
res = append(res, v) for _, media := range medias {
if media.RemoteURL == "" {
printMediaPaths(basePath, media)
}
}
case l.remoteOnly:
// Only print remote media paths.
for _, media := range medias {
if media.RemoteURL != "" {
printMediaPaths(basePath, media)
}
}
default:
// Print all known media paths.
for _, media := range medias {
printMediaPaths(basePath, media)
} }
} }
} }
return res, nil
return nil
} }
// Get a list of emojis using a custom filter func (l *list) ListEmojiPaths(ctx context.Context) error {
func (l *list) GetAllEmojisPaths(ctx context.Context, filter func(*gtsmodel.Emoji) string) ([]string, error) { // Page reused for iterative
res := make([]string, 0, 100) // attachment queries, with
// predefined limit.
var page paging.Page
page.Limit = 500
// Storage base path, used for path building.
basePath := config.GetStorageLocalBasePath()
for { for {
// Get the next page of emoji media up to max ID. // Get the next page of emoji media up to max ID.
attachments, err := l.dbService.GetEmojis(ctx, &l.page) emojis, err := l.state.DB.GetEmojis(ctx, &page)
if err != nil { if err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, fmt.Errorf("failed to retrieve media metadata from database: %w", err) return fmt.Errorf("failed to fetch emojis from database: %w", err)
} }
// Get current max ID. // Get current max ID.
maxID := l.page.Max.Value maxID := page.Max.Value
// If no attachments or the same group is returned, we reached the end. // If no emojis or the same group is returned, we reached end.
if len(attachments) == 0 || maxID == attachments[len(attachments)-1].ID { if len(emojis) == 0 || maxID == emojis[len(emojis)-1].ID {
break break
} }
// Use last ID as the next 'maxID' value. // Use last ID as the next 'maxID'.
maxID = attachments[len(attachments)-1].ID maxID = emojis[len(emojis)-1].ID
l.page.Max = paging.MaxID(maxID) page.Max.Value = maxID
for _, a := range attachments { switch {
v := filter(a) case l.localOnly:
if v != "" { // Only print local emoji paths.
res = append(res, v) for _, emoji := range emojis {
if emoji.ImageRemoteURL == "" {
printEmojiPaths(basePath, emoji)
}
}
case l.remoteOnly:
// Only print remote emoji paths.
for _, emoji := range emojis {
if emoji.ImageRemoteURL != "" {
printEmojiPaths(basePath, emoji)
}
}
default:
// Print all known emoji paths.
for _, emoji := range emojis {
printEmojiPaths(basePath, emoji)
} }
} }
} }
return res, nil
return nil
} }
func setupList(ctx context.Context) (*list, error) { func setupList(ctx context.Context) (*list, error) {
@ -124,149 +210,84 @@ func setupList(ctx context.Context) (*list, error) {
) )
} }
// Initialize caches.
state.Caches.Init() state.Caches.Init()
state.Caches.Start()
state.Workers.Start() // Ensure background cache tasks are running.
if err := state.Caches.Start(); err != nil {
return nil, fmt.Errorf("error starting caches: %w", err)
}
dbService, err := bundb.NewBunDBService(ctx, &state) var err error
// Only set state DB connection.
// Don't need Actions or Workers for this.
state.DB, err = bundb.NewBunDBService(ctx, &state)
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating dbservice: %w", err) return nil, fmt.Errorf("error creating dbservice: %w", err)
} }
state.DB = dbService
return &list{ return &list{
dbService: dbService,
state: &state, state: &state,
page: paging.Page{Limit: 200},
localOnly: localOnly, localOnly: localOnly,
remoteOnly: remoteOnly, remoteOnly: remoteOnly,
out: bufio.NewWriter(os.Stdout),
}, nil }, nil
} }
func (l *list) shutdown() error { func (l *list) shutdown() error {
l.out.Flush() err := l.state.DB.Close()
err := l.dbService.Close()
l.state.Workers.Stop()
l.state.Caches.Stop() l.state.Caches.Stop()
return err return err
} }
// ListAttachments lists local, remote, or all attachment paths. // reusable path building buffer,
var ListAttachments action.GTSAction = func(ctx context.Context) error { // only usable here as we're not
list, err := setupList(ctx) // performing concurrent writes.
if err != nil { var pb fastpath.Builder
return err
// reusable string output buffer,
// only usable here as we're not
// performing concurrent writes.
var outbuf byteutil.Buffer
func printMediaPaths(basePath string, media *gtsmodel.MediaAttachment) {
// Append file path if present.
if media.File.Path != "" {
path := pb.Join(basePath, media.File.Path)
_, _ = outbuf.WriteString(path + "\n")
} }
defer func() { // Append thumb path if present.
// Ensure lister gets shutdown on exit. if media.Thumbnail.Path != "" {
if err := list.shutdown(); err != nil { path := pb.Join(basePath, media.Thumbnail.Path)
log.Error(ctx, err) _, _ = outbuf.WriteString(path + "\n")
}
}()
var (
mediaPath = config.GetStorageLocalBasePath()
filter func(*gtsmodel.MediaAttachment) string
)
switch {
case list.localOnly:
filter = func(m *gtsmodel.MediaAttachment) string {
if m.RemoteURL != "" {
// Remote, not
// interested.
return ""
}
return path.Join(mediaPath, m.File.Path)
}
case list.remoteOnly:
filter = func(m *gtsmodel.MediaAttachment) string {
if m.RemoteURL == "" {
// Local, not
// interested.
return ""
}
return path.Join(mediaPath, m.File.Path)
}
default:
filter = func(m *gtsmodel.MediaAttachment) string {
return path.Join(mediaPath, m.File.Path)
}
} }
attachments, err := list.GetAllAttachmentPaths(ctx, filter) // Only write if any
if err != nil { // string was prepared.
return err if outbuf.Len() > 0 {
_, _ = os.Stdout.Write(outbuf.B)
outbuf.Reset()
} }
for _, a := range attachments {
_, _ = list.out.WriteString(a + "\n")
}
return nil
} }
// ListEmojis lists local, remote, or all emoji filepaths. func printEmojiPaths(basePath string, emoji *gtsmodel.Emoji) {
var ListEmojis action.GTSAction = func(ctx context.Context) error { // Append image path if present.
list, err := setupList(ctx) if emoji.ImagePath != "" {
if err != nil { path := pb.Join(basePath, emoji.ImagePath)
return err _, _ = outbuf.WriteString(path + "\n")
} }
defer func() { // Append static path if present.
// Ensure lister gets shutdown on exit. if emoji.ImageStaticPath != "" {
if err := list.shutdown(); err != nil { path := pb.Join(basePath, emoji.ImageStaticPath)
log.Error(ctx, err) _, _ = outbuf.WriteString(path + "\n")
}
}()
var (
mediaPath = config.GetStorageLocalBasePath()
filter func(*gtsmodel.Emoji) string
)
switch {
case list.localOnly:
filter = func(e *gtsmodel.Emoji) string {
if e.ImageRemoteURL != "" {
// Remote, not
// interested.
return ""
}
return path.Join(mediaPath, e.ImagePath)
}
case list.remoteOnly:
filter = func(e *gtsmodel.Emoji) string {
if e.ImageRemoteURL == "" {
// Local, not
// interested.
return ""
}
return path.Join(mediaPath, e.ImagePath)
}
default:
filter = func(e *gtsmodel.Emoji) string {
return path.Join(mediaPath, e.ImagePath)
}
} }
emojis, err := list.GetAllEmojisPaths(ctx, filter) // Only write if any
if err != nil { // string was prepared.
return err if outbuf.Len() > 0 {
_, _ = os.Stdout.Write(outbuf.B)
outbuf.Reset()
} }
for _, e := range emojis {
_, _ = list.out.WriteString(e + "\n")
}
return nil
} }

View file

@ -20,14 +20,17 @@ package prune
import ( import (
"context" "context"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext" "code.superseriousbusiness.org/gotosocial/internal/gtscontext"
"github.com/superseriousbusiness/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/log"
) )
// check function conformance.
var _ action.GTSAction = All
// All performs all media clean actions // All performs all media clean actions
var All action.GTSAction = func(ctx context.Context) error { func All(ctx context.Context) error {
// Setup pruning utilities. // Setup pruning utilities.
prune, err := setupPrune(ctx) prune, err := setupPrune(ctx)
if err != nil { if err != nil {

View file

@ -21,13 +21,13 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/superseriousbusiness/gotosocial/internal/cleaner" "code.superseriousbusiness.org/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/db" "code.superseriousbusiness.org/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb" "code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/gtserror" "code.superseriousbusiness.org/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/media" "code.superseriousbusiness.org/gotosocial/internal/media"
"github.com/superseriousbusiness/gotosocial/internal/state" "code.superseriousbusiness.org/gotosocial/internal/state"
gtsstorage "github.com/superseriousbusiness/gotosocial/internal/storage" gtsstorage "code.superseriousbusiness.org/gotosocial/internal/storage"
) )
type prune struct { type prune struct {
@ -42,10 +42,17 @@ func setupPrune(ctx context.Context) (*prune, error) {
var state state.State var state state.State
state.Caches.Init() state.Caches.Init()
state.Caches.Start() if err := state.Caches.Start(); err != nil {
return nil, fmt.Errorf("error starting caches: %w", err)
}
state.Workers.Start() // Scheduler is required for the
// cleaner, but no other workers
// are needed for this CLI action.
state.Workers.StartScheduler()
// Set state DB connection.
// Don't need Actions for this.
dbService, err := bundb.NewBunDBService(ctx, &state) dbService, err := bundb.NewBunDBService(ctx, &state)
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating dbservice: %w", err) return nil, fmt.Errorf("error creating dbservice: %w", err)
@ -77,15 +84,11 @@ func setupPrune(ctx context.Context) (*prune, error) {
func (p *prune) shutdown() error { func (p *prune) shutdown() error {
errs := gtserror.NewMultiError(2) errs := gtserror.NewMultiError(2)
if err := p.storage.Close(); err != nil {
errs.Appendf("error closing storage backend: %w", err)
}
if err := p.dbService.Close(); err != nil { if err := p.dbService.Close(); err != nil {
errs.Appendf("error stopping database: %w", err) errs.Appendf("error stopping database: %w", err)
} }
p.state.Workers.Stop() p.state.Workers.Scheduler.Stop()
p.state.Caches.Stop() p.state.Caches.Stop()
return errs.Combine() return errs.Combine()

View file

@ -20,14 +20,17 @@ package prune
import ( import (
"context" "context"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext" "code.superseriousbusiness.org/gotosocial/internal/gtscontext"
"github.com/superseriousbusiness/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/log"
) )
// check function conformance.
var _ action.GTSAction = Orphaned
// Orphaned prunes orphaned media from storage. // Orphaned prunes orphaned media from storage.
var Orphaned action.GTSAction = func(ctx context.Context) error { func Orphaned(ctx context.Context) error {
// Setup pruning utilities. // Setup pruning utilities.
prune, err := setupPrune(ctx) prune, err := setupPrune(ctx)
if err != nil { if err != nil {

View file

@ -21,14 +21,17 @@ import (
"context" "context"
"time" "time"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext" "code.superseriousbusiness.org/gotosocial/internal/gtscontext"
"github.com/superseriousbusiness/gotosocial/internal/log" "code.superseriousbusiness.org/gotosocial/internal/log"
) )
// check function conformance.
var _ action.GTSAction = Remote
// Remote prunes old and/or unused remote media. // Remote prunes old and/or unused remote media.
var Remote action.GTSAction = func(ctx context.Context) error { func Remote(ctx context.Context) error {
// Setup pruning utilities. // Setup pruning utilities.
prune, err := setupPrune(ctx) prune, err := setupPrune(ctx)
if err != nil { if err != nil {

View file

@ -22,23 +22,26 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb" "code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/state" "code.superseriousbusiness.org/gotosocial/internal/state"
"github.com/superseriousbusiness/gotosocial/internal/trans" "code.superseriousbusiness.org/gotosocial/internal/trans"
) )
// check function conformance.
var _ action.GTSAction = Export
// Export exports info from the database into a file // Export exports info from the database into a file
var Export action.GTSAction = func(ctx context.Context) error { func Export(ctx context.Context) error {
var state state.State var state state.State
// Only set state DB connection.
// Don't need Actions or Workers for this.
dbConn, err := bundb.NewBunDBService(ctx, &state) dbConn, err := bundb.NewBunDBService(ctx, &state)
if err != nil { if err != nil {
return fmt.Errorf("error creating dbservice: %s", err) return fmt.Errorf("error creating dbservice: %s", err)
} }
// Set the state DB connection
state.DB = dbConn state.DB = dbConn
exporter := trans.NewExporter(dbConn) exporter := trans.NewExporter(dbConn)

View file

@ -22,23 +22,26 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb" "code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/state" "code.superseriousbusiness.org/gotosocial/internal/state"
"github.com/superseriousbusiness/gotosocial/internal/trans" "code.superseriousbusiness.org/gotosocial/internal/trans"
) )
// check function conformance.
var _ action.GTSAction = Import
// Import imports info from a file into the database // Import imports info from a file into the database
var Import action.GTSAction = func(ctx context.Context) error { func Import(ctx context.Context) error {
var state state.State var state state.State
// Only set state DB connection.
// Don't need Actions or Workers for this.
dbConn, err := bundb.NewBunDBService(ctx, &state) dbConn, err := bundb.NewBunDBService(ctx, &state)
if err != nil { if err != nil {
return fmt.Errorf("error creating dbservice: %s", err) return fmt.Errorf("error creating dbservice: %s", err)
} }
// Set the state DB connection
state.DB = dbConn state.DB = dbConn
importer := trans.NewImporter(dbConn) importer := trans.NewImporter(dbConn)

View file

@ -22,21 +22,21 @@ import (
"encoding/json" "encoding/json"
"os" "os"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action" "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config" "code.superseriousbusiness.org/gotosocial/internal/config"
) )
// check function conformance.
var _ action.GTSAction = Config
// Config just prints the collated config out to stdout as json. // Config just prints the collated config out to stdout as json.
var Config action.GTSAction = func(ctx context.Context) (err error) { func Config(ctx context.Context) (err error) {
var raw map[string]interface{} var raw map[string]interface{}
// Marshal configuration to a raw JSON map // Marshal configuration to a raw JSON map
config.Config(func(cfg *config.Configuration) { config.Config(func(cfg *config.Configuration) {
raw, err = cfg.MarshalMap() raw = cfg.MarshalMap()
}) })
if err != nil {
return err
}
enc := json.NewEncoder(os.Stdout) enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ") enc.SetIndent("", " ")

View file

@ -0,0 +1,68 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package migration
import (
"context"
"fmt"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"code.superseriousbusiness.org/gotosocial/internal/log"
"code.superseriousbusiness.org/gotosocial/internal/state"
)
// check function conformance.
var _ action.GTSAction = Run
// Run will initialize the database, running any available migrations.
func Run(ctx context.Context) error {
var state state.State
defer func() {
if state.DB != nil {
// Lastly, if database service was started,
// ensure it gets closed now all else stopped.
if err := state.DB.Close(); err != nil {
log.Errorf(ctx, "error stopping database: %v", err)
}
}
// Finally reached end of shutdown.
log.Info(ctx, "done! exiting...")
}()
// Initialize caches
state.Caches.Init()
if err := state.Caches.Start(); err != nil {
return fmt.Errorf("error starting caches: %w", err)
}
log.Info(ctx, "starting db service...")
// Open connection to the database now caches started.
dbService, err := bundb.NewBunDBService(ctx, &state)
if err != nil {
return fmt.Errorf("error creating dbservice: %s", err)
}
// Set DB on state.
state.DB = dbService
return nil
}

View file

@ -22,133 +22,273 @@ import (
"errors" "errors"
"fmt" "fmt"
"net/http" "net/http"
"net/netip"
"os" "os"
"os/signal" "os/signal"
"runtime"
"strings"
"syscall" "syscall"
"time" "time"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"code.superseriousbusiness.org/gotosocial/internal/admin"
"code.superseriousbusiness.org/gotosocial/internal/api"
apiutil "code.superseriousbusiness.org/gotosocial/internal/api/util"
"code.superseriousbusiness.org/gotosocial/internal/cleaner"
"code.superseriousbusiness.org/gotosocial/internal/config"
"code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"code.superseriousbusiness.org/gotosocial/internal/email"
"code.superseriousbusiness.org/gotosocial/internal/federation"
"code.superseriousbusiness.org/gotosocial/internal/federation/federatingdb"
"code.superseriousbusiness.org/gotosocial/internal/filter/interaction"
"code.superseriousbusiness.org/gotosocial/internal/filter/mutes"
"code.superseriousbusiness.org/gotosocial/internal/filter/spam"
"code.superseriousbusiness.org/gotosocial/internal/filter/status"
"code.superseriousbusiness.org/gotosocial/internal/filter/visibility"
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/httpclient"
"code.superseriousbusiness.org/gotosocial/internal/log"
"code.superseriousbusiness.org/gotosocial/internal/media"
"code.superseriousbusiness.org/gotosocial/internal/media/ffmpeg"
"code.superseriousbusiness.org/gotosocial/internal/messages"
"code.superseriousbusiness.org/gotosocial/internal/middleware"
"code.superseriousbusiness.org/gotosocial/internal/oauth"
"code.superseriousbusiness.org/gotosocial/internal/oauth/handlers"
"code.superseriousbusiness.org/gotosocial/internal/observability"
"code.superseriousbusiness.org/gotosocial/internal/oidc"
"code.superseriousbusiness.org/gotosocial/internal/processing"
"code.superseriousbusiness.org/gotosocial/internal/router"
"code.superseriousbusiness.org/gotosocial/internal/state"
gtsstorage "code.superseriousbusiness.org/gotosocial/internal/storage"
"code.superseriousbusiness.org/gotosocial/internal/subscriptions"
"code.superseriousbusiness.org/gotosocial/internal/transport"
"code.superseriousbusiness.org/gotosocial/internal/typeutils"
"code.superseriousbusiness.org/gotosocial/internal/web"
"code.superseriousbusiness.org/gotosocial/internal/webpush"
"github.com/KimMachineGun/automemlimit/memlimit"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/api"
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/filter/spam"
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/metrics"
"github.com/superseriousbusiness/gotosocial/internal/middleware"
tlprocessor "github.com/superseriousbusiness/gotosocial/internal/processing/timeline"
"github.com/superseriousbusiness/gotosocial/internal/timeline"
"github.com/superseriousbusiness/gotosocial/internal/tracing"
"go.uber.org/automaxprocs/maxprocs" "go.uber.org/automaxprocs/maxprocs"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/email"
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb"
"github.com/superseriousbusiness/gotosocial/internal/gotosocial"
"github.com/superseriousbusiness/gotosocial/internal/httpclient"
"github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/media"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/internal/oidc"
"github.com/superseriousbusiness/gotosocial/internal/processing"
"github.com/superseriousbusiness/gotosocial/internal/router"
"github.com/superseriousbusiness/gotosocial/internal/state"
gtsstorage "github.com/superseriousbusiness/gotosocial/internal/storage"
"github.com/superseriousbusiness/gotosocial/internal/transport"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/internal/web"
// Inherit memory limit if set from cgroup
_ "github.com/KimMachineGun/automemlimit"
) )
// Start creates and starts a gotosocial server // check function conformance.
var Start action.GTSAction = func(ctx context.Context) error { var _ action.GTSAction = Maintenance
if _, err := maxprocs.Set(maxprocs.Logger(nil)); err != nil { var _ action.GTSAction = Start
log.Infof(ctx, "could not set CPU limits from cgroup: %s", err)
// Maintenance starts and creates a GoToSocial server
// in maintenance mode (returns 503 for most requests).
func Maintenance(ctx context.Context) error {
route, err := router.New(ctx)
if err != nil {
return fmt.Errorf("error creating maintenance router: %w", err)
} }
var state state.State // Route maintenance handlers.
maintenance := web.NewMaintenance()
maintenance.Route(route)
// Initialize caches // Start the maintenance router.
state.Caches.Init() if err := route.Start(); err != nil {
state.Caches.Start() return fmt.Errorf("error starting maintenance router: %w", err)
defer state.Caches.Stop() }
// Initialize Tracing // Catch shutdown signals from the OS.
if err := tracing.Initialize(); err != nil { sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
sig := <-sigs // block until signal received
log.Infof(ctx, "received signal %s, shutting down", sig)
if err := route.Stop(); err != nil {
log.Errorf(ctx, "error stopping router: %v", err)
}
return nil
}
// Start creates and starts a gotosocial server
func Start(ctx context.Context) error {
// Set GOMAXPROCS / GOMEMLIMIT
// to match container limits.
setLimits(ctx)
var (
// Define necessary core variables
// before anything so we can prepare
// defer function for safe shutdown
// depending on what services were
// managed to be started.
state = new(state.State)
route *router.Router
process *processing.Processor
)
defer func() {
// Stop any started caches.
//
// Noop if never started.
state.Caches.Stop()
if route != nil {
// We reached a point where the API router
// was created + setup. Ensure it gets stopped
// first to stop processing new information.
if err := route.Stop(); err != nil {
log.Errorf(ctx, "error stopping router: %v", err)
}
}
// Stop any currently running
// worker processes / scheduled
// tasks from being executed.
//
// Noop on unstarted workers.
state.Workers.Stop()
if process != nil {
const timeout = time.Minute
// Use a new timeout context to ensure
// persisting queued tasks does not fail!
// The main ctx is very likely canceled.
ctx := context.WithoutCancel(ctx)
ctx, cncl := context.WithTimeout(ctx, timeout)
defer cncl()
// Now that all the "moving" components have been stopped,
// persist any remaining queued worker tasks to the database.
if err := process.Admin().PersistWorkerQueues(ctx); err != nil {
log.Errorf(ctx, "error persisting worker queues: %v", err)
}
}
if state.DB != nil {
// Lastly, if database service was started,
// ensure it gets closed now all else stopped.
if err := state.DB.Close(); err != nil {
log.Errorf(ctx, "error stopping database: %v", err)
}
}
// Finally reached end of shutdown.
log.Info(ctx, "done! exiting...")
}()
// Create maintenance router.
var err error
route, err = router.New(ctx)
if err != nil {
return fmt.Errorf("error creating maintenance router: %w", err)
}
// Route maintenance handlers.
maintenance := web.NewMaintenance()
maintenance.Route(route)
// Start the maintenance router to handle reqs
// while the instance is starting up / migrating.
if err := route.Start(); err != nil {
return fmt.Errorf("error starting maintenance router: %w", err)
}
// Initialize tracing (noop if not enabled).
if err := observability.InitializeTracing(ctx); err != nil {
return fmt.Errorf("error initializing tracing: %w", err) return fmt.Errorf("error initializing tracing: %w", err)
} }
// Open connection to the database // Initialize caches
dbService, err := bundb.NewBunDBService(ctx, &state) state.Caches.Init()
if err := state.Caches.Start(); err != nil {
return fmt.Errorf("error starting caches: %w", err)
}
// Open connection to the database now caches started.
dbService, err := bundb.NewBunDBService(ctx, state)
if err != nil { if err != nil {
return fmt.Errorf("error creating dbservice: %s", err) return fmt.Errorf("error creating dbservice: %s", err)
} }
// Set the state DB connection // Set DB on state.
state.DB = dbService state.DB = dbService
// Set Actions on state, providing workers to
// Actions as well for triggering side effects.
state.AdminActions = admin.New(dbService, &state.Workers)
// Ensure necessary database instance prerequisites exist.
if err := dbService.CreateInstanceAccount(ctx); err != nil { if err := dbService.CreateInstanceAccount(ctx); err != nil {
return fmt.Errorf("error creating instance account: %s", err) return fmt.Errorf("error creating instance account: %s", err)
} }
if err := dbService.CreateInstanceInstance(ctx); err != nil { if err := dbService.CreateInstanceInstance(ctx); err != nil {
return fmt.Errorf("error creating instance instance: %s", err) return fmt.Errorf("error creating instance instance: %s", err)
} }
if err := dbService.CreateInstanceApplication(ctx); err != nil {
return fmt.Errorf("error creating instance application: %s", err)
}
// Get the instance account // Get the instance account (we'll need this later).
// (we'll need this later).
instanceAccount, err := dbService.GetInstanceAccount(ctx, "") instanceAccount, err := dbService.GetInstanceAccount(ctx, "")
if err != nil { if err != nil {
return fmt.Errorf("error retrieving instance account: %w", err) return fmt.Errorf("error retrieving instance account: %w", err)
} }
// Open the storage backend // Open the storage backend according to config.
storage, err := gtsstorage.AutoConfig() state.Storage, err = gtsstorage.AutoConfig()
if err != nil { if err != nil {
return fmt.Errorf("error creating storage backend: %w", err) return fmt.Errorf("error opening storage backend: %w", err)
} }
// Set the state storage driver // Parse http client allow
state.Storage = storage // and block range exceptions.
ranges, err := parseClientRanges()
if err != nil {
return err
}
// Build HTTP client // Prepare wrapped httpclient with config.
client := httpclient.New(httpclient.Config{ client := httpclient.New(httpclient.Config{
AllowRanges: config.MustParseIPPrefixes(config.GetHTTPClientAllowIPs()), AllowRanges: ranges.allow,
BlockRanges: config.MustParseIPPrefixes(config.GetHTTPClientBlockIPs()), BlockRanges: ranges.block,
Timeout: config.GetHTTPClientTimeout(), Timeout: config.GetHTTPClientTimeout(),
TLSInsecureSkipVerify: config.GetHTTPClientTLSInsecureSkipVerify(), TLSInsecureSkipVerify: config.GetHTTPClientTLSInsecureSkipVerify(),
}) })
// Initialize workers. // Compile WASM modules ahead of first use
state.Workers.Start() // to prevent unexpected initial slowdowns.
defer state.Workers.Stop() //
// Note that this can take a bit of memory
// Add a task to the scheduler to sweep caches. // and processing so we perform this much
// Frequency = 1 * minute // later after any database migrations.
// Threshold = 80% capacity log.Info(ctx, "compiling WebAssembly")
_ = state.Workers.Scheduler.AddRecurring( if err := compileWASM(ctx); err != nil {
"@cachesweep", // id return err
time.Time{}, // start }
time.Minute, // freq
func(context.Context, time.Time) {
state.Caches.Sweep(60)
},
)
// Build handlers used in later initializations. // Build handlers used in later initializations.
mediaManager := media.NewManager(&state) mediaManager := media.NewManager(state)
oauthServer := oauth.New(ctx, dbService) oauthServer := oauth.New(ctx, state,
typeConverter := typeutils.NewConverter(&state) handlers.GetValidateURIHandler(ctx),
visFilter := visibility.NewFilter(&state) handlers.GetClientScopeHandler(ctx, state),
spamFilter := spam.NewFilter(&state) handlers.GetAuthorizeScopeHandler(),
federatingDB := federatingdb.New(&state, typeConverter, visFilter, spamFilter) handlers.GetInternalErrorHandler(ctx),
transportController := transport.NewController(&state, federatingDB, &federation.Clock{}, client) handlers.GetResponseErrorHandler(ctx),
federator := federation.NewFederator(&state, federatingDB, transportController, typeConverter, mediaManager) handlers.GetUserAuthorizationHandler(),
)
typeConverter := typeutils.NewConverter(state)
visFilter := visibility.NewFilter(state)
muteFilter := mutes.NewFilter(state)
intFilter := interaction.NewFilter(state)
statusFilter := status.NewFilter(state)
spamFilter := spam.NewFilter(state)
federatingDB := federatingdb.New(state, typeConverter, visFilter, intFilter, spamFilter)
transportController := transport.NewController(state, federatingDB, client)
federator := federation.NewFederator(
state,
federatingDB,
transportController,
typeConverter,
visFilter,
intFilter,
mediaManager,
)
// Decide whether to create a noop email // Decide whether to create a noop email
// sender (won't send emails) or a real one. // sender (won't send emails) or a real one.
@ -167,69 +307,117 @@ var Start action.GTSAction = func(ctx context.Context) error {
} }
} }
// Initialize timelines. // Get or create a VAPID key pair.
state.Timelines.Home = timeline.NewManager( if _, err := dbService.GetVAPIDKeyPair(ctx); err != nil {
tlprocessor.HomeTimelineGrab(&state), return gtserror.Newf("error getting or creating VAPID key pair: %w", err)
tlprocessor.HomeTimelineFilter(&state, visFilter),
tlprocessor.HomeTimelineStatusPrepare(&state, typeConverter),
tlprocessor.SkipInsert(),
)
if err := state.Timelines.Home.Start(); err != nil {
return fmt.Errorf("error starting home timeline: %s", err)
} }
state.Timelines.List = timeline.NewManager( // Create a Web Push notification sender.
tlprocessor.ListTimelineGrab(&state), webPushSender := webpush.NewSender(client, state, typeConverter)
tlprocessor.ListTimelineFilter(&state, visFilter),
tlprocessor.ListTimelineStatusPrepare(&state, typeConverter), // Start the job scheduler
tlprocessor.SkipInsert(), // (this is required for cleaner).
) state.Workers.StartScheduler()
if err := state.Timelines.List.Start(); err != nil {
return fmt.Errorf("error starting list timeline: %s", err) // Add a task to the scheduler to sweep caches.
// Frequency = 1 * minute
// Threshold = 60% capacity
if !state.Workers.Scheduler.AddRecurring(
"@cachesweep", // id
time.Time{}, // start
time.Minute, // freq
func(context.Context, time.Time) {
state.Caches.Sweep(60)
},
) {
return fmt.Errorf("error scheduling cache sweep: %w", err)
} }
// Create a media cleaner using the given state. // Create background cleaner.
cleaner := cleaner.New(&state) cleaner := cleaner.New(state)
// Create the processor using all the other services we've created so far. // Create subscriptions fetcher.
processor := processing.NewProcessor( subscriptions := subscriptions.New(
state,
transportController,
typeConverter,
)
// Create the processor using all the
// other services we've created so far.
process = processing.NewProcessor(
cleaner, cleaner,
subscriptions,
typeConverter, typeConverter,
federator, federator,
oauthServer, oauthServer,
mediaManager, mediaManager,
&state, state,
emailSender, emailSender,
webPushSender,
visFilter,
muteFilter,
intFilter,
statusFilter,
) )
// Set state client / federator asynchronous worker enqueue functions // Schedule background cleaning tasks.
state.Workers.EnqueueClientAPI = processor.Workers().EnqueueClientAPI if err := cleaner.ScheduleJobs(); err != nil {
state.Workers.EnqueueFediAPI = processor.Workers().EnqueueFediAPI return fmt.Errorf("error scheduling cleaner jobs: %w", err)
}
// Set state client / federator synchronous processing functions. // Schedule background subscriptions updating.
state.Workers.ProcessFromClientAPI = processor.Workers().ProcessFromClientAPI if err := subscriptions.ScheduleJobs(); err != nil {
state.Workers.ProcessFromFediAPI = processor.Workers().ProcessFromFediAPI return fmt.Errorf("error scheduling subscriptions jobs: %w", err)
}
// Schedule tasks for all existing poll expiries. // Initialize the specialized workers pools.
if err := processor.Polls().ScheduleAll(ctx); err != nil { state.Workers.Client.Init(messages.ClientMsgIndices())
state.Workers.Federator.Init(messages.FederatorMsgIndices())
state.Workers.Delivery.Init(client)
state.Workers.Client.Process = process.Workers().ProcessFromClientAPI
state.Workers.Federator.Process = process.Workers().ProcessFromFediAPI
// Now start workers!
state.Workers.Start()
// Schedule notif tasks for all existing poll expiries.
if err := process.Polls().ScheduleAll(ctx); err != nil {
return fmt.Errorf("error scheduling poll expiries: %w", err) return fmt.Errorf("error scheduling poll expiries: %w", err)
} }
// schedule publication tasks for all scheduled statuses.
if err := process.Status().ScheduledStatusesScheduleAll(ctx); err != nil {
return fmt.Errorf("error scheduling status publications: %w", err)
}
// Initialize metrics. // Initialize metrics.
if err := metrics.Initialize(state.DB); err != nil { if err := observability.InitializeMetrics(ctx, state); err != nil {
return fmt.Errorf("error initializing metrics: %w", err) return fmt.Errorf("error initializing metrics: %w", err)
} }
// Run advanced migrations.
if err := process.AdvancedMigrations().Migrate(ctx); err != nil {
return err
}
/* /*
HTTP router initialization HTTP router initialization
*/ */
router, err := router.New(ctx) // Close down the maintenance router.
if err != nil { if err := route.Stop(); err != nil {
return fmt.Errorf("error creating router: %s", err) return fmt.Errorf("error stopping maintenance router: %w", err)
} }
// Start preparing middleware stack. // Instantiate the main router.
route, err = router.New(ctx)
if err != nil {
return fmt.Errorf("error creating main router: %s", err)
}
// Start preparing global middleware
// stack (used for every request).
middlewares := make([]gin.HandlerFunc, 1) middlewares := make([]gin.HandlerFunc, 1)
// RequestID middleware must run before tracing! // RequestID middleware must run before tracing!
@ -237,19 +425,19 @@ var Start action.GTSAction = func(ctx context.Context) error {
// Add tracing middleware if enabled. // Add tracing middleware if enabled.
if config.GetTracingEnabled() { if config.GetTracingEnabled() {
middlewares = append(middlewares, tracing.InstrumentGin()) middlewares = append(middlewares, observability.TracingMiddleware())
} }
// Add metrics middleware if enabled. // Add metrics middleware if enabled.
if config.GetMetricsEnabled() { if config.GetMetricsEnabled() {
middlewares = append(middlewares, metrics.InstrumentGin()) middlewares = append(middlewares, observability.MetricsMiddleware())
} }
middlewares = append(middlewares, []gin.HandlerFunc{ middlewares = append(middlewares, []gin.HandlerFunc{
// note: hooks adding ctx fields must be ABOVE // note: hooks adding ctx fields must be ABOVE
// the logger, otherwise won't be accessible. // the logger, otherwise won't be accessible.
middleware.Logger(config.GetLogClientIP()), middleware.Logger(config.GetLogClientIP()),
middleware.HeaderFilter(&state), middleware.HeaderFilter(state),
middleware.UserAgent(), middleware.UserAgent(),
middleware.CORS(), middleware.CORS(),
middleware.ExtraHeaders(), middleware.ExtraHeaders(),
@ -279,11 +467,11 @@ var Start action.GTSAction = func(ctx context.Context) error {
middlewares = append(middlewares, middleware.ContentSecurityPolicy(cspExtraURIs...)) middlewares = append(middlewares, middleware.ContentSecurityPolicy(cspExtraURIs...))
// attach global middlewares which are used for every request // attach global middlewares which are used for every request
router.AttachGlobalMiddleware(middlewares...) route.AttachGlobalMiddleware(middlewares...)
// attach global no route / 404 handler to the router // attach global no route / 404 handler to the router
router.AttachNoRouteHandler(func(c *gin.Context) { route.AttachNoRouteHandler(func(c *gin.Context) {
apiutil.ErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), processor.InstanceGetV1) apiutil.ErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), process.InstanceGetV1)
}) })
// build router modules // build router modules
@ -305,53 +493,83 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error generating session name for session middleware: %w", err) return fmt.Errorf("error generating session name for session middleware: %w", err)
} }
// Configure our instance cookie policy.
cookiePolicy := apiutil.NewCookiePolicy()
var ( var (
authModule = api.NewAuth(dbService, processor, idp, routerSession, sessionName) // auth/oauth paths authModule = api.NewAuth(state, process, idp, routerSession, sessionName, cookiePolicy) // auth/oauth paths
clientModule = api.NewClient(dbService, processor) // api client endpoints clientModule = api.NewClient(state, process) // api client endpoints
metricsModule = api.NewMetrics() // Metrics endpoints healthModule = api.NewHealth(dbService.Ready) // Health check endpoints
fileserverModule = api.NewFileserver(processor) // fileserver endpoints fileserverModule = api.NewFileserver(process) // fileserver endpoints
wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints robotsModule = api.NewRobots() // robots.txt endpoint
nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint wellKnownModule = api.NewWellKnown(process) // .well-known endpoints
activityPubModule = api.NewActivityPub(dbService, processor) // ActivityPub endpoints nodeInfoModule = api.NewNodeInfo(process) // nodeinfo endpoint
webModule = web.New(dbService, processor) // web pages + user profiles + settings panels etc activityPubModule = api.NewActivityPub(dbService, process) // ActivityPub endpoints
webModule = web.New(dbService, process, cookiePolicy) // web pages + user profiles + settings panels etc
) )
// create required middleware // Create per-route / per-grouping middlewares.
// rate limiting // rate limiting
rlLimit := config.GetAdvancedRateLimitRequests() rlLimit := config.GetAdvancedRateLimitRequests()
rlExceptions := config.GetAdvancedRateLimitExceptions() exceptions := config.GetAdvancedRateLimitExceptions()
clLimit := middleware.RateLimit(rlLimit, rlExceptions) // client api clLimit := middleware.RateLimit(rlLimit, exceptions) // client api
s2sLimit := middleware.RateLimit(rlLimit, rlExceptions) // server-to-server (AP) s2sLimit := middleware.RateLimit(rlLimit, exceptions) // server-to-server (AP)
fsMainLimit := middleware.RateLimit(rlLimit, rlExceptions) // fileserver / web templates fsMainLimit := middleware.RateLimit(rlLimit, exceptions) // fileserver / web templates
fsEmojiLimit := middleware.RateLimit(rlLimit*2, rlExceptions) // fileserver (emojis only, use high limit) fsEmojiLimit := middleware.RateLimit(rlLimit*2, exceptions) // fileserver (emojis only, use high limit)
// throttling // throttling
cpuMultiplier := config.GetAdvancedThrottlingMultiplier() cpuMultiplier := config.GetAdvancedThrottlingMultiplier()
retryAfter := config.GetAdvancedThrottlingRetryAfter() retryAfter := config.GetAdvancedThrottlingRetryAfter()
clThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // client api clThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // client api
s2sThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // server-to-server (AP) s2sThrottle := middleware.Throttle(cpuMultiplier, retryAfter)
fsThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // fileserver / web templates / emojis
pkThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // throttle public key endpoint separately
gzip := middleware.Gzip() // applied to all except fileserver // server-to-server (AP)
fsThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // fileserver / web templates / emojis
pkThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // throttle public key endpoint separately
// Robots http headers (x-robots-tag).
//
// robotsDisallowAll is used for client API + S2S endpoints
// that definitely should never be indexed by crawlers.
//
// robotsDisallowAIOnly is used for utility endpoints,
// fileserver, and for web endpoints that set their own
// additional robots directives in HTML meta tags.
//
// Other endpoints like .well-known and nodeinfo handle
// robots headers themselves based on configuration.
robotsDisallowAll := middleware.RobotsHeaders("")
robotsDisallowAIOnly := middleware.RobotsHeaders("aiOnly")
// Gzip middleware is applied to all endpoints except
// fileserver (compression too expensive for those),
// health (which really doesn't need compression), and
// metrics (which does its own compression handling that
// is rather annoying to neatly override).
gzip := middleware.Gzip()
// these should be routed in order; // these should be routed in order;
// apply throttling *after* rate limiting // apply throttling *after* rate limiting
authModule.Route(router, clLimit, clThrottle, gzip) authModule.Route(route, clLimit, clThrottle, robotsDisallowAll, gzip)
clientModule.Route(router, clLimit, clThrottle, gzip) clientModule.Route(route, clLimit, clThrottle, robotsDisallowAll, gzip)
metricsModule.Route(router, clLimit, clThrottle, gzip) healthModule.Route(route, clLimit, clThrottle, robotsDisallowAIOnly)
fileserverModule.Route(router, fsMainLimit, fsThrottle) fileserverModule.Route(route, fsMainLimit, fsThrottle, robotsDisallowAIOnly)
fileserverModule.RouteEmojis(router, instanceAccount.ID, fsEmojiLimit, fsThrottle) fileserverModule.RouteEmojis(route, instanceAccount.ID, fsEmojiLimit, fsThrottle, robotsDisallowAIOnly)
wellKnownModule.Route(router, gzip, s2sLimit, s2sThrottle) robotsModule.Route(route, fsMainLimit, fsThrottle, robotsDisallowAIOnly, gzip)
nodeInfoModule.Route(router, s2sLimit, s2sThrottle, gzip) wellKnownModule.Route(route, gzip, s2sLimit, s2sThrottle)
activityPubModule.Route(router, s2sLimit, s2sThrottle, gzip) nodeInfoModule.Route(route, s2sLimit, s2sThrottle, gzip)
activityPubModule.RoutePublicKey(router, s2sLimit, pkThrottle, gzip) activityPubModule.Route(route, s2sLimit, s2sThrottle, robotsDisallowAll, gzip)
webModule.Route(router, fsMainLimit, fsThrottle, gzip) activityPubModule.RoutePublicKey(route, s2sLimit, pkThrottle, robotsDisallowAll, gzip)
webModule.Route(route, fsMainLimit, fsThrottle, robotsDisallowAIOnly, gzip)
// Start the GoToSocial server. // Finally start the main http server!
server := gotosocial.NewServer(dbService, router, cleaner) if err := route.Start(); err != nil {
if err := server.Start(ctx); err != nil { return fmt.Errorf("error starting router: %w", err)
return fmt.Errorf("error starting gotosocial service: %s", err) }
// Fill worker queues from persisted task data in database.
if err := process.Admin().FillWorkerQueues(ctx); err != nil {
return fmt.Errorf("error filling worker queues: %w", err)
} }
// catch shutdown signals from the operating system // catch shutdown signals from the operating system
@ -360,11 +578,77 @@ var Start action.GTSAction = func(ctx context.Context) error {
sig := <-sigs // block until signal received sig := <-sigs // block until signal received
log.Infof(ctx, "received signal %s, shutting down", sig) log.Infof(ctx, "received signal %s, shutting down", sig)
// close down all running services in order
if err := server.Stop(ctx); err != nil {
return fmt.Errorf("error closing gotosocial service: %s", err)
}
log.Info(ctx, "done! exiting...")
return nil return nil
} }
func setLimits(ctx context.Context) {
if _, err := maxprocs.Set(maxprocs.Logger(nil)); err != nil {
log.Warnf(ctx, "could not set CPU limits from cgroup: %s", err)
}
if _, err := memlimit.SetGoMemLimitWithOpts(); err != nil {
if !strings.Contains(err.Error(), "cgroup mountpoint does not exist") {
log.Warnf(ctx, "could not set Memory limits from cgroup: %s", err)
}
}
}
func compileWASM(ctx context.Context) error {
// Use admin-set ffmpeg pool size, and fall
// back to GOMAXPROCS if number 0 or less.
ffPoolSize := config.GetMediaFfmpegPoolSize()
if ffPoolSize <= 0 {
ffPoolSize = runtime.GOMAXPROCS(0)
}
if err := ffmpeg.InitFfmpeg(ctx, ffPoolSize); err != nil {
return gtserror.Newf("error compiling ffmpeg: %w", err)
}
if err := ffmpeg.InitFfprobe(ctx, ffPoolSize); err != nil {
return gtserror.Newf("error compiling ffprobe: %w", err)
}
return nil
}
func parseClientRanges() (
*struct {
allow []netip.Prefix
block []netip.Prefix
},
error,
) {
parseF := func(ips []string, ranges []netip.Prefix, flag string) error {
for i, ip := range ips {
p, err := netip.ParsePrefix(ip)
if err != nil {
return fmt.Errorf("error parsing %s value %s: %w", flag, ip, err)
}
ranges[i] = p
}
return nil
}
allowIPs := config.GetHTTPClientAllowIPs()
allowRanges := make([]netip.Prefix, len(allowIPs))
allowFlag := config.HTTPClientAllowIPsFlag
if err := parseF(allowIPs, allowRanges, allowFlag); err != nil {
return nil, err
}
blockIPs := config.GetHTTPClientBlockIPs()
blockRanges := make([]netip.Prefix, len(blockIPs))
blockFlag := config.HTTPClientBlockIPsFlag
if err := parseF(blockIPs, blockRanges, blockFlag); err != nil {
return nil, err
}
return &struct {
allow []netip.Prefix
block []netip.Prefix
}{
allow: allowRanges,
block: blockRanges,
}, nil
}

View file

@ -0,0 +1,33 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build !debug && !debugenv
package testrig
import (
"context"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
)
// check function conformance.
var _ action.GTSAction = Start
// Start creates and starts a gotosocial testrig server.
// This is only enabled in debug builds, else is nil.
func Start(context.Context) error { return nil }

View file

@ -15,72 +15,130 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build debug || debugenv
package testrig package testrig
import ( import (
"bytes"
"context" "context"
"errors" "errors"
"fmt" "fmt"
"io"
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"code.superseriousbusiness.org/gotosocial/internal/admin"
"code.superseriousbusiness.org/gotosocial/internal/api"
apiutil "code.superseriousbusiness.org/gotosocial/internal/api/util"
"code.superseriousbusiness.org/gotosocial/internal/cleaner"
"code.superseriousbusiness.org/gotosocial/internal/config"
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/language"
"code.superseriousbusiness.org/gotosocial/internal/log"
"code.superseriousbusiness.org/gotosocial/internal/middleware"
"code.superseriousbusiness.org/gotosocial/internal/observability"
"code.superseriousbusiness.org/gotosocial/internal/oidc"
"code.superseriousbusiness.org/gotosocial/internal/router"
"code.superseriousbusiness.org/gotosocial/internal/state"
"code.superseriousbusiness.org/gotosocial/internal/storage"
"code.superseriousbusiness.org/gotosocial/internal/subscriptions"
"code.superseriousbusiness.org/gotosocial/internal/typeutils"
"code.superseriousbusiness.org/gotosocial/internal/web"
"code.superseriousbusiness.org/gotosocial/testrig"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/api"
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
"github.com/superseriousbusiness/gotosocial/internal/gotosocial"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/language"
"github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/metrics"
"github.com/superseriousbusiness/gotosocial/internal/middleware"
"github.com/superseriousbusiness/gotosocial/internal/oidc"
tlprocessor "github.com/superseriousbusiness/gotosocial/internal/processing/timeline"
"github.com/superseriousbusiness/gotosocial/internal/state"
"github.com/superseriousbusiness/gotosocial/internal/storage"
"github.com/superseriousbusiness/gotosocial/internal/timeline"
"github.com/superseriousbusiness/gotosocial/internal/tracing"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/internal/web"
"github.com/superseriousbusiness/gotosocial/testrig"
) )
// Start creates and starts a gotosocial testrig server // check function conformance.
var Start action.GTSAction = func(ctx context.Context) error { var _ action.GTSAction = Start
var state state.State
// Start creates and starts a gotosocial testrig server.
// This is only enabled in debug builds, else is nil.
func Start(ctx context.Context) error {
testrig.InitTestConfig() testrig.InitTestConfig()
testrig.InitTestLog() testrig.InitTestLog()
var (
// Define necessary core variables
// before anything so we can prepare
// defer function for safe shutdown
// depending on what services were
// managed to be started.
state = new(state.State)
route *router.Router
)
defer func() {
// Stop caches with
// background tasks.
state.Caches.Stop()
if route != nil {
// We reached a point where the API router
// was created + setup. Ensure it gets stopped
// first to stop processing new information.
if err := route.Stop(); err != nil {
log.Errorf(ctx, "error stopping router: %v", err)
}
}
// Stop any currently running
// worker processes / scheduled
// tasks from being executed.
testrig.StopWorkers(state)
if state.Storage != nil {
// If storage was created, ensure torn down.
testrig.StandardStorageTeardown(state.Storage)
}
if state.DB != nil {
// Clean up database by
// dropping tables if required.
if !config.GetTestrigSkipDBTeardown() {
testrig.StandardDBTeardown(state.DB)
}
// Lastly, if database service was started,
// ensure it gets closed now all else stopped.
if err := state.DB.Close(); err != nil {
log.Errorf(ctx, "error stopping database: %v", err)
}
}
// Finally reached end of shutdown.
log.Info(ctx, "done! exiting...")
}()
parsedLangs, err := language.InitLangs(config.GetInstanceLanguages().TagStrs()) parsedLangs, err := language.InitLangs(config.GetInstanceLanguages().TagStrs())
if err != nil { if err != nil {
return fmt.Errorf("error initializing languages: %w", err) return fmt.Errorf("error initializing languages: %w", err)
} }
config.SetInstanceLanguages(parsedLangs) config.SetInstanceLanguages(parsedLangs)
if err := tracing.Initialize(); err != nil { if err := observability.InitializeTracing(ctx); err != nil {
return fmt.Errorf("error initializing tracing: %w", err) return fmt.Errorf("error initializing tracing: %w", err)
} }
// Initialize caches and database // Initialize caches and database
state.DB = testrig.NewTestDB(&state) state.DB = testrig.NewTestDB(state)
// Set Actions on state, providing workers to
// Actions as well for triggering side effects.
state.AdminActions = admin.New(state.DB, &state.Workers)
// New test db inits caches so we don't need to do // New test db inits caches so we don't need to do
// that twice, we can just start the initialized caches. // that twice, we can just start the initialized caches.
state.Caches.Start() state.Caches.Start()
defer state.Caches.Stop()
testrig.StandardDBSetup(state.DB, nil) // Populate database tables + data if required.
if !config.GetTestrigSkipDBSetup() {
testrig.StandardDBSetup(state.DB, nil)
}
// Get the instance account // Get the instance account (we'll need this later).
// (we'll need this later).
instanceAccount, err := state.DB.GetInstanceAccount(ctx, "") instanceAccount, err := state.DB.GetInstanceAccount(ctx, "")
if err != nil { if err != nil {
return fmt.Errorf("error retrieving instance account: %w", err) return fmt.Errorf("error retrieving instance account: %w", err)
@ -97,74 +155,51 @@ var Start action.GTSAction = func(ctx context.Context) error {
} }
testrig.StandardStorageSetup(state.Storage, "./testrig/media") testrig.StandardStorageSetup(state.Storage, "./testrig/media")
// Initialize workers.
state.Workers.Start()
defer state.Workers.Stop()
// build backend handlers // build backend handlers
transportController := testrig.NewTestTransportController(&state, testrig.NewMockHTTPClient(func(req *http.Request) (*http.Response, error) { httpClient := testrig.NewMockHTTPClient(nil, "./testrig/media")
r := io.NopCloser(bytes.NewReader([]byte{})) transportController := testrig.NewTestTransportController(state, httpClient)
return &http.Response{ mediaManager := testrig.NewTestMediaManager(state)
StatusCode: 200, federator := testrig.NewTestFederator(state, transportController, mediaManager)
Body: r,
Header: http.Header{
"Content-Type": req.Header.Values("Accept"),
},
}, nil
}, ""))
mediaManager := testrig.NewTestMediaManager(&state)
federator := testrig.NewTestFederator(&state, transportController, mediaManager)
emailSender := testrig.NewEmailSender("./web/template/", nil) emailSender := testrig.NewEmailSender("./web/template/", nil)
typeConverter := typeutils.NewConverter(&state) webPushSender := testrig.NewWebPushMockSender()
filter := visibility.NewFilter(&state) typeConverter := typeutils.NewConverter(state)
// Initialize timelines. processor := testrig.NewTestProcessor(state, federator, emailSender, webPushSender, mediaManager)
state.Timelines.Home = timeline.NewManager(
tlprocessor.HomeTimelineGrab(&state),
tlprocessor.HomeTimelineFilter(&state, filter),
tlprocessor.HomeTimelineStatusPrepare(&state, typeConverter),
tlprocessor.SkipInsert(),
)
if err := state.Timelines.Home.Start(); err != nil {
return fmt.Errorf("error starting home timeline: %s", err)
}
state.Timelines.List = timeline.NewManager( // Initialize workers.
tlprocessor.ListTimelineGrab(&state), testrig.StartWorkers(state, processor.Workers())
tlprocessor.ListTimelineFilter(&state, filter), defer testrig.StopWorkers(state)
tlprocessor.ListTimelineStatusPrepare(&state, typeConverter),
tlprocessor.SkipInsert(),
)
if err := state.Timelines.List.Start(); err != nil {
return fmt.Errorf("error starting list timeline: %s", err)
}
processor := testrig.NewTestProcessor(&state, federator, emailSender, mediaManager)
// Initialize metrics. // Initialize metrics.
if err := metrics.Initialize(state.DB); err != nil { if err := observability.InitializeMetrics(ctx, state); err != nil {
return fmt.Errorf("error initializing metrics: %w", err) return fmt.Errorf("error initializing metrics: %w", err)
} }
// Run advanced migrations.
if err := processor.AdvancedMigrations().Migrate(ctx); err != nil {
return err
}
/* /*
HTTP router initialization HTTP router initialization
*/ */
router := testrig.NewTestRouter(state.DB) route = testrig.NewTestRouter(state.DB)
middlewares := []gin.HandlerFunc{ middlewares := []gin.HandlerFunc{
middleware.AddRequestID(config.GetRequestIDHeader()), // requestID middleware must run before tracing middleware.AddRequestID(config.GetRequestIDHeader()), // requestID middleware must run before tracing
} }
if config.GetTracingEnabled() { if config.GetTracingEnabled() {
middlewares = append(middlewares, tracing.InstrumentGin()) middlewares = append(middlewares, observability.TracingMiddleware())
} }
if config.GetMetricsEnabled() { if config.GetMetricsEnabled() {
middlewares = append(middlewares, metrics.InstrumentGin()) middlewares = append(middlewares, observability.MetricsMiddleware())
} }
middlewares = append(middlewares, []gin.HandlerFunc{ middlewares = append(middlewares, []gin.HandlerFunc{
middleware.Logger(config.GetLogClientIP()), middleware.Logger(config.GetLogClientIP()),
middleware.HeaderFilter(state),
middleware.UserAgent(), middleware.UserAgent(),
middleware.CORS(), middleware.CORS(),
middleware.ExtraHeaders(), middleware.ExtraHeaders(),
@ -194,10 +229,10 @@ var Start action.GTSAction = func(ctx context.Context) error {
middlewares = append(middlewares, middleware.ContentSecurityPolicy(cspExtraURIs...)) middlewares = append(middlewares, middleware.ContentSecurityPolicy(cspExtraURIs...))
// attach global middlewares which are used for every request // attach global middlewares which are used for every request
router.AttachGlobalMiddleware(middlewares...) route.AttachGlobalMiddleware(middlewares...)
// attach global no route / 404 handler to the router // attach global no route / 404 handler to the router
router.AttachNoRouteHandler(func(c *gin.Context) { route.AttachNoRouteHandler(func(c *gin.Context) {
apiutil.ErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), processor.InstanceGetV1) apiutil.ErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), processor.InstanceGetV1)
}) })
@ -220,34 +255,57 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error generating session name for session middleware: %w", err) return fmt.Errorf("error generating session name for session middleware: %w", err)
} }
// Configure our instance cookie policy.
cookiePolicy := apiutil.NewCookiePolicy()
var ( var (
authModule = api.NewAuth(state.DB, processor, idp, routerSession, sessionName) // auth/oauth paths authModule = api.NewAuth(state, processor, idp, routerSession, sessionName, cookiePolicy) // auth/oauth paths
clientModule = api.NewClient(state.DB, processor) // api client endpoints clientModule = api.NewClient(state, processor) // api client endpoints
metricsModule = api.NewMetrics() // Metrics endpoints healthModule = api.NewHealth(state.DB.Ready) // Health check endpoints
fileserverModule = api.NewFileserver(processor) // fileserver endpoints fileserverModule = api.NewFileserver(processor) // fileserver endpoints
wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints robotsModule = api.NewRobots() // robots.txt endpoint
nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints
activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint
webModule = web.New(state.DB, processor) // web pages + user profiles + settings panels etc activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints
webModule = web.New(state.DB, processor, cookiePolicy) // web pages + user profiles + settings panels etc
) )
// these should be routed in order // these should be routed in order
authModule.Route(router) authModule.Route(route)
clientModule.Route(router) clientModule.Route(route)
metricsModule.Route(router) healthModule.Route(route)
fileserverModule.Route(router) fileserverModule.Route(route)
fileserverModule.RouteEmojis(router, instanceAccount.ID) fileserverModule.RouteEmojis(route, instanceAccount.ID)
wellKnownModule.Route(router) robotsModule.Route(route)
nodeInfoModule.Route(router) wellKnownModule.Route(route)
activityPubModule.Route(router) nodeInfoModule.Route(route)
activityPubModule.RoutePublicKey(router) activityPubModule.Route(route)
webModule.Route(router) activityPubModule.RoutePublicKey(route)
webModule.Route(route)
cleaner := cleaner.New(&state) // Create background cleaner.
cleaner := cleaner.New(state)
gts := gotosocial.NewServer(state.DB, router, cleaner) // Schedule background cleaning tasks.
if err := gts.Start(ctx); err != nil { if err := cleaner.ScheduleJobs(); err != nil {
return fmt.Errorf("error starting gotosocial service: %s", err) return fmt.Errorf("error scheduling cleaner jobs: %w", err)
}
// Create subscriptions fetcher.
subscriptions := subscriptions.New(
state,
transportController,
typeConverter,
)
// Schedule background subscriptions updating.
if err := subscriptions.ScheduleJobs(); err != nil {
return fmt.Errorf("error scheduling subscriptions jobs: %w", err)
}
// Finally start the main http server!
if err := route.Start(); err != nil {
return fmt.Errorf("error starting router: %w", err)
} }
// catch shutdown signals from the operating system // catch shutdown signals from the operating system
@ -256,14 +314,5 @@ var Start action.GTSAction = func(ctx context.Context) error {
sig := <-sigs sig := <-sigs
log.Infof(ctx, "received signal %s, shutting down", sig) log.Infof(ctx, "received signal %s, shutting down", sig)
testrig.StandardDBTeardown(state.DB)
testrig.StandardStorageTeardown(state.Storage)
// close down all running services in order
if err := gts.Stop(ctx); err != nil {
return fmt.Errorf("error closing gotosocial service: %s", err)
}
log.Info(ctx, "done! exiting...")
return nil return nil
} }

View file

@ -18,12 +18,12 @@
package main package main
import ( import (
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/admin/account"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/admin/media"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/admin/media/prune"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/admin/trans"
"code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/admin/account"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/admin/media"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/admin/media/prune"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/admin/trans"
"github.com/superseriousbusiness/gotosocial/internal/config"
) )
func adminCommands() *cobra.Command { func adminCommands() *cobra.Command {
@ -108,7 +108,7 @@ func adminCommands() *cobra.Command {
adminAccountDisableCmd := &cobra.Command{ adminAccountDisableCmd := &cobra.Command{
Use: "disable", Use: "disable",
Short: "prevent a local account from signing in or posting etc, but don't delete anything", Short: "set 'disabled' to true on a local account to prevent it from signing in or posting etc, but don't delete anything",
PreRunE: func(cmd *cobra.Command, args []string) error { PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd}) return preRun(preRunArgs{cmd: cmd})
}, },
@ -119,6 +119,19 @@ func adminCommands() *cobra.Command {
config.AddAdminAccount(adminAccountDisableCmd) config.AddAdminAccount(adminAccountDisableCmd)
adminAccountCmd.AddCommand(adminAccountDisableCmd) adminAccountCmd.AddCommand(adminAccountDisableCmd)
adminAccountEnableCmd := &cobra.Command{
Use: "enable",
Short: "undo a previous disable command by setting 'disabled' to false on a local account",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), account.Enable)
},
}
config.AddAdminAccount(adminAccountEnableCmd)
adminAccountCmd.AddCommand(adminAccountEnableCmd)
adminAccountPasswordCmd := &cobra.Command{ adminAccountPasswordCmd := &cobra.Command{
Use: "password", Use: "password",
Short: "set a new password for the given local account", Short: "set a new password for the given local account",
@ -133,6 +146,19 @@ func adminCommands() *cobra.Command {
config.AddAdminAccountPassword(adminAccountPasswordCmd) config.AddAdminAccountPassword(adminAccountPasswordCmd)
adminAccountCmd.AddCommand(adminAccountPasswordCmd) adminAccountCmd.AddCommand(adminAccountPasswordCmd)
adminAccountDisable2FACmd := &cobra.Command{
Use: "disable-2fa",
Short: "disable 2fa for the given local account",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), account.Disable2FA)
},
}
config.AddAdminAccount(adminAccountDisable2FACmd)
adminAccountCmd.AddCommand(adminAccountDisable2FACmd)
adminCmd.AddCommand(adminAccountCmd) adminCmd.AddCommand(adminAccountCmd)
/* /*

View file

@ -21,10 +21,10 @@ import (
"context" "context"
"fmt" "fmt"
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action"
"code.superseriousbusiness.org/gotosocial/internal/config"
"code.superseriousbusiness.org/gotosocial/internal/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/log"
) )
type preRunArgs struct { type preRunArgs struct {
@ -43,16 +43,16 @@ type preRunArgs struct {
// env vars or cli flag. // env vars or cli flag.
func preRun(a preRunArgs) error { func preRun(a preRunArgs) error {
if err := config.BindFlags(a.cmd); err != nil { if err := config.BindFlags(a.cmd); err != nil {
return fmt.Errorf("error binding flags: %s", err) return fmt.Errorf("error binding flags: %w", err)
} }
if err := config.Reload(); err != nil { if err := config.LoadConfigFile(); err != nil {
return fmt.Errorf("error reloading config: %s", err) return fmt.Errorf("error loading config file: %w", err)
} }
if !a.skipValidation { if !a.skipValidation {
if err := config.Validate(); err != nil { if err := config.Validate(); err != nil {
return fmt.Errorf("invalid config: %s", err) return fmt.Errorf("invalid config: %w", err)
} }
} }
@ -64,11 +64,17 @@ func preRun(a preRunArgs) error {
// context, after initializing any last-minute things like loggers etc. // context, after initializing any last-minute things like loggers etc.
func run(ctx context.Context, action action.GTSAction) error { func run(ctx context.Context, action action.GTSAction) error {
log.SetTimeFormat(config.GetLogTimestampFormat()) log.SetTimeFormat(config.GetLogTimestampFormat())
// Set the global log level from configuration
// Set the global log level from configuration.
if err := log.ParseLevel(config.GetLogLevel()); err != nil { if err := log.ParseLevel(config.GetLogLevel()); err != nil {
return fmt.Errorf("error parsing log level: %w", err) return fmt.Errorf("error parsing log level: %w", err)
} }
// Set global log output format from configuration.
if err := log.ParseFormat(config.GetLogFormat()); err != nil {
return fmt.Errorf("error parsing log format: %w", err)
}
if config.GetSyslogEnabled() { if config.GetSyslogEnabled() {
// Enable logging to syslog // Enable logging to syslog
if err := log.EnableSyslog( if err := log.EnableSyslog(

View file

@ -18,9 +18,8 @@
package main package main
import ( import (
configaction "code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/debug/config"
"github.com/spf13/cobra" "github.com/spf13/cobra"
configaction "github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/debug/config"
"github.com/superseriousbusiness/gotosocial/internal/config"
) )
func debugCommands() *cobra.Command { func debugCommands() *cobra.Command {
@ -39,7 +38,6 @@ func debugCommands() *cobra.Command {
return run(cmd.Context(), configaction.Config) return run(cmd.Context(), configaction.Config)
}, },
} }
config.AddServerFlags(debugConfigCmd)
debugCmd.AddCommand(debugConfigCmd) debugCmd.AddCommand(debugConfigCmd)
return debugCmd return debugCmd
} }

View file

@ -23,11 +23,9 @@ import (
godebug "runtime/debug" godebug "runtime/debug"
"strings" "strings"
"codeberg.org/gruf/go-debug" _ "code.superseriousbusiness.org/gotosocial/docs"
"code.superseriousbusiness.org/gotosocial/internal/config"
"github.com/spf13/cobra" "github.com/spf13/cobra"
_ "github.com/superseriousbusiness/gotosocial/docs"
"github.com/superseriousbusiness/gotosocial/internal/config"
) )
// Version is the version of GoToSocial being used. // Version is the version of GoToSocial being used.
@ -42,35 +40,31 @@ func main() {
// override version in config store // override version in config store
config.SetSoftwareVersion(version) config.SetSoftwareVersion(version)
// instantiate the root command rootCmd := new(cobra.Command)
rootCmd := &cobra.Command{ rootCmd.Use = "gotosocial"
Use: "gotosocial", rootCmd.Short = "GoToSocial - a fediverse social media server"
Short: "GoToSocial - a fediverse social media server", rootCmd.Long = "GoToSocial - a fediverse social media server\n\nFor help, see: https://docs.gotosocial.org.\n\nCode: https://codeberg.org/superseriousbusiness/gotosocial"
Long: "GoToSocial - a fediverse social media server\n\nFor help, see: https://docs.gotosocial.org.\n\nCode: https://github.com/superseriousbusiness/gotosocial", rootCmd.Version = version
Version: version, rootCmd.SilenceErrors = true
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { rootCmd.SilenceUsage = true
// before running any other cmd funcs, we must load config-path
return config.LoadEarlyFlags(cmd)
},
SilenceErrors: true,
SilenceUsage: true,
}
// attach global flags to the root command so that they can be accessed from any subcommand // Register global flags with root.
config.AddGlobalFlags(rootCmd) config.RegisterGlobalFlags(rootCmd)
// add subcommands // Add subcommands with their flags.
rootCmd.AddCommand(serverCommands()) rootCmd.AddCommand(serverCommands())
rootCmd.AddCommand(debugCommands()) rootCmd.AddCommand(debugCommands())
rootCmd.AddCommand(adminCommands()) rootCmd.AddCommand(adminCommands())
if debug.DEBUG { rootCmd.AddCommand(migrationCommands())
// only add testrig if debug enabled.
rootCmd.AddCommand(testrigCommands()) // Testrigcmd will only be set when debug is enabled.
if testrigCmd := testrigCommands(); testrigCmd != nil {
rootCmd.AddCommand(testrigCmd)
} else if len(os.Args) > 1 && os.Args[1] == "testrig" { } else if len(os.Args) > 1 && os.Args[1] == "testrig" {
log.Fatalln("gotosocial must be built and run with the DEBUG enviroment variable set to enable and access testrig") log.Fatal("gotosocial must be built and run with the DEBUG enviroment variable set to enable and access testrig")
} }
// run // Run the prepared root command.
if err := rootCmd.Execute(); err != nil { if err := rootCmd.Execute(); err != nil {
log.Fatalf("error executing command: %s", err) log.Fatalf("error executing command: %s", err)
} }

View file

@ -0,0 +1,43 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/migration"
"github.com/spf13/cobra"
)
// migrationCommands returns the 'migrations' subcommand
func migrationCommands() *cobra.Command {
migrationCmd := &cobra.Command{
Use: "migrations",
Short: "gotosocial migrations-related tasks",
}
migrationRunCmd := &cobra.Command{
Use: "run",
Short: "starts and stops the database, running any outstanding migrations",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), migration.Run)
},
}
migrationCmd.AddCommand(migrationRunCmd)
return migrationCmd
}

View file

@ -18,9 +18,8 @@
package main package main
import ( import (
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/server"
"github.com/superseriousbusiness/gotosocial/internal/config"
) )
// serverCommands returns the 'server' subcommand // serverCommands returns the 'server' subcommand
@ -39,7 +38,19 @@ func serverCommands() *cobra.Command {
return run(cmd.Context(), server.Start) return run(cmd.Context(), server.Start)
}, },
} }
config.AddServerFlags(serverStartCmd)
serverCmd.AddCommand(serverStartCmd) serverCmd.AddCommand(serverStartCmd)
serverMaintenanceCmd := &cobra.Command{
Use: "maintenance",
Short: "start the gotosocial server in maintenance mode (returns 503 for almost all requests)",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), server.Maintenance)
},
}
serverCmd.AddCommand(serverMaintenanceCmd)
return serverCmd return serverCmd
} }

View file

@ -18,24 +18,30 @@
package main package main
import ( import (
"code.superseriousbusiness.org/gotosocial/cmd/gotosocial/action/testrig"
"code.superseriousbusiness.org/gotosocial/internal/config"
"codeberg.org/gruf/go-debug"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action/testrig"
) )
func testrigCommands() *cobra.Command { func testrigCommands() *cobra.Command {
testrigCmd := &cobra.Command{ if debug.DEBUG {
Use: "testrig", testrigCmd := &cobra.Command{
Short: "gotosocial testrig-related tasks", Use: "testrig",
} Short: "gotosocial testrig-related tasks",
}
testrigStartCmd := &cobra.Command{ testrigStartCmd := &cobra.Command{
Use: "start", Use: "start",
Short: "start the gotosocial testrig server", Short: "start the gotosocial testrig server",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), testrig.Start) return run(cmd.Context(), testrig.Start)
}, },
} }
testrigCmd.AddCommand(testrigStartCmd) testrigCmd.AddCommand(testrigStartCmd)
return testrigCmd config.AddTestrig(testrigCmd)
return testrigCmd
}
return nil
} }

133
cmd/process-emoji/main.go Normal file
View file

@ -0,0 +1,133 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"context"
"io"
"os"
"os/signal"
"syscall"
"code.superseriousbusiness.org/gotosocial/internal/config"
"code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"code.superseriousbusiness.org/gotosocial/internal/log"
"code.superseriousbusiness.org/gotosocial/internal/media"
"code.superseriousbusiness.org/gotosocial/internal/media/ffmpeg"
"code.superseriousbusiness.org/gotosocial/internal/state"
"code.superseriousbusiness.org/gotosocial/internal/storage"
"code.superseriousbusiness.org/gotosocial/internal/util"
"codeberg.org/gruf/go-storage/memory"
)
func main() {
ctx := context.Background()
ctx, cncl := signal.NotifyContext(ctx, syscall.SIGTERM, syscall.SIGINT)
defer cncl()
log.SetLevel(log.INFO)
if len(os.Args) != 3 {
log.Panic(ctx, "Usage: go run ./cmd/process-emoji <input-file> <output-static>")
}
if err := ffmpeg.InitFfprobe(ctx, 1); err != nil {
log.Panic(ctx, err)
}
if err := ffmpeg.InitFfmpeg(ctx, 1); err != nil {
log.Panic(ctx, err)
}
var st storage.Driver
st.Storage = memory.Open(10, true)
var state state.State
state.Storage = &st
state.Caches.Init()
var err error
config.SetHost("example.com")
config.SetStorageBackend("disk")
config.SetStorageLocalBasePath("/tmp/gotosocial")
config.SetDbType("sqlite")
config.SetDbAddress(":memory:")
state.DB, err = bundb.NewBunDBService(ctx, &state)
if err != nil {
log.Panic(ctx, err)
}
if err := state.DB.CreateInstanceAccount(ctx); err != nil {
log.Panicf(ctx, "error creating instance account: %s", err)
}
if err := state.DB.CreateInstanceInstance(ctx); err != nil {
log.Panicf(ctx, "error creating instance instance: %s", err)
}
if err := state.DB.CreateInstanceApplication(ctx); err != nil {
log.Panicf(ctx, "error creating instance application: %s", err)
}
mgr := media.NewManager(&state)
processing, err := mgr.CreateEmoji(ctx,
"emoji",
"example.com",
func(ctx context.Context) (reader io.ReadCloser, err error) {
return os.Open(os.Args[1])
},
media.AdditionalEmojiInfo{
URI: util.Ptr("example.com/emoji"),
},
)
if err != nil {
log.Panic(ctx, err)
}
emoji, err := processing.Load(ctx)
if err != nil {
log.Panic(ctx, err)
}
copyFile(ctx, &st, emoji.ImageStaticPath, os.Args[2])
}
func copyFile(ctx context.Context, st *storage.Driver, key string, path string) {
rc, err := st.GetStream(ctx, key)
if err != nil {
log.Panic(ctx, err)
}
defer rc.Close()
_ = os.Remove(path)
output, err := os.Create(path)
if err != nil {
log.Panic(ctx, err)
}
defer output.Close()
_, err = io.Copy(output, rc)
if err != nil {
log.Panic(ctx, err)
}
}

245
cmd/process-media/main.go Normal file
View file

@ -0,0 +1,245 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"strings"
"syscall"
"time"
"code.superseriousbusiness.org/gotosocial/internal/config"
"code.superseriousbusiness.org/gotosocial/internal/db/bundb"
"code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
"code.superseriousbusiness.org/gotosocial/internal/log"
"code.superseriousbusiness.org/gotosocial/internal/media"
"code.superseriousbusiness.org/gotosocial/internal/media/ffmpeg"
"code.superseriousbusiness.org/gotosocial/internal/state"
"code.superseriousbusiness.org/gotosocial/internal/storage"
"codeberg.org/gruf/go-storage/memory"
)
func main() {
ctx := context.Background()
ctx, cncl := signal.NotifyContext(ctx, syscall.SIGTERM, syscall.SIGINT)
defer cncl()
log.SetLevel(log.ERROR)
if len(os.Args) != 4 {
log.Panic(ctx, "Usage: go run ./cmd/process-media <input-file> <output-processed> <output-thumbnail>")
}
if err := ffmpeg.InitFfprobe(ctx, 1); err != nil {
log.Panic(ctx, err)
}
if err := ffmpeg.InitFfmpeg(ctx, 1); err != nil {
log.Panic(ctx, err)
}
var st storage.Driver
st.Storage = memory.Open(10, true)
var state state.State
state.Storage = &st
state.Caches.Init()
var err error
config.SetProtocol("http")
config.SetHost("localhost:8080")
config.SetStorageBackend("disk")
config.SetStorageLocalBasePath("/tmp/gotosocial")
config.SetDbType("sqlite")
config.SetDbAddress(":memory:")
state.DB, err = bundb.NewBunDBService(ctx, &state)
if err != nil {
log.Panic(ctx, err)
}
if err := state.DB.CreateInstanceAccount(ctx); err != nil {
log.Panicf(ctx, "error creating instance account: %s", err)
}
if err := state.DB.CreateInstanceInstance(ctx); err != nil {
log.Panicf(ctx, "error creating instance instance: %s", err)
}
if err := state.DB.CreateInstanceApplication(ctx); err != nil {
log.Panicf(ctx, "error creating instance application: %s", err)
}
account, err := state.DB.GetInstanceAccount(ctx, "")
if err != nil {
log.Panic(ctx, err)
}
mgr := media.NewManager(&state)
processing, err := mgr.CreateMedia(ctx,
account.ID,
func(ctx context.Context) (reader io.ReadCloser, err error) {
return os.Open(os.Args[1])
},
media.AdditionalMediaInfo{},
)
if err != nil {
log.Panic(ctx, err)
}
media, err := processing.Load(ctx)
if err != nil {
log.Panic(ctx, err)
}
outputCopyable(media)
copyFile(ctx, &st, media.File.Path, os.Args[2])
copyFile(ctx, &st, media.Thumbnail.Path, os.Args[3])
}
func copyFile(ctx context.Context, st *storage.Driver, key string, path string) {
rc, err := st.GetStream(ctx, key)
if err != nil {
if storage.IsNotFound(err) {
return
}
log.Panic(ctx, err)
}
defer rc.Close()
_ = os.Remove(path)
output, err := os.Create(path)
if err != nil {
log.Panic(ctx, err)
}
defer output.Close()
_, err = io.Copy(output, rc)
if err != nil {
log.Panic(ctx, err)
}
}
func outputCopyable(media *gtsmodel.MediaAttachment) {
var (
now = time.Now()
nowStr = now.Format(time.RFC3339)
mediaType string
fileMetaExtra string
)
switch media.Type {
case gtsmodel.FileTypeImage:
mediaType = "gtsmodel.FileTypeImage"
case gtsmodel.FileTypeVideo:
mediaType = "gtsmodel.FileTypeVideo"
case gtsmodel.FileTypeGifv:
mediaType = "gtsmodel.FileTypeGifv"
case gtsmodel.FileTypeAudio:
mediaType = "gtsmodel.FileTypeAudio"
case gtsmodel.FileTypeUnknown:
mediaType = "gtsmodel.FileTypeUnknown"
}
if media.FileMeta.Original.Duration != nil {
fileMetaExtra += fmt.Sprintf("\n\t\t\tDuration: util.Ptr[float32](%f),", *media.FileMeta.Original.Duration)
}
if media.FileMeta.Original.Framerate != nil {
fileMetaExtra += fmt.Sprintf("\n\t\t\tFramerate: util.Ptr[float32](%f),", *media.FileMeta.Original.Framerate)
}
if media.FileMeta.Original.Bitrate != nil {
fileMetaExtra += fmt.Sprintf("\n\t\t\tBitrate: util.Ptr[uint64](%d),", *media.FileMeta.Original.Bitrate)
}
fmt.Printf(`{
ID: "%s",
StatusID: "STATUS_ID_GOES_HERE",
URL: "%s",
RemoteURL: "",
CreatedAt: TimeMustParse("%s"),
Type: %s,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
Width: %d,
Height: %d,
Size: %d,
Aspect: %f,%s
},
Small: gtsmodel.Small{
Width: %d,
Height: %d,
Size: %d,
Aspect: %f,
},
Focus: gtsmodel.Focus{
X: 0,
Y: 0,
},
},
AccountID: "ACCOUNT_ID_GOES_HERE",
Description: "DESCRIPTION_GOES_HERE",
ScheduledStatusID: "",
Blurhash: "%s",
Processing: 2,
File: gtsmodel.File{
Path: "%s",
ContentType: "%s",
FileSize: %d,
},
Thumbnail: gtsmodel.Thumbnail{
Path: "%s",
ContentType: "%s",
FileSize: %d,
URL: "%s",
RemoteURL: "",
},
Avatar: util.Ptr(false),
Header: util.Ptr(false),
Cached: util.Ptr(true),
}`+"\n",
media.ID,
strings.ReplaceAll(media.URL, media.AccountID, "ACCOUNT_ID_GOES_HERE"),
nowStr,
mediaType,
media.FileMeta.Original.Width,
media.FileMeta.Original.Height,
media.FileMeta.Original.Size,
media.FileMeta.Original.Aspect,
fileMetaExtra,
media.FileMeta.Small.Width,
media.FileMeta.Small.Height,
media.FileMeta.Small.Size,
media.FileMeta.Small.Aspect,
media.Blurhash,
strings.ReplaceAll(media.File.Path, media.AccountID, "ACCOUNT_ID_GOES_HERE"),
media.File.ContentType,
media.File.FileSize,
strings.ReplaceAll(media.Thumbnail.Path, media.AccountID, "ACCOUNT_ID_GOES_HERE"),
media.Thumbnail.ContentType,
media.Thumbnail.FileSize,
strings.ReplaceAll(media.Thumbnail.URL, media.AccountID, "ACCOUNT_ID_GOES_HERE"),
)
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -178,7 +178,7 @@ hooks:
For PostgreSQL, you'll want to use `postgresql_databases` instead. For PostgreSQL, you'll want to use `postgresql_databases` instead.
The file mentioned in `patterns_from` can be created by transforming the output from the GoToSocial CLI media [`list-attachments`](cli.md#gotosocial-admin-media-list-attachments) and [`list-emojis`](cli.md#gotosocial-admin-media-list-emojis) commands. In order to generate the right patterns you can use the [`media-to-borg-patterns.py`](https://github.com/superseriousbusiness/gotosocial/tree/main/example/borgmatic/media-to-borg-patterns.py) script. How Borg patterns work is explained in [their documentation](https://man.archlinux.org/man/borg-patterns.1). The file mentioned in `patterns_from` can be created by transforming the output from the GoToSocial CLI media [`list-attachments`](cli.md#gotosocial-admin-media-list-attachments) and [`list-emojis`](cli.md#gotosocial-admin-media-list-emojis) commands. In order to generate the right patterns you can use the [`media-to-borg-patterns.py`](https://codeberg.org/superseriousbusiness/gotosocial/tree/main/example/borgmatic/media-to-borg-patterns.py) script. How Borg patterns work is explained in [their documentation](https://man.archlinux.org/man/borg-patterns.1).
You'll need to put that file on your GoToSocial instance and make sure the file is executable. It requires Python 3 which you will already have if you have Borg and Borgmatic installed. It only depends on the Python standard library. You'll need to put that file on your GoToSocial instance and make sure the file is executable. It requires Python 3 which you will already have if you have Borg and Borgmatic installed. It only depends on the Python standard library.
@ -186,7 +186,7 @@ You'll need to put that file on your GoToSocial instance and make sure the file
For this to work reliably, you should ensure that the [storage-local-base-path](../configuration/storage.md) in your GoToSocial configuration uses an absolute path. Otherwise you'll have to tweak the paths yourself. For this to work reliably, you should ensure that the [storage-local-base-path](../configuration/storage.md) in your GoToSocial configuration uses an absolute path. Otherwise you'll have to tweak the paths yourself.
```sh ```sh
$ gotosocial admin media list-attachments --local-only | \ $ gotosocial --config-path /path/to/config.yaml admin media list-attachments --local-only | \
/path/to/media-to-borg-patterns.py \ /path/to/media-to-borg-patterns.py \
<storage-local-base-path> <storage-local-base-path>
``` ```
@ -210,7 +210,7 @@ If you're running Borgmatic as a systemd service, you can [create a drop-in](htt
```ini ```ini
[Service] [Service]
ExecStartPre=/path/to/gotosocial admin media list-attachments --local-only | /path/to/media-to-borg-patterns.py <storage-local-base-path> /etc/borgmatic/gotosocial_patterns ExecStartPre=/path/to/gotosocial --config-path /path/to/config.yaml admin media list-attachments --local-only | /path/to/media-to-borg-patterns.py <storage-local-base-path> /etc/borgmatic/gotosocial_patterns
``` ```
Documentation that's good to review: Documentation that's good to review:

View file

@ -13,25 +13,41 @@ GoToSocial - a fediverse social media server
For help, see: https://docs.gotosocial.org. For help, see: https://docs.gotosocial.org.
Code: https://github.com/superseriousbusiness/gotosocial Code: https://codeberg.org/superseriousbusiness/gotosocial
Usage: Usage:
gotosocial [command] gotosocial [command]
Available Commands: Available Commands:
admin gotosocial admin-related tasks admin gotosocial admin-related tasks
completion generate the autocompletion script for the specified shell
debug gotosocial debug-related tasks debug gotosocial debug-related tasks
help Help about any command help Help about any command
server gotosocial server-related tasks server gotosocial server-related tasks
testrig gotosocial testrig-related tasks
``` ```
Under `Available Commands`, you can see the standard `server` command. But there are also commands doing admin and testing etc, which will be explained in this document. Under `Available Commands`, you can see the standard `server` command. But there are also commands doing admin and debugging etc, which will be explained in this document.
**Please note -- for all of these commands, you will still need to set the global options correctly so that the CLI tool knows how eg., how to connect to your database, which database to use, which host and account domain to use etc.** !!! Info "Passing global config to the CLI"
For all of these commands, you will still need to set the global options correctly so that the CLI tool knows how to connect to your database, which database to use, which host and account domain to use, etc.
You can set these options using environment variables, passing them as CLI flags (eg., `gotosocial [commands] --host example.org`), or by just pointing the CLI tool towards your config file (eg., `gotosocial --config-path ./config.yaml [commands]`).
You can set these options using environment variables, passing them as CLI flags (eg., `gotosocial [commands] --host example.org`), or by just pointing the CLI tool towards your config file (eg., `gotosocial --config-path ./config.yaml [commands]`). !!! Info
When running CLI commands, you'll get a bit of output like the following:
```text
time=XXXX level=info msg=connected to SQLITE database
time=XXXX level=info msg=there are no new migrations to run func=doMigration
time=XXXX level=info msg=closing db connection
```
This is normal and indicates that the commands ran as expected.
!!! Warning "Restarting GtS after running admin commands"
Because of the way internal caching works in GoToSocial, you may need to restart GoToSocial after running some of these commands in order for the effect of the command to "take". We are still looking for a way to make this unnecessary. In the meantime, commands that require a restart after running the command are highlighted below.
## gotosocial admin ## gotosocial admin
@ -41,6 +57,9 @@ Contains `account`, `export`, `import`, and `media` subcommands.
This command can be used to create a new account on your instance. This command can be used to create a new account on your instance.
!!! Warning
You must have launched the server at least once before running this command, to initialize essential entries in the database.
`gotosocial admin account create --help`: `gotosocial admin account create --help`:
```text ```text
@ -68,7 +87,11 @@ gotosocial admin account create \
### gotosocial admin account confirm ### gotosocial admin account confirm
This command can be used to confirm a user+account on your instance, allowing them to log in and use the account. Note that if the account was created using `admin account create` this is not necessary. This command can be used to confirm a user+account on your instance, allowing them to log in and use the account.
!!! Info
If the account was created using `admin account create` it is not necessary to run `confirm` on the account, it will be confirmed already.
`gotosocial admin account confirm --help`: `gotosocial admin account confirm --help`:
@ -93,6 +116,10 @@ gotosocial admin account confirm --username some_username --config-path config.y
This command can be used to promote a user to admin. This command can be used to promote a user to admin.
!!! Warning "Server restart required"
In order for the change to "take", this command requires a restart of GoToSocial after running the command.
`gotosocial admin account promote --help`: `gotosocial admin account promote --help`:
```text ```text
@ -116,6 +143,10 @@ gotosocial admin account promote --username some_username --config-path config.y
This command can be used to demote a user from admin to normal user. This command can be used to demote a user from admin to normal user.
!!! Warning "Server restart required"
In order for the change to "take", this command requires a restart of GoToSocial after running the command.
`gotosocial admin account demote --help`: `gotosocial admin account demote --help`:
```text ```text
@ -139,10 +170,14 @@ gotosocial admin account demote --username some_username --config-path config.ya
This command can be used to disable an account on your instance: prevent it from signing in or doing anything, without deleting data. This command can be used to disable an account on your instance: prevent it from signing in or doing anything, without deleting data.
!!! Warning "Server restart required"
In order for the change to "take", this command requires a restart of GoToSocial after running the command.
`gotosocial admin account disable --help`: `gotosocial admin account disable --help`:
```text ```text
prevent a local account from signing in or posting etc, but don't delete anything set 'disabled' to true on a local account to prevent it from signing in or posting etc, but don't delete anything
Usage: Usage:
gotosocial admin account disable [flags] gotosocial admin account disable [flags]
@ -158,10 +193,41 @@ Example:
gotosocial admin account disable --username some_username --config-path config.yaml gotosocial admin account disable --username some_username --config-path config.yaml
``` ```
### gotosocial admin account enable
This command can be used to reenable an account on your instance, undoing a previous `disable` command.
!!! Warning "Server restart required"
In order for the change to "take", this command requires a restart of GoToSocial after running the command.
`gotosocial admin account enable --help`:
```text
undo a previous disable command by setting 'disabled' to false on a local account
Usage:
gotosocial admin account enable [flags]
Flags:
-h, --help help for enable
--username string the username to create/delete/etc
```
Example:
```bash
gotosocial admin account enable --username some_username --config-path config.yaml
```
### gotosocial admin account password ### gotosocial admin account password
This command can be used to set a new password on the given local account. This command can be used to set a new password on the given local account.
!!! Warning "Server restart required"
In order for the change to "take", this command requires a restart of GoToSocial after running the command.
`gotosocial admin account password --help`: `gotosocial admin account password --help`:
```text ```text
@ -329,7 +395,11 @@ This command can be used to prune orphaned media from your GoToSocial.
Orphaned media is defined as media that is in storage under a key that matches the format used by GoToSocial, but which does not have a corresponding database entry. This is useful for excising files that may be remaining from a previous installation, or files that were placed in storage mistakenly. Orphaned media is defined as media that is in storage under a key that matches the format used by GoToSocial, but which does not have a corresponding database entry. This is useful for excising files that may be remaining from a previous installation, or files that were placed in storage mistakenly.
**This command only works when GoToSocial is not running, since it acquires an exclusive lock on storage. Stop GoToSocial first before running this command!** !!! Warning "Requires a stopped server"
This command only works when GoToSocial is not running, since it acquires an exclusive lock on storage.
Stop GoToSocial first before running this command!
```text ```text
prune orphaned media from storage prune orphaned media from storage
@ -366,7 +436,11 @@ These items will be refetched later on demand, if necessary.
Unused media means avatars/headers/status attachments which are not currently in use by an account or status. Unused media means avatars/headers/status attachments which are not currently in use by an account or status.
**This command only works when GoToSocial is not running, since it acquires an exclusive lock on storage. Stop GoToSocial first before running this command!** !!! Warning "Requires a stopped server"
This command only works when GoToSocial is not running, since it acquires an exclusive lock on storage.
Stop GoToSocial first before running this command!
```text ```text
prune unused/stale remote media from storage, older than given number of days prune unused/stale remote media from storage, older than given number of days

View file

@ -0,0 +1,55 @@
# Database Maintenance
Regardless of whether you choose to run GoToSocial with SQLite or Postgres, you may need to occasionally take maintenance steps to keep your database running well.
!!! tip
Though the maintenance tips provided here are intended to be non-destructive, you should backup your database before manually performing maintenance. That way if you mistype something or accidentally run a bad command, you can restore your backup and try again.
!!! danger
Manually creating, deleting, or updating entries in your GoToSocial database is **heavily discouraged**, and such commands are not provided here. Even if you think you know what you are doing, running `DELETE` statements etc. may introduce issues that are very difficult to debug. The maintenance tips below are designed to help with the smooth running of your instance; they will not save your ass if you have manually gone into your database and hacked at entries, tables, and indexes.
## SQLite
To do manual SQLite maintenance, you should first install the SQLite command line tool `sqlite3` on the same machine that your GoToSocial sqlite.db file is stored on. See [here](https://sqlite.org/cli.html) for details about `sqlite3`.
### Analyze / Optimize
Following [SQLite best practice](https://sqlite.org/lang_analyze.html#recommended_usage_pattern), GoToSocial runs the `optimize` SQLite pragma with `analysis_limit=1000` on closing database connections to keep index information up to date.
After each set of database migrations (eg., when starting a newer version of GoToSocial), GoToSocial will run `ANALYZE` to ensure that any indexes added or removed by migrations are taken into account correctly by the query planner.
The `ANALYZE` command may take ~10 minutes depending on your hardware and the size of your database file.
Because of the above automated steps, in normal circumstances you should not need to run manual `ANALYZE` commands against your SQLite database file.
However, if you interrupted a previous `ANALYZE` command, and you notice that queries are running remarkably slowly, it could be the case that the index metadata stored in SQLite's internal tables has been removed or undesirably altered.
If this is the case, you can try manually running a full `ANALYZE` command, by doing the following:
1. Stop GoToSocial.
2. While connected to your GoToSocial database file in the `sqlite3` shell, run `PRAGMA analysis_limit=0; ANALYZE;` (this may take quite a few minutes).
3. Start GoToSocial.
[See here](https://sqlite.org/lang_analyze.html#approximate_analyze_for_large_databases) for more info.
### Vacuum
GoToSocial does not currently enable auto-vacuum for SQLite. To repack the database file to an optimal size you may want to run a `VACUUM` command on your SQLite database periodically (eg., every few months).
You can see lots of information about the `VACUUM` command [here](https://sqlite.org/lang_vacuum.html).
The basic steps are:
1. Stop GoToSocial.
2. While connected to your GoToSocial database file in the `sqlite3` shell, run `VACUUM;` (this may take quite a few minutes).
3. Start GoToSocial.
### Replication
It's a common practice to set up safeguards for your database like replication. SQLite can be replicated using external software. The basic steps are described on the [Replicating SQLite](../advanced/replicating-sqlite.md) page.
## Postgres
TODO: Maintenance recommendations for Postgres.

View file

@ -2,7 +2,7 @@
GoToSocial supports 'blocking'/'suspending' domains that you don't want your instance to federate with. In our documentation, the two terms 'block' and 'suspend' are used interchangeably with regard to domains, because they mean the same thing: preventing your instance and the instance running on the target domain from communicating with one another, effectively cutting off federation between the two instances. GoToSocial supports 'blocking'/'suspending' domains that you don't want your instance to federate with. In our documentation, the two terms 'block' and 'suspend' are used interchangeably with regard to domains, because they mean the same thing: preventing your instance and the instance running on the target domain from communicating with one another, effectively cutting off federation between the two instances.
You can view, create, and remove domain blocks and domain allows using the [instance admin panel](./settings.md#federation). You can view, create, and remove domain blocks and domain allows using the [instance admin panel](./settings.md#domain-permissions).
This document focuses on what domain blocks actually *do* and what side effects are processed when you create a new domain block. This document focuses on what domain blocks actually *do* and what side effects are processed when you create a new domain block.
@ -41,9 +41,9 @@ With this in mind, you should only ever treat domain blocking as *one layer* of
Unfortunately, the Fediverse has its share of trolls, many of whom see domain blocking as an adversary to be defeated. To achieve this, they often target instances which use domain blocks to protect users. Unfortunately, the Fediverse has its share of trolls, many of whom see domain blocking as an adversary to be defeated. To achieve this, they often target instances which use domain blocks to protect users.
As such, there are bots on the Fediverse which scrape instance domain blocks and announce any discovered blocks to the followers of the bot, opening the admin of the blocking instance up to harassment. These bots use the `api/v1/instance/peers?filter=suspended` endpoint of GoToSocial instances to gather domain block information. As such, there are bots on the Fediverse which scrape instance domain blocks and announce any discovered blocks to the followers of the bot, opening the admin of the blocking instance up to harassment. These bots use the `api/v1/instance/peers?filter=suspended`, `api/v1/instance/peers?filter=blocked`, and/or `api/v1/instance/domain_blocks` endpoints of GoToSocial instances to gather domain block information.
By default, GoToSocial does not expose this endpoint publicly, so your instance will be safe from such scraping. However, if you set `instance-expose-suspended` to `true` in your config.yaml file, you may find that this endpoint gets scraped occasionally, and you may see your blocks being announced by troll bots. By default, GoToSocial does not expose these endpoints publicly, so your instance will be safe from such scraping. However, if you set `instance-expose-blocklist` to `true` in your config.yaml file, you may find that these endpoints gets scraped occasionally, and you may see your blocks being announced by troll bots.
## What are the side effects of creating a domain block ## What are the side effects of creating a domain block

View file

@ -0,0 +1,185 @@
# Domain Permission Subscriptions
Via the [admin settings panel](./settings.md#subscriptions), you can create and manage domain permission subscriptions.
Domain permission subscriptions allow you to specify a URL at which a permission list is hosted. Every 24hrs at 11pm (by default), your instance will fetch and parse each list you're subscribed to, in order of priority (highest to lowest), and create domain permissions (or domain permission drafts) based on entries discovered in the lists.
Each domain permission subscription can be used to create domain allow or domain block entries.
!!! warning
Currently, via blocklist subscriptions it is only possible to create "suspend" level domain blocks; other severities are not yet supported. Entries of severity "silence" or "limit" etc. on subscribed blocklists will be skipped.
## Priority
When you specify multiple domain permission subscriptions, they will be fetched and parsed in order of priority, from highest priority (255) to lowest priority (0).
Permissions discovered on lists higher up in the priority ranking will override permissions on lists lower down in the priority ranking.
For example, an instance admin subscribes to two allow lists, "Important List" at priority 255, and "Less Important List" at priority 128. Each of these subscribed lists contain an entry for `good-eggs.example.org`.
The subscription with the higher priority is the one that now creates and manages the domain allow entry for `good-eggs.example.org`.
If the subscription with the higher priority is removed, then the next time all the subscriptions are fetched, "Less Important List" will create (or take ownership of) the domain allow instead.
## Retractions
Sometimes, an entry that was present on a subscribed block or allow list will be removed later by the curator(s) of that list. When this happens, the removed domain permission entry can be said to have been "retracted".
For example, say your instance subscribes to one block list, and that block list contains an entry for `baddies.example.org`. A corresponding domain block for `baddies.example.org` has therefore been created in your database, with the subscription ID of your block list. In other words, the domain block is in force, and is managed by your block list subscription.
At some point, your instance fetches the list again, and this time it sees that the entry for `baddies.example.org` is no longer present in the list, because it has been removed by the list curator(s) (perhaps the admins turned their policies around, or the instance was shut down, etc). Thus, according to your instance, the block for `baddies.example.org` is now a "retracted" domain permission entry.
If the domain permission subscription is set to "Remove retracted permissions," then the now-retracted domain block will be removed from the database, and will no longer be enforced. In this example, that means your instance will start federating (again) with `baddies.example.org`.
If the domain permission subscription is *not* set to "Remove retracted permissions," then instead of the retracted block being removed from the database, it will be kept in the database but "orphaned" -- ie., it will still be in force, but it will be marked as no longer being managed by the subscription. In this example, that means your instance will keep blocking `baddies.example.org`.
!!!! Note "Retracted permissions and other subscriptions"
When a permission is retracted and removed from the database, but an entry for it exists on the list of *another* subscription of a lower priority than the one it was retracted from, then the permission will be recreated as an entry managed by the lower priority list.
For example, say you subscribe to List1 at priority 255, and List2 at priority 128, and `baddies.example.org` is present on both lists. That means the domain block entry will be managed by List1. If List1 later *retracts* the entry, it will be removed from your database (assuming you have "Remove retracted permissions" set). However, as soon as List2 is checked (usually seconds after List1), then an entry for `baddies.example.org` will be created again, but managed by List2 this time.
In other words, it is only when an entry is retracted from *every list you subscribe to* that it will truly be removed.
## Orphan Permissions
Domain permissions (blocks or allows) that are not currently managed by a domain permission subscription are considered "orphan" permissions. This includes permissions that an admin created in the settings panel by hand, entries which were imported manually via the import/export page, or entries that belonged to a subscription but have since been retracted but not removed.
If you wish, when creating a domain permission subscription, you can set ["adopt orphans"](./settings.md#adopt-orphan-permissions) to true for that subscription. If a domain permission subscription that is set to adopt orphans encounters an orphan permission which is *also present on the list at the subscription's URI*, then it will "adopt" the orphan by setting the orphan's subscription ID to its own ID.
For example, an instance admin manually creates a domain block for the domain `horrid-trolls.example.org`. Later, they create a domain permission subscription for a block list that contains an entry for `horrid-trolls.example.org`, and they set "adopt orphans" to true. When their instance fetches and parses the list, and creates domain permission entries from it, then the orphan domain block for `horrid-trolls.example.org` gets adopted by the domain permission subscription. Now, if the domain permission subscription is removed, and the option to remove all permissions owned by the subscription is checked, then the domain block for `horrid-trolls.example.org` will also be removed.
## Fun Stuff To Do With Domain Permission Subscriptions
### 1. Create an allowlist-federation cluster.
Domain permission subscriptions make it possible to easily create allowlist-federation clusters, ie., a group of instances can essentially form their own mini-fediverse, wherein each instance runs in [allowlist federation mode](./federation_modes.md#allowlist-federation-mode), and subscribes to a cooperatively-managed allowlist hosted somewhere.
For example, instances `instance-a.example.org`, `instance-b.example.org`, and `instance-c.example.org` decide that they only want to federate with each other.
Using some version management platform like Codeberg, they host a plaintext-formatted allowlist at something like `https://codeberg.org/our-cluster/allowlist/raw/branch/main/allows.txt`.
The contents of the plaintext-formatted allowlist are as follows:
```text
instance-a.example.org
instance-b.example.org
instance-c.example.org
```
Each instance admin sets their federation mode to `allowlist`, and creates a subscription to create allows from `https://codeberg.org/our-cluster/allowlist/raw/branch/main/allows.txt`, which results in domain allow entries being created for their own domain, and for each other domain in the cluster.
At some point, someone from `instance-d.example.org` asks (out of band) whether they can be added to the cluster. The existing admins agree, and update their plaintext-formatted allowlist to read:
```text
instance-a.example.org
instance-b.example.org
instance-c.example.org
instance-d.example.org
```
The next time each instance fetches the list, a new domain allow entry will be created for `instance-d.example.org`, and it will be able to federate with the other domains on the list.
### 2. Cooperatively manage a blocklist.
Domain permission subscriptions make it easy to collaborate on and subscribe to shared blocklists of domains that host illegal / fashy / otherwise undesired accounts and content.
For example, the admins of instances `instance-e.example.org`, `instance-f.example.org`, and `instance-g.example.org` decide that they are tired of duplicating work by playing whack-a-mole with bad actors. To make their lives easier, they decide to collaborate on a shared blocklist.
Using some version management platform like Codeberg, they host a blocklist at something like `https://codeberg.org/our-cluster/allowlist/raw/branch/main/blocks.csv`.
When someone discovers a new domain hosting an instance they don't like, they can open a pull request or similar against the list, to add the questionable instance to the domain.
For example, someone gets an unpleasant reply from a new instance `fashy-arseholes.example.org`. Using their collaboration tools, they propose adding `fashy-arseholes.example.org` to the blocklist. After some deliberation and discussion, the domain is added to the list.
The next time each of `instance-e.example.org`, `instance-f.example.org`, and `instance-g.example.org` fetch the block list, a block entry will be created for ``fashy-arseholes.example.org``.
### 3. Subscribe to a blocklist, but ignore some of it.
Say that `instance-g.example.org` in the previous section decides that they agree with most of the collaboratively-curated blocklist, but they actually would like to keep federating with ``fashy-arseholes.example.org`` for some godforsaken reason.
This can be done in one of three ways:
1. The admin of `instance-g.example.org` subscribes to the shared blocklist, but they do so with the ["create as drafts"](./settings.md#create-permissions-as-drafts) option set to true. When their instance fetches the blocklist, a draft block is created for `fashy-arseholes.example.org`. The admin of `instance-g` just leaves the permission as a draft, or rejects it, so it never comes into force.
2. Before the blocklist is re-fetched, the admin of `instance-g.example.org` creates a [domain permission exclude](./settings.md#excludes) entry for ``instance-g.example.org``. The domain ``instance-g.example.org`` then becomes exempt/excluded from automatic permission creation, and so the block for ``instance-g.example.org`` on the shared blocklist does not get created in the database of ``instance-g.example.org`` the next time the list is fetched.
3. The admin of `instance-g.example.org` creates an explicit domain allow entry for `fashy-arseholes.example.org` on their own instance. Because their instance is running in `blocklist` federation mode, [the explicit allow overrides the domain block entry](./federation_modes.md#in-blocklist-mode), and so the domain remains unblocked.
### 4. Subscribe directly to another instance's blocklist.
Because GoToSocial is able to fetch and parse JSON-formatted lists of domain permissions, it is possible to subscribe directly to another instance's list of blocked domains via their `/api/v1/instance/domain_blocks` (Mastodon) or `/api/v1/instance/peers?filter=suspended` (GoToSocial) endpoint (if exposed).
For example, the Mastodon instance `peepee.poopoo.example.org` exposes their block list publicly, and the owner of the GoToSocial instance `instance-h.example.org` decides they quite like the cut of the Mastodon moderator's jib. They create a domain permission subscription of type JSON, and set the URI to `https://peepee.poopoo.example.org/api/v1/instance/domain_blocks`. Every 24 hours, their instance will go fetch the blocklist JSON from the Mastodon instance, and create permissions based on entries discovered therein.
## Example lists per content type
Shown below are examples of the different permission list formats that GoToSocial is able to understand and parse.
Each list contains three domains, `bumfaces.net`, `peepee.poopoo`, and `nothanks.com`.
### CSV
CSV lists use content type `text/csv`.
Mastodon domain permission exports generally use this format.
```csv
#domain,#severity,#reject_media,#reject_reports,#public_comment,#obfuscate
bumfaces.net,suspend,false,false,big jerks,false
peepee.poopoo,suspend,false,false,harassment,false
nothanks.com,suspend,false,false,,false
```
### JSON (application/json)
JSON lists use content type `application/json`.
```json
[
{
"domain": "bumfaces.net",
"suspended_at": "2020-05-13T13:29:12.000Z",
"comment": "big jerks"
},
{
"domain": "peepee.poopoo",
"suspended_at": "2020-05-13T13:29:12.000Z",
"comment": "harassment"
},
{
"domain": "nothanks.com",
"suspended_at": "2020-05-13T13:29:12.000Z"
}
]
```
As an alternative to `"comment"`, `"public_comment"` will also work:
```json
[
{
"domain": "bumfaces.net",
"suspended_at": "2020-05-13T13:29:12.000Z",
"public_comment": "big jerks"
},
{
"domain": "peepee.poopoo",
"suspended_at": "2020-05-13T13:29:12.000Z",
"public_comment": "harassment"
},
{
"domain": "nothanks.com",
"suspended_at": "2020-05-13T13:29:12.000Z"
}
]
```
### Plaintext (text/plain)
Plaintext lists use content type `text/plain`.
Note that it is not possible to include any fields like "obfuscate" or "public comment" in plaintext lists, as they are simply a newline-separated list of domains.
```text
bumfaces.net
peepee.poopoo
nothanks.com
```

View file

@ -31,13 +31,18 @@ When your instance encounters a mention or an announce of a status or account it
## Combining blocks and allows ## Combining blocks and allows
It is possible to both block and allow the same domain, and the effect of combining these two things depends on which federation mode your instance is currently using. !!! danger
Combining blocks and allows is a tricky business!
When importing lists of allows and blocks, you should always review the list manually to make sure that you do not inadvertently block a domain that you would prefer not to block, since this can have **very annoying side effects** like removing follows/following, statuses, etc.
When in doubt, always add an explicit allow first as an insurance policy!
![A flow chart diagram showing how the two different federation modes treat incoming requests.](../assets/diagrams/federation_modes.png) It is possible to both block and allow the same domain, and the effect of combining these two things depends on which federation mode your instance is currently using, as explained in the following subsections, which are summarised in a flowchart that you can find below.
### In blocklist mode ### In blocklist mode
As the chart shows, in blocklist mode (the left-hand part of the diagram), an explicit domain allow can be used to override a domain block. As the chart below shows, in blocklist mode (the left-hand part of the diagram), an explicit domain allow can be used to override a domain block.
This is useful in cases where you are importing a blocklist from someone else, but the imported blocklist contains some instances you would actually prefer not to block. To avoid blocking those instances, you can create explicit domain allows for those instances first. Then, when you import the block list, the explicitly allowed domains will not be blocked, and the side effects of creating a block (deleting statuses, media, relationships etc) will not be processed. This is useful in cases where you are importing a blocklist from someone else, but the imported blocklist contains some instances you would actually prefer not to block. To avoid blocking those instances, you can create explicit domain allows for those instances first. Then, when you import the block list, the explicitly allowed domains will not be blocked, and the side effects of creating a block (deleting statuses, media, relationships etc) will not be processed.
@ -47,16 +52,11 @@ Conversely, if you add an explicit allow for a domain that was blocked, the side
### In allowlist mode ### In allowlist mode
As the chart shows, in allowlist mode (the right-hand part of the diagram) an explicit domain block trumps an explicit domain allow. The following two things must be true in order for an instance to be allowed through, when running in allowlist mode: As the chart below shows, in allowlist mode (the right-hand part of the diagram) an explicit domain block trumps an explicit domain allow. The following two things must be true in order for an instance to be allowed through, when running in allowlist mode:
1. An explicit domain block **does not exist** for the instance. 1. An explicit domain block **does not exist** for the instance.
2. An explicit domain allow **does exist** for the instance. 2. An explicit domain allow **does exist** for the instance.
If either of the above conditions are not met, the request will be denied. If either of the above conditions are not met, the request will be denied.
!!! danger ![A flow chart diagram showing how the two different federation modes treat incoming requests.](../public/diagrams/federation_modes.png)
Combining blocks and allows is a tricky business!
When importing lists of allows and blocks, you should always review the list manually to make sure that you do not inadvertently block a domain that you would prefer not to block, since this can have **very annoying side effects** like removing follows/following, statuses, etc.
When in doubt, always add an explicit allow first as an insurance policy!

View file

@ -7,8 +7,6 @@ GoToSocial currently offers 'block', 'allow' and disabled HTTP request header fi
HTTP request header filtering is also still considered "experimental". It should do what it says on the box, but it may cause bugs or edge cases to appear elsewhere, we're not sure yet! HTTP request header filtering is also still considered "experimental". It should do what it says on the box, but it may cause bugs or edge cases to appear elsewhere, we're not sure yet!
Management via settings panel is TBA. Until then you will need to manage these directly via API endpoints.
## Disabled header filtering mode (default) ## Disabled header filtering mode (default)
When `advanced-header-filter-mode` is set to `""`, i.e. an empty string, all request header filtering will be disabled. When `advanced-header-filter-mode` is set to `""`, i.e. an empty string, all request header filtering will be disabled.
@ -30,4 +28,4 @@ In allow mode, a block header filter can be used to override an existing allow f
A request in allow mode will only be accepted if it is EXPLICITLY ALLOWED AND NOT EXPLICITLY BLOCKED. A request in allow mode will only be accepted if it is EXPLICITLY ALLOWED AND NOT EXPLICITLY BLOCKED.
!!! danger !!! danger
Allow filtering mode is an extremely restrictive mode that will almost certainly prevent many (legitimate) clients from being able to access your instance, including yourself. You should only enable this mode if you know exactly what you're trying to achieve. Allow filtering mode is an extremely restrictive mode that will almost certainly prevent many (legitimate) clients from being able to access your instance, including yourself. You should only enable this mode if you know exactly what you're trying to achieve.

15
docs/admin/robots.md Normal file
View file

@ -0,0 +1,15 @@
# Robots.txt
GoToSocial serves a `robots.txt` file on the host domain. This file contains rules that attempt to block known AI scrapers, as well as some other indexers. It also includes some rules to ensure things like API endpoints aren't indexed by search engines since there really isn't any point to them.
## Allow/disallow stats collection
You can allow or disallow crawlers from collecting stats about your instance from the `/nodeinfo/2.0` and `/nodeinfo/2.1` endpoints by changing the setting `instance-stats-mode`, which modifies the `robots.txt` file. See [instance configuration](../configuration/instance.md) for more details.
## AI scrapers
The AI scrapers come from a [community maintained repository][airobots]. It's manually kept in sync for the time being. If you know of any missing robots, please send them a PR!
A number of AI scrapers are known to ignore entries in `robots.txt` even if it explicitly matches their User-Agent. This means the `robots.txt` file is not a foolproof way of ensuring AI scrapers don't grab your content. In addition to this you might want to look into blocking User-Agents via [requester header filtering](request_filtering_modes.md).
[airobots]: https://github.com/ai-robots-txt/ai.robots.txt/

View file

@ -20,23 +20,25 @@ Instance moderation settings.
### Reports ### Reports
![List of reports for testing, one resolved and one open.](../assets/admin-settings-reports.png) ![List of reports for testing, showing one open report.](../public/admin-settings-reports.png)
The reports section shows a list of reports, originating from your local users, or remote instances (shown anonymously as just the name of the instance, without specific username). The reports section shows a list of reports, originating from your local users, or remote instances (shown anonymously as just the name of the instance, without specific username).
Clicking a report shows if it was resolved (with the reasoning if available), more information, and a list of reported toots if selected by the reporting user. You can also use this view to mark a report as resolved, and fill in a comment. Whatever comment you enter here will be visible to the user that created the report, if that user is from your instance. Clicking a report shows if it was resolved (with the reasoning if available), more information, and a list of reported toots if selected by the reporting user. You can also use this view to mark a report as resolved, and fill in a comment. Whatever comment you enter here will be visible to the user that created the report, if that user is from your instance.
![The detailed view of an open report, showing the reported status and the reason for the report.](../public/admin-settings-report-detail.png)
Clicking on the username of the reported account opens that account in the 'Accounts' view, allowing you to perform moderation actions on it. Clicking on the username of the reported account opens that account in the 'Accounts' view, allowing you to perform moderation actions on it.
### Accounts ### Accounts
You can use this section to search for an account and perform moderation actions on it. You can use this section to search for an account and perform moderation actions on it.
### Federation ### Domain Permissions
![List of suspended instances, with a field to filter/add new blocks. Below is a link to the bulk import/export interface](../assets/admin-settings-federation.png) ![List of suspended instances, with a field to filter/add new blocks. Below is a link to the bulk import/export interface](../public/admin-settings-federation.png)
In the federation section you can create, delete, and review explicit domain blocks and domain allows. In the domain permissions section you can create, delete, and review domain blocks, domain allows, drafts, excludes, and subscriptions.
For more detail on federation settings, and specifically how domain allows and domain blocks work in combination, please see [the federation modes section](./federation_modes.md), and [the domain blocks section](./domain_blocks.md). For more detail on federation settings, and specifically how domain allows and domain blocks work in combination, please see [the federation modes section](./federation_modes.md), and [the domain blocks section](./domain_blocks.md).
@ -44,20 +46,105 @@ For more detail on federation settings, and specifically how domain allows and d
You can enter a domain to suspend in the search field, which will filter the list to show you if you already have a block for it. You can enter a domain to suspend in the search field, which will filter the list to show you if you already have a block for it.
Clicking 'suspend' gives you a form to add a public and/or private comment, and submit to add the block. Adding a suspension will suspend all the currently known accounts on the instance, and prevent any new interactions with any user on the blocked instance. Clicking 'suspend' gives you a form to add a public and/or private comment, and submit to add the block.
Adding a domain block will suspend all currently known accounts from that domain, and prevent any new interactions with the blocked domain.
#### Domain Allows #### Domain Allows
The domain allows section works much like the domain blocks section, described above, only for explicit domain allows rather than domain blocks. The domain allows section works much like the domain blocks section, described above, only for explicit domain allows rather than domain blocks.
#### Bulk import/export #### Import/export
Through the link at the bottom of the Federation section (or going to `/settings/admin/federation/import-export`) you can do bulk import/export of blocklists and allowlists. In this section you can do bulk import/export of domain permissions in JSON, CSV, or plaintext formats.
![List of domains included in an import, providing ways to select some or all of them, change their domains, and update the use of subdomains.](../assets/admin-settings-federation-import-export.png) ![List of domains included in an import, providing ways to select some or all of them, change their domains, and update the use of subdomains.](../public/admin-settings-federation-import-export.png)
Upon importing a list, either through the input field or from a file, you can review the entries in the list before importing a subset. You'll also be warned for entries that use subdomains, providing an easy way to change them to the main domain. Upon importing a list, either through the input field or from a file, you can review the entries in the list before importing a subset. You'll also be warned for entries that use subdomains, providing an easy way to change them to the main domain.
#### Drafts
In this section you can create, search through, accept, and reject domain permission drafts.
Domain permission drafts are domain permissions that have been proposed (either via manual creation or as an entry from a subscribed block / allow list), but have not yet come into force.
Until it is accepted, a domain permission draft will not have any effect on federation with the domain it targets. Upon acceptance, it will be converted into either a domain block or a domain allow, and start being enforced.
#### Excludes
In this section, you can create, search through, and remove domain permission excludes.
Domain permission excludes prevent permissions for a domain (and all subdomains) from being automatically managed by domain permission subscriptions.
For example, if you create an exclude entry for the domain `example.org`, then a blocklist or allowlist subscription will exclude entries for `example.org` and any of its subdomains (`sub.example.org`, `another.sub.example.org` etc.) when creating domain permission drafts and domain blocks/allows.
This functionality allows you to manually manage permissions for excluded domains, in cases where you know you definitely do or don't want to federate with a given domain, no matter what entries are contained in a domain permission subscription.
Note that by itself, creation of an exclude entry for a given domain does not affect federation with that domain at all, it is only useful in combination with permission subscriptions.
#### Subscriptions
In this section, you can create, search through, edit, test, and remove domain permission subscriptions.
Domain permission subscriptions allow you to specify a URL at which a permission list is hosted. Every 24hrs at 11pm (by default), your instance will fetch and parse each subscribed list, and create domain permissions (or domain permission drafts) based on entries in the lists.
##### Title
You can optionally use the title field to set a title for the subscription, as a reminder for yourself and other admins.
For example, you might subscribe to a list at `https://lists.example.org/baddies.csv` and set the title of the subscription to something that reflects the contents of that list, such as "Basic block list (worst of the worst)", or similar.
##### Subscription Priority
When you specify multiple domain permission subscriptions, they will be fetched and parsed in order of priority, from highest priority (255) to lowest priority (0).
Permissions discovered on lists higher up in the priority ranking will override permissions on lists lower down in the priority ranking.
For more information on priority, please see the separate [domain permission subscriptions](./domain_permission_subscriptions.md) document.
##### Permission Type
You can use this dropdown to select whether permissions discovered at the list URL should be created as domain blocks, or domain allows.
##### Content Type
You can use this dropdown to select the content type of the list at the subscribed URL.
Use CSV for Mastodon-style permission lists, plain for plaintext lists of domain names, or JSON for json-exported lists.
##### Basic Auth
Check this box to provide a basic auth username and/or password credential for the subscribed list, which will be sent along with each request to fetch the list.
##### Adopt Orphan Permissions
If you check this box, then any existing domain permissions will become managed by this subscription in the following circumstances:
1. They don't already have a subscription ID (ie., they're not managed by any domain permission subscription).
2. They match a domain permission included in the list at the URL of this subscription.
For more information on orphan permissions, please see the separate [domain permission subscriptions](./domain_permission_subscriptions.md#orphan-permissions) document.
##### Remove Retracted Permissions
This setting controls how retractions are handled by this domain permission subscription: if "Remove retracted permissions" is checked, retracted entries will be removed from the database; if "Remove retracted permissions" is not checked, retracted entries will just be orphaned instead.
For more detail on how retractions work, with examples, please see the separate [domain permission subscriptions](./domain_permission_subscriptions.md#retractions) document.
##### Create Permissions as Drafts
With this box checked (default), any permissions created by this subscription will be created as **drafts** which require manual approval to come into force.
It is recommended to leave this box checked unless you absolutely trust the subscribed list, to avoid inadvertent blocking or allowing of domains you'd rather not block or allow.
##### Test a Subscription
To test whether a subscription can be successfully parsed, first create the subscription, then in the detailed view for that subscription, click on the "Test" button.
If your instance is able to fetch and parse permissions at the subscription URI, then you will see a list of these after clicking "Test". Otherwise, you will see an error message.
![Screenshot of the detailed view of a subscription, with arrows pointing to the test section near the bottom.](../public/admin-settings-federation-subscription-test.png)
## Administration ## Administration
Instance administration settings. Instance administration settings.
@ -66,6 +153,10 @@ Instance administration settings.
Run one-off administrative actions. Run one-off administrative actions.
#### Email
You can use this section to send a test email to the given email address, with an optional test message.
#### Media #### Media
You can use this section run a media action to clean up the remote media cache using the specified number of days. Media older than the given number of days will be removed from storage (s3 or local). Media removed in this way will be refetched again later if the media is required again. This action is functionally identical to the media cleanup that runs automatically. You can use this section run a media action to clean up the remote media cache using the specified number of days. Media older than the given number of days will be removed from storage (s3 or local). Media removed in this way will be refetched again later if the media is required again. This action is functionally identical to the media cleanup that runs automatically.
@ -80,7 +171,7 @@ Custom Emoji will be automatically fetched when included in remote toots, but to
#### Local #### Local
![Local custom emoji section, showing an overview of custom emoji sorted by category. There are a lot of garfields.](../assets/admin-settings-emoji-local.png) ![Local custom emoji section, showing an overview of custom emoji sorted by category. There are a lot of garfields.](../public/admin-settings-emoji-local.png)
This section shows an overview of all the custom emoji enabled on your instance, sorted by their category. Clicking an emoji shows it's details, and provides options to change the category or image, or delete it completely. The shortcode cannot be updated here, you would have to upload it with the new shortcode yourself (and optionally delete the old one). This section shows an overview of all the custom emoji enabled on your instance, sorted by their category. Clicking an emoji shows it's details, and provides options to change the category or image, or delete it completely. The shortcode cannot be updated here, you would have to upload it with the new shortcode yourself (and optionally delete the old one).
@ -88,7 +179,7 @@ Below the overview you can upload your own custom emoji, after previewing how th
#### Remote #### Remote
![Remote custom emoji section, showing a list of 3 emoji parsed from the entered toot, garfield, blobfoxbox and blobhajmlem. They can be selected, their shortcode can be tweaked, and they can be assigned to a category, before submitting as a copy or delete operation](../assets/admin-settings-emoji-remote.png) ![Remote custom emoji section, showing a list of 3 emoji parsed from the entered toot, garfield, blobfoxbox and blobhajmlem. They can be selected, their shortcode can be tweaked, and they can be assigned to a category, before submitting as a copy or delete operation](../public/admin-settings-emoji-remote.png)
Through the 'remote' section, you can look up a link to any remote toots (provided the instance isn't suspended). If they use any custom emoji they will be listed, providing an easy way to copy them to the local emoji (for use in your own toots), or disable them ( hiding them from toots). Through the 'remote' section, you can look up a link to any remote toots (provided the instance isn't suspended). If they use any custom emoji they will be listed, providing an easy way to copy them to the local emoji (for use in your own toots), or disable them ( hiding them from toots).
@ -96,7 +187,7 @@ Through the 'remote' section, you can look up a link to any remote toots (provid
### Instance Settings ### Instance Settings
![Screenshot of the GoToSocial admin panel, showing the fields to change an instance's settings](../assets/admin-settings-instance.png) ![Screenshot of the GoToSocial admin panel, showing the fields to change an instance's settings](../public/admin-settings-instance.png)
Here you can set various metadata for your instance, like the displayed name/title, thumbnail image, (short) description, and contact info. Here you can set various metadata for your instance, like the displayed name/title, thumbnail image, (short) description, and contact info.
@ -161,3 +252,11 @@ Links to the set contact account and/or email address will appear on the footer
The selected **contact user** must be an active (not suspended) admin and/or moderator on the instance. The selected **contact user** must be an active (not suspended) admin and/or moderator on the instance.
If you're on a single-user instance and you give admin privileges to your main account, you can just fill in your own username here; you don't need to make a separate admin account just for this. If you're on a single-user instance and you give admin privileges to your main account, you can just fill in your own username here; you don't need to make a separate admin account just for this.
### Instance Custom CSS
custom CSS allows you to further customize the way your instance looks when visited through a browser.
This custom CSS will be applied to all pages of your instance. Users themes and CSS still take precedence over this customization.
See the [Custom CSS](../user_guide/custom_css.md) page for some tips on writing custom CSS for your instance.

61
docs/admin/signups.md Normal file
View file

@ -0,0 +1,61 @@
# New Account Sign-Ups
If you want to allow more people than just you to have an account on your instance, you can open your instance to new account sign-ups / registrations.
Be wary that as instance admin, like it or not, you are responsible for what people post on your instance. If users on your instance harass or annoy other people on the fediverse, you may find your instance gets a bad reputation and becomes blocked by others. Moderating a space properly takes work. As such, you should carefully consider whether or not you are willing and able to do moderation, and consider accepting sign-ups on your instance only from friends and people that you really trust.
!!! warning
For the sign-up flow to work as intended, your instance [should be configured to send emails](../configuration/smtp.md).
As mentioned below, several emails are sent during the sign-up flow, both to you (as admin/moderator) and to the applicant, including an email asking them to confirm their email address.
If they cannot receive this email (because your instance is not configured to send emails), you will have to manually confirm the account by [using the CLI tool](../admin/cli.md#gotosocial-admin-account-confirm).
## Opening Sign-Ups
You can open new account sign-ups for your instance by changing the variable `accounts-registration-open` to `true` in your [configuration](../configuration/accounts.md), and restarting your GoToSocial instance.
A sign-up form for your instance will be available at the `/signup` endpoint. For example, `https://your-instance.example.org/signup`.
![Sign-up form, showing email, password, username, and reason fields.](../public/signup-form.png)
Also, your instance homepage and "about" pages will be updated to reflect that registrations are open.
When someone submits a new sign-up, they'll receive an email at the provided email address, giving them a link to confirm that the address really belongs to them.
In the meantime, admins and moderators on your instance will receive an email and a notification that a new sign-up has been submitted.
## Handling Sign-Ups
Instance admins and moderators can handle a new sign-up by either approving or rejecting it via the "accounts" -> "pending" section in the admin panel.
![Admin settings panel open to "accounts" -> "pending", showing one account in a list.](../public/signup-pending.png)
If you have no sign-ups, the list pictured above will be empty. If you have a pending account sign-up, however, you can click on it to open that account in the account details screen:
![Details of a new pending account, giving options to approve or reject the sign-up.](../public/signup-account.png)
At the bottom, you will find actions that let you approve or reject the sign-up.
If you **approve** the sign-up, the account will be marked as "approved", and an email will be sent to the applicant informing them their sign-up has been approved, and reminding them to confirm their email address if they haven't already done so. If they have already confirmed their email address, they will be able to log in and start using their account.
If you **reject** the sign-up, you may wish to inform the applicant that their sign-up has been rejected, which you can do by ticking the "send email" checkbox. This will send a short email to the applicant informing them of the rejection. If you wish, you can add a custom message, which will be added at the bottom of the email. You can also add a private note that will be visible to other admins only.
!!! warning
You may want to hold off on approving a sign-up until they have confirmed their email address, in case the applicant made a typo when submitting, or the email address they provided does not actually belong to them. If they cannot confirm their email address, they will not be able to log in and use their account.
## Sign-Up Limits
By default, to avoid sign-up backlogs overwhelming admins and moderators, GoToSocial limits the sign-up pending backlog to 20 accounts. Once there are 20 accounts pending in the backlog waiting to be handled by an admin or moderator, new sign-ups will not be accepted via the form.
By default, new sign-ups will also not be accepted via the form if 10 or more new account sign-ups have been approved in the last 24 hours, to avoid instances rapidly expanding beyond the capabilities of moderators.
In both cases, applicants will be shown an error message explaining why they could not submit the form, and inviting them to try again later.
The limit of sign-ups per day, and the backlog size, can be configured or disabled altogether with the variables `accounts-registration-daily-limit` and `accounts-registration-backlog-limit`. See the [accounts config section](../configuration/accounts.md) for more info.
To combat spam accounts, GoToSocial account sign-ups **always** require manual approval by an administrator, and applicants must **always** confirm their email address before they are able to log in and post.
## Sign-Up Via Invite
NOT IMPLEMENTED YET: in a future update, admins and moderators will be able to create and send invites that allow accounts to be created even when public sign-up is closed, and to pre-approve accounts created via invitation, and/or allow them to override the sign-up limits described above.

View file

@ -0,0 +1,43 @@
# Managing GtS on slow hardware
While GoToSocial runs great on lower-end hardware, some operations are not practical on it, especially
instances with the database on slow storage (think anything that is not an SSD). This document
offers some suggestions on how to work around common issues when running GtS on slow hardware.
## Running database migrations on a different machine
Sometimes a database migration will need to do operations that are taxing on the database's storage.
These operations can take days if the database resides on a hard disk or SD card. If your
database is on slow storage, it can save a lot of time to follow the following procedure:
!!! danger
It might seem tempting to keep GtS running while you run the migrations on another machine, but
doing this will lead to all the posts that are received during the migration post disappearing
once the migrated database is re-imported.
1. Shut down GtS
2. Take a [backup](backup_and_restore.md#what-to-backup-database) of the database
3. Import the database on faster hardware
4. Run the GtS migration on the faster hardware
5. Take a backup of the resultant database
6. Import the resultant backup and overwrite the old database
7. Start GtS with the new version
### Running GtS migrations separately
After you import the database on the faster hardware, you can run the migration without starting
GtS by downloading the *target* GtS version from the [releases](https://codeberg.org/superseriousbusiness/gotosocial/releases) page.
For instance, if you are running `v0.19.2` and you want to upgrade to `v0.20.0-rc1`, download the
latter version. Once you have the binary, set it to executable by running `chmod u+x /path/to/gotosocial`. Afterwards, copy the configuration of the original server, and alter
it with the location of the new database. We copy the configuration in case variables like
the hostname is used in the migration, we want to keep that consistent.
Once everything is in place, you can run the migration like this:
```sh
$ /path/to/gotosocial --config-path /path/to/config migrations run
```
This will run all the migrations, just like GtS would if it was started normally. Once this is done
you can copy the result to the original instance and start the new GtS version there as well, which
will see that everything is migrated and that there's nothing to do except run as expected.

30
docs/admin/themes.md Normal file
View file

@ -0,0 +1,30 @@
# Themes
Users on your instance can select a theme for their profile from any css files present in the `web/assets/themes` directory.
GoToSocial comes with some theme files already, but you can add more yourself by doing the following:
1. Create a file in `web/assets/themes` called (for example) `new-theme.css`.
2. (Optional) Include the following comment at the top of your theme file to title and describe your theme:
```css
/*
theme-title: My New Theme
theme-description: This is an example theme
*/
```
You can use any text you like for these fields, but bear in mind whatever you write here will appear in the settings panel to help users when selecting a theme, so keep it short and sweet.
3. Fill out your custom CSS in the rest of the file. You can use one of the existing CSS files to guide you. Also see [this page](../user_guide/custom_css.md) for some rough guidelines about how to write accessible CSS.
4. Restart your instance so that the new CSS file is picked up.
!!! info
If you're using Docker for your deployment, you can mount theme files from the host machine into your GoToSocial `web/assets/themes` directory instead, by including entries for them in the `volumes` section of your Docker configuration.
For example, say you've created a theme on your host machine at `~/gotosocial/my-themes/new-theme.css`, you could mount that theme into the GoToSocial Docker container in the following way:
```yaml
volumes:
[.... some other volume entries ...]
- "~/gotosocial/my-themes/new-theme.css:/gotosocial/web/assets/themes/new-theme.css"
```
Bear in mind if you mount an entire directory to `/gotosocial/web/assets/themes` instead of mounting individual theme files, you'll override the default themes.

View file

@ -0,0 +1,31 @@
# Build without Wazero / WASM
!!! Danger "This is unsupported"
We do not offer any kind of support for deployments of GoToSocial built with the `nowasm` tag described in this section. Such builds should be considered strictly experimental, and any issues that come when running them are none of our business! Please don't open issues on the repo looking for help debugging deployments of `nowasm` builds.
On [supported platforms](../../getting_started/releases.md#supported-platforms), GoToSocial uses the WebAssembly runtime [Wazero](https://wazero.io/) to sandbox `ffmpeg`, `ffprobe`, and `sqlite3` WebAssembly binaries, allowing these applications to be packaged and run inside the GoToSocial binary, without requiring admins to install + manage any external dependencies.
This has the advantage of making it easier for admins to maintain their GoToSocial instance, as their GtS binary is completely isolated from any changes to their system-installed `ffmpeg`, `ffprobe`, and `sqlite`. It's also a bit safer to run `ffmpeg` in this way, as GoToSocial wraps the `ffmpeg` binary in a very constrained file system that doesn't permit the `ffmpeg` binary to access any files other than the ones it's decoding + reencoding. In other words, GoToSocial on supported platforms offers most of the functionality of `ffmpeg` and so on, without some of the headaches.
However, not all platforms are capable of running Wazero in the much-faster "compiler" mode, and have to fall back to the very slow (and resource-heavy) "interpreter" mode. See [this table](https://github.com/tetratelabs/wazero?tab=readme-ov-file#conformance) from Wazero for conformance.
"Interpreter" mode runs so poorly for GoToSocial's use case that it's simply not feasible to run a GoToSocial instance in a stable manner on platforms that aren't 64-bit Linux or 64-bit FreeBSD, as all the memory and CPU get gobbled up by media processing.
However! To enable folks to run **experimental, unsupported deployments of GoToSocial**, we expose the `nowasm` build tag, which can be used to compile a build of GoToSocial that does not use Wazero or WASM at all.
A GoToSocial binary built with `nowasm` will use the [modernc version of SQLite](https://pkg.go.dev/modernc.org/sqlite) instead of the WASM one, and will use on-system `ffmpeg` and `ffprobe` binaries for media processing.
!!! tip
To test if your system is compatible with the standard builds, you can use this command:
`if grep -qE '^flags.* (sse4|LSE)' /proc/cpuinfo; then echo "Your system is supporting GTS!"; else echo "Your system is not supporting GTS, you'll have to use the 'nowasm' builds :("; fi`
To build GoToSocial with the `nowasm` tag, you can pass the tag into our convenience `build.sh` script like so:
```bash
GO_BUILDTAGS=nowasm ./scripts/build.sh
```
In order to run a version of GoToSocial built in this way, you must ensure that `ffmpeg` and `ffprobe` are installed on the host. This is usually as simple as running a command like `doas -u root pkg_add ffmpeg` (OpenBSD), or `sudo apt install ffmpeg` (Debian etc.).
!!! Danger "No really though, it's unsupported"
Again, if running builds of GoToSocial with `nowasm` works for your OS/Arch combination, that's great, but we do not support such builds and we won't be able to help debugging why something doesn't work.

View file

@ -0,0 +1,48 @@
# Health Checks
GoToSocial exposes two health check HTTP endpoints: `/readyz` and `/livez`.
These can be used to check whether GoToSocial is reachable and able to make simple database queries.
`/livez` will always return a 200 OK response with no body, in response to both GET and HEAD requests. This is useful to check if the GoToSocial service is alive.
`/readyz` will return a 200 OK response with no body, in response to both GET and HEAD requests, if GoToSocial is able to run a very simple SELECT query against the configured database backend. If an error occurs while running the SELECT, the error will be logged, and 500 Internal Server Error will be returned, with no body.
You can use the above endpoints to implement health checks in container runtimes / orchestration systems.
For example, in a Docker setup, you could add the following to your docker-compose.yaml:
```yaml
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8080/readyz || exit 1
interval: 120s
retries: 5
start_period: 30s
timeout: 10s
```
The above health check will start after 30 seconds, and check every two minutes whether the service is available by doing a HEAD request to `/readyz`. If the check fails five times in a row, the service will be reported as unhealthy. You can use this in whatever orchestration system you are using to force the container to restart.
!!! warning
When doing database migrations on slow hardware, migration might take longer than the 10 minutes afforded by the above health check.
On such a system, you may want to increase the interval or number of retries of the health check to ensure that you don't stop GoToSocial in the middle of a migration (which is a very bad thing to do!).
!!! tip
Though the health check endpoints don't reveal any sensitive info, and run only very simple queries, you may want to avoid exposing them to the outside world. You could do this in nginx, for example, by adding the following snippet to your `server` stanza:
```nginx
location /livez {
return 404;
}
location /readyz {
return 404;
}
```
This will cause nginx to intercept these requests *before* they are passed to GoToSocial, and just return 404 Not Found.
References:
- [Dockerfile reference](https://docs.docker.com/reference/dockerfile/#healthcheck)
- [Compose file reference](https://docs.docker.com/compose/compose-file/compose-file-v3/#healthcheck)

View file

@ -98,8 +98,8 @@ myservice:
labels: labels:
- 'traefik.http.routers.myservice.rule=Host(`example.org`)' # account-domain - 'traefik.http.routers.myservice.rule=Host(`example.org`)' # account-domain
- 'traefik.http.middlewares.myservice-gts.redirectregex.permanent=true' - 'traefik.http.middlewares.myservice-gts.redirectregex.permanent=true'
- 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo|host-meta)$$' # host - 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo|host-meta)(\?.*)?$' # host
- 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://social.$${1}/.well-known/$${2}' # host - 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://social.$${1}/.well-known/$${2}$${3}' # host
- 'traefik.http.routers.myservice.middlewares=myservice-gts@docker' - 'traefik.http.routers.myservice.middlewares=myservice-gts@docker'
``` ```

View file

@ -1,6 +1,6 @@
# Advanced # Advanced
In this section we touch on a number of more advanced topics, primarily related around deploying, operating and tuning GoToSocial. In this section we touch on a number of more advanced topics, primarily related around building, deploying, operating and tuning GoToSocial.
We consider these topics advanced because applying them incorrectly does have the possibility of causing client and federation issues. Applying any of these configuration changes may also make it harder for you to debug an issue with your GoToSocial instance if you don't understand the changes that you're making. We consider these topics advanced because applying them incorrectly does have the possibility of causing client and federation issues. Applying any of these configuration changes may also make it harder for you to debug an issue with your GoToSocial instance if you don't understand the changes that you're making.
@ -15,3 +15,5 @@ We consider these topics advanced because applying them incorrectly does have th
* [Firewall configuration](security/firewall.md) * [Firewall configuration](security/firewall.md)
* [Tracing](tracing.md) * [Tracing](tracing.md)
* [Metrics](metrics.md) * [Metrics](metrics.md)
* [Replicating SQLite](replicating-sqlite.md)
* [SQLite on networked storage](sqlite-networked-storage.md)

View file

@ -1,32 +1,89 @@
# Metrics # Metrics
GoToSocial comes with [OpenTelemetry][otel] based metrics. The metrics are exposed using the [Prometheus exposition format][prom] on the `/metrics` path. The configuration settings are documented in the [Observability configuration reference][obs]. GoToSocial uses the [OpenTelemetry][otel] Go SDK to enable instance admins to expose runtime metrics in the Prometheus metrics format.
Currently the following metrics are collected: Currently, the following metrics are collected:
* Go performance and runtime metrics * Go performance and runtime metrics
* Gin (HTTP) metrics * Gin (HTTP server) metrics
* Bun (database) metrics * Bun (database) metrics
Metrics can be enable with the following configuration: ## Enabling metrics
To enable metrics, first set the `metrics-enabled` configuration value to `true` in your config.yaml file:
```yaml ```yaml
metrics-enabled: true metrics-enabled: true
``` ```
Though metrics do not contain anything privacy sensitive, you may not want to allow just anyone to view and scrape operational metrics of your instance. Then, you will need to set some additional environment variables on the GoToSocial process in order to configure OpenTelemetry to expose metrics in the Prometheus format:
```env
OTEL_METRICS_PRODUCERS=prometheus
OTEL_METRICS_EXPORTER=prometheus
```
By default, this configuration will instantiate an additional HTTP server running alongside the standard GoToSocial HTTP server, which exposes a Prometheus metrics endpoint at `localhost:9464/metrics`.
!!! tip
If you are running GoToSocial using the [example systemd service definition](../../example/gotosocial.service), you can easily set these environment variables by uncommenting the relevant two lines in that file, and reloading + restarting the service.
If you wish, you can further customize this metrics HTTP server by using the following environment variables to change the host and port:
```env
OTEL_EXPORTER_PROMETHEUS_HOST=example.org
OTEL_EXPORTER_PROMETHEUS_PORT=9999
```
## Serving metrics to the outside world
If you have deployed GoToSocial in a "bare-metal" fashion without a reverse proxy, you can expose the metrics endpoint to the outside world by setting `OTEL_EXPORTER_PROMETHEUS_HOST` to your host value. For example, if your GtS instance `host` configuration value is set to `example.org`, you should set `OTEL_EXPORTER_PROMETHEUS_HOST=example.org`. You should then be able to access your metrics at `http://example.org:9464/metrics`. GoToSocial running in this fashion will not serve LetsEncrypt certificates at the metrics endpoint, so you will be limited to using HTTP rather than HTTPS.
If you are using a reverse proxy like Nginx, you can expose the metrics endpoint to the outside world with HTTPS certificates, by putting an additional location stanza in your Nginx configuration above the catch-all `location /` stanza:
```nginx
location /metrics {
proxy_pass http://127.0.0.1:9464;
}
```
This will instruct Nginx to forward requests to `example.org/metrics` to the separate Prometheus server running on port 9464.
## Enabling basic authentication ## Enabling basic authentication
You can enable basic authentication for the metrics endpoint. On the GoToSocial, side you'll need the following configuration: Although there is no sensitive data contained in the OTEL runtime statistics exported by Prometheus, you may nevertheless wish to gate access to the `/metrics` endpoint behind some kind of authentication, to prevent every Tom, Dick, and Harry from looking at your runtime stats.
```yaml You can do this by configuring your reverse proxy to require basic authentication for access to `/metrics`.
metrics-auth-enabled: true
metrics-auth-username: some_username In Nginx, for example, you could do this by creating an `htpasswd` file alongside your site in the `sites-available` directory of Nginx, and instructing Nginx to use that file to gate access.
metrics-auth-password: some_password
Assuming you followed the [guide for setting up Nginx as your reverse proxy](../getting_started/reverse_proxy/nginx.md), you will already have a file for your Nginx service definition at `/etc/nginx/sites-available/example.org`, where `example.org` is the hostname of your instance.
You can create an `htpasswd` file alongside this file using the following command:
```bash
htpasswd -c /etc/nginx/sites-available/example.org.htpasswd username
``` ```
You can scrape that endpoint with a Prometheus instance using the following configuration in your `scrape_configs`: In the command, be sure to replace `example.org` with your hostname, and `username` with whatever username you want to use.
Now, edit `/etc/nginx/sites-available/example.org` and update your `/metrics` stanza to use the `httpasswd` file. After editing it should look something like this:
```nginx
location /metrics {
proxy_pass http://127.0.0.1:9464;
auth_basic "Metrics";
auth_basic_user_file /etc/nginx/sites-available/example.org.htpasswd;
}
```
Again, replace `example.org` in that snippet with your instance hostname.
When you're finished editing, reload + restart Nginx, and you should see a basic authentication prompt when visiting the `/metrics` endpoint of your instance in your browser.
## Prometheus scrape configuration
You can scrape your `/metrics` endpoint with a Prometheus instance using the following configuration in your `scrape_configs`:
```yaml ```yaml
- job_name: gotosocial - job_name: gotosocial
@ -40,18 +97,12 @@ You can scrape that endpoint with a Prometheus instance using the following conf
- example.org - example.org
``` ```
## Blocking external scraping Change `example.org` to your hostname in the above snippet. If you are not using HTTPS, change the `scheme` value to `http`. If you are not using basic authentication, you can remove the `basic_auth` section. If you are not using a reverse proxy, and metrics are exposed on port 9464, add the port to the host (eg., `example.org` -> `example.org:9464`).
When running with a reverse proxy you can use it to block external access to metrics. You can use this approach if your Prometheus scraper runs on the same machine as your GoToSocial instance and can thus access it internally. ## Viewing metrics on Grafana
For example with nginx, block the `/metrics` endpoint by returning a 404: Instructions on how to set up Grafana are beyond the scope of this document. However, once you have set up a Grafana to pull from your Prometheus instance, you can import the [example Grafana dashboard](https://codeberg.org/superseriousbusiness/gotosocial/raw/branch/main/example/metrics/gotosocial_grafana_dashboard.json) into your Grafana frontend to easily view GoToSocial Go runtime and HTTP metrics.
```nginx
location /metrics {
return 404;
}
```
[otel]: https://opentelemetry.io/ [otel]: https://opentelemetry.io/
[prom]: https://prometheus.io/docs/instrumenting/exposition_formats/ [prom]: https://prometheus.io/docs/instrumenting/exposition_formats/
[obs]: ../configuration/observability.md [obs]: ../configuration/observability_and_metrics.md

View file

@ -0,0 +1,104 @@
# Replicating SQLite
Next to your regular [backup methods](../admin/backup_and_restore.md), you might want to set up replication for disaster recovery to another path or external host.
For this to work properly, SQLite needs the journal mode to be configured in `WAL` mode, with synchronous mode set to `NORMAL`. This is the default configuration for GoToSocial.
You can check your settings in the configuration file. The journal mode is set in `db-sqlite-journal-mode` and the synchronous mode in `db-sqlite-synchronous`.
## Litestream on Linux
A relatively light, and fast way to set up replication with SQLite is by using [Litestream](https://litestream.io). It can be configured very easily and supports different backends like file based replication, S3 compatible storage and many other setups.
You can then install the prebuilt package by either the deb file on Linux, or building it from source on other distributions.
Using a .deb package on Linux:
Navigate to the [releases page](https://github.com/benbjohnson/litestream/releases/latest), and download the latest release (make sure to select the appropiate platform for the wget command below).
```bash
wget https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb
sudo dpkg -i litestream-*.deb
```
## Configuring Litestream
Configuration is done by editing the configuration file. It's located in /etc/litestream.yml.
### Configuring file based replication
```yaml
dbs:
- path: /gotosocial/sqlite.db
- path: /backup/sqlite.db
```
### Configuring S3 based replication
Set up a bucket for replication, and make sure to set it to be private.
Make sure to replace the example `access-key-id` and `secret-access-key` with the proper values from your dashboard.
```yaml
access-key-id: AKIAJSIE27KKMHXI3BJQ
secret-access-key: 5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39
dbs:
- path: /gotosocial/sqlite.db
- url: s3://my.bucket.com/db
```
When using a S3 compatible storage provider you will need to set an endpoint.
For example for minio this can be done with the following configuration.
```yaml
access-key-id: miniouser
secret-access-key: miniopassword
dbs:
- path: /gotosocial/sqlite.db
- type: s3
bucket: mybucket
path: sqlite.db
endpoint: minio:9000
```
## Enabling replication
You can enable replication on Linux by enabling the Litestream service.
```bash
sudo systemctl enable litestream
sudo systemctl start litestream
```
Check if it's running properly using `sudo journalctl -u litestream -f`.
If you need to change the configuration file, restart Litestream:
```bash
sudo systemctl restart litestream
```
### Recovering from the configured backend
You can pull down a recovery file from the stored backend with the following simple command.
```bash
sudo litestream restore
```
If you have configured multiple files to be backupped, or have multiple replicas, specify what you want to do.
For filebased replication:
```bash
sudo litestream restore -o /gotosocial/sqlite.db /backup/sqlite.db
```
For s3 based replication:
```bash
sudo litestream restore -o /gotosocial/sqlite.db s3://bucketname/db
```

View file

@ -18,13 +18,13 @@ Different distributions have different sandboxing mechanisms they prefer and sup
We ship an example AppArmor policy for GoToSocial, which you can retrieve and install as follows: We ship an example AppArmor policy for GoToSocial, which you can retrieve and install as follows:
```sh ```sh
$ curl -LO 'https://github.com/superseriousbusiness/gotosocial/raw/main/example/apparmor/gotosocial' $ curl -LO 'https://codeberg.org/superseriousbusiness/gotosocial/raw/main/example/apparmor/gotosocial'
$ sudo install -o root -g root gotosocial /etc/apparmor.d/gotosocial $ sudo install -o root -g root gotosocial /etc/apparmor.d/gotosocial
$ sudo apparmor_parser -Kr /etc/apparmor.d/gotosocial $ sudo apparmor_parser -Kr /etc/apparmor.d/gotosocial
``` ```
!!! tip !!! tip
If you're using SQLite, the AppArmor profile expects the database in `/gotosocial/db/` so you'll need to adjust your configuration paths or the policy accordingly. The provided AppArmor example is just intended to get you started. It will still need to be edited depending on your exact setup; consult the comments in the example profile file for more information.
With the policy installed, you'll need to configure your system to use it to constrain the permissions GoToSocial has. With the policy installed, you'll need to configure your system to use it to constrain the permissions GoToSocial has.

View file

@ -0,0 +1,35 @@
# SQLite on networked storage
SQLite's operating model assumes the database and the processes or applications using it are colocated on the same host. When running the database in WAL-mode, which is GoToSocial's default, it relies on shared memory between processes to ensure the integrity of your database.
!!! quote
All processes using a database must be on the same host computer; WAL does not work over a network filesystem. This is because WAL requires all processes to share a small amount of memory and processes on separate host machines obviously cannot share memory with each other.
— SQLite.org [Write-Ahead Logging](https://www.sqlite.org/wal.html)
This also means that any other processes accessing the database need to run in the same namespace or container context.
It is in theory possible to run SQLite over Samba, NFS, iSCSI or other forms of filesystems accessed over the network. But it is neither recommended nor supported by the SQLite maintainers, irrespective of whether you're running with write-ahead logging or not. Doing so puts you at risk of database corruption. There is a long history of networked storage having synchronisation issues in their locking primitives, or implementing them with weaker guarantees than what a local filesystem can provide.
Your cloud provider's external volumes, like Hetzner Cloud Volumes, AWS EBS, GCP Persistent Disk etc. may also cause problems, and add variable latency. This has a tendency to severely degrade SQLite's performance.
If you're going to access your database over the network, it's better to use a database with a client-server architecture. GoToSocial supports Postgres for such use-cases.
For the purpose of having a copy of the SQLite database on durable long-term storage, refer to [SQLite streaming replication](replicating-sqlite.md) instead. Remember that neither replication nor using a networked filesystem are a substitute [for having backups](../admin/backup_and_restore.md).
## Settings
!!! danger "Corrupted database"
We do not support running GoToSocial with SQLite on a networked filesystem and we will not be able to help you if you damage your database this way.
Should you really want to take this risk, you'll need to adjust the SQLite [synchronous][sqlite-sync] mode and [journal][sqlite-journal] mode to match the limitations of the filesystem.
[sqlite-sync]: https://www.sqlite.org/pragma.html#pragma_synchronous
[sqlite-journal]: https://www.sqlite.org/pragma.html#pragma_journal_mode
You'll need to update the following settings:
* `db-sqlite-journal-mode`
* `db-sqlite-synchronous`
We don't provide any recommendations as this will vary based on the solution you're using. See [this issue](https://codeberg.org/superseriousbusiness/gotosocial/issues/3360#issuecomment-2380332027) for what you could potentially set those values to.

View file

@ -1,25 +1,20 @@
# Tracing # Tracing
GoToSocial comes with [OpenTelemetry][otel] based tracing built-in. It's not wired through every function, but our HTTP handlers and database library will create spans. How to configure tracing is explained in the [Observability configuration reference][obs]. GoToSocial comes with [OpenTelemetry][otel] based tracing built-in. It's not wired through every function, but our HTTP handlers and database library will create spans that may help you debug issues.
## Enabling tracing
To enable tracing on your instance, you must set `tracing-enabled` to `true` in your config.yaml file. Then, you must set the environment variable `OTEL_TRACES_EXPORTER` to your desired tracing format. A list of available options is available [here](https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_traces_exporter). Once you have changed your config and set the environment variable, restart your instance.
If necessary, you can do further configuration of tracing using the other environment variables listed [here](https://opentelemetry.io/docs/languages/sdk-configuration/general/).
## Ingesting traces
In order to receive the traces, you need something to ingest them and then visualise them. There are many options available including self-hosted and commercial options. In order to receive the traces, you need something to ingest them and then visualise them. There are many options available including self-hosted and commercial options.
We provide an example of how to do this using [Grafana Tempo][tempo] to ingest the spans and [Grafana][grafana] to explore them. Please beware that the configuration we provide is not suitable for a production setup. It can be used safely for local development and can provide a good starting point for setting up your own tracing infrastructure. In [`example/tracing`][ext] we provide an example of how to do this using [Grafana Tempo][tempo] to ingest the spans and [Grafana][grafana] to explore them. You can use the files with `docker-compose up -d` to get Tempo and Grafana running.
You'll need the files in [`example/tracing`][ext]. Once you have those you can run `docker-compose up -d` to get Tempo and Grafana running. With both services running, you can add the following to your GoToSocial configuration and restart your instance: Please be aware that while the example configuration we provide can be used safely for local development and can provide a good starting point for setting up your own tracing infrastructure, it is not suitable for a so-called "production" setup.
```yaml
tracing-enabled: true
tracing-transport: "grpc"
tracing-endpoint: "localhost:4317"
tracing-insecure-transport: true
```
[otel]: https://opentelemetry.io/
[obs]: ../configuration/observability.md
[tempo]: https://grafana.com/oss/tempo/
[grafana]: https://grafana.com/oss/grafana/
[ext]: https://github.com/superseriousbusiness/gotosocial/tree/main/example/tracing
## Querying and visualising traces ## Querying and visualising traces
@ -27,18 +22,23 @@ Once you execute a few queries against your instance, you'll be able to find the
Using TraceQL, a simple query to find all traces related to requests to `/api/v1/instance` would look like this: Using TraceQL, a simple query to find all traces related to requests to `/api/v1/instance` would look like this:
``` ```traceql
{.http.route = "/api/v1/instance"} {.http.route = "/api/v1/instance"}
``` ```
If you wanted to see all GoToSocial traces, you could instead run: If you wanted to see all GoToSocial traces, you could instead run:
``` ```traceql
{.service.name = "GoToSocial"} {.service.name = "GoToSocial"}
``` ```
Once you select a trace, a second panel will open up visualising the span. You can drill down from there, by clicking into every sub-span to see what it was doing. Once you select a trace, a second panel will open up visualising the span. You can drill down from there, by clicking into every sub-span to see what it was doing.
![Grafana showing a trace for the /api/v1/instance endpoint](../assets/tracing.png) ![Grafana showing a trace for the /api/v1/instance endpoint](../overrides/public/tracing.png)
[traceql]: https://grafana.com/docs/tempo/latest/traceql/ [traceql]: https://grafana.com/docs/tempo/latest/traceql/
[otel]: https://opentelemetry.io/
[obs]: ../configuration/observability_and_metrics.md
[tempo]: https://grafana.com/oss/tempo/
[grafana]: https://grafana.com/oss/grafana/
[ext]: https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/example/tracing

View file

@ -1,60 +1,69 @@
# Authentication with the API # Authentication with the API
Using the client API requires authentication. This page documents the general flow for retrieving an authentication token with examples for doing this on the CLI Using the client API requires authentication. This page documents the general flow for retrieving an authentication token with examples for doing this on the CLI using `curl`.
!!! tip
If you want to get an API access token via the settings panel instead, without having to use the command line, see the [Application documentation](https://docs.gotosocial.org/en/latest/user_guide/settings/#applications).
## Create a new application ## Create a new application
We need to register a new application, which we can then use to request an OAuth token. This is done by making a `POST` request to the `/api/v1/apps` endpoint. Replace `your_app_name` in the code below: We need to register a new application, which we can then use to request an OAuth token. This is done by making a `POST` request to the `/api/v1/apps` endpoint. Replace `your_app_name` in the command below with the name you want to use for your application:
```bash ```bash
curl -X POST 'https://your.instance.url/api/v1/apps' \ curl \
-H 'Content-Type:application/json' \ -H 'Content-Type:application/json' \
-d '{ -d '{
"client_name": "your_app_name", "client_name": "your_app_name",
"redirect_uris": "urn:ietf:wg:oauth:2.0:oob", "redirect_uris": "urn:ietf:wg:oauth:2.0:oob",
"scopes": "read" "scopes": "read"
}' }' \
'https://example.org/api/v1/apps'
``` ```
The string "urn:ietf:wg:oauth:2.0:oob" is an indication of what is known as out-of-band authentication - a technique used in multi-factor authentication to reduce the number of ways that a bad actor can intrude on the authentication process. In this instance, it allows us to view and manually copy the tokens created to use further in this process. The string `urn:ietf:wg:oauth:2.0:oob` is an indication of what is known as out-of-band authentication - a technique used in multi-factor authentication to reduce the number of ways that a bad actor can intrude on the authentication process. In this instance, it allows us to view and manually copy the tokens created to use further in this process.
Note that `scopes` can be any space-separated combination of: !!! tip "Scopes"
It is always good practice to grant your application the lowest tier permissions it needs to do its job. e.g. If your application won't be making posts, use `scope=read` or even a subscope of that.
- read
- write In this spirit, "read" is used in the example above, which means that the application will be restricted to only being able to do "read" actions.
- admin
For a list of available scopes, see [the swagger docs](https://docs.gotosocial.org/en/latest/api/swagger/).
!!! warning !!! warning
GoToSocial does not currently support scoped authorization tokens, so any token you obtain in this process will be able to perform all actions on your behalf, including admin actions if your account has admin permissions. Nevertheless, it is always good practice to grant your application the lowest tier permissions it needs to do its job. e.g. If your application won't be making posts, use scope=read. GoToSocial did not support scoped authorization tokens before version 0.19.0, so if you are using a version of GoToSocial below that, then any token you obtain in this process will be able to perform all actions on your behalf, including admin actions if your account has admin permissions.
In this spirit, "read" is used in the example above, which means that in the future when scoped tokens are supported, the application will be restricted to only being able to do "read" actions. A successful call returns a response with a `client_id` and `client_secret`, which we are going need to use in the rest of the process. It looks something like this:
You can read more about additional planned OAuth security features [right here](https://github.com/superseriousbusiness/gotosocial/issues/2232).
A successful call returns a response with a `client_id` and `client_secret` that we are going need to use in the rest of the process. It looks something like this:
```json ```json
{ {
"id": "randomised_id", "id": "01J1CYJ4QRNFZD6WHQMZV7248G",
"name": "your_app_name", "name": "your_app_name",
"redirect_uri": "urn:ietf:wg:oauth:2.0:oob", "redirect_uri": "urn:ietf:wg:oauth:2.0:oob",
"client_id": "your_new_client_id", "client_id": "YOUR_CLIENT_ID",
"client_secret": "your_new_client_secret" "client_secret": "YOUR_CLIENT_SECRET"
} }
``` ```
!!! tip !!! tip
Ensure you save the `client_id` and `client_secret` somewhere so you can refer to it as we go. Ensure you save the `client_id` and `client_secret` values somewhere so you can refer to them as we go.
## Authorizing your application ## Authorize your application to act on your behalf
We've registered a new application with GoToSocial, but it isn't connected to your account just yet. Now we need to tell GoToSocial that that new application is actually going to act on your behalf. To do this, we need to authenticate with your instance via a browser to initiate the login and permission granting process. We've registered a new application with GoToSocial, but it isn't connected to your account just yet. Now we need to tell GoToSocial that that new application is actually going to act on your behalf. To do this, we need to authenticate with your instance via a browser to initiate the login and permission-granting process.
Using the `client_id` from the previous step, create a URL with a query string like so: Create a URL with a query string like so, replacing `YOUR_CLIENT_ID` with the `client_id` you received in the previous step, and paste the URL into your browser:
```
https://your.instance.url/oauth/authorize?client_id=your_new_client_id-id&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code ```text
https://example.org/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=read
``` ```
You'll get a login form to your instance and be prompted to login if you aren't already logged in. Once logged in, you will get a screen that says something like this: !!! tip
If you used different scopes to register your application, then replace `scope=read` in the URL above with a plus-separated list of the scopes you registered with. For example, if you registered your application with a `scopes` value of `read write` then you should change `scope=read` in the above URL to `scope=read+write`.
After pasting the URL into your browser, you'll be directed to a login form for your instance which prompts you to enter your email address and password in order to connect the application to your account.
Once you've submitted your credentials, you will arrive on a page that says something like this:
``` ```
Hi `your_username`! Hi `your_username`!
@ -62,56 +71,74 @@ Application `your_app_name` would like to perform actions on your behalf, with s
The application will redirect to urn:ietf:wg:oauth:2.0:oob to continue. The application will redirect to urn:ietf:wg:oauth:2.0:oob to continue.
``` ```
Once you click `Allow`, you will get a window that looks something like this: Click `Allow`, and you will get a page that looks something like this:
``` ```text
Here's your out-of-band token with scope "read", use it wisely: Here's your out-of-band token with scope "read", use it wisely:
WBANQAXXHDN9KJQZXGWNQANA4V9EJWMUDHVCUUM3JHYAB3DP YOUR_AUTHORIZATION_TOKEN
``` ```
Copy the out-of-band authorization token somewhere, as you'll need it in the next step.
## Get an access token
The next step is to exchange the out-of-band authorization token you just received with a reusable access token that can be sent along with all further API requests.
You can do this with another `POST` request that looks like the following:
## Getting your token
The next step is to send a `POST` request to the oauth/token endpoint to get an access token that you will use to authenticate your future requests.
```bash ```bash
curl -X POST 'https://your.instance.url/oauth/token' \ curl \
-H 'Content-Type:application/json' -H 'Content-Type: application/json' \
-d '{ -d '{
"redirect_uri": "urn:ietf:wg:oauth:2.0:oob", "redirect_uri": "urn:ietf:wg:oauth:2.0:oob",
"client_id": "your_new_client_id", "client_id": "YOUR_CLIENT_ID",
"client_secret": "your_new_client_secret", "client_secret": "YOUR_CLIENT_SECRET",
"grant_type": "authorization_code", "grant_type": "authorization_code",
"code": "WBANQAXXHDN9KJQZXGWNQANA4V9EJWMUDHVCUUM3JHYAB3DP" "code": "YOUR_AUTHORIZATION_TOKEN"
}' }' \
'https://example.org/oauth/token'
``` ```
!!! warning
Please note that the characters used above are just a random selection of characters and cannot be used. Make sure to replace:
Make sure you replace it with the code *you* get from your instance.
- `YOUR_CLIENT_ID` with the client ID received in the first step.
- `YOUR_CLIENT_SECRET` with the client secret received in the first step.
- `YOUR_AUTHORIZATION_TOKEN` with the out-of-band authorization token received in the second step.
You'll get a response that includes your access token and looks something like this: You'll get a response that includes your access token and looks something like this:
```json ```json
{ {
"access_token": "your_brand_new_access_token", "access_token": "YOUR_ACCESS_TOKEN",
"created_at": unixtimestamp, "created_at": 1719577950,
"scope": "read", "scope": "read",
"token_type": "Bearer" "token_type": "Bearer"
} }
``` ```
## Verifying it all
To make sure everything went through successfully, query the `/api/v1/verify_credentials` endpoint, adding your new access token to the Header as `Authorization: Bearer your_brand_new_token`. Copy and save your access token somewhere safe.
## Verifying
To make sure everything worked, try querying the `/api/v1/verify_credentials` endpoint, adding your access token to the request header as `Authorization: Bearer YOUR_ACCESS_TOKEN`.
See this example: See this example:
```bash ```bash
curl -X GET 'https://your.instance.url/api/v1/accounts/verify_credentials' \ curl \
-H 'Content-Type:application/json' -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Authorization:Bearer your_brand_new_token' 'https://example.org/api/v1/accounts/verify_credentials'
``` ```
If all goes well, you should get your user profile as a response response. If all goes well, you should get your user profile as a JSON response.
## Final notes ## Final notes
Thereafter, whenever you make an api call, say to query your notifications, add a Header to your request `Authorization:Bearer your_brand_new_token` like this:
```bash
curl --request GET \
--url https://your.instance.url/api/v1/notifications \
--header 'Authorization: Bearer your_brand_new_token' \
```
Now that you have an access token, you can reuse that token in every API request for authorization. You do not need to do the entire token exchange dance every time!
For example, you can issue another `GET` request to the API using the same access token to get your notifications, as follows:
```bash
curl \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
'https://example.org/api/v1/notifications'
```

View file

@ -24,11 +24,11 @@ In case the rate limit is exceeded, an [HTTP 429 Too Many Requests](https://deve
### My rate limit keeps being exceeded! Why? ### My rate limit keeps being exceeded! Why?
If you find that your rate limit is regularly being exceeded (both for yourself and other callers) during normal use of your instance, it may be that GoToSocial can't tell the clients apart by IP address. You can investigate this by viewing the logs of your instance. If (almost) all logged IP addresses appear to be the same IP address (something like `172.x.x.x`), then the rate limiting will cause problems. If you find that your rate limit is regularly being exceeded (both for yourself and other callers) during normal use of your instance, it may be that GoToSocial can't tell the clients apart by IP address. You can investigate this by viewing the logs of your instance. If (almost) all logged client IP addresses appear to be the same IP address (something like `172.x.x.x`), then the rate limiting will cause problems.
This happens when your server is running inside NAT (port forwarding), or behind an HTTP proxy without the correct configuration, causing your instance to see all incoming IP addresses as the same address: namely, the IP address of your reverse proxy or gateway. This means that all incoming requests are *sharing the same rate limit*, rather than being split correctly per IP. This happens when your server is running inside NAT (port forwarding), or behind an HTTP proxy without the correct configuration, causing your instance to see all incoming IP addresses as the same address: namely, the IP address of your reverse proxy or gateway. This means that all incoming requests are *sharing the same rate limit*, rather than being split correctly per IP.
If you are using an HTTP proxy then it's likely that your `trusted-proxies` is not correctly configured. If this is the case, try adding the IP address of your reverse proxy to the list of `trusted-proxies`, and restarting your instance. If you are using an HTTP proxy then it's likely that your `trusted-proxies` is not correctly configured. See the [trusted-proxies](../configuration/trusted_proxies.md) documentation for more info on how to resolve this.
If you don't have an HTTP proxy, then it's likely caused by NAT. In this case you should disable rate limiting altogether. If you don't have an HTTP proxy, then it's likely caused by NAT. In this case you should disable rate limiting altogether.

View file

@ -14,8 +14,8 @@ Most of the GoToSocial API endpoints require a user-level OAuth token. For a gui
See the following issues for more context: See the following issues for more context:
- [#1958](https://github.com/superseriousbusiness/gotosocial/issues/1958) - [#1958](https://codeberg.org/superseriousbusiness/gotosocial/issues/1958)
- [#1944](https://github.com/superseriousbusiness/gotosocial/issues/1944) - [#1944](https://codeberg.org/superseriousbusiness/gotosocial/issues/1944)
- [#2641](https://github.com/superseriousbusiness/gotosocial/issues/2641) - [#2641](https://codeberg.org/superseriousbusiness/gotosocial/issues/2641)
<swagger-ui src="swagger.yaml"/> <swagger-ui src="swagger.yaml"/>

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

View file

@ -9,21 +9,39 @@
# Config pertaining to creation and maintenance of accounts on the server, as well as defaults for new accounts. # Config pertaining to creation and maintenance of accounts on the server, as well as defaults for new accounts.
# Bool. Do we want people to be able to just submit sign up requests, or do we want invite only? # Bool. Allow people to submit new sign-up / registration requests via the form at /signup.
#
# Options: [true, false] # Options: [true, false]
# Default: true # Default: false
accounts-registration-open: true accounts-registration-open: false
# Bool. Do sign up requests require approval from an admin/moderator before an account can sign in/use the server?
# Options: [true, false]
# Default: true
accounts-approval-required: true
# Bool. Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)? # Bool. Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?
# Options: [true, false] # Options: [true, false]
# Default: true # Default: true
accounts-reason-required: true accounts-reason-required: true
# Int. Number of approved sign-ups allowed within
# 24hrs before new account registration is closed.
#
# Leaving this count at the default essentially limits
# your instance to growing by 10 accounts per day.
#
# Setting this number to 0 or less removes the limit.
#
# Default: 10
accounts-registration-daily-limit: 10
# Int. Number of new account sign-ups allowed in the pending
# approval queue before new account registration is closed.
#
# This can be used to essentially "throttle" the sign-up
# queue to prevent instance admins becoming overwhelmed.
#
# Setting this number to 0 or less removes the limit.
#
# Default: 20
accounts-registration-backlog-limit: 20
# Bool. Allow accounts on this instance to set custom CSS for their profile pages and statuses. # Bool. Allow accounts on this instance to set custom CSS for their profile pages and statuses.
# Enabling this setting will allow accounts to upload custom CSS via the /user settings page, # Enabling this setting will allow accounts to upload custom CSS via the /user settings page,
# which will then be rendered on the web view of the account's profile and statuses. # which will then be rendered on the web view of the account's profile and statuses.
@ -46,4 +64,12 @@ accounts-allow-custom-css: false
# Examples: [500, 5000, 9999] # Examples: [500, 5000, 9999]
# Default: 10000 # Default: 10000
accounts-custom-css-length: 10000 accounts-custom-css-length: 10000
# Int. The maximum number of profile fields allowed for each account.
#
# Note that going way higher than the default might break federation.
#
# Examples: [4, 6, 12]
# Default: 6
accounts-max-profile-fields: 6
``` ```

Some files were not shown because too many files have changed in this diff Show more