Snap successfully builds meek-client, and WIP getting tor to connect

This commit is contained in:
Micah Lee 2021-11-14 17:52:40 -08:00
parent 0f63c89a59
commit f09bb66425
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 42 additions and 23 deletions

View File

@ -354,6 +354,11 @@ class Onion(object):
f.write("\nUseBridges 1\n")
# Execute a tor subprocess
self.common.log(
"Onion",
"connect",
f"starting {self.tor_path} subprocess",
)
start_ts = time.time()
if self.common.platform == "Windows":
# In Windows, hide console window when opening tor.exe subprocess
@ -374,22 +379,29 @@ class Onion(object):
)
# Wait for the tor controller to start
self.common.log(
"Onion",
"connect",
f"tor pid: {self.tor_proc.pid}",
)
time.sleep(2)
# Connect to the controller
try:
if (
self.common.platform == "Windows"
or self.common.platform == "Darwin"
):
self.c = Controller.from_port(port=self.tor_control_port)
self.c.authenticate()
else:
self.c = Controller.from_socket_file(path=self.tor_control_socket)
self.c.authenticate()
except Exception as e:
print("OnionShare could not connect to Tor:\n{}".format(e.args[0]))
raise BundledTorBroken(e.args[0])
self.common.log(
"Onion",
"connect",
"authenticating to tor controller",
)
# try:
if self.common.platform == "Windows" or self.common.platform == "Darwin":
self.c = Controller.from_port(port=self.tor_control_port)
self.c.authenticate()
else:
self.c = Controller.from_socket_file(path=self.tor_control_socket)
self.c.authenticate()
# except Exception as e:
# print("OnionShare could not connect to Tor:\n{}".format(e))
# raise BundledTorBroken(e.args[0])
while True:
try:

View File

@ -412,7 +412,7 @@ class GuiCommon:
def get_tor_paths(self):
if self.common.platform == "Linux":
base_path = self.get_resource_path("tor")
if base_path:
if base_path and os.path.isdir(base_path):
self.common.log(
"GuiCommon", "get_tor_paths", "using paths in resources"
)

View File

@ -15,6 +15,7 @@ apps:
onionshare:
common-id: org.onionshare.OnionShare
command: onionshare
extensions: [ gnome-3-34 ]
plugs:
- desktop
- home
@ -125,7 +126,7 @@ parts:
- setuptools
- pynacl
- colorama
- git+https://github.com/onionshare/stem.git@1.8.1
- cepa == 1.8.3
stage-packages:
- build-essential
- libssl-dev
@ -135,7 +136,7 @@ parts:
stage:
- -usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
- -usr/share/doc/libssl1.1/changelog.Debian.gz
after: [tor, obfs4, snowflake-client]
after: [tor, obfs4, snowflake-client, meek-client]
tor:
source: https://dist.torproject.org/tor-0.4.6.8.tar.gz
@ -165,11 +166,17 @@ parts:
source: https://git.torproject.org/pluggable-transports/snowflake.git
source-type: git
source-tag: v2.0.1
organize:
bin/client: bin/snowflake-client
# meek-client:
# plugin: go
# go-importpath: git.torproject.org/pluggable-transports/meek.git/meek-client
# go-packages: ["google.golang.org/appengine"]
# source: https://git.torproject.org/pluggable-transports/meek.git
# source-type: git
# source-tag: v0.37.0
meek-client:
plugin: go
go-channel: stable
go-importpath: git.torproject.org/pluggable-transports/meek.git/meek-client
# Not sure why I have to do this, but it works
override-build: |
cd meek-client
go build -o /root/parts/meek-client/install/bin ./...
source: https://git.torproject.org/pluggable-transports/meek.git
source-type: git
source-tag: v0.37.0