summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-03-19 08:49:19 -0400
committerJoey Hess2016-03-19 08:49:19 -0400
commitc5282cc38c1891580fe1ecd751c2d8e4d841a291 (patch)
treefdaf17bf01c9989f109fbeceac229e6d7219ab8f
parenta0d01b8ad22cab75496c1b2fce4157309bc3222a (diff)
parent2563624a77b4058d6b96ce0f099b2bee476fe359 (diff)
Merge branch 'joeyconfig'
-rw-r--r--debian/changelog2
-rw-r--r--joeyconfig.hs2
-rw-r--r--src/Propellor/Property/Tor.hs22
3 files changed, 21 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index a8fb5ecc..b3f19cbb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,8 @@ propellor (2.17.0) UNRELEASED; urgency=medium
need to make changes every time.
* Speed up propellor's build of itself, by asking cabal to only build
the propellor-config binary and not all the libraries.
+ * Tor.named: Fix bug that sometimes caused the property to fail the first
+ time, though retrying succeeded.
-- Joey Hess <id@joeyh.name> Mon, 29 Feb 2016 17:58:08 -0400
diff --git a/joeyconfig.hs b/joeyconfig.hs
index 1d9798ea..327c268e 100644
--- a/joeyconfig.hs
+++ b/joeyconfig.hs
@@ -143,7 +143,7 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64"
mayfly :: Host
mayfly = standardSystem "mayfly.kitenet.net" (Stable "jessie") "amd64"
[ "Scratch VM. Contents can change at any time!" ]
- & ipv4 "104.167.118.15"
+ & ipv4 "167.88.36.193"
& CloudAtCost.decruft
& Apt.unattendedUpgrades
diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs
index e5fcdaa4..0c040f95 100644
--- a/src/Propellor/Property/Tor.hs
+++ b/src/Propellor/Property/Tor.hs
@@ -54,18 +54,32 @@ named n = configured [("Nickname", n')]
torPrivKey :: Context -> Property HasInfo
torPrivKey context = f `File.hasPrivContent` context
`onChange` File.ownerGroup f user (userGroup user)
- -- install tor first, so the directory exists with right perms
- `requires` Apt.installed ["tor"]
+ `requires` torPrivKeyDirExists
where
- f = "/var/lib/tor/keys/secret_id_key"
+ f = torPrivKeyDir </> "secret_id_key"
+
+torPrivKeyDirExists :: Property NoInfo
+torPrivKeyDirExists = File.dirExists torPrivKeyDir
+ `onChange` setperms
+ `requires` installed
+ where
+ setperms = File.ownerGroup torPrivKeyDir user (userGroup user)
+ `before` File.mode torPrivKeyDir 0O2700
+
+torPrivKeyDir :: FilePath
+torPrivKeyDir = "/var/lib/tor/keys"
-- | A tor server (bridge, relay, or exit)
-- Don't use if you just want to run tor for personal use.
server :: Property NoInfo
server = configured [("SocksPort", "0")]
- `requires` Apt.installed ["tor", "ntp"]
+ `requires` installed
+ `requires` Apt.installed ["ntp"]
`describe` "tor server"
+installed :: Property NoInfo
+installed = Apt.installed ["tor"]
+
-- | Specifies configuration settings. Any lines in the config file
-- that set other values for the specified settings will be removed,
-- while other settings are left as-is. Tor is restarted when