tor: Add onion location to apache
This is continuation of work done in !2305 (closed) to ensure that the feature is enabled/disabled as expected. This is a draft because I have not tested it after writing test cases. @nbenedek, I could use some help with testing this.
-
When hidden service is enabled create and enable an apache site with the proper configurations. This will let visitors using the Tor browser that a hidden version of the website is available.
-
Disable apache site when hidden service is disabled
-
Create a backup of the apache site
-
Hidden service won't be advertised when the user visits mediawiki, wordpress or tt-rss. These sites don't work (well) with a hidden service when a normal domain is already set up.
Tests:
-
Functional tests pass.
-
With fresh install of Tor app, onion location header apache configuration is enabled and header is served in HTTP requests.
-
When Onion services are enabled/disabled, header is enabled/disabled due to webserver configuration changes.
-
When Tor app is enabled/disabled, header is enabled/disabled due to webserver configuration being enabled/disabled.
-
When Tor app is upgraded from earlier version while app is enabled, onion service is enabled, Tor app remains enabled. Onion location is enabled.
-
When Tor app is upgraded from earlier version while app is enabled, onion service is disabled, Tor app remains enabled. Onion location is disabled.
-
When Tor app is upgraded from earlier version while app is disabled, onion service is enabled, Tor app remains disabled. Onion location is disabled.
-
When Tor app is upgraded from earlier version while app is disabled, onion service is disabled, Tor app remains disabled. Onion location is disabled.
Signed-off-by: nbenedek contact@nbenedek.me [sunil: Ensure that enabling/disabling app enables/disables onion location] [sunil: Ensure that upgrading from old version does not enable the app] [sunil: Ensure that upgrading from old version enables/disables onion location] [sunil: Apache file should be a 'config' and not 'site'] Signed-off-by: Sunil Mohan Adapa sunil@medhas.org