1
Fork 0
satellite/hosts/nixos/lapetus/services/commafeed.nix

31 lines
1.1 KiB
Nix
Raw Normal View History

2024-02-24 14:24:35 +01:00
{ config, ... }:
let
2024-06-13 15:47:36 +02:00
port = config.satellite.ports.commafeed;
2024-02-25 06:38:24 +01:00
dataDir = "/persist/state/var/lib/commafeed";
2024-02-24 14:24:35 +01:00
in
{
systemd.tmpfiles.rules = [ "d ${dataDir}" ];
2024-06-13 15:47:36 +02:00
satellite.nginx.at.rss.port = port;
2024-02-24 14:24:35 +01:00
2024-02-25 06:38:24 +01:00
virtualisation.oci-containers.containers.commafeed = {
2024-02-24 14:24:35 +01:00
image = "athou/commafeed:latest";
ports = [ "${toString port}:8082" ]; # server:docker
volumes = [ "${dataDir}:/commafeed/data" ]; # server:docker
# the JVM is way too hungry
entrypoint = builtins.toJSON
[ "java" "-Xmx64m" "-jar" "commafeed.jar" "server" "config.yml" ];
2024-02-24 14:24:35 +01:00
# https://github.com/Athou/commafeed/blob/master/commafeed-server/config.yml.example
environment = {
2024-06-13 15:47:36 +02:00
CF_APP_PUBLICURL = "https://${config.satellite.nginx.at.rss.host}";
2024-02-24 16:03:18 +01:00
CF_APP_ALLOWREGISTRATIONS = "false"; # I already made an account
2024-02-25 03:05:35 +01:00
CF_APP_MAXENTRIESAGEDAYS = "0"; # Fetch old entries
2024-02-24 16:03:18 +01:00
# I randomly generated an user agent for this
CF_APP_USERAGENT = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_6; like Mac OS X) AppleWebKit/533.48 (KHTML, like Gecko) Chrome/49.0.2557.162 Mobile Safari/602.0";
2024-02-24 14:24:35 +01:00
};
};
}