2014-03-30 04:38:16 +00:00
|
|
|
module Property.Tor where
|
|
|
|
|
2014-03-30 19:31:57 +00:00
|
|
|
import Common
|
2014-03-30 17:12:33 +00:00
|
|
|
import qualified Property.File as File
|
2014-03-30 04:52:02 +00:00
|
|
|
import qualified Property.Apt as Apt
|
2014-03-30 04:38:16 +00:00
|
|
|
|
|
|
|
isBridge :: Property
|
2014-03-30 04:52:02 +00:00
|
|
|
isBridge = setup `requires` Apt.installed ["tor"]
|
2014-03-30 19:53:35 +00:00
|
|
|
`describe` "tor bridge"
|
2014-03-30 04:52:02 +00:00
|
|
|
where
|
2014-03-30 17:12:33 +00:00
|
|
|
setup = "/etc/tor/torrc" `File.hasContent`
|
2014-03-30 04:52:02 +00:00
|
|
|
[ "SocksPort 0"
|
|
|
|
, "ORPort 443"
|
|
|
|
, "BridgeRelay 1"
|
|
|
|
, "Exitpolicy reject *:*"
|
|
|
|
] `onChange` restartTor
|
2014-03-30 04:38:16 +00:00
|
|
|
|
|
|
|
restartTor :: Property
|
|
|
|
restartTor = cmdProperty "service" [Param "tor", Param "restart"]
|