~bigbes/core-go

ref: 038a9eb03a3043e4ee418a8b24a8769c37c82006 core-go/go.mod -rw-r--r-- 3.0 KiB
565df04e — Drew DeVault 10 months ago
model: introduce ID type

Based on UUIDv7 but represented to users in a more compact base32 form,
though all of that are internal implementation details.
42a4b67b — Drew DeVault 1 year, 18 days ago
Switch from minio to AWS SDK S3 client

Moves s3 => objects to avoid conflicting with the AWS module.
a8516055 — Conrad Hoffmann 1 year, 26 days ago
server: handle CORS in server

Currently CORS is handled in nginx in front of the API. That setup is
not very suitable for Kubernetes. Instead, handle CORS here, so we do
not need any intermediaries between the ingress and the APIs.

The CORS settings are taken from sr.ht-nginx/graphql.conf [1]

[1] https://git.sr.ht/~sircmpwn/sr.ht-nginx/tree/master/item/graphql.conf
e36951da — Conrad Hoffmann 1 year, 1 month ago
Update ProtonMail/go-crypto to v1.3.0
f0b0e702 — Conrad Hoffmann 1 year, 2 months ago
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
aa1834b6 — Robin Jarry 1 year, 7 months ago
email: fix mime version header position

Prevent the MIME-Version header from being inserted on the first part.

Link: https://github.com/emersion/go-pgpmail/pull/15
Signed-off-by: Robin Jarry <robin@jarry.cc>
78a07dca — Robin Jarry 1 year, 7 months ago
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>
eeb0384a — Robin Jarry 1 year, 8 months ago
mod: use latest version for dowork

The latest version contains fixes against potential races.

Link: https://git.sr.ht/~sircmpwn/dowork/commit/d4703ef2dbb3
Link: https://git.sr.ht/~sircmpwn/dowork/commit/2b00aa42322c
Signed-off-by: Robin Jarry <robin@jarry.cc>
7457c44b — Robin Jarry 1 year, 8 months ago
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>
9e4ef2d2 — Conrad Hoffmann 1 year, 9 months ago
Upgrade Go, `go mod tidy`, build on Alpine 3.20
e1b63989 — Conrad Hoffmann 1 year, 9 months ago
redis: use UniveralClient, support sentinel mode

This commit switches the redis client to using a UniversalClient [1],
which can operate in standard, cluster, or failover (sentinel) mode.

It also implements basic support for having (multiple)
`redis+sentinel://` URLs as connection URL in the config (e.g. for
`redis-host`).

This is the Go equivalent of the proposed Python patch [2]. It supports
the same examples given there.

[1] https://pkg.go.dev/github.com/go-redis/redis/v8#UniversalClient
[2] https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/55521
069c77be — Drew DeVault 2 years ago
email: update StartTLS usage per go-smtp changes
53966da2 — Simon Ser 2 years ago
Drop gqlparser v1 dependency

Only use v2 throughout the repository.
d2ad494f — Simon Ser 2 years ago
Migrate to chi v5

v1 is not maintained anymore.
cfae7bae — Simon Ser 3 years ago
Upgrade dependencies
156c5e26 — Adnan Maolood 3 years ago
s3: Import middleware from pages.sr.ht

Closes: https://todo.sr.ht/~sircmpwn/pages.sr.ht/19
1f6fac1d — Simon Ser 3 years ago
go mod tidy

Fixes the following error when running `go test`:

    ../../go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/internal/metric.go:19:2: missing go.sum entry for module providing package github.com/prometheus/client_model/go (imported by github.com/prometheus/client_golang/prometheus); to add:
    	go get github.com/prometheus/client_golang/prometheus@v1.14.0
fa27910a — Drew DeVault 3 years ago
Add prometheus SQL connection stats

Also updates the prometheus client_go library
b1540a22 — Conrad Hoffmann 3 years ago
Update pq (Postgres driver) to latest version
dd20891a — Julien Moutinho 4 years ago
Replace x/crypto package by ProtonMail/go-crypto to support ed25519 OpenPGP keys
Next