TOR: prevent creation of torPrivoxy.conf if Privoxy is disabled.
Patch by Russel O'Connor svn path=/nixos/trunk/; revision=23862
This commit is contained in:
parent
b9aa56969f
commit
e5aea56bb5
@ -233,36 +233,33 @@ in
|
|||||||
home = stateDir;
|
home = stateDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs.tor =
|
jobs = {
|
||||||
{ name = "tor";
|
tor = { name = "tor";
|
||||||
|
|
||||||
startOn = "started network-interfaces";
|
startOn = "started network-interfaces";
|
||||||
stopOn = "stopping network-interfaces";
|
stopOn = "stopping network-interfaces";
|
||||||
|
|
||||||
preStart =
|
preStart = ''
|
||||||
''
|
mkdir -m 0755 -p ${stateDir}
|
||||||
mkdir -m 0755 -p ${stateDir}
|
chown ${torUser} ${stateDir}
|
||||||
chown ${torUser} ${stateDir}
|
'';
|
||||||
'';
|
exec = "${tor}/bin/tor -f ${pkgs.writeText "torrc" cfg.config}";
|
||||||
exec = "${tor}/bin/tor -f ${pkgs.writeText "torrc" cfg.config}";
|
}; }
|
||||||
};
|
// optionalAttrs (cfg.client.privoxy.enable && cfg.client.enable) {
|
||||||
|
torPrivoxy = { name = "tor-privoxy";
|
||||||
|
|
||||||
jobs.torPrivoxy = mkIf (cfg.client.privoxy.enable && cfg.client.enable)
|
startOn = "starting tor";
|
||||||
{ name = "tor-privoxy";
|
stopOn = "stopping tor";
|
||||||
|
|
||||||
startOn = "starting tor";
|
preStart = ''
|
||||||
stopOn = "stopping tor";
|
mkdir -m 0755 -p ${privoxyDir}
|
||||||
|
chown ${torUser} ${privoxyDir}
|
||||||
|
|
||||||
preStart =
|
# Needed to run privoxy as an unprivileged user?
|
||||||
''
|
${modprobe}/sbin/modprobe capability || true
|
||||||
mkdir -m 0755 -p ${privoxyDir}
|
'';
|
||||||
chown ${torUser} ${privoxyDir}
|
exec = "${privoxy}/sbin/privoxy --no-daemon --user ${torUser} ${pkgs.writeText "torPrivoxy.conf" cfg.client.privoxy.config}";
|
||||||
|
}; };
|
||||||
# Needed to run privoxy as an unprivileged user?
|
|
||||||
${modprobe}/sbin/modprobe capability || true
|
|
||||||
'';
|
|
||||||
exec = "${privoxy}/sbin/privoxy --no-daemon --user ${torUser} ${pkgs.writeText "torPrivoxy.conf" cfg.client.privoxy.config}";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.tor.config = ''
|
services.tor.config = ''
|
||||||
DataDirectory ${stateDir}
|
DataDirectory ${stateDir}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user