2014-03-30 04:38:16 +00:00
|
|
|
module Property.Tor where
|
|
|
|
|
|
|
|
import Property
|
|
|
|
import Utility.SafeCommand
|
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"]
|
|
|
|
where
|
|
|
|
setup = fileHasContent "/etc/tor/torrc"
|
|
|
|
[ "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"]
|