Commit Graph
14 Commits
Author SHA1 Message Date
ef3ea08b79 perf(challenge/proofofwork): stream sha256 into stack buffer in Validate (#1653)
Signed-off-by: jvoisin <[email protected]>
Co-authored-by: Jason Cameron <[email protected]>
2026-06-03 11:35:28 -04:00
Julien VoisinandGitHub 04b3a835cd perf(lib): iterate s.policy.Bots by index to drop per-call heap copy (#1639)
Signed-off-by: jvoisin <[email protected]>
2026-05-28 15:35:14 +00:00
Jason CameronandGitHub c7b31d0ca9 fix: nil ptr deref (#1467)
Signed-off-by: Jason Cameron <[email protected]>
Signed-off-by: Jason Cameron <[email protected]>
2026-03-18 18:02:57 +00:00
Xe IasoandGitHub 4ead3ed16e fix(config): deprecate the report_as field for challenges (#1311)
* fix(config): deprecate the report_as field for challenges

This was a bad idea when it was added and it is irresponsible to
continue to have it. It causes more UX problems than it fixes with
slight of hand.

Closes: #1310
Closes: #1307
Signed-off-by: Xe Iaso <[email protected]>

* fix(policy): use the new logger for config validation messages

Signed-off-by: Xe Iaso <[email protected]>

* docs(admin/thresholds): remove this report_as setting

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-11-25 23:25:17 -05:00
Xe IasoandGitHub f032d5d0ac feat: writing logs to the filesystem with rotation support (#1299)
* refactor: move lib/policy/config to lib/config

Signed-off-by: Xe Iaso <[email protected]>

* refactor: don't set global loggers anymore

Ref #864

You were right @kotx, it is a bad idea to set the global logger
instance.

Signed-off-by: Xe Iaso <[email protected]>

* feat(config): add log sink support

Signed-off-by: Xe Iaso <[email protected]>

* chore: update spelling

Signed-off-by: Xe Iaso <[email protected]>

* chore(test): go mod tidy

Signed-off-by: Xe Iaso <[email protected]>

* chore: update spelling

Signed-off-by: Xe Iaso <[email protected]>

* docs(admin/policies): add logging block documentation

Signed-off-by: Xe Iaso <[email protected]>

* docs: update CHANGELOG

Signed-off-by: Xe Iaso <[email protected]>

* fix(cmd/anubis): revert this change, it's meant to be its own PR

Signed-off-by: Xe Iaso <[email protected]>

* chore: go mod tidy

Signed-off-by: Xe Iaso <[email protected]>

* test: add file logging smoke test

Assisted-by: GLM 4.6 via Claude Code
Signed-off-by: Xe Iaso <[email protected]>

* fix: don't expose the old log file time format string

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-11-21 11:46:00 -05:00
Xe IasoandGitHub cb67c54ac5 ci: add asset build verification workflow (#1254)
* ci: add asset build verification workflow

A CI pass that fails if generated files are out of date.

* chore: npm run assets

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-11-08 00:24:38 +00:00
Xe IasoandGitHub fb3637df95 feat(metarefresh): randomly use the Refresh header (#1133)
* feat(lib/challenge): expose ResponseWriter to challenge issuers

Signed-off-by: Xe Iaso <[email protected]>

* feat(metarefresh): randomly use the Refresh header

There are several ways to trigger an automatic refresh without
JavaScript. One of them is the "meta refresh" method[1], but the other
is with the Refresh header[2]. Both are semantically identical and
supported with browsers as old as Chrome version 1.

Given that they are basically the same thing, this patch makes Anubis
randomly select between them by using the challenge random data's first
character. This will fire about 50% of the time.

I expect this to have no impact. If this works out fine, then I will
implement some kind of fallback logic for the fast challenge such that
admins can opt into allowing clients with a no-js configuration to pass
the fast challenge. This needs to bake in the oven though.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv
[2]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Refresh

Signed-off-by: Xe Iaso <[email protected]>

* docs: update CHANGELOG

Signed-off-by: Xe Iaso <[email protected]>

* feat(metarefresh): simplify random logic

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
2025-09-16 17:32:13 -04:00
29d038835f feat(web): Add option for customizable explanation text (#747)
* Add option for customizable explanation text

* Add changes to CHANGELOG.md

* Replace custom explanation text in favor of static simplified text

Also includes translations for the simple_explanation using Google
Translate as a placeholder so tests pass.

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-08-14 11:12:55 -04:00
Xe IasoandGitHub f6481b81a2 fix(web): embed challenge ID in pass-challenge invocations (#944)
* refactor: make challenge pages return the challenge component

This means that challenge pages will return only the little bit that
actually matters, not the entire component.

Signed-off-by: Xe Iaso <[email protected]>

* fix(web): move Anubis version info to be implicitly in the footer

Signed-off-by: Xe Iaso <[email protected]>

* fix(web): embed challenge ID into generated pages

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): make tests pass

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/policy/config): amend tests

Signed-off-by: Xe Iaso <[email protected]>

* test(lib): fix tests again

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
2025-08-04 18:49:19 +00:00
Xe IasoandGitHub dff2176beb feat(lib): use new challenge creation flow (#749)
* feat(decaymap): add Delete method

Signed-off-by: Xe Iaso <[email protected]>

* chore(lib/challenge): refactor Validate to take ValidateInput

Signed-off-by: Xe Iaso <[email protected]>

* feat(lib): implement store interface

Signed-off-by: Xe Iaso <[email protected]>

* feat(lib/store): all metapackage to import all store implementations

Signed-off-by: Xe Iaso <[email protected]>

* chore(policy): import all store backends

Signed-off-by: Xe Iaso <[email protected]>

* feat(lib): use new challenge creation flow

Previously Anubis constructed challenge strings from request metadata.
This was a good idea in spirit, but has turned out to be a very bad idea
in practice. This new flow reuses the Store facility to dynamically
create challenge values with completely random data.

This is a fairly big rewrite of how Anubis processes challenges. Right
now it defaults to using the in-memory storage backend, but on-disk
(boltdb) and valkey-based adaptors will come soon.

Signed-off-by: Xe Iaso <[email protected]>

* chore(decaymap): fix documentation typo

Signed-off-by: Xe Iaso <[email protected]>

* chore(lib): fix SA4004

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/store): make generic storage interface test adaptor

Signed-off-by: Xe Iaso <[email protected]>

* chore: spelling

Signed-off-by: Xe Iaso <[email protected]>

* fix(decaymap): invert locking process for Delete

Signed-off-by: Xe Iaso <[email protected]>

* feat(lib/store): add bbolt store implementation

Signed-off-by: Xe Iaso <[email protected]>

* chore: spelling

Signed-off-by: Xe Iaso <[email protected]>

* chore: go mod tidy

Signed-off-by: Xe Iaso <[email protected]>

* chore(devcontainer): adapt to docker compose, add valkey service

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): make challenges live for 30 minutes by default

Signed-off-by: Xe Iaso <[email protected]>

* feat(lib/store): implement valkey backend

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/store/valkey): disable tests if not using docker

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/policy/config): ensure valkey stores can be loaded

Signed-off-by: Xe Iaso <[email protected]>

* Update metadata

check-spelling run (pull_request) for Xe/store-interface

Signed-off-by: check-spelling-bot <[email protected]>
on-behalf-of: @check-spelling <[email protected]>

* chore(devcontainer): remove port forwards because vs code handles that for you

Signed-off-by: Xe Iaso <[email protected]>

* docs(default-config): add a nudge to the storage backends section of the docs

Signed-off-by: Xe Iaso <[email protected]>

* chore(docs): listen on 0.0.0.0 for dev container support

Signed-off-by: Xe Iaso <[email protected]>

* docs(policy): document storage backends

Signed-off-by: Xe Iaso <[email protected]>

* docs: update CHANGELOG and internal links

Signed-off-by: Xe Iaso <[email protected]>

* docs(admin/policies): don't start a sentence with as

Signed-off-by: Xe Iaso <[email protected]>

* chore: fixes found in review

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: check-spelling-bot <[email protected]>
2025-07-04 20:42:28 +00:00
ad5430612f feat: implement localization system (#716)
* lib/localization: implement localization system

Locale files are placed in lib/localization/locales/. If you add a
locale, update manifest.json with available locales.

* Exclude locales from check spelling

* tests(lib/localization): add comprehensive translations test

Signed-off-by: Xe Iaso <[email protected]>

* fix(challenge/metarefresh): enable localization

Signed-off-by: Xe Iaso <[email protected]>

* fix: use simple syntax for localization in templ

Also localize CELPHASE into French according to the wishes of the
artist.

Signed-off-by: Xe Iaso <[email protected]>

* chore: spelling

Signed-off-by: Xe Iaso <[email protected]>

* chore:(js): fix forbidden patterns

Signed-off-by: Xe Iaso <[email protected]>

* chore: add goi18n to tools

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/localization): dynamically determine the list of supported languages

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-06-27 17:49:15 +00:00
Xe IasoandGitHub 5870f7072c feat: implement imprint/impressum support (#706)
* feat: implement imprint/impressum support

Closes #362

Signed-off-by: Xe Iaso <[email protected]>

* chore(docs/anubis): enable an imprint

Signed-off-by: Xe Iaso <[email protected]>

* chore: spelling

Signed-off-by: Xe Iaso <[email protected]>

* docs: fix the end of the sentence, comment out a default impressum

Signed-off-by: Xe Iaso <[email protected]>

* docs: link back to impressum page

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-06-22 18:09:37 -04:00
Xe IasoandGitHub 5a7499ea3b fix(lib/challenge): allow challenges to register HTTP routes (#620)
Signed-off-by: Xe Iaso <[email protected]>
2025-06-06 00:26:23 +00:00
Xe IasoandGitHub f2db43ad4b feat: implement challenge registry (#607)
* feat: implement challenge method registry

This paves the way for implementing a no-js check method (#95) by making
the challenge providers more generic.

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib/challenge): rename proof-of-work package to proofofwork

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): make validated challenges a CounterVec

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): annotate jwts with challenge method

Signed-off-by: Xe Iaso <[email protected]>

* test(lib/challenge/proofofwork): implement tests

Signed-off-by: Xe Iaso <[email protected]>

* test(lib): add smoke tests for known good and known bad config files

Signed-off-by: Xe Iaso <[email protected]>

* docs: update CHANGELOG

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): use challenge.Impl#Issue when issuing challenges

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-06-04 02:01:58 +00:00