fix up blog, add spacebar-client experimentally

This commit is contained in:
mtgmonkey 2025-06-08 18:48:43 +00:00
parent f7d48d286a
commit e8c8d58c0d
5 changed files with 134 additions and 10 deletions

View file

@ -4,22 +4,54 @@
pkgs,
...
}: let
botPolicies-nix = {
dnsbl = false;
status_codes = {
CHALLENGE = 200;
DENY = 200;
};
bots = [
{
name = "catch-everything";
user_agent_regex = ".*";
action = "CHALLENGE";
}
];
};
ferron-conf-nix = {
global = {
port = 8181;
secure = false;
wwwroot = "${elmskell-blog.packages.x86_64-linux.default}/wwwroot";
};
};
in {
systemd.services.ferron = {
services.anubis = {
instances.blog = {
enable = true;
settings = {
BIND = "[::1]:9181";
BIND_NETWORK = "tcp";
DIFFICULTY = 4;
METRICS_BIND = "[::1]:9182";
METRICS_BIND_NETWORK = "tcp";
POLICY_FNAME = "/etc/anubis/blog.botPolicies.yaml";
TARGET = "http://localhost:8181";
};
};
};
environment.etc."anubis/blog.botPolicies.yaml" = {
source = (pkgs.formats.yaml {}).generate "" botPolicies-nix;
mode = "644";
};
systemd.services.blog-ferron = {
serviceConfig = {
Type = "simple";
ExecStart = "${lib.getExe pkgs.ferron} --config=/etc/ferron.yaml";
ExecStart = "${lib.getExe pkgs.ferron} --config=/etc/blog.ferron.yaml";
RemainAfterExit = true;
};
};
environment.etc."ferron.yaml" = {
environment.etc."blog.ferron.yaml" = {
source = (pkgs.formats.yaml {}).generate "" ferron-conf-nix;
mode = "644";
};