summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoryochananmarqos2019-12-04 10:21:39 -0700
committeryochananmarqos2019-12-04 10:21:39 -0700
commitd08d955281a057ba9857cf5c08fafc2d6a083f53 (patch)
treef9dbe5d43013696d798be38b344dad5616fef453
parent7ce28273002140dd432b1cd9987dcc907c1af06f (diff)
downloadaur-d08d955281a057ba9857cf5c08fafc2d6a083f53.tar.gz
clean before build, update relays
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD19
-rw-r--r--relays.json.tar.xzbin12204 -> 0 bytes
-rwxr-xr-xupdate-relays.sh19
5 files changed, 34 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5279a8422e6c..a78eb3a0ffe4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mullvad-vpn
pkgdesc = The Mullvad VPN client app for desktop
pkgver = 2019.9
- pkgrel = 9
+ pkgrel = 10
url = https://www.mullvad.net
install = mullvad-vpn.install
arch = x86_64
@@ -17,11 +17,11 @@ pkgbase = mullvad-vpn
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
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
diff --git a/PKGBUILD b/PKGBUILD
index 87c3a823984a..732058e7e1dd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,12 @@
# Contributor: Matthew McGinn <mamcgi at gmail dot com>
# Contributor: alicewww <almw at protonmail dot 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
pkgver=2019.9
-pkgrel=9
+pkgrel=10
pkgdesc="The Mullvad VPN client app for desktop"
url="https://www.mullvad.net"
arch=('x86_64')
@@ -18,11 +18,11 @@ install="$pkgname.install"
source=("git+https://github.com/mullvad/mullvadvpn-app.git#tag=$pkgver"
'git+https://github.com/mullvad/mullvadvpn-app-binaries.git'
"$pkgname.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
deleted file mode 100644
index 1f527f74d7d8..000000000000
--- a/relays.json.tar.xz
+++ /dev/null
Binary files differ
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