diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rwxr-xr-x | mullvad-daemon.rc | 16 | ||||
-rwxr-xr-x | mullvad-early-boot-blocking.rc | 14 | ||||
-rw-r--r-- | mullvad.install | 14 |
6 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..4d91be2d1730 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = mullvad-vpn-openrc + pkgdesc = mullvad openrc service + pkgver = 1.0 + pkgrel = 1 + url = https://aur.archlinux.org/packages/mullvad-vpn-openrc + arch = any + license = GPL + depends = openrc + depends = mullvad-vpn + source = mullvad-daemon.rc + source = mullvad-early-boot-blocking.rc + source = mullvad.install + sha256sums = 30d4add10f0673de2fb49ca017fe6d6c939262acf6369138fdda14eae697923a + sha256sums = 4127f351a7eea23b6a9cd2012efa7600683aeb56d7e32b62d627415fcd3c10ce + sha256sums = 9e81c3f1b97d3c26a4a5d5216d18147cf9b0307b4208cfaa441f4700975f6cde + +pkgname = mullvad-vpn-openrc + install = mullvad.install diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..291cff9f6ff1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,21 @@ +# Maintainer: Zero <zero@cock.li> +# Contributor: voj343 <voj343@yandex.com> + +pkgname=mullvad-vpn-openrc +pkgver=1.0 +pkgrel=1 +pkgdesc="mullvad openrc service" +arch=('any') +url='https://aur.archlinux.org/packages/mullvad-vpn-openrc' +license=('GPL') +depends=('openrc' 'mullvad-vpn') +source=('mullvad-daemon.rc' 'mullvad-early-boot-blocking.rc' 'mullvad.install') +sha256sums=("30d4add10f0673de2fb49ca017fe6d6c939262acf6369138fdda14eae697923a" + "4127f351a7eea23b6a9cd2012efa7600683aeb56d7e32b62d627415fcd3c10ce" + "9e81c3f1b97d3c26a4a5d5216d18147cf9b0307b4208cfaa441f4700975f6cde") + +package() { + install -Dm755 ${srcdir}/mullvad-daemon.rc "$pkgdir"/etc/init.d/mullvad-daemon + install -Dm755 ${srcdir}/mullvad-early-boot-blocking.rc "$pkgdir"/etc/init.d/mullvad-early-boot-blocking + install=mullvad.install +} diff --git a/mullvad-daemon.rc b/mullvad-daemon.rc new file mode 100755 index 000000000000..fde87f5a8f41 --- /dev/null +++ b/mullvad-daemon.rc @@ -0,0 +1,16 @@ +#!/sbin/openrc-run +# OpenRC service unit file for the Mullvad VPN daemon + +depend() { + need net + after mullvad-early-boot-blocking +} + +export "MULLVAD_RESOURCE_DIR=/opt/Mullvad VPN/resources/" +name=$RC_SVCNAME +description="Mullvad VPN daemon" +supervisor="supervise-daemon" +command="/usr/bin/mullvad-daemon" +command_args="-v --disable-stdout-timestamps" +pidfile="/run/${RC_SVCNAME}.pid" +command_background=true diff --git a/mullvad-early-boot-blocking.rc b/mullvad-early-boot-blocking.rc new file mode 100755 index 000000000000..ff564f0eb6f8 --- /dev/null +++ b/mullvad-early-boot-blocking.rc @@ -0,0 +1,14 @@ +#!/sbin/openrc-run +# OpenRC service unit file to block all traffic during early boot. +# This is required since almost no distributions use a `network-pre.target`, +# which implies it's difficult to ensure that the daemon will start and block +# traffic before any network configuration will be applied. + +depend() { + before mullvad-daemon +} + +name=$RC_SVCNAME +description="Mullvad early boot network blocker" +command="/usr/bin/mullvad-daemon" +command_args="--initialize-early-boot-firewall" diff --git a/mullvad.install b/mullvad.install new file mode 100644 index 000000000000..0e23bcdef564 --- /dev/null +++ b/mullvad.install @@ -0,0 +1,14 @@ +post_install() { + echo " ==> Add the Mullvad daemon to system startup wtih 'rc-update add mullvad-daemon default'" + echo " ==> Add the Mullvad early boot network blocker to boot with 'rc-update add mullvad-early-boot-blocking boot'" + echo " ==> Start the mullvad daemon now with 'rc-service mullvad-daemon start'" +} + +post_upgrade() { + post_install "$1" +} + +pre_remove() { + echo " ==> Make sure you run 'rc-update del mullvad-daemon default'" + echo " ==> Make sure you run 'rc-update del mullvad-early-boot-blocking boot'" +} |