diff options
author | yochananmarqos | 2019-12-04 10:25:32 -0700 |
---|---|---|
committer | yochananmarqos | 2019-12-04 10:25:32 -0700 |
commit | 2ae54575947dd2a95126fe0712dd56bbb3bbd9cd (patch) | |
tree | ff12db1bb7d1e3d3c554f30af27486919ec862fe | |
parent | e7d964f0a674021ead64012be53fe3e47396541d (diff) | |
download | aur-2ae54575947dd2a95126fe0712dd56bbb3bbd9cd.tar.gz |
clean before build, update relays
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | relays.json.tar.xz | bin | 12204 -> 0 bytes | |||
-rwxr-xr-x | update-relays.sh | 19 |
5 files changed, 34 insertions, 12 deletions
@@ -1,7 +1,7 @@ pkgbase = mullvad-vpn-beta pkgdesc = The Mullvad VPN client app for desktop pkgver = 2019.9.stable - pkgrel = 7 + pkgrel = 8 url = https://www.mullvad.net install = mullvad-vpn.install arch = x86_64 @@ -17,11 +17,11 @@ pkgbase = mullvad-vpn-beta source = git+https://github.com/mullvad/mullvadvpn-app.git#tag=2019.9 source = git+https://github.com/mullvad/mullvadvpn-app-binaries.git source = mullvad-vpn.desktop - source = relays.json.tar.xz + source = update-relays.sh sha256sums = SKIP sha256sums = SKIP sha256sums = 121d90e6683e64d9c0d2dbb7b346fa918bdb37cf21fdaf9f66232304ed23abc2 - sha256sums = 1d2c77dac7fefefc9a120781f7679731b046f82492a9e8dc447122bbf2973f10 + sha256sums = 2ad702e141e8c3e5ea48a83fa8513fbcf64ba194da681122d6da408bd2736d25 pkgname = mullvad-vpn-beta diff --git a/.gitignore b/.gitignore index ae0d3ce8085d..3102c7b66867 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ !.SRCINFO !mullvad-vpn.desktop !mullvad-vpn.install -!relays.json.tar.xz +!update-relays.sh @@ -1,13 +1,13 @@ # Maintainer: telans <telans@protonmail.com> # Co-Maintainer: yochananmarqos <yochanan.marqos@gmail.com> # Contributor: David Birks <david at tellus dot space> -# Contributor: Linus Färnstrand <https://github.com/faern> -# Contributor: Emīls Piņķis <https://github.com/pinkisemils> -# Contributor: Andrej Mihajlov <https://github.com/pronebird> +# Contributor: Linus Färnstrand <linus at mullvad dot net> +# Contributor: Emīls Piņķis <emil at mullvad dot net> +# Contributor: Andrej Mihajlov <and at mullvad dot net> pkgname=mullvad-vpn-beta pkgver=2019.9.stable _pkgver=2019.9 -pkgrel=7 +pkgrel=8 pkgdesc="The Mullvad VPN client app for desktop" url="https://www.mullvad.net" arch=('x86_64') @@ -18,11 +18,11 @@ install="${pkgname%-beta}.install" source=("git+https://github.com/mullvad/mullvadvpn-app.git#tag=$_pkgver" 'git+https://github.com/mullvad/mullvadvpn-app-binaries.git' "${pkgname%-beta}.desktop" - 'relays.json.tar.xz') # file too large, had to compress + 'update-relays.sh') sha256sums=('SKIP' 'SKIP' '121d90e6683e64d9c0d2dbb7b346fa918bdb37cf21fdaf9f66232304ed23abc2' - '1d2c77dac7fefefc9a120781f7679731b046f82492a9e8dc447122bbf2973f10') + '2ad702e141e8c3e5ea48a83fa8513fbcf64ba194da681122d6da408bd2736d25') prepare() { # Point the submodule to our local copy @@ -36,6 +36,9 @@ prepare() { build() { cd "$srcdir/mullvadvpn-app" + # Remove old Rust build artifacts + cargo clean --release --locked + # Build mullvad-daemon cargo build --release --locked @@ -46,8 +49,8 @@ build() { cp target/release/{mullvad,mullvad-daemon,mullvad-problem-report} \ dist-assets/ - # TODO: Generate relays.json instead of copying it from .deb - cp "$srcdir/relays.json" dist-assets/ + # Update relay list & generate relays.json + ../update-relays.sh # Build Electron GUI app cd gui diff --git a/relays.json.tar.xz b/relays.json.tar.xz Binary files differdeleted file mode 100644 index 1f527f74d7d8..000000000000 --- a/relays.json.tar.xz +++ /dev/null diff --git a/update-relays.sh b/update-relays.sh new file mode 100755 index 000000000000..4a1dcc8c6ef9 --- /dev/null +++ b/update-relays.sh @@ -0,0 +1,19 @@ +#!/bin/bash +read -d '' JSONRPC_CODE <<-JSONRPC_CODE + var buff = ""; + process.stdin.on('data', function (chunk) { + buff += chunk; + }) + process.stdin.on('end', function () { + var obj = JSON.parse(buff); + var output = JSON.stringify(obj.result, null, ' '); + process.stdout.write(output); + }) + JSONRPC_CODE + + JSONRPC_RESPONSE="$(curl -X POST \ + --fail \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list_v3"}' \ + https://api.mullvad.net/rpc/)" + echo "$JSONRPC_RESPONSE" | node -e "$JSONRPC_CODE" > dist-assets/relays.json |