initial refactoring

This commit is contained in:
Noah Masur
2025-01-20 22:35:40 -05:00
parent a4b5e05f8f
commit c7933f8502
209 changed files with 5998 additions and 5308 deletions

View File

@ -0,0 +1,40 @@
{
config,
lib,
...
}:
let
cfg = config.nmasur.presets.services.filebrowser;
in
{
options.nmasur.presets.services.filebrowser.enable = lib.mkEnableOption "Filebrowser private files";
config = lib.mkIf cfg.enable {
services.filebrowser = {
enable = true;
# Generate password: htpasswd -nBC 10 "" | tr -d ':\n'
password = "$2y$10$ze1cMob0k6pnXRjLowYfZOVZWg4G.dsPtH3TohbUeEbI0sdkG9.za";
};
caddy.routes = [
{
match = [ { host = [ config.hostnames.files ]; } ];
handle = [
{
handler = "reverse_proxy";
upstreams = [
{ dial = "localhost:8020"; }
];
}
];
}
];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains = [ config.hostnames.files ];
};
}