mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/tor: fix HidServAuth (#122439)
* add an example for services.tor.settings.HidServAuth * fix HidServAuth validation to require ".onion" Per https://manpages.debian.org/testing/tor/torrc.5.en.html : > Valid onion addresses contain 16 characters in a-z2-7 plus ".onion"
This commit is contained in:
parent
b5227312c8
commit
33a4c43126
1 changed files with 8 additions and 2 deletions
|
@ -170,7 +170,7 @@ let
|
||||||
else if k == "ServerTransportPlugin" then
|
else if k == "ServerTransportPlugin" then
|
||||||
optionalString (v.transports != []) "${concatStringsSep "," v.transports} exec ${v.exec}"
|
optionalString (v.transports != []) "${concatStringsSep "," v.transports} exec ${v.exec}"
|
||||||
else if k == "HidServAuth" then
|
else if k == "HidServAuth" then
|
||||||
concatMapStringsSep "\n${k} " (settings: settings.onion + " " settings.auth) v
|
v.onion + " " + v.auth
|
||||||
else generators.mkValueStringDefault {} v;
|
else generators.mkValueStringDefault {} v;
|
||||||
genTorrc = settings:
|
genTorrc = settings:
|
||||||
generators.toKeyValue {
|
generators.toKeyValue {
|
||||||
|
@ -715,7 +715,7 @@ in
|
||||||
(submodule {
|
(submodule {
|
||||||
options = {
|
options = {
|
||||||
onion = mkOption {
|
onion = mkOption {
|
||||||
type = strMatching "[a-z2-7]{16}(\\.onion)?";
|
type = strMatching "[a-z2-7]{16}\\.onion";
|
||||||
description = "Onion address.";
|
description = "Onion address.";
|
||||||
example = "xxxxxxxxxxxxxxxx.onion";
|
example = "xxxxxxxxxxxxxxxx.onion";
|
||||||
};
|
};
|
||||||
|
@ -726,6 +726,12 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
example = [
|
||||||
|
{
|
||||||
|
onion = "xxxxxxxxxxxxxxxx.onion";
|
||||||
|
auth = "xxxxxxxxxxxxxxxxxxxxxx";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
options.HiddenServiceNonAnonymousMode = optionBool "HiddenServiceNonAnonymousMode";
|
options.HiddenServiceNonAnonymousMode = optionBool "HiddenServiceNonAnonymousMode";
|
||||||
options.HiddenServiceStatistics = optionBool "HiddenServiceStatistics";
|
options.HiddenServiceStatistics = optionBool "HiddenServiceStatistics";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue