mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
[Backport release-26.05] nixos/miniflux: fix AppArmor profile (#552423)
This commit is contained in:
@@ -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>
|
||||
}
|
||||
'';
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user