~bigbes/core-go

ref: 038ec76d56ff8991c69c807b8a5d8f68933c5bba core-go/server d---------
server/email: print correct var on type assertion failure
e4b0261f — Drew DeVault 1 year, 6 months ago
Export webhooks public key via api-meta.json
0ad8eb8e — Drew DeVault 1 year, 7 months ago
server: add @admin directive implementation

This will be used at least by meta.sr.ht in the near future.
17315205 — Robin Jarry 1 year, 8 months ago
config: factorize integer parsing

Add a new GetInt() function to parse an integer value from a parsed
ini.File. Use that function instead of duplicated code.

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>
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
9833a827 — Drew DeVault 1 year, 9 months ago
server: add AnonRouter function

To expose anonymous (unauthenticated) routing to downstream core-go
users.
8f9aa9d5 — Drew DeVault 1 year, 9 months ago
server: fix playground on config.Debug

A recent change made it so that the playground required authentication
to access in debug mode; this moves it under the other auth-free
endpoints.
0d6031be — Conrad Hoffmann 1 year, 11 months ago
server: use routing groups

Instead of hardcoding some exceptions in the auth middleware, use a
different routing group for routes that do not require auth. Makes the
auth middleware more generic and also removes a lot of unneccessary
middleware processing from routes that don't need it.

For now, the added group is not accessible from outside the module, but
if the need arises, this might be an option.
453dcaef — Simon Ser 2 years ago
server/directives: disambiguate AnonInternal error message

AUTH_INTERNAL won't work with AnonInternal.
d2ad494f — Simon Ser 2 years ago
Migrate to chi v5

v1 is not maintained anymore.
86ad9b5a — Conrad Hoffmann 2 years ago
server/email: use go-message for address parsing

No need to additionally depend on net/mail
65b1657b — Simon Ser 3 years ago
auth: add AuthContext.Access

Same logic as server.Access, but lower-level. Useful to check for
a permission not covered by the GraphQL schema @access directives
(such as builds.sr.ht secrets).
a941162e — Simon Ser 3 years ago
server/email: don't panic in EmailRecover

A panic in here is not great, because this function is supposed to
be the panic handler. Let's just log the error instead.
1fd2476d — Simon Ser 3 years ago
server/email: log missing mail::error-to, treat empty string as unset

Log a message when mail::error-to is unset, just in case the admin
forgot to set it. Don't try to parse an email address if error-to
is set to the empty string (the default value in the default config
file).
2f239415 — Simon Ser 3 years ago
server/email: simplify and cleanup

- Only print the error once
- Remove unnecessary var
- Use debug.Stack instead of hand-rolled logic
- Ignore json.Marshal errors in a simpler way
30cea5cc — Simon Ser 3 years ago
server: fix error message on missing grant in Access

The error returned when a token is missing a required grant would
be "Access denied for invalid auth method" which is confusing.
Fix this with a more accurate error message.
ca47b9fe — Simon Ser 3 years ago
server/directives: handle auth.AUTH_ANON_INTERNAL in Access
144fc447 — Drew DeVault 3 years ago
server: register SQL collector

Missed this step
fa27910a — Drew DeVault 3 years ago
Add prometheus SQL connection stats

Also updates the prometheus client_go library
Next