From 14ae2fa12ccfe0e72f405a295f2343bfb1bbe328 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 24 Nov 2026 12:58:49 -0600 Subject: use filebrowser-quantum for pe-pro --- hosts/poweredge-pro/filebrowser.nix | 51 ++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'hosts') diff --git a/hosts/poweredge-pro/filebrowser.nix b/hosts/poweredge-pro/filebrowser.nix index 4c63af3..d7ca026 100644 --- a/hosts/poweredge-pro/filebrowser.nix +++ b/hosts/poweredge-pro/filebrowser.nix @@ -4,49 +4,58 @@ privateNetwork = true; hostBridge = "br-lan1"; localMacAddress = "02:00:00:00:77:12"; + ephemeral = true; # Host path bindMounts = { - "/var/lib/filebrowser/data/chexx" = { + "/var/lib/filebrowser" = { + hostPath = "/nix/persist/filebrowser"; + isReadOnly = false; + }; + "/VMDisk/shares/chexx" = { hostPath = "/VMDisk/shares/chexx"; - isReadOnly = true; + isReadOnly = false; }; - "/var/lib/filebrowser/data/Scans" = { - hostPath = "/VMDisk/shares/scans/"; - isReadOnly = true; + "/VMDisk/shares/scans" = { + hostPath = "/VMDisk/shares/scans"; + isReadOnly = false; }; }; - config = { lib, pkg, config, ... }: let - publicPort = 9000; + config = { lib, pkgs, config, ... }: let + FILEBROWSER_CONFIG = "${(pkgs.formats.yaml { }).generate "config.yaml" { + server = { + port = 8080; + database = "/var/lib/filebrowser/database.db"; + sources = [ { path = "/VMDisk/shares"; } ]; + }; + }}"; in { # Network networking.interfaces.eth0.useDHCP = true; - networking.firewall.allowedTCPPorts = [ 80 publicPort ]; # Caddy (private + public) + networking.firewall.allowedTCPPorts = [ 80 8080 ]; # Caddy + filebrowser - # Filebrowser + # Filebrowser-quantum services.filebrowser = { enable = true; - #package = pkgs.filebrowser-quantum; # Not supported yet + package = pkgs.filebrowser-quantum; + }; + + # Edit systemd service for filebrowser to make it compatible w/ filebrowser-quantum + systemd.services.filebrowser = { + #environment.FILEBROWSER_DATABASE = + environment = { inherit FILEBROWSER_CONFIG; }; + serviceConfig = { + ExecStart = lib.mkForce (lib.getExe pkgs.filebrowser-quantum); + }; }; # Reverse proxy services.caddy = { enable = true; - # Private virtualHosts.":80".extraConfig = '' reverse_proxy localhost:8080 ''; - # Public (not sure why toString is needed but ok) - virtualHosts.":${toString publicPort}".extraConfig = '' - @shared { - path /share/* - path /static/* - path /api/public/* - } - - reverse_proxy @shared localhost:8080 - ''; }; system.stateVersion = "26.05"; -- cgit v1.3.1