feat: more email, like dns

This commit is contained in:
Benjamin Bädorf 2023-11-12 21:45:02 +01:00
parent 4d87bfe502
commit bf71744b93
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
5 changed files with 59 additions and 1 deletions

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
flake,
... ...
}: { }: {
age.secrets."mail@b12f.io-password" = { age.secrets."mail@b12f.io-password" = {
@ -9,8 +10,19 @@
owner = "maddy"; owner = "maddy";
}; };
services.caddy.virtualHosts = {
"mail.b12f.io" = {
extraConfig = ''
respond "404 Not Found"
'';
};
};
services.maddy = { services.maddy = {
enable = true; enable = false;
openFirewall = true;
primaryDomain = "b12f.io"; primaryDomain = "b12f.io";
ensureAccounts = [ ensureAccounts = [

View file

@ -31,6 +31,8 @@
interface = "enp1s0"; interface = "enp1s0";
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ];
# Caddy reverse proxy for local services like cups # Caddy reverse proxy for local services like cups
services.caddy = { services.caddy = {
globalConfig = '' globalConfig = ''

View file

@ -0,0 +1,42 @@
{
pkgs,
lib,
...
}: let
bbeu = pkgs.stdenv.mkDerivation {
name = "benjaminbaedorf.eu";
src = builtins.fetchgit {
url = "https://git.pub.solar/b12f/benjaminbaedorf.eu.git";
sparseCheckout = [
"fonts"
"cows.jpg"
"fonts.css"
"index.html"
"public-pgp-benjamin-baedorf.asc"
];
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
};
in {
services.caddy.virtualHosts = {
"benjaminbaedorf.eu" = {
extraConfig = ''
redir https://b12f.io{uri} temporary
'';
};
"b12f.io" = {
extraConfig = ''
handle {
root * ${bbeu}
try_files {path}.html {path}
file_server
}
handle_errors {
respond "{http.error.status_code} {http.error.status_text}"
}
'';
};
};
}

View file

@ -73,6 +73,8 @@
forward-tls-upstream = "yes"; forward-tls-upstream = "yes";
} }
]; ];
remote-control.control-enable = true;
}; };
}; };

Binary file not shown.