summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-02-23 13:04:00 +0100
committerRuben Pollan <meskio@sindominio.net>2017-03-03 10:50:53 +0100
commit9ab90040d4cf87a89f23a92b73ce95cbe8ac983c (patch)
tree72ed005a53e53be3ce0a38106954247974945dae
parentaf3866350e94c9238889a1c2485661466b1ec2dc (diff)
[feat] add VPN API to bitmask.js
- Resolves: #8779
-rw-r--r--ui/app/lib/bitmask.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js
index 79f4b91..88a6644 100644
--- a/ui/app/lib/bitmask.js
+++ b/ui/app/lib/bitmask.js
@@ -204,6 +204,65 @@ var bitmask = function(){
}
},
+ /**
+ * For now the VPN setup is not really streamlined
+ *
+ * src/leap/bitmask/vpn/README.rst for more info
+ */
+ vpn: {
+ enable: function() {
+ return call(['vpn', 'enable'])
+ },
+
+ disable: function() {
+ return call(['vpn', 'disable'])
+ },
+
+ status: function() {
+ return call(['vpn', 'status'])
+ },
+
+ start: function(provider) {
+ return call(['vpn', 'start', provider])
+ },
+
+ stop: function() {
+ return call(['vpn', 'stop'])
+ },
+
+ /**
+ * Check if the VPN is ready to start and has the cert downloaded
+ *
+ * @return {Promise<bool>} User readable status
+ */
+ check: function(provider) {
+ return call(['vpn', 'check', provider])
+ },
+
+ /**
+ * Download VPN cert
+ *
+ * @param {string} userid the userid to be used
+ */
+ get_cert: function(userid) {
+ return call(['vpn', 'get_cert', userid])
+ },
+
+ /**
+ * Install helpers in the system
+ */
+ install: function() {
+ return call(['vpn', 'install'])
+ },
+
+ /**
+ * Uninstall helpers in the system
+ */
+ uninstall: function() {
+ return call(['vpn', 'uninstall'])
+ }
+ },
+
mail: {
/**
* Check the status of the email service