Author SHA1 Message Date
klaatu aa4afea341 chore(gitea/anubis): remove anubis-secret from kustomization
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2026-05-21 06:05:54 +00:00
klaatu b12731a100 chore(gitea/anubis): remove anubis-secret.yaml, no manual secret needed
buildbot/nix-eval Build done.
2026-05-21 06:05:42 +00:00
klaatu ce2c9c76a7 chore(gitea/anubis): remove ED25519 secret env var, Anubis auto-generates key
buildbot/nix-eval Build done.
2026-05-21 06:05:34 +00:00
root dc083ddf1a feat(gitea): add Anubis anti-crawler sidecar
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
Anubis (https://anubis.techaro.lol) is a lightweight proof-of-work
challenge that protects web services from AI crawlers and scrapers.

Changes:
- Add Anubis as an extraContainers sidecar in the Gitea HelmRelease
  - Listens on :8080, proxies to Gitea at http://localhost:3000
  - DIFFICULTY=4 (default; tune up to increase challenge strength)
  - SERVE_ROBOTS_TXT=true (Anubis manages robots.txt)
  - OG_PASSTHROUGH=true (OpenGraph bots pass through for link previews)
  - Signs challenges with ED25519 key from 'anubis-key' secret
- Add anubis port (8080) to Gitea service via additionalPorts
- Update Ingress to route to the 'anubis' port instead of 'http'
- Add anubis-secret.yaml placeholder with creation instructions

One-time setup required before applying:
  kubectl create secret generic anubis-key \
    --namespace gitea \
    --from-literal=ED25519_PRIVATE_KEY_HEX=$(openssl rand -hex 32)
2026-05-20 03:34:42 -05:00
9 changed files with 103 additions and 128 deletions
Generated
+30 -30
View File
@@ -239,11 +239,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779507042, "lastModified": 1779125151,
"narHash": "sha256-7wOwi8B6D0BYsieZCnHZZj2sNUzgJhLoIVSfkwB7lxQ=", "narHash": "sha256-bPHT0oJAHe5a43lkkSGAiCEg/RBqpwv5xsFrcj+Bog8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "509ed3c603349a9d43de9e2ae6613baea6bd5b34", "rev": "fab3fd7327a0ac7a1fae5095bf140377704fac7f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -281,11 +281,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1779508581, "lastModified": 1778039471,
"narHash": "sha256-qZjcS4jRe0pUv4ZAFCyr7ELFrb3LPLr+5u8LHRZjMVQ=", "narHash": "sha256-Arjg44jFcpSqOKK05EIxbKIjhfjou/EGF12COFU+9QA=",
"owner": "Infinidoge", "owner": "Infinidoge",
"repo": "nix-minecraft", "repo": "nix-minecraft",
"rev": "e13397b445bb0dcb390f90126914113ec5dd5afe", "rev": "87611ef4788116de05f851920c5958f0c37d5b05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -300,11 +300,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1779223902, "lastModified": 1778839878,
"narHash": "sha256-qQogttCU2zOyK7MN85yPaUxxN2u0BN9zabfO4X7FwNg=", "narHash": "sha256-S2nSP6YWUz8I2uRZuAY93FoAAUa9TiZetLzjBv1n5vk=",
"owner": "Mic92", "owner": "Mic92",
"repo": "niks3", "repo": "niks3",
"rev": "1db826ca990cb3dead5c033bcfba4bf68ce9fc05", "rev": "c29f3641de064545d75f00318cd45bea2b4ea1d0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -336,11 +336,11 @@
}, },
"nix-hardware": { "nix-hardware": {
"locked": { "locked": {
"lastModified": 1779258371, "lastModified": 1779099457,
"narHash": "sha256-j1iZsLy6oFApqR1oiDmHhvkwxXqcNi0aoSJj643LuwU=", "narHash": "sha256-u73aVD/lUmmT3JV+kPDztl7zPwQKd0eobD1AbJltaGs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "c97bc4d15bd3473dd095e8e8ba57330ab1943a77", "rev": "8792fab9d4a6454a9201675f01326f827ce35ead",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -413,11 +413,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1779142197, "lastModified": 1778491576,
"narHash": "sha256-Fypu3KtYQ+ZXL91CZIGqS3ZKwrMH6GOSPCtJ07W3ecU=", "narHash": "sha256-9YOHDS9ANGbRmf3DSQ9UCvas3CyYNIBwBkKGQZTLXGY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d4d6b67b138722feb847a75760a430943c33f4ef", "rev": "1174f92bf37f1a5914be77e1b44482d6fbc75ecc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -429,11 +429,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1779508470, "lastModified": 1778869304,
"narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "29916453413845e54a65b8a1cf996842300cd299", "rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -461,11 +461,11 @@
}, },
"nixunstable": { "nixunstable": {
"locked": { "locked": {
"lastModified": 1779508470, "lastModified": 1778869304,
"narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "29916453413845e54a65b8a1cf996842300cd299", "rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -484,11 +484,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1779554657, "lastModified": 1779116047,
"narHash": "sha256-qjLcUp7DBpmSUL+nVjLymp2nEvAzeKKoAVDCRgZYxFk=", "narHash": "sha256-2BnXm4/BvR5B0CH8nxC4CL+y+Z7woqPbPxKO7IMH85U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "1a380f12453ba97ad8cc9c60f223afb1cb8bace8", "rev": "1367315826ebda2bebbf896029f44ac05df523f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -504,11 +504,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1779579389, "lastModified": 1779124721,
"narHash": "sha256-YbWzWejE/QRBLQN9VKBL66byuTFPvncQgiv4NC25lN4=", "narHash": "sha256-Z1q8QkuHAdkmXh4SItOzViVVFVLb+tzaEaYCTHI2UKk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "65439f69b3bcf6b26b8a7c92c26bd09066fdf9c5", "rev": "ad57d8faf36bb02c65c90012cd0289daa0b2d9c4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -644,11 +644,11 @@
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1779507994, "lastModified": 1779077424,
"narHash": "sha256-vw/u69n4vPibpWNUVkbwlfVHQukg3xcuKoHwCXJkOvc=", "narHash": "sha256-2nuxPFMR1R3IlV/OlF65qjs2gGjHhASa7U0+8QX0bJg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "375f9dc68aa90ccff57891af5dfe1d5fb2a9b20a", "rev": "b7bde1772cdb20e77381516fbbb5306a621d0965",
"type": "github" "type": "github"
}, },
"original": { "original": {
+26 -24
View File
@@ -13,23 +13,25 @@
includes = [ "config.local" ]; includes = [ "config.local" ];
enableDefaultConfig = false; enableDefaultConfig = false;
settings = matchBlocks =
let let
nas = { nas = {
User = "admin"; user = "admin";
}; };
owned = { owned = {
User = "greg"; user = "greg";
}; };
in in
{ {
inherit nas; inherit nas;
"*" = { "*" = {
DynamicForward = [ "10240" ]; dynamicForwards = [ { port = 10240; } ];
ServerAliveInterval = 60; serverAliveInterval = 60;
LogLevel = "error"; extraOptions = {
SetEnv = { TERM = "xterm-256color"; }; LogLevel = "error";
SetEnv = "TERM=xterm-256color";
};
}; };
"10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas; "10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas;
@@ -39,46 +41,46 @@
"chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas; "chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas;
gh = { gh = {
User = "git"; user = "git";
Hostname = "github.com"; hostname = "github.com";
}; };
"src" = { "src" = {
User = "git"; user = "git";
Hostname = "jeremiah.shire-zebra.ts.net"; hostname = "jeremiah.shire-zebra.ts.net";
Port = 32222; port = 32222;
}; };
srcpub = { srcpub = {
User = "git"; user = "git";
Hostname = "src.thehellings.com"; hostname = "src.thehellings.com";
Port = 2222; port = 2222;
}; };
ivr = { ivr = {
User = "git"; user = "git";
Hostname = "gitlab.com"; hostname = "gitlab.com";
}; };
"ivr.thehellings.lan" = lib.hm.dag.entryBefore [ "ivr" ] { "ivr.thehellings.lan" = lib.hm.dag.entryBefore [ "ivr" ] {
User = "gregory.hellings"; user = "gregory.hellings";
}; };
"*.thehellings.lan" = owned; "*.thehellings.lan" = owned;
"10.42.*" = owned; "10.42.*" = owned;
"host.crosswire.org crosswire" = { "host.crosswire.org crosswire" = {
Hostname = "host.crosswire.org"; hostname = "host.crosswire.org";
User = "ghellings"; user = "ghellings";
}; };
fedpeople = { fedpeople = {
Hostname = "fedorapeople.org"; hostname = "fedorapeople.org";
User = "greghellings"; user = "greghellings";
}; };
"src.fedoraproject.org pkgs.fedoraproject.org" = { "src.fedoraproject.org pkgs.fedoraproject.org" = {
User = "greghellings"; user = "greghellings";
}; };
"127.*" = { "127.*".extraOptions = {
PubkeyAcceptedAlgorithms = "+ssh-rsa"; PubkeyAcceptedAlgorithms = "+ssh-rsa";
HostkeyAlgorithms = "+ssh-rsa"; HostkeyAlgorithms = "+ssh-rsa";
}; };
+1 -2
View File
@@ -22,7 +22,6 @@ let
#"1.0.0.1" # Cloudflare #"1.0.0.1" # Cloudflare
#"149.112.112.112" # Quad 9 #"149.112.112.112" # Quad 9
metadata.infra.gw # Currently using our UniFi router for DNS as well metadata.infra.gw # Currently using our UniFi router for DNS as well
"100.100.100.100"
]; ];
in in
{ {
@@ -133,7 +132,7 @@ in
file = makeZoneFile (lib'.hostsByNet net metadata.hosts) domain; file = makeZoneFile (lib'.hostsByNet net metadata.hosts) domain;
}) })
{ {
#"shire-zebra.ts.net" = "tailscale"; "shire-zebra.ts.net" = "tailscale";
"nebula.thehellings.com" = "nebula"; "nebula.thehellings.com" = "nebula";
nebula = "nebula"; nebula = "nebula";
"thehellings.lan" = "lan"; "thehellings.lan" = "lan";
+2 -2
View File
@@ -142,12 +142,12 @@ in
updateOutputs = false; updateOutputs = false;
}; };
}; };
domain = "${config.networking.hostName}.shire-zebra.ts.net:8010"; domain = "${config.networking.hostName}.shire-zebra.ts.net";
evalMaxMemorySize = 8192; evalMaxMemorySize = 8192;
evalWorkerCount = 4; evalWorkerCount = 4;
gitea = { gitea = {
enable = true; enable = true;
instanceUrl = "https://gitea.shire-zebra.ts.net"; instanceUrl = "https://src.thehellings.com";
oauthId = "7ec9107d-379b-47c8-870f-1191956d0500"; oauthId = "7ec9107d-379b-47c8-870f-1191956d0500";
oauthSecretFile = config.age.secrets.gitea-oauthSecret.path; oauthSecretFile = config.age.secrets.gitea-oauthSecret.path;
tokenFile = config.age.secrets.gitea-oauthToken.path; tokenFile = config.age.secrets.gitea-oauthToken.path;
+27 -53
View File
@@ -1,4 +1,4 @@
{ config, ... }: { ... }:
let let
srcDomain = "src.thehellings.com"; srcDomain = "src.thehellings.com";
@@ -6,23 +6,15 @@ let
in in
{ {
greg.proxies."${srcDomain}" = { greg.proxies."${srcDomain}" = {
target = "http://unix:${config.services.anubis.instances.git.settings.BIND}"; target = "https://gitea.shire-zebra.ts.net";
ssl = true; ssl = true;
genAliases = false; genAliases = false;
extraConfig = '' extraConfig = ''
#proxy_ssl_verify off; proxy_ssl_verify off;
#proxy_ssl_server_name on; proxy_ssl_server_name on;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Http-Version $server_protocol;
proxy_set_header User-Agent $http_user_agent;
client_max_body_size 100000m; client_max_body_size 100000m;
#proxy_set_header Host $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header X-Forwarded-Ssl on;
# Ultimate AI Block List v1.7 20250924 # Ultimate AI Block List v1.7 20250924
# https://perishablepress.com/ultimate-ai-block-list/ # https://perishablepress.com/ultimate-ai-block-list/
@@ -95,44 +87,6 @@ in
networking.firewall.allowedTCPPorts = [ sshPort ]; networking.firewall.allowedTCPPorts = [ sshPort ];
services = {
anubis = {
instances = {
git = {
enable = true;
settings = {
BIND = "/run/anubis/anubis-git/anubis.sock";
COOKIE_DOMAIN = "thehellings.com";
SERVE_ROBOTS_TXT = true;
TARGET = "https://gitea.shire-zebra.ts.net/";
};
};
};
};
haproxy = {
enable = true;
config = ''
global
daemon
maxconn 20
defaults
timeout connect 500s
timeout client 500s
timeout server 1h
listen gitsshd
bind *:${toString sshPort}
timeout client 1h
mode tcp
server git-isaiah isaiah.shire-zebra.ts.net:32222
server git-jeremiah jeremiah.shire-zebra.ts.net:32222
server git-zeke zeke.shire-zebra.ts.net:32222
'';
};
};
systemd.services = { systemd.services = {
haproxy = { haproxy = {
after = [ after = [
@@ -144,5 +98,25 @@ in
}; };
}; };
users.users.nginx.extraGroups = [ config.users.groups.anubis.name ]; services.haproxy = {
enable = true;
config = ''
global
daemon
maxconn 20
defaults
timeout connect 500s
timeout client 500s
timeout server 1h
listen gitsshd
bind *:${toString sshPort}
timeout client 1h
mode tcp
server git-isaiah isaiah.shire-zebra.ts.net:32222
server git-jeremiah jeremiah.shire-zebra.ts.net:32222
server git-zeke zeke.shire-zebra.ts.net:32222
'';
};
} }
+12 -13
View File
@@ -47,6 +47,12 @@ spec:
type: LoadBalancer type: LoadBalancer
port: 32222 port: 32222
nodePort: 32222 nodePort: 32222
# Anubis sidecar port — ingress routes here; Anubis proxies to :3000
additionalPorts:
- name: anubis
port: 8080
targetPort: 8080
protocol: TCP
gitea: gitea:
admin: admin:
@@ -66,8 +72,8 @@ spec:
APP_NAME: "Gitea: Greg's Cup of Git" APP_NAME: "Gitea: Greg's Cup of Git"
RUN_MODE: dev RUN_MODE: dev
server: server:
DOMAIN: "shire-zebra.ts.net" DOMAIN: "thehellings.com"
ROOT_URL: "https://gitea.shire-zebra.ts.net" ROOT_URL: "https://src.thehellings.com"
SSH_PORT: "2222" SSH_PORT: "2222"
database: database:
DB_TYPE: postgres DB_TYPE: postgres
@@ -133,16 +139,14 @@ spec:
value: "4" value: "4"
- name: METRICS_BIND - name: METRICS_BIND
value: ":9090" value: ":9090"
- name: POLICY_FNAME
value: "/etc/anubis/policy.yaml"
- name: SERVE_ROBOTS_TXT - name: SERVE_ROBOTS_TXT
value: "true" value: "true"
- name: TARGET - name: TARGET
value: "http://localhost:3000" value: "http://localhost:3000"
volumeMounts: - name: OG_PASSTHROUGH
- name: anubis-policy value: "true"
mountPath: /etc/anubis - name: OG_EXPIRY_TIME
readOnly: true value: "24h"
resources: resources:
limits: limits:
cpu: "750m" cpu: "750m"
@@ -161,11 +165,6 @@ spec:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
extraVolumes:
- name: anubis-policy
configMap:
name: anubis-policy
strategy: strategy:
type: RollingUpdate type: RollingUpdate
rollingUpdate: rollingUpdate:
+2 -1
View File
@@ -8,7 +8,8 @@ spec:
service: service:
name: gitea-release-http name: gitea-release-http
port: port:
name: http # Route through Anubis anti-crawler sidecar instead of directly to Gitea
name: anubis
tls: tls:
- hosts: - hosts:
- gitea - gitea
+2 -2
View File
@@ -15,8 +15,8 @@ spec:
storage: |- storage: |-
MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }} MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }}
MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }} MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }}
#minio_key: "{{ .minio_nas1_key }}" minio_key: "{{ .minio_nas1_key }}"
#minio_secret: "{{ .minio_nas1_secret }}" minio_secret: "{{ .minio_nas1_secret }}"
secretStoreRef: secretStoreRef:
name: bitwarden-login name: bitwarden-login
kind: ClusterSecretStore kind: ClusterSecretStore
+1 -1
View File
@@ -14,7 +14,7 @@
"pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS", "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS",
"external": true, "external": true,
"ts": "100.119.228.115", "ts": "100.119.228.115",
"aliases": ["s3"] "aliases": [ "s3" ]
}, },
"exodus": { "exodus": {
"ip": null, "ip": null,