Tor: rename 'varPath' to 'varLib'
Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
This commit is contained in:
parent
1f328755f5
commit
2368b0d5af
|
@ -20,20 +20,20 @@ hiddenServiceAvailable :: HostName -> Int -> Property
|
||||||
hiddenServiceAvailable hn port = hiddenServiceHostName prop
|
hiddenServiceAvailable hn port = hiddenServiceHostName prop
|
||||||
where
|
where
|
||||||
prop = mainConfig `File.containsLines`
|
prop = mainConfig `File.containsLines`
|
||||||
[ unlines ["HiddenServiceDir", varPath </> hn]
|
[ unlines ["HiddenServiceDir", varLib </> hn]
|
||||||
, unlines ["HiddenServicePort", show port, "127.0.0.1:" ++ show port]
|
, unlines ["HiddenServicePort", show port, "127.0.0.1:" ++ show port]
|
||||||
]
|
]
|
||||||
`describe` "hidden service available"
|
`describe` "hidden service available"
|
||||||
`onChange` Service.reloaded "tor"
|
`onChange` Service.reloaded "tor"
|
||||||
hiddenServiceHostName p = adjustProperty p $ \satisfy -> do
|
hiddenServiceHostName p = adjustProperty p $ \satisfy -> do
|
||||||
r <- satisfy
|
r <- satisfy
|
||||||
h <- liftIO $ readFile (varPath </> hn </> "hostname")
|
h <- liftIO $ readFile (varLib </> hn </> "hostname")
|
||||||
warningMessage $ unlines ["hidden service hostname:", h]
|
warningMessage $ unlines ["hidden service hostname:", h]
|
||||||
return r
|
return r
|
||||||
|
|
||||||
hiddenService :: HostName -> Int -> Property
|
hiddenService :: HostName -> Int -> Property
|
||||||
hiddenService hn port = mainConfig `File.containsLines`
|
hiddenService hn port = mainConfig `File.containsLines`
|
||||||
[ unlines ["HiddenServiceDir", varPath </> hn]
|
[ unlines ["HiddenServiceDir", varLib </> hn]
|
||||||
, unlines ["HiddenServicePort", show port, "127.0.0.1:" ++ show port]
|
, unlines ["HiddenServicePort", show port, "127.0.0.1:" ++ show port]
|
||||||
]
|
]
|
||||||
`describe` unlines ["hidden service available:", hn, show port]
|
`describe` unlines ["hidden service available:", hn, show port]
|
||||||
|
@ -45,5 +45,5 @@ restarted = Service.restarted "tor"
|
||||||
mainConfig :: FilePath
|
mainConfig :: FilePath
|
||||||
mainConfig = "/etc/tor/torrc"
|
mainConfig = "/etc/tor/torrc"
|
||||||
|
|
||||||
varPath :: FilePath
|
varLib :: FilePath
|
||||||
varPath = "/var/lib/tor"
|
varLib = "/var/lib/tor"
|
||||||
|
|
Loading…
Reference in New Issue