From bd8c9210c97800a0bc8e8af58163586864ffb037 Mon Sep 17 00:00:00 2001 From: sora-ext Date: Mon, 1 Jun 2026 17:16:50 +0200 Subject: [PATCH] Add modules/server/containers/apps/freshrss.nix --- modules/server/containers/apps/freshrss.nix | 54 +++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 modules/server/containers/apps/freshrss.nix diff --git a/modules/server/containers/apps/freshrss.nix b/modules/server/containers/apps/freshrss.nix new file mode 100644 index 0000000..cfd99a8 --- /dev/null +++ b/modules/server/containers/apps/freshrss.nix @@ -0,0 +1,54 @@ +{ config, containerCfg, pkgs, lib, builder, name, ... }: +let + version = "latest"; + serverCfg = config.syscfg.server; +in { + sops = true; + db = true; + paths = [ + { + path = "${serverCfg.configPath}/freshrss"; + owner = "1000:1000"; + mode = "0755"; + } + ]; + + containers = { + server = builder.mkContainer { + subdomain = containerCfg.subdomain; + image = "ghcr.io/freshrss/freshrss:${version}"; + port = 80; + secret = name; + + extraEnv = { + CRON_MIN = "5,35"; + PUID = "1000"; + PGID = "1000"; + TRUSTED_PROXY = "10.0.0.0/8 192.168.0.1/16"; + PUBLISHED_PORT = "80"; + ADMIN_PASSWORD = "admin"; # Change this to a secure password in production! + ADMIN_API_PASSWORD = "admin"; # Change this to a secure password in production! + BASE_URL = "https://${containerCfg.subdomain}.${serverCfg.domain}"; + SERVER_DNS = "${containerCfg.subdomain}.${serverCfg.domain}"; + DB_HOST = "${builder.host}"; + DB_BASE = "freshrss_db"; + DB_USER = "freshrss_user"; + }; + + overrides = { + volumes = [ + "${serverCfg.configPath}/freshrss:/config" + ]; + }; + }; + }; + + setup = { + trigger = "server"; # Triggers atomic environment verification on main controller + envFile = config.sops.secrets."FRESHRSS".path; + script = pkgs.writeShellScript "setup-freshrss" '' + RSS_URL="https://${containerCfg.subdomain}.${serverCfg.domain}" + ${pkgs.curl}/bin/curl -s -X POST "$RSS_URL/i/index.php?step=0" -H "Content-Type: application/x-www-form-urlencoded" --data-raw "language=en" + ''; + }; +} \ No newline at end of file