mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-25 01:50:40 +00:00
Compare commits
2 Commits
python-upd
...
public-inb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e4975c49 | ||
|
|
948e1ca5ad |
@@ -53,7 +53,9 @@ let
|
|||||||
# if running simultaneous services.
|
# if running simultaneous services.
|
||||||
NonBlocking = true;
|
NonBlocking = true;
|
||||||
#LimitNOFILE = 30000;
|
#LimitNOFILE = 30000;
|
||||||
User = config.users.users."public-inbox".name;
|
User =
|
||||||
|
lib.mkIf config.systemd.services."public-inbox-${srv}".confinement.enable
|
||||||
|
config.users.users."public-inbox".name;
|
||||||
Group = config.users.groups."public-inbox".name;
|
Group = config.users.groups."public-inbox".name;
|
||||||
RuntimeDirectory = [
|
RuntimeDirectory = [
|
||||||
"public-inbox-${srv}/perl-inline"
|
"public-inbox-${srv}/perl-inline"
|
||||||
@@ -61,9 +63,7 @@ let
|
|||||||
RuntimeDirectoryMode = "700";
|
RuntimeDirectoryMode = "700";
|
||||||
# This is for BindPaths= and BindReadOnlyPaths=
|
# This is for BindPaths= and BindReadOnlyPaths=
|
||||||
# to allow traversal of directories they create inside RootDirectory=
|
# to allow traversal of directories they create inside RootDirectory=
|
||||||
UMask = "0066";
|
UMask = "0026";
|
||||||
StateDirectory = ["public-inbox"];
|
|
||||||
StateDirectoryMode = "0750";
|
|
||||||
WorkingDirectory = stateDir;
|
WorkingDirectory = stateDir;
|
||||||
BindReadOnlyPaths = [
|
BindReadOnlyPaths = [
|
||||||
"/etc"
|
"/etc"
|
||||||
@@ -109,7 +109,6 @@ let
|
|||||||
SystemCallArchitectures = "native";
|
SystemCallArchitectures = "native";
|
||||||
|
|
||||||
# The following options are redundant when confinement is enabled
|
# The following options are redundant when confinement is enabled
|
||||||
RootDirectory = "/var/empty";
|
|
||||||
TemporaryFileSystem = "/";
|
TemporaryFileSystem = "/";
|
||||||
PrivateMounts = true;
|
PrivateMounts = true;
|
||||||
MountAPIVFS = true;
|
MountAPIVFS = true;
|
||||||
@@ -434,8 +433,10 @@ in
|
|||||||
(mkIf cfg.imap.enable
|
(mkIf cfg.imap.enable
|
||||||
{ public-inbox-imapd = mkMerge [(serviceConfig "imapd") {
|
{ public-inbox-imapd = mkMerge [(serviceConfig "imapd") {
|
||||||
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
||||||
|
environment.PI_DIR = "/var/lib/public-inbox/.public-inbox";
|
||||||
requires = [ "public-inbox-init.service" ];
|
requires = [ "public-inbox-init.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
DynamicUser = !config.systemd.services."public-inbox-imapd".confinement.enable;
|
||||||
ExecStart = escapeShellArgs (
|
ExecStart = escapeShellArgs (
|
||||||
[ "${cfg.package}/bin/public-inbox-imapd" ] ++
|
[ "${cfg.package}/bin/public-inbox-imapd" ] ++
|
||||||
cfg.imap.args ++
|
cfg.imap.args ++
|
||||||
@@ -448,8 +449,10 @@ in
|
|||||||
(mkIf cfg.http.enable
|
(mkIf cfg.http.enable
|
||||||
{ public-inbox-httpd = mkMerge [(serviceConfig "httpd") {
|
{ public-inbox-httpd = mkMerge [(serviceConfig "httpd") {
|
||||||
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
||||||
|
environment.PI_DIR = "/var/lib/public-inbox/.public-inbox";
|
||||||
requires = [ "public-inbox-init.service" ];
|
requires = [ "public-inbox-init.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
DynamicUser = !config.systemd.services."public-inbox-httpd".confinement.enable;
|
||||||
ExecStart = escapeShellArgs (
|
ExecStart = escapeShellArgs (
|
||||||
[ "${cfg.package}/bin/public-inbox-httpd" ] ++
|
[ "${cfg.package}/bin/public-inbox-httpd" ] ++
|
||||||
cfg.http.args ++
|
cfg.http.args ++
|
||||||
@@ -487,8 +490,10 @@ in
|
|||||||
(mkIf cfg.nntp.enable
|
(mkIf cfg.nntp.enable
|
||||||
{ public-inbox-nntpd = mkMerge [(serviceConfig "nntpd") {
|
{ public-inbox-nntpd = mkMerge [(serviceConfig "nntpd") {
|
||||||
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
after = [ "public-inbox-init.service" "public-inbox-watch.service" ];
|
||||||
|
environment.PI_DIR = "/var/lib/public-inbox/.public-inbox";
|
||||||
requires = [ "public-inbox-init.service" ];
|
requires = [ "public-inbox-init.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
DynamicUser = !config.systemd.services."public-inbox-nntpd".confinement.enable;
|
||||||
ExecStart = escapeShellArgs (
|
ExecStart = escapeShellArgs (
|
||||||
[ "${cfg.package}/bin/public-inbox-nntpd" ] ++
|
[ "${cfg.package}/bin/public-inbox-nntpd" ] ++
|
||||||
cfg.nntp.args ++
|
cfg.nntp.args ++
|
||||||
@@ -509,6 +514,10 @@ in
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${cfg.package}/bin/public-inbox-watch";
|
ExecStart = "${cfg.package}/bin/public-inbox-watch";
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
|
StateDirectory = ["public-inbox"];
|
||||||
|
StateDirectoryMode = "0750";
|
||||||
|
User = config.users.users."public-inbox".name;
|
||||||
|
Group = config.users.groups."public-inbox".name;
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
})
|
})
|
||||||
@@ -562,15 +571,22 @@ in
|
|||||||
ls -1 "$inbox" | grep -q '^xap' ||
|
ls -1 "$inbox" | grep -q '^xap' ||
|
||||||
${cfg.package}/bin/public-inbox-index "$inbox"
|
${cfg.package}/bin/public-inbox-index "$inbox"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Older versions of the module did not make inboxes group-readable.
|
||||||
|
# chmod -R g+r ${stateDir}/inboxes
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
StateDirectory = [
|
StateDirectory = [
|
||||||
|
"public-inbox"
|
||||||
"public-inbox/.public-inbox"
|
"public-inbox/.public-inbox"
|
||||||
"public-inbox/.public-inbox/emergency"
|
"public-inbox/.public-inbox/emergency"
|
||||||
"public-inbox/inboxes"
|
"public-inbox/inboxes"
|
||||||
];
|
];
|
||||||
|
StateDirectoryMode = "0750";
|
||||||
|
User = config.users.users."public-inbox".name;
|
||||||
|
Group = config.users.groups."public-inbox".name;
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user