server-configs/machines/gerd/services/miniflux.nix

69 lines
1.7 KiB
Nix
Raw Normal View History

2024-12-30 21:53:22 +00:00
{ config, lib, pkgs, ... }:
let
svc_domain = "miniflux.${config.mine.shared.settings.domain}";
port = 6466;
2025-01-20 17:29:17 +00:00
listenOn = "localhost:${builtins.toString port}";
httpListenOn = "http://${listenOn}";
2024-12-30 21:53:22 +00:00
in {
services.miniflux = {
enable = true;
config = {
# listen only on localhost
2025-01-20 17:29:17 +00:00
LISTEN_ADDR = listenOn;
2024-12-30 21:53:22 +00:00
# setup the correct baseurl
BASE_URL = "https://${svc_domain}";
2024-12-30 21:53:22 +00:00
# disable admin account, disable local auth
CREATE_ADMIN = 0;
DISABLE_LOCAL_AUTH = "true";
# use auth proxy
AUTH_PROXY_HEADER = config.mine.shared.lib.authelia.protectedHeaders.username;
2024-12-30 21:53:22 +00:00
AUTH_PROXY_USER_CREATION = "true";
2025-01-09 17:24:32 +00:00
# For privacy, proxy images instead of hotlinking
2025-01-09 19:55:45 +00:00
MEDIA_PROXY_RESOURCE_TYPES = "image,audio,video";
2025-01-09 17:24:32 +00:00
MEDIA_PROXY_MODE = "all";
2024-12-30 21:53:22 +00:00
};
};
# nginx
services.nginx.virtualHosts."${svc_domain}" = config.mine.shared.lib.authelia.mkProtectedWebsite {
forceSSL = true;
enableACME = true;
locations."/" = config.mine.shared.lib.authelia.mkProtectedLocation {
2025-01-20 17:29:17 +00:00
proxyPass = httpListenOn;
2024-12-30 21:53:22 +00:00
};
2025-01-20 17:29:17 +00:00
# allow API for mobile apps etc.
locations."/v1".proxyPass = httpListenOn;
# allow sharing
locations."/share".proxyPass = httpListenOn;
2025-01-20 17:35:42 +00:00
# used for sharing
# TODO: would be nice if nginx could serve this instead
2025-01-20 17:29:17 +00:00
locations."~* \.(js|jpg|png|css)$".proxyPass = httpListenOn;
2024-12-30 21:53:22 +00:00
};
# meta
mine.shared.meta.miniflux = {
name = "Miniflux";
description = "We host our own miniflux, use it to read all your feeds!";
url = "https://${svc_domain}";
package = let
pkg = config.services.miniflux.package;
in {
name = pkg.pname;
version = pkg.version;
meta = pkg.meta;
};
};
}