mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-05 16:28:17 +00:00
Compare commits
8 Commits
Xe/agent-h
...
Xe/haproxy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c414ddd9dc | ||
|
|
89282230f5 | ||
|
|
4e0df8c643 | ||
|
|
c34ec67777 | ||
|
|
61026976ec | ||
|
|
189c5c021c | ||
|
|
dde186150b | ||
|
|
a98f721957 |
2
.github/actions/spelling/allow.txt
vendored
2
.github/actions/spelling/allow.txt
vendored
@@ -24,3 +24,5 @@ iplist
|
||||
NArg
|
||||
blocklists
|
||||
rififi
|
||||
prolocation
|
||||
Prolocation
|
||||
|
||||
11
.github/actions/spelling/expect.txt
vendored
11
.github/actions/spelling/expect.txt
vendored
@@ -2,10 +2,12 @@ acs
|
||||
Actorified
|
||||
actorifiedstore
|
||||
actorify
|
||||
agentic
|
||||
Aibrew
|
||||
alibaba
|
||||
alrest
|
||||
amazonbot
|
||||
anexia
|
||||
anthro
|
||||
anubis
|
||||
anubistest
|
||||
@@ -61,7 +63,9 @@ checkresult
|
||||
chibi
|
||||
cidranger
|
||||
ckie
|
||||
CLAUDE
|
||||
cloudflare
|
||||
cloudsolutions
|
||||
Codespaces
|
||||
confd
|
||||
containerbuild
|
||||
@@ -115,6 +119,7 @@ FCr
|
||||
fcrdns
|
||||
fediverse
|
||||
ffprobe
|
||||
fhdr
|
||||
financials
|
||||
finfos
|
||||
Firecrawl
|
||||
@@ -152,6 +157,7 @@ grw
|
||||
gzw
|
||||
Hashcash
|
||||
hashrate
|
||||
hdr
|
||||
headermap
|
||||
healthcheck
|
||||
healthz
|
||||
@@ -161,6 +167,7 @@ Hetzner
|
||||
hmc
|
||||
homelab
|
||||
hostable
|
||||
HSTS
|
||||
htmlc
|
||||
htmx
|
||||
httpdebug
|
||||
@@ -327,6 +334,8 @@ stackoverflow
|
||||
startprecmd
|
||||
stoppostcmd
|
||||
storetest
|
||||
srcip
|
||||
strcmp
|
||||
subgrid
|
||||
subr
|
||||
subrequest
|
||||
@@ -351,12 +360,14 @@ Timpibot
|
||||
TLog
|
||||
traefik
|
||||
trunc
|
||||
txn
|
||||
uberspace
|
||||
Unbreak
|
||||
unbreakdocker
|
||||
unifiedjs
|
||||
unmarshal
|
||||
unparseable
|
||||
updown
|
||||
uvx
|
||||
UXP
|
||||
valkey
|
||||
|
||||
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
|
||||
|
||||
- name: Log into registry
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
SLOG_LEVEL: debug
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
|
||||
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
|
||||
with:
|
||||
subject-name: ${{ env.IMAGE }}
|
||||
subject-digest: ${{ steps.build.outputs.digest }}
|
||||
|
||||
6
.github/workflows/docs-deploy.yml
vendored
6
.github/workflows/docs-deploy.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||
|
||||
- name: Log into registry
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: techarohq
|
||||
@@ -53,14 +53,14 @@ jobs:
|
||||
push: true
|
||||
|
||||
- name: Apply k8s manifests to limsa lominsa
|
||||
uses: actions-hub/kubectl@f6d776bd78f4523e36d6c74d34f9941c242b2213 # v1.35.0
|
||||
uses: actions-hub/kubectl@3ece3793e7a9fe94effe257d03ac834c815ea87d # v1.35.1
|
||||
env:
|
||||
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
||||
with:
|
||||
args: apply -k docs/manifest
|
||||
|
||||
- name: Apply k8s manifests to limsa lominsa
|
||||
uses: actions-hub/kubectl@f6d776bd78f4523e36d6c74d34f9941c242b2213 # v1.35.0
|
||||
uses: actions-hub/kubectl@3ece3793e7a9fe94effe257d03ac834c815ea87d # v1.35.1
|
||||
env:
|
||||
KUBE_CONFIG: ${{ secrets.LIMSA_LOMINSA_KUBECONFIG }}
|
||||
with:
|
||||
|
||||
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
go-version: "1.25.4"
|
||||
|
||||
- name: Cache playwright binaries
|
||||
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
id: playwright-cache
|
||||
with:
|
||||
path: |
|
||||
|
||||
2
.github/workflows/lint-pr-title.yaml
vendored
2
.github/workflows/lint-pr-title.yaml
vendored
@@ -14,6 +14,6 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
|
||||
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
1
.github/workflows/smoke-tests.yml
vendored
1
.github/workflows/smoke-tests.yml
vendored
@@ -24,6 +24,7 @@ jobs:
|
||||
- i18n
|
||||
- log-file
|
||||
- nginx
|
||||
- haproxy-simple
|
||||
- palemoon/amd64
|
||||
#- palemoon/i386
|
||||
- robots_txt
|
||||
|
||||
2
.github/workflows/ssh-ci-runner-cron.yml
vendored
2
.github/workflows/ssh-ci-runner-cron.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Log into registry
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
|
||||
2
.github/workflows/zizmor.yml
vendored
2
.github/workflows/zizmor.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
|
||||
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
|
||||
|
||||
- name: Run zizmor 🌈
|
||||
run: uvx zizmor --format sarif . > results.sarif
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
lib/config/testdata/bad/*
|
||||
*.inc
|
||||
*.inc
|
||||
AGENTS.md
|
||||
CLAUDE.md
|
||||
75
AGENTS.md
Normal file
75
AGENTS.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Agent instructions
|
||||
|
||||
Primary agent documentation is in `CONTRIBUTING.md`. You MUST read this file before proceeding.
|
||||
|
||||
## Useful Commands
|
||||
|
||||
```shell
|
||||
npm ci # install node dependencies
|
||||
npm run assets # build JS/CSS (required before any Go build/test)
|
||||
npm run build # assets + go build -> ./var/anubis
|
||||
npm run dev # assets + run locally with --use-remote-address
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
```shell
|
||||
npm run test
|
||||
```
|
||||
|
||||
## Linting
|
||||
|
||||
```shell
|
||||
go vet ./...
|
||||
go tool staticcheck ./...
|
||||
go tool govulncheck ./...
|
||||
```
|
||||
|
||||
## Commit Messages
|
||||
|
||||
Commit messages follow the [**Conventional Commits**](https://www.conventionalcommits.org/en/v1.0.0/) format:
|
||||
|
||||
```text
|
||||
<type>[optional scope]: <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer(s)]
|
||||
```
|
||||
|
||||
**Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
|
||||
|
||||
- Add `!` after type/scope for breaking changes or include `BREAKING CHANGE:` in the footer.
|
||||
- Keep descriptions concise, imperative, lowercase, and without a trailing period.
|
||||
- Reference issues/PRs in the footer when applicable.
|
||||
- **ALL git commits MUST be made with `--signoff`.** This is mandatory.
|
||||
|
||||
### Attribution Requirements
|
||||
|
||||
AI agents must disclose what tool and model they are using in the "Assisted-by" commit footer:
|
||||
|
||||
```text
|
||||
Assisted-by: [Model Name] via [Tool Name]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```text
|
||||
Assisted-by: GLM 4.6 via Claude Code
|
||||
```
|
||||
|
||||
## PR Checklist
|
||||
|
||||
- Add description of changes to `[Unreleased]` in `docs/docs/CHANGELOG.md`.
|
||||
- Add test cases for bug fixes and behavior changes.
|
||||
- Run integration tests: `npm run test:integration`.
|
||||
- All commits must have verified (signed) signatures.
|
||||
|
||||
## Key Conventions
|
||||
|
||||
- **Security-first**: This is security software. Code reviews are strict. Always add tests for bug fixes. Consider adversarial inputs.
|
||||
- **Configuration**: YAML-based policy files. Config structs validate via `Valid() error` methods returning sentinel errors.
|
||||
- **Store interface**: `lib/store.Interface` abstracts key-value storage.
|
||||
- **Environment variables**: Parsed from flags via `flagenv`. Use `.env` files locally (loaded by `godotenv/autoload`). Never commit `.env` files.
|
||||
- **Assets must be built first**: JS/CSS assets are embedded into the Go binary. Always run `npm run assets` before `go test` or `go build`.
|
||||
- **CEL expressions**: Policy rules support CEL (Common Expression Language) expressions for advanced matching. See `lib/policy/expressions/`.
|
||||
@@ -29,6 +29,12 @@ Anubis is brought to you by sponsors and donors like:
|
||||
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="./docs/static/img/sponsors/distrust-logo.webp" alt="Distrust" height="64">
|
||||
</a>
|
||||
<a href="https://about.gitea.com?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="./docs/static/img/sponsors/gitea-logo.webp" alt="Gitea" height="64">
|
||||
</a>
|
||||
<a href="https://prolocation.net?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="./docs/static/img/sponsors/prolocation-logo.svg" alt="Prolocation" height="64">
|
||||
</a>
|
||||
<a href="https://terminaltrove.com/?utm_campaign=github&utm_medium=referral&utm_content=anubis&utm_source=abgh">
|
||||
<img src="./docs/static/img/sponsors/terminal-trove.webp" alt="Terminal Trove" height="64">
|
||||
</a>
|
||||
@@ -58,6 +64,9 @@ Anubis is brought to you by sponsors and donors like:
|
||||
height="64"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://www.anexia.com/">
|
||||
<img src="./docs/static/img/sponsors/anexia-cloudsolutions-logo.webp" alt="ANEXIA Cloud Solutions" height="64">
|
||||
</a>
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add iplist2rule tool that lets admins turn an IP address blocklist into an Anubis ruleset.
|
||||
- Add Polish locale ([#1292](https://github.com/TecharoHQ/anubis/pull/1309))
|
||||
- Fix honeypot and imprint links missing `BASE_PREFIX` when deployed behind a path prefix ([#1402](https://github.com/TecharoHQ/anubis/issues/1402))
|
||||
- Add ANEXIA Sponsor logo to docs ([#1409](https://github.com/TecharoHQ/anubis/pull/1409))
|
||||
- Improve idle performance in memory storage
|
||||
- Add HAProxy Configurations to Docs ([#1424](https://github.com/TecharoHQ/anubis/pull/1424))
|
||||
|
||||
<!-- This changes the project to: -->
|
||||
|
||||
|
||||
99
docs/docs/admin/environments/haproxy.mdx
Normal file
99
docs/docs/admin/environments/haproxy.mdx
Normal file
@@ -0,0 +1,99 @@
|
||||
# HAProxy
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
|
||||
To use Anubis with HAProxy, you have two variants:
|
||||
- simple - stick Anubis between HAProxy and your application backend (simple)
|
||||
- perfect if you only have a single application in general
|
||||
- advanced - force Anubis challenge by default and route to the application backend by HAProxy if the challenge is correct
|
||||
- useful for complex setups
|
||||
- routing can be done in HAProxy
|
||||
- define ACLs in HAProxy for domains, paths etc which are required/excluded regarding Anubis
|
||||
- HAProxy 3.0 recommended
|
||||
|
||||
## Simple Variant
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: HAProxy with simple config
|
||||
---
|
||||
flowchart LR
|
||||
T(User Traffic)
|
||||
HAProxy(HAProxy Port 80/443)
|
||||
Anubis
|
||||
Application
|
||||
|
||||
T --> HAProxy
|
||||
HAProxy --> Anubis
|
||||
Anubis --> |Happy Traffic| Application
|
||||
```
|
||||
|
||||
Your Anubis env file configuration may look like this:
|
||||
|
||||
import simpleAnubis from "!!raw-loader!./haproxy/simple-config.env";
|
||||
|
||||
<CodeBlock language="bash">{simpleAnubis}</CodeBlock>
|
||||
|
||||
The important part is that `TARGET` points to your actual application and if Anubis and HAProxy are on the same machine, a UNIX socket can be used.
|
||||
|
||||
Your frontend and backend configuration of HAProxy may look like the following:
|
||||
|
||||
import simpleHAProxy from "!!raw-loader!./haproxy/simple-haproxy.cfg";
|
||||
|
||||
<CodeBlock language="bash">{simpleHAProxy}</CodeBlock>
|
||||
|
||||
This simply enables SSL offloading, sets some useful and required headers and routes to Anubis directly.
|
||||
|
||||
## Advanced Variant
|
||||
|
||||
Due to the fact that HAProxy can decode JWT, we are able to verify the Anubis token directly in HAProxy and route the traffic to the specific backends ourselves.
|
||||
|
||||
In this example are three applications behind one HAProxy frontend. Only App1 and App2 are secured via Anubis; App3 is open for everyone. The path `/excluded/path` can also be accessed by anyone.
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: HAProxy with advanced config
|
||||
---
|
||||
|
||||
flowchart LR
|
||||
T(User Traffic)
|
||||
HAProxy(HAProxy Port 80/443)
|
||||
B1(App1)
|
||||
B2(App2)
|
||||
B3(App3)
|
||||
Anubis
|
||||
|
||||
T --> HAProxy
|
||||
HAProxy --> |Traffic for App1 and App2 without valid challenge| Anubis
|
||||
HAProxy --> |app1.example.com | B1
|
||||
HAProxy --> |app2.example.com| B2
|
||||
HAProxy --> |app3.example.com| B3
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
For an improved JWT decoding performance, it's recommended to use HAProxy version 3.0 or above.
|
||||
|
||||
:::
|
||||
|
||||
Your Anubis env file configuration may look like this:
|
||||
|
||||
import advancedAnubis from "!!raw-loader!./haproxy/advanced-config.env";
|
||||
|
||||
<CodeBlock language="bash">{advancedAnubis}</CodeBlock>
|
||||
|
||||
It's important to use `HS512_SECRET` which HAProxy understands. Please replace `<SECRET-HERE>` with your own secret string (alphanumerical string with 128 characters recommended).
|
||||
|
||||
You can set Anubis to force a challenge for every request using the following policy file:
|
||||
|
||||
import advancedAnubisPolicy from "!!raw-loader!./haproxy/advanced-config-policy.yml";
|
||||
|
||||
<CodeBlock language="yaml">{advancedAnubisPolicy}</CodeBlock>
|
||||
|
||||
The HAProxy config file may look like this:
|
||||
|
||||
import advancedHAProxy from "!!raw-loader!./haproxy/advanced-haproxy.cfg";
|
||||
|
||||
<CodeBlock language="haproxy">{advancedHAProxy}</CodeBlock>
|
||||
|
||||
Please replace `<SECRET-HERE>` with the same secret from the Anubis config.
|
||||
@@ -0,0 +1,15 @@
|
||||
# /etc/anubis/challenge-any.yml
|
||||
|
||||
bots:
|
||||
- name: any
|
||||
action: CHALLENGE
|
||||
user_agent_regex: .*
|
||||
|
||||
status_codes:
|
||||
CHALLENGE: 403
|
||||
DENY: 403
|
||||
|
||||
thresholds: []
|
||||
|
||||
dnsbl: false
|
||||
|
||||
11
docs/docs/admin/environments/haproxy/advanced-config.env
Normal file
11
docs/docs/admin/environments/haproxy/advanced-config.env
Normal file
@@ -0,0 +1,11 @@
|
||||
# /etc/anubis/default.env
|
||||
|
||||
BIND=/run/anubis/default.sock
|
||||
BIND_NETWORK=unix
|
||||
DIFFICULTY=4
|
||||
METRICS_BIND=:9090
|
||||
# target is irrelevant here, backend routing happens in HAProxy
|
||||
TARGET=http://0.0.0.0
|
||||
HS512_SECRET=<SECRET-HERE>
|
||||
COOKIE_DYNAMIC_DOMAIN=True
|
||||
POLICY_FNAME=/etc/anubis/challenge-any.yml
|
||||
59
docs/docs/admin/environments/haproxy/advanced-haproxy.cfg
Normal file
59
docs/docs/admin/environments/haproxy/advanced-haproxy.cfg
Normal file
@@ -0,0 +1,59 @@
|
||||
# /etc/haproxy/haproxy.cfg
|
||||
|
||||
frontend FE-multiple-applications
|
||||
mode http
|
||||
bind :80
|
||||
# ssl offloading on port 443 using a certificate from /etc/haproxy/ssl/ directory
|
||||
bind :443 ssl crt /etc/haproxy/ssl/ alpn h2,http/1.1 ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
# set X-Real-IP header required for Anubis
|
||||
http-request set-header X-Real-IP "%[src]"
|
||||
|
||||
# redirect HTTP to HTTPS
|
||||
http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
# add HSTS header
|
||||
http-response set-header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
|
||||
# only force Anubis challenge for app1 and app2
|
||||
acl acl_anubis_required hdr(host) -i "app1.example.com"
|
||||
acl acl_anubis_required hdr(host) -i "app2.example.com"
|
||||
|
||||
# exclude Anubis for a specific path
|
||||
acl acl_anubis_ignore path /excluded/path
|
||||
|
||||
# use Anubis if auth cookie not found
|
||||
use_backend BE-anubis if acl_anubis_required !acl_anubis_ignore !{ req.cook(techaro.lol-anubis-auth) -m found }
|
||||
|
||||
# get payload of the JWT such as algorithm, expire time, restrictions
|
||||
http-request set-var(txn.anubis_jwt_alg) req.cook(techaro.lol-anubis-auth),jwt_header_query('$.alg') if acl_anubis_required !acl_anubis_ignore
|
||||
http-request set-var(txn.anubis_jwt_exp) cook(techaro.lol-anubis-auth),jwt_payload_query('$.exp','int') if acl_anubis_required !acl_anubis_ignore
|
||||
http-request set-var(txn.anubis_jwt_res) cook(techaro.lol-anubis-auth),jwt_payload_query('$.restriction') if acl_anubis_required !acl_anubis_ignore
|
||||
http-request set-var(txn.srcip) req.fhdr(X-Real-IP) if acl_anubis_required !acl_anubis_ignore
|
||||
http-request set-var(txn.now) date() if acl_anubis_required !acl_anubis_ignore
|
||||
|
||||
# use Anubis if JWT has wrong algorithm, is expired, restrictions don't match or isn't signed with the correct key
|
||||
use_backend BE-anubis if acl_anubis_required !acl_anubis_ignore !{ var(txn.anubis_jwt_alg) -m str HS512 }
|
||||
use_backend BE-anubis if acl_anubis_required !acl_anubis_ignore { var(txn.anubis_jwt_exp),sub(txn.now) -m int lt 0 }
|
||||
use_backend BE-anubis if acl_anubis_required !acl_anubis_ignore !{ var(txn.srcip),digest(sha256),hex,lower,strcmp(txn.anubis_jwt_res) eq 0 }
|
||||
use_backend BE-anubis if acl_anubis_required !acl_anubis_ignore !{ cook(techaro.lol-anubis-auth),jwt_verify(txn.anubis_jwt_alg,"<SECRET-HERE>") -m int 1 }
|
||||
|
||||
# custom routing in HAProxy
|
||||
use_backend BE-app1 if { hdr(host) -i "app1.example.com" }
|
||||
use_backend BE-app2 if { hdr(host) -i "app2.example.com" }
|
||||
use_backend BE-app3 if { hdr(host) -i "app3.example.com" }
|
||||
|
||||
backend BE-app1
|
||||
mode http
|
||||
server app1-server 127.0.0.1:3000
|
||||
|
||||
backend BE-app2
|
||||
mode http
|
||||
server app2-server 127.0.0.1:4000
|
||||
|
||||
backend BE-app3
|
||||
mode http
|
||||
server app3-server 127.0.0.1:5000
|
||||
|
||||
BE-anubis
|
||||
mode http
|
||||
server anubis /run/anubis/default.sock
|
||||
10
docs/docs/admin/environments/haproxy/simple-config.env
Normal file
10
docs/docs/admin/environments/haproxy/simple-config.env
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/anubis/default.env
|
||||
|
||||
BIND=/run/anubis/default.sock
|
||||
BIND_NETWORK=unix
|
||||
SOCKET_MODE=0666
|
||||
DIFFICULTY=4
|
||||
METRICS_BIND=:9090
|
||||
COOKIE_DYNAMIC_DOMAIN=true
|
||||
# address and port of the actual application
|
||||
TARGET=http://localhost:3000
|
||||
22
docs/docs/admin/environments/haproxy/simple-haproxy.cfg
Normal file
22
docs/docs/admin/environments/haproxy/simple-haproxy.cfg
Normal file
@@ -0,0 +1,22 @@
|
||||
# /etc/haproxy/haproxy.cfg
|
||||
|
||||
frontend FE-application
|
||||
mode http
|
||||
bind :80
|
||||
# ssl offloading on port 443 using a certificate from /etc/haproxy/ssl/ directory
|
||||
bind :443 ssl crt /etc/haproxy/ssl/ alpn h2,http/1.1 ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
# set X-Real-IP header required for Anubis
|
||||
http-request set-header X-Real-IP "%[src]"
|
||||
|
||||
# redirect HTTP to HTTPS
|
||||
http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
# add HSTS header
|
||||
http-response set-header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
|
||||
# route to Anubis backend by default
|
||||
default_backend BE-anubis-application
|
||||
|
||||
BE-anubis-application
|
||||
mode http
|
||||
server anubis /run/anubis/default.sock
|
||||
@@ -203,6 +203,7 @@ To get Anubis filtering your traffic, you need to make sure it's added to your H
|
||||
- [Kubernetes](./environments/kubernetes.mdx)
|
||||
- [Nginx](./environments/nginx.mdx)
|
||||
- [Traefik](./environments/traefik.mdx)
|
||||
- [HAProxy](./environments/haproxy.mdx)
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
@@ -143,3 +143,4 @@ For more details on particular reverse proxies, see here:
|
||||
|
||||
- [Apache](./environments/apache.mdx)
|
||||
- [Nginx](./environments/nginx.mdx)
|
||||
- [HAProxy](./environments/haproxy.mdx)
|
||||
|
||||
13
docs/docs/developer/ai-coding-policy.md
Normal file
13
docs/docs/developer/ai-coding-policy.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# AI Coding Policy
|
||||
|
||||
At some level it would be nice to be able to have the following AI coding policy from an ideological standpoint:
|
||||
|
||||
> Anubis does not accept code made primarily with the use of agentic AI tools such as Claude Code, Gemini CLI, GitHub Copilot, Zed, OpenCode, or any other similar tools. Please do not use them when contributing to this repo.
|
||||
|
||||
However, I'd be in violation by doing this because I have knowingly committed minor bits of code to the Anubis repo that were generated by AI tools (mostly things for smoke tests).
|
||||
|
||||
As such, Anubis is taking more of a centrist approach with regards to AI coding tools: regardless of what tool you use to make contributions to Anubis, when you sign off your code, you are taking responsibility for what you commit. You are also expected to understand what you are changing, what the implications are, and all other relevant factors.
|
||||
|
||||
If you use AI coding tools for a majority of your committed work, you MUST disclose it with [the `Assisted-by` footer](https://xeiaso.net/notes/2025/assisted-by-footer/). The Anubis maintainers will be using tooling that looks for these footers and will prioritize scrutiny and level of attention appropriately.
|
||||
|
||||
In order to ensure compliance with this policy, language has been placed in `AGENTS.md` and `CLAUDE.md` to entice AI coding tools to add these footers.
|
||||
@@ -38,6 +38,12 @@ Anubis is brought to you by sponsors and donors like:
|
||||
<a href="https://distrust.co?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="/img/sponsors/distrust-logo.webp" alt="Distrust" height="64" />
|
||||
</a>
|
||||
<a href="https://about.gitea.com?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="/img/sponsors/gitea-logo.webp" alt="Gitea" height="64" />
|
||||
</a>
|
||||
<a href="https://prolocation.net?utm_campaign=github&utm_medium=referral&utm_content=anubis">
|
||||
<img src="/img/sponsors/prolocation-logo.svg" alt="Prolocation" height="64" />
|
||||
</a>
|
||||
<a href="https://terminaltrove.com/?utm_campaign=github&utm_medium=referral&utm_content=anubis&utm_source=abgh">
|
||||
<img
|
||||
src="/img/sponsors/terminal-trove.webp"
|
||||
|
||||
BIN
docs/static/img/sponsors/anexia-cloudsolutions-logo.webp
vendored
Normal file
BIN
docs/static/img/sponsors/anexia-cloudsolutions-logo.webp
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/static/img/sponsors/gitea-logo.webp
vendored
Normal file
BIN
docs/static/img/sponsors/gitea-logo.webp
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
37
docs/static/img/sponsors/prolocation-logo.svg
vendored
Normal file
37
docs/static/img/sponsors/prolocation-logo.svg
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="250px" height="42px" viewBox="0 0.05 250 42" enable-background="new 0 0.05 250 42" xml:space="preserve">
|
||||
<g>
|
||||
<rect y="0.15" fill="#FFFFFF" width="42" height="42"/>
|
||||
<polygon fill="#FF0600" points="0,42.05 10.5,42.05 10.5,10.55 31.5,10.55 31.5,31.55 21,31.55 10.5,42.05 42,42.05 42,0.05
|
||||
0,0.05 "/>
|
||||
<path fill="#222222" d="M59.1,24.95h-2.2v9.6h-5.3V8.05h7.5c5.7,0,7.5,3.3,7.5,8.5C66.6,21.65,64.9,24.95,59.1,24.95z M59,12.75h-2
|
||||
v7.4h2c2.2,0,2.3-2,2.3-3.7C61.3,14.85,61.2,12.75,59,12.75z"/>
|
||||
<path fill="#222222" d="M80.1,34.55l-3.2-10.3h-1.8v10.3h-5.3V8.05h7.6c5.8,0,7.4,3,7.4,8.1c0,2.8-0.4,5.4-3,7l3.9,11.5h-5.6V34.55
|
||||
z M77.3,12.75h-2.2v6.7h2.2c2,0,2.1-1.8,2.1-3.4C79.4,14.55,79.3,12.75,77.3,12.75z"/>
|
||||
<path fill="#222222" d="M101.2,32.149c-1.2,1.5-2.9,2.7-5.8,2.7s-4.6-1.2-5.8-2.7c-1.9-2.3-2-5.8-2-10.899c0-5.1,0.1-8.6,2-10.9
|
||||
c1.2-1.5,2.9-2.7,5.8-2.7s4.6,1.2,5.8,2.7c1.9,2.3,2,5.8,2,10.9C103.2,26.35,103.1,29.85,101.2,32.149z M97.2,13.55
|
||||
c-0.3-0.6-0.8-1-1.8-1s-1.5,0.4-1.8,1c-0.6,1.2-0.7,4.5-0.7,7.7c0,3.2,0.1,6.5,0.7,7.8c0.3,0.6,0.8,1,1.8,1s1.5-0.4,1.8-1
|
||||
c0.6-1.2,0.7-4.5,0.7-7.8C97.9,18.05,97.8,14.75,97.2,13.55z"/>
|
||||
<path fill="#222222" d="M106.5,34.55V8.05h5.3v21.8h6.9v4.8h-12.2V34.55z"/>
|
||||
<path fill="#222222" d="M133.7,32.149c-1.2,1.5-2.9,2.7-5.8,2.7c-2.9,0-4.601-1.2-5.8-2.7c-1.9-2.3-2-5.8-2-10.899
|
||||
c0-5.1,0.1-8.6,2-10.9c1.2-1.5,2.9-2.7,5.8-2.7c2.899,0,4.6,1.2,5.8,2.7c1.899,2.3,2,5.8,2,10.9
|
||||
C135.7,26.35,135.6,29.85,133.7,32.149z M129.7,13.55c-0.3-0.6-0.8-1-1.8-1s-1.5,0.4-1.801,1c-0.6,1.2-0.7,4.5-0.7,7.7
|
||||
c0,3.2,0.1,6.5,0.7,7.8c0.301,0.6,0.801,1,1.801,1s1.5-0.4,1.8-1c0.6-1.2,0.7-4.5,0.7-7.8C130.4,18.05,130.3,14.75,129.7,13.55z"/>
|
||||
<path fill="#222222" d="M151.3,32.95c-1.3,1.3-2.899,1.899-5.1,1.899c-2.9,0-4.601-1.2-5.8-2.7c-1.9-2.3-2-5.8-2-10.899
|
||||
c0-5.1,0.1-8.6,2-10.9c1.199-1.5,2.899-2.7,5.8-2.7c2.2,0,3.8,0.6,5.1,1.9c1.4,1.3,2.3,3.4,2.4,5.9h-5.3c0-0.7-0.101-1.5-0.4-2
|
||||
c-0.3-0.6-0.8-1-1.8-1s-1.5,0.4-1.8,1c-0.601,1.2-0.7,4.5-0.7,7.7c0,3.2,0.1,6.5,0.7,7.8c0.3,0.6,0.8,1,1.8,1s1.5-0.4,1.8-1
|
||||
c0.3-0.601,0.4-1.301,0.4-2.101h5.3C153.6,29.55,152.7,31.649,151.3,32.95z"/>
|
||||
<path fill="#222222" d="M167.8,34.55l-0.899-4.1H160.8l-0.899,4.1h-5.5l6.899-26.5h5.2l6.8,26.5H167.8z M163.9,15.85l-2,9.8h4.1
|
||||
L163.9,15.85z"/>
|
||||
<path fill="#222222" d="M182.2,12.75v21.8h-5.3v-21.8h-4.5v-4.7H186.6v4.8H182.2V12.75z"/>
|
||||
<path fill="#222222" d="M189.5,34.55V8.05h5.3v26.5H189.5z"/>
|
||||
<path fill="#222222" d="M211.7,32.149c-1.2,1.5-2.9,2.7-5.8,2.7c-2.9,0-4.601-1.2-5.801-2.7c-1.899-2.3-2-5.8-2-10.899
|
||||
c0-5.1,0.101-8.6,2-10.9c1.2-1.5,2.9-2.7,5.801-2.7c2.899,0,4.6,1.2,5.8,2.7c1.899,2.3,2,5.8,2,10.9
|
||||
C213.7,26.35,213.5,29.85,211.7,32.149z M207.6,13.55c-0.3-0.6-0.8-1-1.8-1s-1.5,0.4-1.8,1c-0.6,1.2-0.7,4.5-0.7,7.7
|
||||
c0,3.2,0.101,6.5,0.7,7.8c0.3,0.6,0.8,1,1.8,1s1.5-0.4,1.8-1c0.601-1.2,0.7-4.5,0.7-7.8C208.3,18.05,208.3,14.75,207.6,13.55z"/>
|
||||
<path fill="#222222" d="M227.9,34.55l-5.601-13v13H217V8.05h4.6l5.5,13v-13h5.301v26.5H227.9z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
224
package-lock.json
generated
224
package-lock.json
generated
@@ -10,7 +10,7 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"preact": "^10.28.2"
|
||||
"preact": "^10.28.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^20.4.1",
|
||||
@@ -18,7 +18,7 @@
|
||||
"baseline-browser-mapping": "^2.9.19",
|
||||
"cssnano": "^7.1.2",
|
||||
"cssnano-preset-advanced": "^7.0.10",
|
||||
"esbuild": "^0.27.2",
|
||||
"esbuild": "^0.27.3",
|
||||
"husky": "^9.1.7",
|
||||
"playwright": "^1.52.0",
|
||||
"postcss-cli": "^11.0.1",
|
||||
@@ -361,9 +361,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz",
|
||||
"integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
|
||||
"integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -378,9 +378,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz",
|
||||
"integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
|
||||
"integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -395,9 +395,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -412,9 +412,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -429,9 +429,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -446,9 +446,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -463,9 +463,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -480,9 +480,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -497,9 +497,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz",
|
||||
"integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
|
||||
"integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -514,9 +514,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -531,9 +531,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz",
|
||||
"integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
|
||||
"integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -548,9 +548,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz",
|
||||
"integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
|
||||
"integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -565,9 +565,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz",
|
||||
"integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
|
||||
"integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
@@ -582,9 +582,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz",
|
||||
"integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
|
||||
"integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -599,9 +599,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz",
|
||||
"integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
|
||||
"integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -616,9 +616,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz",
|
||||
"integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
|
||||
"integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -633,9 +633,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -650,9 +650,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -667,9 +667,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -684,9 +684,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -701,9 +701,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -718,9 +718,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -735,9 +735,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -752,9 +752,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz",
|
||||
"integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
|
||||
"integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -769,9 +769,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz",
|
||||
"integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
|
||||
"integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -786,9 +786,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz",
|
||||
"integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
|
||||
"integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1650,9 +1650,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
|
||||
"integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==",
|
||||
"version": "0.27.3",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
|
||||
"integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
@@ -1663,32 +1663,32 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.27.2",
|
||||
"@esbuild/android-arm": "0.27.2",
|
||||
"@esbuild/android-arm64": "0.27.2",
|
||||
"@esbuild/android-x64": "0.27.2",
|
||||
"@esbuild/darwin-arm64": "0.27.2",
|
||||
"@esbuild/darwin-x64": "0.27.2",
|
||||
"@esbuild/freebsd-arm64": "0.27.2",
|
||||
"@esbuild/freebsd-x64": "0.27.2",
|
||||
"@esbuild/linux-arm": "0.27.2",
|
||||
"@esbuild/linux-arm64": "0.27.2",
|
||||
"@esbuild/linux-ia32": "0.27.2",
|
||||
"@esbuild/linux-loong64": "0.27.2",
|
||||
"@esbuild/linux-mips64el": "0.27.2",
|
||||
"@esbuild/linux-ppc64": "0.27.2",
|
||||
"@esbuild/linux-riscv64": "0.27.2",
|
||||
"@esbuild/linux-s390x": "0.27.2",
|
||||
"@esbuild/linux-x64": "0.27.2",
|
||||
"@esbuild/netbsd-arm64": "0.27.2",
|
||||
"@esbuild/netbsd-x64": "0.27.2",
|
||||
"@esbuild/openbsd-arm64": "0.27.2",
|
||||
"@esbuild/openbsd-x64": "0.27.2",
|
||||
"@esbuild/openharmony-arm64": "0.27.2",
|
||||
"@esbuild/sunos-x64": "0.27.2",
|
||||
"@esbuild/win32-arm64": "0.27.2",
|
||||
"@esbuild/win32-ia32": "0.27.2",
|
||||
"@esbuild/win32-x64": "0.27.2"
|
||||
"@esbuild/aix-ppc64": "0.27.3",
|
||||
"@esbuild/android-arm": "0.27.3",
|
||||
"@esbuild/android-arm64": "0.27.3",
|
||||
"@esbuild/android-x64": "0.27.3",
|
||||
"@esbuild/darwin-arm64": "0.27.3",
|
||||
"@esbuild/darwin-x64": "0.27.3",
|
||||
"@esbuild/freebsd-arm64": "0.27.3",
|
||||
"@esbuild/freebsd-x64": "0.27.3",
|
||||
"@esbuild/linux-arm": "0.27.3",
|
||||
"@esbuild/linux-arm64": "0.27.3",
|
||||
"@esbuild/linux-ia32": "0.27.3",
|
||||
"@esbuild/linux-loong64": "0.27.3",
|
||||
"@esbuild/linux-mips64el": "0.27.3",
|
||||
"@esbuild/linux-ppc64": "0.27.3",
|
||||
"@esbuild/linux-riscv64": "0.27.3",
|
||||
"@esbuild/linux-s390x": "0.27.3",
|
||||
"@esbuild/linux-x64": "0.27.3",
|
||||
"@esbuild/netbsd-arm64": "0.27.3",
|
||||
"@esbuild/netbsd-x64": "0.27.3",
|
||||
"@esbuild/openbsd-arm64": "0.27.3",
|
||||
"@esbuild/openbsd-x64": "0.27.3",
|
||||
"@esbuild/openharmony-arm64": "0.27.3",
|
||||
"@esbuild/sunos-x64": "0.27.3",
|
||||
"@esbuild/win32-arm64": "0.27.3",
|
||||
"@esbuild/win32-ia32": "0.27.3",
|
||||
"@esbuild/win32-x64": "0.27.3"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
@@ -3147,9 +3147,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/preact": {
|
||||
"version": "10.28.2",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.2.tgz",
|
||||
"integrity": "sha512-lbteaWGzGHdlIuiJ0l2Jq454m6kcpI1zNje6d8MlGAFlYvP2GO4ibnat7P74Esfz4sPTdM6UxtTwh/d3pwM9JA==",
|
||||
"version": "10.28.3",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.3.tgz",
|
||||
"integrity": "sha512-tCmoRkPQLpBeWzpmbhryairGnhW9tKV6c6gr/w+RhoRoKEJwsjzipwp//1oCpGPOchvSLaAPlpcJi9MwMmoPyA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"baseline-browser-mapping": "^2.9.19",
|
||||
"cssnano": "^7.1.2",
|
||||
"cssnano-preset-advanced": "^7.0.10",
|
||||
"esbuild": "^0.27.2",
|
||||
"esbuild": "^0.27.3",
|
||||
"husky": "^9.1.7",
|
||||
"playwright": "^1.52.0",
|
||||
"postcss-cli": "^11.0.1",
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"preact": "^10.28.2"
|
||||
"preact": "^10.28.3"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
|
||||
11
test/haproxy-simple/anubis.env
Normal file
11
test/haproxy-simple/anubis.env
Normal file
@@ -0,0 +1,11 @@
|
||||
# /etc/anubis/default.env
|
||||
|
||||
BIND=/shared/anubis.sock
|
||||
BIND_NETWORK=unix
|
||||
SOCKET_MODE=0666
|
||||
DIFFICULTY=4
|
||||
METRICS_BIND=:9090
|
||||
COOKIE_DYNAMIC_DOMAIN=true
|
||||
# address and port of the actual application (httpdebug container)
|
||||
TARGET=http://httpdebug:3000
|
||||
POLICY_FNAME=/cfg/anubis.yaml
|
||||
11
test/haproxy-simple/conf/anubis/anubis.yaml
Normal file
11
test/haproxy-simple/conf/anubis/anubis.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
bots:
|
||||
- name: mozilla
|
||||
user_agent_regex: Mozilla
|
||||
action: CHALLENGE
|
||||
challenge:
|
||||
difficulty: 2
|
||||
algorithm: fast
|
||||
|
||||
status_codes:
|
||||
CHALLENGE: 401
|
||||
DENY: 403
|
||||
27
test/haproxy-simple/conf/haproxy/haproxy.cfg
Normal file
27
test/haproxy-simple/conf/haproxy/haproxy.cfg
Normal file
@@ -0,0 +1,27 @@
|
||||
# /etc/haproxy/haproxy.cfg
|
||||
|
||||
frontend FE-application
|
||||
mode http
|
||||
timeout client 5s
|
||||
timeout connect 5s
|
||||
timeout server 5s
|
||||
bind :80
|
||||
# ssl offloading on port 8443 using a certificate from /etc/haproxy/ssl/
|
||||
bind :8443 ssl crt /etc/techaro/pki/haproxy-simple.test.pem alpn h2,http/1.1 ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
# set X-Real-IP header required for Anubis
|
||||
http-request set-header X-Real-IP "%[src]"
|
||||
|
||||
# redirect HTTP to HTTPS
|
||||
http-request redirect scheme https code 301 unless { ssl_fc }
|
||||
# add HSTS header
|
||||
http-response set-header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
|
||||
# route to Anubis backend by default
|
||||
default_backend BE-anubis-application
|
||||
|
||||
backend BE-anubis-application
|
||||
mode http
|
||||
timeout connect 5s
|
||||
timeout server 5s
|
||||
server anubis /shared/anubis.sock
|
||||
27
test/haproxy-simple/docker-compose.yaml
Normal file
27
test/haproxy-simple/docker-compose.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
services:
|
||||
haproxy:
|
||||
image: haproxytech/haproxy-alpine:3.0
|
||||
ports:
|
||||
- 80:80
|
||||
- 8443:8443
|
||||
volumes:
|
||||
- ./conf/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
|
||||
- ./pki:/etc/techaro/pki:ro
|
||||
- anubis-socket:/shared
|
||||
|
||||
anubis:
|
||||
image: ghcr.io/techarohq/anubis:main
|
||||
env_file: ./anubis.env
|
||||
user: root
|
||||
volumes:
|
||||
- anubis-socket:/shared
|
||||
- ./conf/anubis:/cfg:ro
|
||||
depends_on:
|
||||
- httpdebug
|
||||
|
||||
httpdebug:
|
||||
image: ghcr.io/xe/x/httpdebug
|
||||
pull_policy: always
|
||||
|
||||
volumes:
|
||||
anubis-socket:
|
||||
39
test/haproxy-simple/test.mjs
Normal file
39
test/haproxy-simple/test.mjs
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
async function main() {
|
||||
console.log("Starting HAProxy simple smoke test...");
|
||||
|
||||
console.log("trying to hit backend through haproxy");
|
||||
let resp = await fetch(
|
||||
"https://localhost:8443",
|
||||
{
|
||||
headers: {
|
||||
"User-Agent": "Anubis testing",
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (resp.status !== 200) {
|
||||
throw new Error(`Expected 200, got ${resp.status}`);
|
||||
}
|
||||
console.log("Got 200 as expected");
|
||||
|
||||
console.log("trying to get stopped by anubis");
|
||||
resp = await fetch(
|
||||
"https://localhost:8443",
|
||||
{
|
||||
headers: {
|
||||
"User-Agent": "Mozilla/5.0",
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (resp.status !== 401) {
|
||||
throw new Error(`Expected 401, got ${resp.status}`);
|
||||
}
|
||||
console.log("Got 401 as expected");
|
||||
|
||||
console.log("All runtime tests passed successfully!");
|
||||
}
|
||||
|
||||
await main();
|
||||
31
test/haproxy-simple/test.sh
Executable file
31
test/haproxy-simple/test.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ../lib/lib.sh
|
||||
|
||||
export KO_DOCKER_REPO=ko.local
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Step 1: Config validation
|
||||
mint_cert haproxy-simple.test
|
||||
|
||||
# Combine cert and key for HAProxy SSL directory format
|
||||
cat pki/haproxy-simple.test/cert.pem pki/haproxy-simple.test/key.pem >pki/haproxy-simple.test/haproxy.pem
|
||||
|
||||
docker run --rm \
|
||||
-v $PWD/conf/haproxy:/usr/local/etc/haproxy:ro \
|
||||
-v $PWD/pki:/etc/techaro/pki:ro \
|
||||
haproxytech/haproxy-alpine:3.0 \
|
||||
haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
|
||||
|
||||
# Step 2: Runtime testing
|
||||
echo "Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
sleep 5
|
||||
|
||||
echo "Services are healthy. Starting runtime tests..."
|
||||
export NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||
node test.mjs
|
||||
|
||||
# Cleanup happens automatically via trap in lib.sh
|
||||
Reference in New Issue
Block a user