[Backport release-26.05] nixos/miniflux: fix AppArmor profile (#552423)

This commit is contained in:
Rémi NICOLE
2026-08-14 13:16:34 +00:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -214,7 +214,13 @@ in
abi <abi/4.0>,
include <tunables/global>
profile ${cfg.package}/bin/miniflux {
# Flag `attach_disconnected` is necessary
# because the PostgreSQL socket path appears
# as a "disconnected" path: `run/postgresql/.s.PGSQL.XXXX`,
# without the trailing slash, which AppArmor can't resolve.
# The flag prepends a `/`, which isn't recommended,
# but there aren't any alternative currently.
profile ${cfg.package}/bin/miniflux flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/nameservice>
include <abstractions/ssl_certs>
@@ -222,6 +228,8 @@ in
include "${pkgs.apparmorRulesFromClosure { name = "miniflux"; } cfg.package}"
${cfg.package}/bin/miniflux r,
/run/miniflux/** rw,
/run/postgresql/.s.PGSQL.* rw,
/run/credentials/** r,
include if exists <local/bin.miniflux>
}
'';

View File

@@ -29,6 +29,7 @@ in
default =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
inherit adminCredentialsFile;
@@ -38,6 +39,7 @@ in
withoutSudo =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
inherit adminCredentialsFile;
@@ -48,6 +50,7 @@ in
customized =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
config = {
@@ -82,6 +85,7 @@ in
externalDb =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
createDatabaseLocally = false;
@@ -105,6 +109,7 @@ in
machine.succeed(
f"curl 'http://localhost:{port}/v1/me' -u '{user}' -H Content-Type:application/json | grep '\"is_admin\":true'"
)
machine.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')
default.start()
withoutSudo.start()