summaryrefslogtreecommitdiff
path: root/Property
diff options
context:
space:
mode:
authorJoey Hess2014-03-30 00:38:16 -0400
committerJoey Hess2014-03-30 00:38:16 -0400
commitf8c8be2079873fefcb6e24f47e9573a08d207dc0 (patch)
tree8ae8388ff352a66345192d42a9da8464a2e20148 /Property
parent38e626da7fa0db62c16dee4eb783fff2ce952378 (diff)
tor bridge
Diffstat (limited to 'Property')
-rw-r--r--Property/Tor.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Property/Tor.hs b/Property/Tor.hs
new file mode 100644
index 00000000..bebf0763
--- /dev/null
+++ b/Property/Tor.hs
@@ -0,0 +1,21 @@
+module Property.Tor where
+
+import Control.Applicative
+import Control.Monad
+import System.FilePath
+
+import Property
+import Property.User
+import Utility.SafeCommand
+import Utility.Exception
+
+isBridge :: Property
+isBridge = fileHasContent "/etc/tor/torrc"
+ [ "SocksPort 0"
+ , "ORPort 443"
+ , "BridgeRelay 1"
+ , "Exitpolicy reject *:*"
+ ] `onChange` restartTor
+
+restartTor :: Property
+restartTor = cmdProperty "service" [Param "tor", Param "restart"]