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 336a6c8028
commit 43e5d21731
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):