diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1042869..12c54110 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: key: ${{ runner.os }}-win64-tor-${{ hashFiles('desktop/scripts/get-tor.py') }} - name: Get tor binaries from Tor Browser (64-bit) - run: cd desktop && C:\hostedtoolcache\windows\Python\3.12.8\x64\Scripts\poetry run python .\scripts\get-tor.py win64 + run: cd desktop && C:\hostedtoolcache\windows\Python\3.12.8\x64\Scripts\poetry run python .\scripts\get-tor.py windows-x86_64 - name: Install Go >=1.23.5 uses: actions/setup-go@v5 diff --git a/desktop/README.md b/desktop/README.md index f903c143..a76ef0ec 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -39,7 +39,7 @@ poetry install - Download and install [7-Zip (x64)](https://7-zip.org/). Add `C:\Program Files\7-Zip` to your path. - Download and install [gpg4win](https://gpg4win.org/). Add `C:\Program Files (x86)\GnuPG\bin` to your path. -Download Tor Browser and extract the binaries for your platform. The platform must be `win64`, `macos`, or `linux-x86_64`. +Download Tor Browser and extract the binaries for your platform. The platform must be `windows-x86_64`, `macos`, or `linux-x86_64`. ```sh poetry run python ./scripts/get-tor.py [platform] diff --git a/desktop/scripts/get-tor.py b/desktop/scripts/get-tor.py index 08a8669d..454fb1e2 100644 --- a/desktop/scripts/get-tor.py +++ b/desktop/scripts/get-tor.py @@ -12,7 +12,7 @@ import tempfile import gnupg torbrowser_latest_url = ( - "https://aus1.torproject.org/torbrowser/update_3/release/downloads.json" + "https://aus1.torproject.org/torbrowser/update_3/release" ) tor_dev_fingerprint = "EF6E286DDA85EA2A4BA7DE684E2C6E8793298290" @@ -24,13 +24,12 @@ working_path = os.path.join(root_path, "build", "tor") def get_latest_tor_version_urls(platform): - r = requests.get(torbrowser_latest_url) - if r.status_code != 200 or platform not in r.json()["downloads"]: - print("Tor browser latest version url not working") - sys.exit(-1) + r = requests.get(f"{torbrowser_latest_url}/download-{platform}.json") + if r.status_code != 200: + raise RuntimeError("Tor browser latest version url not working") - platform_url = r.json()["downloads"][platform]["ALL"]["binary"] - platform_sig_url = r.json()["downloads"][platform]["ALL"]["sig"] + platform_url = r.json()["binary"] + platform_sig_url = r.json()["sig"] platform_filename = platform_url.split("/")[-1] return platform_url, platform_filename, platform_sig_url @@ -320,7 +319,7 @@ def main(platform): """ Download Tor Browser and extract tor binaries """ - valid_platforms = ["win64", "macos", "linux-x86_64"] + valid_platforms = ["windows-x86_64", "macos", "linux-x86_64"] if platform not in valid_platforms: click.echo(f"platform must be one of: {valid_platforms}") return @@ -337,7 +336,7 @@ def main(platform): ) print(f"Imported Tor GPG key: {torkey.fingerprints}") - if platform == "win64": + if platform == "windows-x86_64": get_tor_windows( gpg, torkey, platform_url, platform_filename, expected_platform_sig )