summaryrefslogtreecommitdiff
path: root/installer/packages/riseupvpn
diff options
context:
space:
mode:
Diffstat (limited to 'installer/packages/riseupvpn')
-rw-r--r--installer/packages/riseupvpn/data/.gitignore3
-rw-r--r--installer/packages/riseupvpn/data/README.txt3
-rwxr-xr-xinstaller/packages/riseupvpn/data/post-install.py96
-rw-r--r--installer/packages/riseupvpn/data/se.leap.bitmask-helper.plist26
-rw-r--r--installer/packages/riseupvpn/meta/install.js53
-rw-r--r--installer/packages/riseupvpn/meta/package.xml11
6 files changed, 0 insertions, 192 deletions
diff --git a/installer/packages/riseupvpn/data/.gitignore b/installer/packages/riseupvpn/data/.gitignore
deleted file mode 100644
index 63c86a1..0000000
--- a/installer/packages/riseupvpn/data/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-openvpn.leap
-bitmask-helper
-riseup-vpn.app
diff --git a/installer/packages/riseupvpn/data/README.txt b/installer/packages/riseupvpn/data/README.txt
deleted file mode 100644
index c71984f..0000000
--- a/installer/packages/riseupvpn/data/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This is the RiseupVPN README.
-It should be replaced with something more meaningful
-(give links to issue tracker, repos, uninstaller etc).
diff --git a/installer/packages/riseupvpn/data/post-install.py b/installer/packages/riseupvpn/data/post-install.py
deleted file mode 100755
index 02da859..0000000
--- a/installer/packages/riseupvpn/data/post-install.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import shutil
-import sys
-import subprocess
-
-HELPER = "bitmask-helper"
-HELPER_PLIST = "/Library/LaunchDaemons/se.leap.bitmask-helper.plist"
-_dir = os.path.dirname(os.path.realpath(__file__))
-
-def main():
- log = open(os.path.join(_dir, 'post-install.log'), 'w')
- log.write('Checking for admin privileges...\n')
-
- _id = os.getuid()
- if _id != 0:
- err = "error: need to run as root. UID: %s\n" % str(_id)
- logErr(log, err)
-
- # failure: sys.exit(1)
-
- if isHelperRunning():
- log.write("Trying to stop bitmask-helper...\n")
- # if this fail, we can check if the HELPER_PLIST is there
- ok = unloadHelper()
- log.write("success: %s \n" % str(ok))
-
- ok = fixHelperOwner(log)
- log.write("chown helper: %s \n" % str(ok))
-
- log.write("Copy launch daemon...\n")
- copyLaunchDaemon()
-
- out = launchHelper()
- log.write("Copy plist: %s \n" % str(ok))
-
- grantPermissionsOnLogFolder()
-
- # all done
- log.write('post-install script: done\n')
- sys.exit(0)
-
-
-def logErr(log, msg):
- log.write(msg)
- sys.exit(1)
-
-def isHelperRunning():
- ps = _getProcessList()
- return HELPER in ps
-
-def unloadHelper():
- out = subprocess.call(["launchctl", "unload", HELPER_PLIST])
- return out == 0
-
-def fixHelperOwner(log):
- path = os.path.join(_dir, HELPER)
- try:
- os.chown(path, 0, 0)
- except OSError as exc:
- log.write(str(exc))
- return False
- return True
-
-def copyLaunchDaemon():
- plist = "se.leap.bitmask-helper.plist"
- path = os.path.join(_dir, plist)
- dest = os.path.join('/Library/LaunchDaemons', plist)
- _p = _dir.replace("/", "\/")
- subprocess.call(["sed", "-i.back", "s/PATH/%s/" % _p, path])
- shutil.copy(path, dest)
-
-def launchHelper():
- out = subprocess.call(["launchctl", "load", "/Library/LaunchDaemons/se.leap.bitmask-helper.plist"])
- return out == 0
-
-def grantPermissionsOnLogFolder():
- helperDir = os.path.join(_dir, 'helper')
- try:
- os.makedirs(helperDir)
- except Exception:
- pass
- os.chown(helperDir, 0, 0)
-
-def _getProcessList():
- _out = []
- output = subprocess.Popen(["ps", "-ceA"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- stdout, stderr = output.communicate()
- for line in stdout.split('\n'):
- cmd = line.split(' ')[-1]
- _out.append(cmd.strip())
- return _out
-
-if __name__ == "__main__":
- main()
diff --git a/installer/packages/riseupvpn/data/se.leap.bitmask-helper.plist b/installer/packages/riseupvpn/data/se.leap.bitmask-helper.plist
deleted file mode 100644
index c9d9687..0000000
--- a/installer/packages/riseupvpn/data/se.leap.bitmask-helper.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>WorkingDirectory</key>
- <string>/tmp</string>
- <key>StandardOutPath</key>
- <string>bitmask-helper.log</string>
- <key>StandardErrorPath</key>
- <string>bitmask-helper-err.log</string>
- <key>GroupName</key>
- <string>daemon</string>
- <key>RunAtLoad</key>
- <true/>
- <key>SessionCreate</key>
- <true/>
- <key>KeepAlive</key>
- <true/>
- <key>ThrottleInterval</key>
- <integer>5</integer>
- <key>Label</key>
- <string>se.leap.BitmaskHelper</string>
- <key>Program</key>
- <string>PATH/bitmask-helper</string>
-</dict>
-</plist>
diff --git a/installer/packages/riseupvpn/meta/install.js b/installer/packages/riseupvpn/meta/install.js
deleted file mode 100644
index f9c85f2..0000000
--- a/installer/packages/riseupvpn/meta/install.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 LEAP
-**
-****************************************************************************/
-
-function Component() {
-}
-
-Component.prototype.createOperations = function ()
-{
- // This will actually install the files
- component.createOperations();
-
- // And now our custom actions.
- // See https://doc.qt.io/qtinstallerframework/operations.html for reference
- //
- // We can also use this to register different components (different architecture for instance)
- // See https://doc.qt.io/qtinstallerframework/qt-installer-framework-systeminfo-packages-root-meta-installscript-qs.html
-
- if (systemInfo.productType === "windows") {
- postInstallWindows();
- } else if (systemInfo.productType === "osx") {
- postInstallOSX();
- } else {
- postInstallLinux();
- }
-}
-
-function postInstallWindows() {
- component.addOperation(
- "CreateShortcut",
- "@TargetDir@/README.txt",
- "@StartMenuDir@/README.lnk",
- "workingDirectory=@TargetDir@",
- "iconPath=%SystemRoot%/system32/SHELL32.dll",
- "iconId=2");
-}
-
-function postInstallOSX() {
- console.log("Post-installation for OSX");
- // TODO add UNDOEXECUTE for the uninstaller
- component.addElevatedOperation(
- "Execute", "{0}",
- "@TargetDir@/post-install.py",
- "errormessage=There was an error during the post-installation script, things might be broken. Please report this error and attach the post-install.log file.");
-}
-
-function postInstallLinux() {
- console.log("Post-installation for GNU/Linux");
- console.log("Maybe you want to use your package manager instead?");
- component.addOperation("AppendFile", "/tmp/riseupvpn.log", "this is a test - written from the installer");
-}
diff --git a/installer/packages/riseupvpn/meta/package.xml b/installer/packages/riseupvpn/meta/package.xml
deleted file mode 100644
index 4dd7ae9..0000000
--- a/installer/packages/riseupvpn/meta/package.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Package>
- <DisplayName>RiseupVPN</DisplayName>
- <Description>RiseupVPN</Description>
- <Version>0.20.6-1</Version>
- <ReleaseDate>2020-07-01</ReleaseDate>
- <Default>false</Default>
- <RequiresAdminRights>true</RequiresAdminRights>
- <Script>install.js</Script>
- <ForcedInstallation>true</ForcedInstallation>
-</Package>