Merge branch 'joeyconfig'
This commit is contained in:
commit
3145346fb8
|
@ -1,6 +1,7 @@
|
|||
propellor (0.9.3) UNRELEASED; urgency=medium
|
||||
|
||||
* Added prosody module, contributed by Félix Sipma.
|
||||
* Can be used to configure tor hidden services. Thanks, Félix Sipma.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Mon, 10 Nov 2014 11:15:27 -0400
|
||||
|
||||
|
|
|
@ -16,5 +16,28 @@ isBridge = setup `requires` Apt.installed ["tor"]
|
|||
, "Exitpolicy reject *:*"
|
||||
] `onChange` restarted
|
||||
|
||||
hiddenServiceAvailable :: FilePath -> Int -> Property
|
||||
hiddenServiceAvailable dir port = hiddenServiceHostName prop
|
||||
where
|
||||
prop = "/etc/tor/torrc" `File.containsLines`
|
||||
[ "HiddenServiceDir " ++ dir
|
||||
, "HiddenServicePort " ++ show port ++ " 127.0.0.1:" ++ show port
|
||||
]
|
||||
`describe` "hidden service available"
|
||||
`onChange` Service.reloaded "tor"
|
||||
hiddenServiceHostName p = adjustProperty p $ \satisfy -> do
|
||||
r <- satisfy
|
||||
h <- liftIO $ readFile (dir </> "hostname")
|
||||
warningMessage $ unlines ["hidden service hostname:", h]
|
||||
return r
|
||||
|
||||
hiddenService :: FilePath -> Int -> Property
|
||||
hiddenService dir port = "/etc/tor/torrc" `File.containsLines`
|
||||
[ "HiddenServiceDir " ++ dir
|
||||
, "HiddenServicePort " ++ show port ++ " 127.0.0.1:" ++ show port
|
||||
]
|
||||
`describe` ("hidden service (" ++ dir ++ " " ++ show port ++ ") available")
|
||||
`onChange` Service.reloaded "tor"
|
||||
|
||||
restarted :: Property
|
||||
restarted = Service.restarted "tor"
|
||||
|
|
Loading…
Reference in New Issue