diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-03-19 15:10:55 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-03-19 15:10:55 -0400 |
| commit | c15223dfaedca2fae8f5bcd6ae9f23610c8ed0b1 (patch) | |
| tree | ab5b57170f9274dbb5787ba0bcec1a7bdd13781b /src | |
| parent | c48c8c973084f2fafc34a3c5c6ca4553c843013d (diff) | |
Tor.named, Tor.torPrivKey: Include the new ed25519 public/private key pair in addition to the old secret_id_key.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Tor.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index 24d5b687..7a9402b9 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -53,12 +53,19 @@ named n = configured [("Nickname", n')] where n' = saneNickname n +-- | Configures tor with secret_id_key, ed25519_master_id_public_key, and +-- ed25519_master_id_secret_key from privdata. torPrivKey :: Context -> Property (HasInfo + DebianLike) -torPrivKey context = f `File.hasPrivContent` context - `onChange` File.ownerGroup f user (userGroup user) +torPrivKey context = mconcat (map go keyfiles) `requires` torPrivKeyDirExists where - f = torPrivKeyDir </> "secret_id_key" + keyfiles = map (torPrivKeyDir </>) + [ "secret_id_key" + , "ed25519_master_id_public_key" + , "ed25519_master_id_secret_key" + ] + go f = f `File.hasPrivContent` context + `onChange` File.ownerGroup f user (userGroup user) torPrivKeyDirExists :: Property DebianLike torPrivKeyDirExists = File.dirExists torPrivKeyDir |
