mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 16:40:14 +00:00
initial refactoring
This commit is contained in:
@ -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 ];
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user