Compare commits

..

28 Commits

Author SHA1 Message Date
Xe Iaso
364622d890 chore: fixes found in review
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 20:37:32 +00:00
Xe Iaso
41993466a1 docs(admin/policies): don't start a sentence with as
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:55:15 +00:00
Xe Iaso
3894469d98 Merge branch 'main' into Xe/store-interface
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:49:05 +00:00
Xe Iaso
8a3520466b docs: update CHANGELOG and internal links
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:47:54 +00:00
Xe Iaso
066e642310 docs(policy): document storage backends
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:36:43 +00:00
Xe Iaso
e8e70122d6 chore(docs): listen on 0.0.0.0 for dev container support
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:36:32 +00:00
Xe Iaso
5b337cd322 docs(default-config): add a nudge to the storage backends section of the docs
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:36:11 +00:00
Xe Iaso
a6e6caad7b chore(devcontainer): remove port forwards because vs code handles that for you
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 19:34:13 +00:00
Xe Iaso
9e19dc1ee4 Update metadata
check-spelling run (pull_request) for Xe/store-interface

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>
2025-07-04 18:48:17 +00:00
Xe Iaso
b96ab68e85 test(lib/policy/config): ensure valkey stores can be loaded
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 18:46:33 +00:00
Xe Iaso
4845f8515d test(lib/store/valkey): disable tests if not using docker
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 18:38:35 +00:00
Xe Iaso
3808f7ba17 feat(lib/store): implement valkey backend
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 18:31:01 +00:00
Xe Iaso
59f69d48d2 fix(lib): make challenges live for 30 minutes by default
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 17:29:14 +00:00
Xe Iaso
ded9c32801 chore(devcontainer): adapt to docker compose, add valkey service
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-04 17:28:52 +00:00
Xe Iaso
06b2dca7fc chore: go mod tidy
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 18:14:23 +00:00
Xe Iaso
1dceab889c chore: spelling
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 18:05:21 +00:00
Xe Iaso
45f6fa2194 feat(lib/store): add bbolt store implementation
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 18:02:17 +00:00
Xe Iaso
ddb7b0e99e fix(decaymap): invert locking process for Delete
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 04:50:11 +00:00
Xe Iaso
acee62a9d0 chore: spelling
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 00:46:16 -04:00
Xe Iaso
2b3bfdc40b test(lib/store): make generic storage interface test adaptor
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 04:44:29 +00:00
Xe Iaso
e538f55e89 chore(lib): fix SA4004
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 04:08:32 +00:00
Xe Iaso
b8e0c1a961 chore(decaymap): fix documentation typo
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-03 04:07:44 +00:00
Xe Iaso
def6f2dc90 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 <me@xeiaso.net>
2025-07-02 23:56:23 +00:00
Xe Iaso
e5c39facfe chore(policy): import all store backends
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-02 23:34:49 +00:00
Xe Iaso
18b21330df feat(lib/store): all metapackage to import all store implementations
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-02 23:17:51 +00:00
Xe Iaso
0f9da86003 feat(lib): implement store interface
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-02 23:12:27 +00:00
Xe Iaso
32afc9c040 chore(lib/challenge): refactor Validate to take ValidateInput
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-02 22:23:10 +00:00
Xe Iaso
9245c4beec feat(decaymap): add Delete method
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-07-02 22:22:34 +00:00
8 changed files with 65 additions and 21 deletions

View File

@@ -3,7 +3,9 @@ FROM ghcr.io/xe/devcontainer-base/pre/go
WORKDIR /app
COPY go.mod go.sum package.json package-lock.json ./
RUN apt-get update \
RUN go install github.com/a-h/templ/cmd/templ \
&& npx --yes playwright@1.52.0 install --with-deps\
&& apt-get update \
&& apt-get -y install zstd brotli redis \
&& mkdir -p /home/vscode/.local/share/fish \
&& chown -R vscode:vscode /home/vscode/.local/share/fish \

View File

@@ -2,6 +2,14 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Dev",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "build": {
// "dockerfile": "./Dockerfile",
// "context": "..",
// "cacheFrom": [
// "type=registry,ref=ghcr.io/techarohq/anubis/devcontainer"
// ]
// },
"dockerComposeFile": ["./docker-compose.yaml"],
"service": "workspace",
"workspaceFolder": "/workspace/anubis",

View File

@@ -1,13 +1,4 @@
services:
playwright:
image: mcr.microsoft.com/playwright:v1.52.0-noble
init: true
network_mode: service:workspace
command:
- /bin/sh
- -c
- npx -y playwright@1.52.0 run-server --port 9001 --host 0.0.0.0
valkey:
image: valkey/valkey:8
pull_policy: always
@@ -18,6 +9,8 @@ services:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
cache_from:
- "type=registry,ref=ghcr.io/techarohq/anubis/devcontainer"
volumes:
- ../:/workspace/anubis:cached
environment:

47
.github/workflows/devcontainer.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Dev container prebuild
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
jobs:
devcontainer:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-tags: true
fetch-depth: 0
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: latest
- run: |
sudo apt-get update
sudo apt-get -y install skopeo
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: techarohq
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 # v0.3.1900000417
with:
imageName: ghcr.io/techarohq/anubis/devcontainer
cacheFrom: ghcr.io/techarohq/anubis/devcontainer
push: always
platform: linux/amd64,linux/arm64

View File

@@ -21,4 +21,8 @@ If you use a browser extension such as [JShelter](https://jshelter.org/), you wi
## Does Anubis mine Bitcoin?
No. Anubis does not mine Bitcoin or any other cryptocurrency.
No. Anubis does not mine Bitcoin.
In order to mine bitcoin, you need to download a copy of the blockchain (so you have the state required to do mining) and also broadcast your mined blocks to the network should you reach a hash with the right number of leading zeroes. You also need to continuously read for newly broadcasted transactions so you can batch them into a block. This requires gigabytes of data to be transferred from the server to the client.
Anubis transfers two digit numbers of kilobytes from the server to the client (which you can independently verify with your browser's Developer Tools feature). This is orders of magnitude below what is required to mine Bitcoin.

View File

@@ -45,7 +45,6 @@ This page contains a non-exhaustive list with all websites using Anubis.
- https://gitlab.postmarketos.org/
- https://wiki.koha-community.org/
- https://extensions.typo3.org/
- https://ebird.org/
- <details>
<summary>FreeCAD</summary>
- https://forum.freecad.org/

View File

@@ -127,8 +127,3 @@ impressum:
status_codes:
CHALLENGE: 200
DENY: 200
store:
backend: bbolt
parameters:
path: /xe/data/anubis/data.bdb

View File

@@ -15,8 +15,6 @@ spec:
- name: anubis
configMap:
name: anubis-cfg
- name: temporary-data
emptyDir: {}
containers:
- name: anubis-docs
image: ghcr.io/techarohq/anubis/docs:main
@@ -53,8 +51,6 @@ spec:
volumeMounts:
- name: anubis
mountPath: /xe/cfg/anubis
- name: temporary-data
mountPath: /xe/data/anubis
resources:
limits:
cpu: 500m