In CI, download Tor from for windows Tor Expert Bundle, and build meek, obfs4proxy, and snowflake ourselves

This commit is contained in:
Micah Lee 2022-04-10 19:07:35 -04:00
parent de4dbb54a0
commit e184ca5d03
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 96 additions and 28 deletions

View File

@ -90,15 +90,38 @@ jobs:
cd ~\project\desktop
poetry install
- run:
name: Get tor
name: Download tor (Windows Expert Bundle)
command: |
cd ~\project\desktop
poetry run python .\scripts\get-tor.py
mkdir ~\Downloads\tor
cd ~\Downloads\tor
$URL = "https://www.torproject.org/dist/torbrowser/11.0.10/tor-win32-0.4.6.10.zip"
$Filename = "tor-win32-0.4.6.10.zip"
$ExpectedHash = "d3f62317507dbe1a1aa74b9e0e03996dbded2143f94409270828f6a8bcdda16a"
Invoke-WebRequest -Uri $URL -OutFile $Filename
$FileHash = Get-FileHash $Filename
if($FileHash.Hash -ne $ExpectedHash) {
throw "Invalid hash"
}
Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\project\desktop\onionshare\resources\tor
- run:
name: Build meek
name: Build obfs4proxy
command: |
cd ~\project\desktop
python .\scripts\build-meek-client.py
mkdir ~\Downloads\obfs4proxy
cd Downloads\obfs4proxy
git clone https://gitlab.com/yawning/obfs4
cd obfs4
go build .\obfs4proxy
Move-Item -Path .\obfs4proxy.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe
- run:
name: Build snowflake-client
command: |
go install git.torproject.org/pluggable-transports/snowflake.git/client@latest
Move-Item -Path ~\go\bin\client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe
- run:
name: Build meek-client
command: |
go install git.torproject.org/pluggable-transports/meek.git/meek-client@v0.37.0
Move-Item -Path ~\go\bin\meek-client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe
- run:
name: Build OnionShare
command: |
@ -138,10 +161,38 @@ jobs:
cd ~\project\desktop
C:\Python-32bit\Scripts\poetry install
- run:
name: Get tor
name: Download tor (Windows Expert Bundle)
command: |
cd ~\project\desktop
C:\Python-32bit\Scripts\poetry run python .\scripts\get-tor.py
mkdir ~\Downloads\tor
cd ~\Downloads\tor
$URL = "https://www.torproject.org/dist/torbrowser/11.0.10/tor-win32-0.4.6.10.zip"
$Filename = "tor-win32-0.4.6.10.zip"
$ExpectedHash = "d3f62317507dbe1a1aa74b9e0e03996dbded2143f94409270828f6a8bcdda16a"
Invoke-WebRequest -Uri $URL -OutFile $Filename
$FileHash = Get-FileHash $Filename
if($FileHash.Hash -ne $ExpectedHash) {
throw "Invalid hash"
}
Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\project\desktop\onionshare\resources\tor
- run:
name: Build obfs4proxy
command: |
mkdir ~\Downloads\obfs4proxy
cd Downloads\obfs4proxy
git clone https://gitlab.com/yawning/obfs4
cd obfs4
"C:\\Program Files (x86)\\Go\\bin\\go" build .\obfs4proxy
Move-Item -Path .\obfs4proxy.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe
- run:
name: Build snowflake-client
command: |
"C:\\Program Files (x86)\\Go\\bin\\go" install git.torproject.org/pluggable-transports/snowflake.git/client@latest
Move-Item -Path ~\go\bin\client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe
- run:
name: Build meek-client
command: |
"C:\\Program Files (x86)\\Go\\bin\\go" install git.torproject.org/pluggable-transports/meek.git/meek-client@v0.37.0
Move-Item -Path ~\go\bin\meek-client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe
- run:
name: Build meek
command: |

View File

@ -44,6 +44,7 @@ def run(cmd, cwd=None, error_ok=False):
def sign(filename):
click.echo(f"> Signing {filename}")
run(
[
shutil.which("signtool"),
@ -580,15 +581,10 @@ def codesign(win32_path, win64_path):
return
for path in paths:
bin_path = os.path.join(path, "onionshare.exe")
click.echo(f"> Signing {bin_path}")
sign(bin_path)
bin_path = os.path.join(path, "onionshare-cli.exe")
click.echo(f"> Signing {bin_path}")
sign(bin_path)
bin_path = os.path.join(
sign(os.path.join(path, "onionshare.exe"))
sign(os.path.join(path, "onionshare-cli.exe"))
sign(
os.path.join(
path,
"lib",
"onionshare",
@ -597,8 +593,29 @@ def codesign(win32_path, win64_path):
"Tor",
"meek-client.exe",
)
click.echo(f"> Signing {bin_path}")
sign(bin_path)
)
sign(
os.path.join(
path,
"lib",
"onionshare",
"resources",
"tor",
"Tor",
"obfs4proxy.exe",
)
)
sign(
os.path.join(
path,
"lib",
"onionshare",
"resources",
"tor",
"Tor",
"snowflake-client.exe",
)
)
@main.command()