Fix bug that was preventing tor from connecting in snapcraft

This commit is contained in:
Micah Lee 2021-11-14 20:53:22 -08:00
parent f09bb66425
commit 99c85f55e2
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 27 additions and 11 deletions

View file

@ -437,6 +437,12 @@ class Common:
Returns True if OnionShare is running in a Flatpak sandbox
"""
return os.environ.get("FLATPAK_ID") == "org.onionshare.OnionShare"
def is_snapcraft(self):
"""
Returns True if OnionShare is running in a Flatpak sandbox
"""
return os.environ.get("SNAP_INSTANCE_NAME") == "onionshare"
@staticmethod
def random_string(num_bytes, output_len=None):