relocate tor socket out of /etc

weasel explained that apparmor limits on what files tor can read do not
apply to sockets (because they're not files). And apparently the
problems I was seeing with hidden services not being accessible had to
do with onion address propigation and not the location of the socket
file.

remotedaemon looks up the HiddenServicePort in torrc, so if it was
previously configured with the socket in /etc, that will still work.

This commit was sponsored by Denis Dzyubenko on Patreon.
This commit is contained in:
Joey Hess 2016-12-20 16:01:10 -04:00
parent 477aa44209
commit 944a6503b9
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
4 changed files with 71 additions and 48 deletions

View file

@ -30,6 +30,6 @@ start ps = case readish =<< headMaybe ps of
when (uuid == NoUUID) $
giveup "This can only be run in a git-annex repository."
(onionaddr, onionport) <- liftIO $
addHiddenService userid (fromUUID uuid)
addHiddenService "tor-annex" userid (fromUUID uuid)
storeP2PAddress $ TorAnnex onionaddr onionport
stop