Skip to content

Commit

Permalink
Add deprecation warning if v2 config detected
Browse files Browse the repository at this point in the history
  • Loading branch information
eloquence committed Jul 21, 2020
1 parent 019e1af commit 4739258
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/validate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,25 @@ def confirm_environment_valid(self):

def confirm_onion_config_valid(self):
"""
We support both v2 and v3 Onion Services, so if the values
in config file match either format, good enough.
We support both v2 and v3 onion services, so if the values
in the config file match either format, the configuration is considered
valid. A deprecation warning is shown if v2 services are in use.
"""
v2_config = False
try:
self.confirm_onion_v3_url()
self.confirm_onion_v3_auth()
except AssertionError:
self.confirm_onion_v2_url()
self.confirm_onion_v2_auth()
v2_config = True

if v2_config:
print(
"WARNING: v2 onion service configuration found.\n"
"Support for v2 onion services will be removed from SecureDrop in February 2021.\n"
"Migration guide: https://docs.securedrop.org/en/master/v3_services.html"
)

def confirm_onion_v3_url(self):
assert "hidserv" in self.config
Expand Down

0 comments on commit 4739258

Please sign in to comment.