Author SHA1 Message Date
rootandGreg Hellings e6217401f9 feat(gitea): add Anubis anti-crawler proxy
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Anubis (https://anubis.techaro.lol) is a lightweight proof-of-work
challenge that protects web services from AI crawlers and scrapers.
2026-05-24 21:25:50 -05:00
Greg Hellings d97fb37f0e chore: update SSH config for home-manager updates
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Update flake.lock / update-flake-lock (push) Successful in 1m46s
Update manifest chart versions / update-manifests (push) Successful in 29s
2026-05-21 13:19:26 -05:00
5 changed files with 91 additions and 67 deletions
+24 -26
View File
@@ -13,25 +13,23 @@
includes = [ "config.local" ]; includes = [ "config.local" ];
enableDefaultConfig = false; enableDefaultConfig = false;
matchBlocks = settings =
let let
nas = { nas = {
user = "admin"; User = "admin";
}; };
owned = { owned = {
user = "greg"; User = "greg";
}; };
in in
{ {
inherit nas; inherit nas;
"*" = { "*" = {
dynamicForwards = [ { port = 10240; } ]; DynamicForward = [ "10240" ];
serverAliveInterval = 60; ServerAliveInterval = 60;
extraOptions = { LogLevel = "error";
LogLevel = "error"; SetEnv = { TERM = "xterm-256color"; };
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;
@@ -41,46 +39,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.*".extraOptions = { "127.*" = {
PubkeyAcceptedAlgorithms = "+ssh-rsa"; PubkeyAcceptedAlgorithms = "+ssh-rsa";
HostkeyAlgorithms = "+ssh-rsa"; HostkeyAlgorithms = "+ssh-rsa";
}; };
+53 -27
View File
@@ -1,4 +1,4 @@
{ ... }: { config, ... }:
let let
srcDomain = "src.thehellings.com"; srcDomain = "src.thehellings.com";
@@ -6,15 +6,23 @@ let
in in
{ {
greg.proxies."${srcDomain}" = { greg.proxies."${srcDomain}" = {
target = "https://gitea.shire-zebra.ts.net"; target = "http://unix:${config.services.anubis.instances.git.settings.BIND}";
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-Forwarded-Ssl on; proxy_set_header X-Real-IP $remote_addr;
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/
@@ -87,6 +95,44 @@ 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 = [
@@ -98,25 +144,5 @@ in
}; };
}; };
services.haproxy = { users.users.nginx.extraGroups = [ config.users.groups.anubis.name ];
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
'';
};
} }
+11 -10
View File
@@ -47,12 +47,6 @@ 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:
@@ -139,14 +133,16 @@ 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"
- name: OG_PASSTHROUGH volumeMounts:
value: "true" - name: anubis-policy
- name: OG_EXPIRY_TIME mountPath: /etc/anubis
value: "24h" readOnly: true
resources: resources:
limits: limits:
cpu: "750m" cpu: "750m"
@@ -165,6 +161,11 @@ spec:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
extraVolumes:
- name: anubis-policy
configMap:
name: anubis-policy
strategy: strategy:
type: RollingUpdate type: RollingUpdate
rollingUpdate: rollingUpdate:
+1 -2
View File
@@ -8,8 +8,7 @@ spec:
service: service:
name: gitea-release-http name: gitea-release-http
port: port:
# Route through Anubis anti-crawler sidecar instead of directly to Gitea name: http
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