347 Commits

Author SHA1 Message Date
Xe Iaso
1f7fcf938b
fix(lib): add the ability to set a custom slog Logger (#915)
* fix(lib): add the ability to set a custom slog Logger

Closes #864

* test(lib): amend s.check usage

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
2025-07-31 08:06:35 -04:00
Xe Iaso
b81c577106
chore(docs/anubis-cfg): update contact email
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-29 15:38:08 +00:00
Xe Iaso
4a4031450c
fix(anubis): store the challenge method in the store (#924)
* fix(lib): reduce challenge string size

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(internal): add host, method, and path to request logs

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(anubis): log when challenges explicitly fail

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(lib): make challenge validation fully deterministic

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(anubis): nuke challengeFor function

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs: update changelog

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-28 10:57:50 -04:00
Xe Iaso
bca2e87e80
feat(default-rules): add weight to Custom-AsyncHttpClient (#914)
Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
2025-07-27 00:41:43 +00:00
Xe Iaso
a735770c93
feat(expressions): add segments function to break path into segments (#916)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-25 16:21:08 -04:00
dependabot[bot]
0ef3461816
build(deps): bump brace-expansion from 1.1.11 to 1.1.12 in /docs (#909)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 11:18:27 -04:00
Xe Iaso
9affd2edf4
chore: expose thoth in lib (#911)
Imports a patch previously exclusive to Botstopper.

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-25 10:58:30 -04:00
dependabot[bot]
26b6d8a91a
build(deps): bump on-headers and compression in /docs (#910)
Bumps [on-headers](https://github.com/jshttp/on-headers) and [compression](https://github.com/expressjs/compression). These dependencies needed to be updated together.

Updates `on-headers` from 1.0.2 to 1.1.0
- [Release notes](https://github.com/jshttp/on-headers/releases)
- [Changelog](https://github.com/jshttp/on-headers/blob/master/HISTORY.md)
- [Commits](https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0)

Updates `compression` from 1.8.0 to 1.8.1
- [Release notes](https://github.com/expressjs/compression/releases)
- [Changelog](https://github.com/expressjs/compression/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/compression/compare/1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: on-headers
  dependency-version: 1.1.0
  dependency-type: indirect
- dependency-name: compression
  dependency-version: 1.8.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 10:53:28 -04:00
Xe Iaso
958992a69a
chore: release v1.21.3
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-25 10:30:44 -04:00
Xe Iaso
221d9f2072
fix(web): make the try again button always go back to / (#907)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-25 14:25:04 +00:00
Xe Iaso
5700512da5
chore: release v1.21.2
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-24 10:47:32 -04:00
Xe Iaso
d40e9056bc
fix(lib): block XSS attacks via nonstandard URLs (#904)
* fix(lib): block XSS attacks via nonstandard URLs

This could allow an attacker to craft an Anubis pass-challenge URL that
forces a redirect to nonstandard URLs, such as the `javascript:` scheme
which executes arbitrary JavaScript code in a browser context when the
user clicks the "Try again" button.

Release-status: cut
Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: spelling

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-24 14:05:00 +00:00
Moonchild
21f570962c
Pass forward X-Real-IP to nginx backend server (#901)
The TLS termination server sets X-Real-IP to be used by the back-end, but the back-end configuration example doesn't actually extract it so nginx logs (and back-end processing) fails to log or use the visiting IP in any way (it just states `unix:` if using a unix socket like in the example given, or the local IP if forwarded over TCP).

Adding real_ip_header to the config will fix this.

Signed-off-by: Moonchild <moonchild@palemoon.org>
2025-07-24 12:11:53 +00:00
Xe Iaso
1cb1352a44
fix(blog/v1.21.1): we avoid breaking changes
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-22 22:54:22 +00:00
Xe Iaso
a4c08687cc
docs: add blogpost for announcing v1.21.1 (#886)
* docs: add release announcement post for v1.21.1

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(v1.21.1): small fixups

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(v1.21.1): spelling fixes

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(v1.21.1): clarify that Bell is trash

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: spelling

check-spelling run (pull_request) for Xe/v1.21.1-blogpost

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
2025-07-22 16:42:58 -04:00
Xe Iaso
1a19d7eee4
chore: release v1.21.1 (#887)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-22 16:32:06 -04:00
Sunniva Løvstad
25af5a232f
feat(localization): Add in Bokmål and Nynorsk translations (#855)
* feat(localization): add bokmål and nynorsk translations

* feat(localization): update tests for Bokmål and Nynorsk

* docs(localization): document bokmål and nynorsk locales

* fix(locales/nb,nn): remove unicode ellipsis to make tests pass

Signed-off-by: Xe Iaso <me@xeiaso.net>

* style(localization): sort languages to make test output stable

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: spelling

check-spelling run (pull_request) for main

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
Co-authored-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <xe.iaso@techaro.lol>
2025-07-21 22:37:49 -04:00
Xe Iaso
24d2501187
feat: Russian localization for Anubis (#882)
* feat(localization): Add Russian language translation

* test(localization): ensure Russian translations are tested

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs(changelog): update with Russian translation

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
Co-authored-by: MichaelAgarkov <michaelagarkov@internet.ru>
2025-07-21 23:14:51 +00:00
ZerionSeven
1dc9525427
Add Finnish localization (#863)
* add Finnish localization

* add fi to supportedLanguages

* add entry for Finnish to CHANGELOG
2025-07-21 18:56:16 -04:00
Xe Iaso
24e3746b0b
fix(lib): fix challenge issuance logic (#881)
* fix(lib): fix challenge issuance logic

Fixes #869

v1.21.0 changed the core challenge flow to maintain information about
challenges on the server side instead of only doing them via stateless
idempotent generation functions and relying on details to not change.
There was a subtle bug introduced in this change: if a client has an
unknown challenge ID set in its test cookie, Anubis will clear that
cookie and then throw an HTTP 500 error.

This has been fixed by making Anubis throw a new challenge page instead.

Signed-off-by: Xe Iaso <me@xeiaso.net>

* test(lib): you win this time spell check

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-21 18:53:59 -04:00
Xe Iaso
e69fadddf1
fix(web/fast): remove event loop thrashing (#880)
Fixes #877

Continued from #879, event loop thrashing can cause stack space
exhaustion on ia32 systems. Previously this would thrash the event loop
in Firefox and Firefox derived browsers such as Pale Moon. I suspect
that this is the ultimate root cause of the bizarre irreproducible bugs
that Pale Moon (and maybe Cromite) users have been reporting since at
least #87 was merged.

The root cause is an invalid boolean statement:

```js
// send a progress update every 1024 iterations. since each thread checks
// separate values, one simple way to do this is by bit masking the
// nonce for multiples of 1024. unfortunately, if the number of threads
// is not prime, only some of the threads will be sending the status
// update and they will get behind the others. this is slightly more
// complicated but ensures an even distribution between threads.
if (
  (nonce > oldNonce) | 1023 && // we've wrapped past 1024
  (nonce >> 10) % threads === threadId // and it's our turn
) {
  postMessage(nonce);
}
```

The logic here looks fine but is subtly wrong as was reported in #877
by a user in the Pale Moon community. Consider the following scenario:

`nonce` is a counter that increments by the worker count every loop.
This is intended to spread the load between CPU cores as such:

| Iteration | Worker ID | Nonce |
| :-------- | :-------- | :---- |
| 1         | 0         | 0     |
| 1         | 1         | 1     |
| 2         | 0         | 2     |
| 3         | 1         | 3     |

And so on.

The incorrect part of this is the boolean logic, specifically the part
with the bitwise or `|`. I think the intent was to use a logical or
(`||`), but this had the effect of making the `postMessage` handler fire
on every iteration. The intent of this snippet (as the comment clearly
indicates) is to make sure that the main event loop is only updated with
the worker status every 1024 iterations per worker. This had the
opposite effect, causing a lot of messages to be sent from workers to
the parent JavaScript context.

This is bad for the event loop.

Instead, I have ripped out that statement and replaced it with a much
simpler increment only counter that fires every 1024 iterations.
Additionally, only the first thread communicates back to the parent
process. This does mean that in theory the other workers could be ahead
of the first thread (posting a message out of a worker has a nonzero
cost), but in practice I don't think this will be as much of an issue as
the current behaviour is.

The root cause of the stack exhaustion is likely the pressure caused by
all of the postMessage futures piling up. Maybe the larger stack size in
64 bit environments is causing this to be fine there, maybe it's some
combination of newer hardware in 64 bit systems making this not be as
much of a problem due to it being able to handle events fast enough to
keep up with the pressure.

Either way, thanks much to @wolfbeast and the Pale Moon community for
finding this. This will make Anubis faster for everyone!

Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
2025-07-21 18:05:24 -04:00
Xe Iaso
5e8ebaeb5d
fix(web): amend future leak on proof of work solution (#879)
Possible fix for #877

In some cases, the parallel solution finder in Anubis could cause
all of the worker promises to leak due to the fact the promises
were being improperly terminated. A recursion bomb happens in the
following scenario:

1. A worker sends a message indicating it found a solution to the proof
   of work challenge.
2. The `onmessage` handler for that worker calls `terminate()`
3. Inside `terminate()`, the parent process loops through all other
   workers and calls `w.terminate()` on them.
4. It's possible that terminating a worker could lead to the `onerror`
   event handler.
5. This would create a recursive loop of `onmessage` -> `terminate` ->
   `onerror` -> `terminate` -> `onerror` and so on.

This infinite recursion quickly consumes all available stack space, but
this has never been noticed in development because all of my computers
have at least 64Gi of ram provisioned to them under the axiom paying for
more ram is cheaper than paying in my time spent having to work around
not having enough ram. Additionally, ia32 has a smaller base stack size,
which means that they will run into this issue much sooner than users on
other CPU architectures will.

The fix adds a boolean `settled` flag to prevent termination from
running more than once.

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-21 17:50:31 -04:00
Xe Iaso
76dcd21582
feat(expressions): add missingHeader function to bot environment (#870)
Also add tests to the bot expressions custom functions.
2025-07-20 19:09:29 -04:00
Josef Moravec
6b639cd911
feat(localization): Add Czech language translation (#849)
* feat(localization): Add Czech language translation

* feat(localization): Add record to CHANGELOG.md
2025-07-18 17:23:19 -04:00
Nicholas Sherlock
300720f030
fix broken bbolt database cleanup process (#848) (#848)
Closes #820, was broken since #761
2025-07-18 13:51:32 -04:00
Emily Rowlands
c59b7179c3
fix(cmd/anubis): add signal handling to metrics server (#856)
This fixes a bug that was introduced in 68b653b0, in which the call
to metricsServer was passed a plain context.Background without
signal handling.

This commit adds back in the signal handling for the metrics server,
as well as for the Thoth client and storage backend.

Closes: #853

Signed-off-by: Emily Rowlands <emily@erowl.net>
2025-07-18 13:56:52 +00:00
Lothar Serra Mari
59515ed669
docs(known-instances): update list of known instances (#847)
Signed-off-by: Lothar Serra Mari <mail@serra.me>
2025-07-17 07:37:37 -04:00
Xe Iaso
2915c1d209
fix(docs/manifest): k8s typo
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-16 20:35:33 -04:00
Xe Iaso
68b653b099
feat(anubis): add /healthz route to metrics server (#843)
* feat(anubis): add /healthz route to metrics server

Also add health check test for Docker Compose and update documentation
for health checking Anubis with Docker Compose.

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: spelling

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-17 00:31:18 +00:00
Xe Iaso
132b2ed853
feat(cmd/anubis): capture ja4h fingerprints (#834)
This is not used yet, but it will be part of a larger strategy around
adding/removing weight based on JA4H (and other) fingerprint matches
with Thoth.

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-14 23:31:33 -04:00
Xe Iaso
d28991ce8d
fix: race conditions, cookie logic, and the try again button (#833)
* fix(lib): fix race condition when rendering multiple challenge pages at once

Closes #832

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(web): make try again button work

Looks like the intent of this was "try the solution again". This fix
makes the client try the challenge again.

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(web): don't block a user if they have an invalid challenge cookie

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs: update CHANGELOG

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-15 00:54:08 +00:00
Xe Iaso
3f6750ac7d
chore(sponsors): add fabulous systems
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-12 23:08:30 +00:00
Xe Iaso
de17823bc7
chore: release v1.21.0-pre2 (#816)
* chore: release v1.21.0-pre2

* chore: disable automated stable package builds for now

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-12 16:57:08 -04:00
Xe Iaso
29622e605d
chore(docs): add link to status page in the footer (#814)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-12 13:32:24 -04:00
Maxime Louet
fbf69680f5
chore(docs): fix typo in configuration/expressions (#811)
This example code block was missing a closing single quote.

Signed-off-by: Maxime Louet <maxime@saumon.io>
2025-07-11 13:30:27 +00:00
Lothar Serra Mari
c74de19532
docs(known-instances): add rpmfusion.org and wiki.freepascal.org to known instances (#807)
* docs(known-instances): add rpmfusion.org to known instances

Signed-off-by: Lothar Serra Mari <mail@serra.me>

* docs(known-instances): add wiki.freepascal.org to known instances

Signed-off-by: Lothar Serra Mari <mail@serra.me>

---------

Signed-off-by: Lothar Serra Mari <mail@serra.me>
2025-07-10 14:38:17 -04:00
Evgeni Golov
6dc726013a
correct gitea.botPolicies extension to be yaml, not json (#800)
* correct gitea.botPolicies extension to be yaml, not json

while Anubis probably doesn't care about the extension, and would parse a JSON file just fine too, the rest of the page talks about `gitea.botPolicies.yaml`, so let's be consistent

Signed-off-by: Evgeni Golov <evgeni@golov.de>

* chore: spelling

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Evgeni Golov <evgeni@golov.de>
Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-07-10 17:10:47 +00:00
Lothar Serra Mari
02304e8f3c
docs(known-instances): update list of known instances (#801)
* docs(known-instances): add clew.se to known instances

Signed-off-by: Lothar Serra Mari <mail@serra.me>

* docs(known-instances): add tumfatig.net to known instances

Signed-off-by: Lothar Serra Mari <mail@serra.me>

---------

Signed-off-by: Lothar Serra Mari <mail@serra.me>
2025-07-10 12:56:46 -04:00
Xe Iaso
607c9791d8
chore(docs): add fly.toml file as a hail mary
Ref #799

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-10 06:05:17 -04:00
Xe Iaso
6b67be86a1
chore(docs/manifest): branded 404 page
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-09 17:06:23 -04:00
Xe Iaso
e02f017153
chore(docs/manifest): remove fastcgi from the nginx config
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-09 17:01:42 -04:00
Xe Iaso
66b39f64af
docs: update CHANGELOG for language changes (#793)
Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Xe Iaso <xe.iaso@techaro.lol>
2025-07-09 20:58:08 +00:00
Xe Iaso
944fd25924
chore: use nginx-micro to make the docs image 13 MB (#796)
* chore: use nginx-micro to make the docs image 13 MB

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: update spelling

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-09 20:54:44 +00:00
Xe Iaso
fa3fbfb0a5
feat(blog): incident report for TI-20250709-0001 (#795)
* feat(blog): incident report for TI-20250709-0001

Signed-off-by: Xe Iaso <me@xeiaso.net>

* chore: spelling

check-spelling run (pull_request) for Xe/TI-20250709-0001

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>

* fix(blog/TI-20250709-0001): add TecharoHQ/anubis#794

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix(blog/TI-20250709-0001): amend grammar

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
2025-07-09 14:56:12 +00:00
Xe Iaso
3c739c1305
fix(internal/thoth): don't block Anubis starting if healthcheck fails (#794)
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-09 13:31:28 +00:00
giomba
053d29e0b6
feat(localization): Add Italian language translation (#778)
Signed-off-by: Giovan Battista Rolandi <giomba@glgprograms.it>
2025-07-09 11:49:19 +00:00
Henri Vasserman
1c4a1aec4a
feat(i18n): add Estonian locale (#783)
* feat(i18n): add et locale

* chore: update changelog

* wording

* "feature"
2025-07-09 11:18:11 +00:00
Joe Brockmeier
0cb6ef76e1
Update apache.mdx (#784)
Was missing the opening stanza to enable mod_proxy for Apache.

Signed-off-by: Joe Brockmeier <jzb@zonker.net>
2025-07-09 07:08:19 -04:00
Henri Vasserman
a900e98b8b
fix(localization): HTML language header and forced-language (#787)
* fix: HTML language header and forced-language

* style(changelog): added a couple headers

* add test
2025-07-09 07:04:42 -04:00
Mahid Sheikh
e79cd93b61
docs(installation): Clarify information about private keys and multiple instances (#788)
Signed-off-by: Mahid Sheikh <mahid@standingpad.org>
2025-07-09 10:54:36 +00:00