Update ProtonMail/go-crypto to v1.3.0
Add sourcehut-migrate, a unified DB migration tool
This tool will replace both the old `srht-migrate` as well as all
`<SERVICE>-migrate` tools, but services need to be migrated over to it
one by one. This tool is based on brant [1].
Invocation in both production and development can be as simple as:
sourcehut-migrate <SERVICE> up
The tool will read a config like a regular service (first in ., then
/etc/sr.ht, etc.). The database connection details are taken from the
config. To facilitate development, the tool will check if a folder
./migrations exists; if it does, migrations will be loaded from there.
If no ./migrations folder was found, it will look for migrations in
`<ASSETS>/migrations/<SERVICE>`, where <ASSETS> is also taken from the
config, with a default of `/usr/share/sourcehut`.
For an explanation of the available commands, see brant [1].
This tool also supports a simple command to initialize a newly created
database to the current version (much like the `<SERVICE>-initdb` tools
used to):
sourcehut-migrate <SERVICE> stamp head
will automatically set the database version to whatever the latest
available migration version is.
[1]: https://git.sr.ht/~bitfehler/brant
email: fix malformed emails
go-message 0.18.2 contains a new implementation of the message line
wrapping algorithm. Without it, messages sometimes contain random line
breaks in the middle of the body.
Update to the latest tag.
Signed-off-by: Robin Jarry <robin@jarry.cc>
treewide: update to new multi worker dowork api
The work.Queue() implementation has changed and now allows scheduling
tasks from multiple goroutines in parallel. Also, it requires a new
argument for limiting the queue buffer size in order to apply back
pressure.
Define new configuration variables to allow tuning the queue sizes and
number of workers per service:
[mail]
# Maximum size of the outgoing email queue (default 512).
egress-queue-size = 512
[$service_name]
# Number of parallel workers per queue (default 1).
# There are multiple queues (for egress email, webhooks, etc.).
# This setting is applied on a per-queue basis.
queue-workers = 1
[webhooks]
# Maximum size of the webhooks queue (default 512).
queue-size = 512
Use these new settings to configure the queues and workers accordingly.
Fix unit tests as well.
Link: https://git.sr.ht/~sircmpwn/dowork/commit/95719cfc0118
Signed-off-by: Robin Jarry <robin@jarry.cc>
Upgrade Go, `go mod tidy`, build on Alpine 3.20
email: update StartTLS usage per go-smtp changes
Drop gqlparser v1 dependency
Only use v2 throughout the repository.
Migrate to chi v5
v1 is not maintained anymore.
Add prometheus SQL connection stats
Also updates the prometheus client_go library
Update pq (Postgres driver) to latest version
Replace x/crypto package by ProtonMail/go-crypto to support ed25519 OpenPGP keys
Add support for mail setups that don't support TLS or Auth
auth: fix /query/api-meta.json route
This route does not need authentication.