~bigbes/core-go

ref: 46a4ad6a4ded21294e5561d8094833674a21ec7d core-go/server/server.go -rw-r--r-- 8.3 KiB
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.
d2ad494f — Simon Ser 2 years ago
Migrate to chi v5

v1 is not maintained anymore.
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
0b2fef24 — Conrad Hoffmann 4 years ago
Normalize remote address before saving to context

One cause for https://todo.sr.ht/~sircmpwn/meta.sr.ht/193 was that code
performing this sanitization was in multiple places, and a fix was not
applied in all places. There is no reasonable expectation for the port
to be present anyways, e.g. if the address is taken from a trusted
reverse proxy's header. Hence, perform the normalization here, so that
the code doing this in applications can be simplified.

Note that this does not yet fix the below ticket, it will just make the
fix easier.

References: https://todo.sr.ht/~sircmpwn/meta.sr.ht/193
8c2729f4 — Adnan Maolood 4 years ago
email.EnqueueStd: Don't overwrite headers

Sometimes we need to specify the Message-Id, From, and Reply-To headers
(e.g. for todo.sr.ht ticket notifications). Don't overwrite these
headers if they are present.
dea4ef29 — Drew DeVault 4 years ago
server: move auth middlware ahead of RealIP

So that @internal auth can correctly test against internal-ipnet.
48250772 — Simon Ser 4 years ago
Remove %e formatting verbs

%e is not valid for formatting error values:

> %e	scientific notation, e.g. -1.234456e+78

Instead, use %w when using fmt.Errorf (for error wrapping) and
%v when using log.Printf (%w is not valid in that context).
5f76a1f4 — Drew DeVault 4 years ago
Enforce complexity limit on webhook payload
1371ba4b — Drew DeVault 4 years ago
Configure server to manage mail queue

This also sets up the recovery function for webhooks, so we get emailed
when we panic during a webhook query.
67ddd428 — Drew DeVault 5 years ago
server: add server reference to context
6bcaea61 — Drew DeVault 5 years ago
server: set max upload size to 1 GiB
5de4cd8e — Drew DeVault 5 years ago
Stash remote address in context
af2afebd — Drew DeVault 5 years ago
Add legacy webhooks worker implementation
14f4b921 — Drew DeVault 5 years ago
Expand context for work queues
5b2fce24 — Drew DeVault 5 years ago
server: use SO_REUSEADDR for main listener
f53a762c — Drew DeVault 5 years ago
server: add /query/api-meta.json, docs
e72ffa65 — Drew DeVault 5 years ago
server: incorporate queue management
789f4a81 — Drew DeVault 5 years ago
Simplify server module
0c651498 — Drew DeVault 5 years ago
Add email work queue
Next