From f8c8be2079873fefcb6e24f47e9573a08d207dc0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Mar 2014 00:38:16 -0400 Subject: tor bridge --- Property/Tor.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Property/Tor.hs (limited to 'Property') 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"] -- cgit v1.3-2-g0d8e