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
Greg Hellings 75e71f9ce9 fix: get Matrix running again
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-effects Build done.
buildbot/nix-build Build done.
2026-05-20 03:27:45 -05:00
Greg Hellings 19540ea1da chore: update mariadb-operator version 2026-05-20 03:26:37 -05:00
Greg Hellings 431f78f8af fix: enable minio access for gitea backups 2026-05-19 23:48:34 -05:00
Greg Hellings 95eea6fc26 fix: enable s3 DNS aliases 2026-05-19 23:47:42 -05:00
greg 387a34ffff Merge pull request 'chore: update flake.lock 2026-05-18' (#23) from auto/update-flake-lock-20260518 into main
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Reviewed-on: https://src.thehellings.com/greg/nixos/pulls/23
Reviewed-by: klaatu <klaatu@thehellings.com>
2026-05-19 15:16:50 +00:00
10 changed files with 76 additions and 42 deletions
+7 -2
View File
@@ -115,10 +115,15 @@ in
"@\tIN\tSOA\t${config.networking.hostName}\tgreg@thehellings.com (1 1m 1m 1m 1m)"
"\tIN\tNS\t${config.networking.hostName}"
];
makeHost = host: "${host.name}\tIN\tA\t${host.address}";
makeHost =
host:
[ "${host.name}\tIN\tA\t${host.address}" ]
++ lib.map (a: "${a}\tIN\tA\t${host.address}") (
if builtins.hasAttr "aliases" host then host.aliases else [ ]
);
in
pkgs.writeText "${domain}" (
builtins.concatStringsSep "\n" (preamble ++ (lib.map makeHost hosts) ++ [ "" ])
builtins.concatStringsSep "\n" (preamble ++ (lib.flatten (lib.map makeHost hosts)) ++ [ "" ])
);
in
lib.mapAttrs
+13 -31
View File
@@ -2,12 +2,24 @@
# them by the following commands:
# nix run nixpkgs.matrix-synapse
# register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448
{ config, lib, ... }:
{ config, ... }:
let
domain = "${config.networking.domain}";
fqdn = "matrix.${domain}";
in
{
greg.proxies."${fqdn}" = {
extraConfig = ''
error_log /var/log/nginx/debug.log debug;
proxy_ssl_verify off;
proxy_ssl_server_name on;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
'';
genAliases = false;
ssl = true;
target = "https://matrix.shire-zebra.ts.net";
};
services.nginx = {
virtualHosts = {
# Server the '.well-known' files to find the Matrix API server
@@ -44,36 +56,6 @@ in
return 200 '${builtins.toJSON client}';
'';
};
# Reverse proxy in front of the actual Matrix server
"${fqdn}" = {
enableACME = true;
forceSSL = true;
extraConfig = ''
error_log /var/log/nginx/debug.log debug;
'';
# Not the appropriate place for the chat client
locations =
(builtins.listToAttrs (
builtins.map
(
val:
lib.nameValuePair "/_${val}" {
proxyPass = "https://matrix.shire-zebra.ts.net";
}
)
[
"matrix"
"synapse"
"dendrite"
]
))
// {
"/".extraConfig = "return 404;";
};
};
};
};
-5
View File
@@ -34,10 +34,5 @@ in
ssl = true;
genAliases = false;
};
"doubles.thehellings.com" = {
target = "http://localhost:8081";
ssl = true;
genAliases = false;
};
};
}
+1
View File
@@ -15,6 +15,7 @@
(name: value: {
inherit name;
address = builtins.getAttr netAttr value;
aliases = lib.optionals (builtins.hasAttr "aliases" value) (builtins.getAttr "aliases" value);
})
(
lib.filterAttrs (
+46
View File
@@ -47,6 +47,12 @@ spec:
type: LoadBalancer
port: 32222
nodePort: 32222
# Anubis sidecar port — ingress routes here; Anubis proxies to :3000
additionalPorts:
- name: anubis
port: 8080
targetPort: 8080
protocol: TCP
gitea:
admin:
@@ -119,6 +125,46 @@ spec:
cpu: "100m"
memory: "2Gi"
# Anubis anti-crawler sidecar
# Anubis listens on :8080 and proxies to Gitea at http://localhost:3000
# Ingress is updated to route to the anubis port instead of http
extraContainers:
- name: anubis
image: ghcr.io/techarohq/anubis:latest
imagePullPolicy: Always
env:
- name: BIND
value: ":8080"
- name: DIFFICULTY
value: "4"
- name: METRICS_BIND
value: ":9090"
- name: SERVE_ROBOTS_TXT
value: "true"
- name: TARGET
value: "http://localhost:3000"
- name: OG_PASSTHROUGH
value: "true"
- name: OG_EXPIRY_TIME
value: "24h"
resources:
limits:
cpu: "750m"
memory: "256Mi"
requests:
cpu: "250m"
memory: "256Mi"
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
strategy:
type: RollingUpdate
rollingUpdate:
+2 -1
View File
@@ -8,7 +8,8 @@ spec:
service:
name: gitea-release-http
port:
name: http
# Route through Anubis anti-crawler sidecar instead of directly to Gitea
name: anubis
tls:
- hosts:
- gitea
+2 -2
View File
@@ -15,8 +15,8 @@ spec:
storage: |-
MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }}
MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }}
#minio_key: "{{ .minio_nas1_key }}"
#minio_secret: "{{ .minio_nas1_secret }}"
minio_key: "{{ .minio_nas1_key }}"
minio_secret: "{{ .minio_nas1_secret }}"
secretStoreRef:
name: bitwarden-login
kind: ClusterSecretStore
+2
View File
@@ -19,6 +19,7 @@ spec:
kind: HelmRepository
name: mariadb-operator
interval: "1h"
version: "26.3.0"
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
@@ -33,6 +34,7 @@ spec:
kind: HelmRepository
name: mariadb-operator
interval: "1h"
version: "26.3.0"
dependsOn:
- name: mariadb-operator-crds
- name: longhorn
@@ -11,6 +11,7 @@ spec:
kind: HelmRepository
name: mariadb-operator
interval: "1h"
version: "26.3.0"
dependsOn:
- name: mariadb-operator-crds
- name: mariadb-operator
+2 -1
View File
@@ -13,7 +13,8 @@
"ip": "10.42.1.4",
"pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS",
"external": true,
"ts": "100.119.228.115"
"ts": "100.119.228.115",
"aliases": [ "s3" ]
},
"exodus": {
"ip": null,