cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack-primate] branch master updated: vue: allow both http and https configuration (#2)
Date Mon, 11 Nov 2019 09:02:26 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new 4cfa1c9  vue: allow both http and https configuration (#2)
4cfa1c9 is described below

commit 4cfa1c989b2b0e4e5fd59dfac6d003b3aa821c1d
Author: Gregor Riepl <Gregor.Riepl@swisstxt.ch>
AuthorDate: Fri Sep 20 08:41:04 2019 +0200

    vue: allow both http and https configuration (#2)
    
    This closes #2
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 .env.local.https.example |  7 +++++++
 README.md                |  2 ++
 vue.config.js            | 11 ++++++++++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/.env.local.https.example b/.env.local.https.example
new file mode 100644
index 0000000..f0ab16d
--- /dev/null
+++ b/.env.local.https.example
@@ -0,0 +1,7 @@
+CS_URL=http://localhost:8080
+PUBLIC_HOST=primate.example.com
+HTTPS_CERT=/etc/ssl/certs/primate.example.com.pem
+HTTPS_KEY=/etc/ssl/private/primate.example.com.key
+HTTPS_CA=/etc/ssl/certs/ca.pem
+HTTPS_DHPARAM=/etc/ssl/keys/dh2048.pem
+ALLOWED_HOSTS=["primate.example.com","cloud.example.com"]
diff --git a/README.md b/README.md
index 3432ac0..0cabdb1 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,8 @@ Override the default `CS_URL` to a running CloudStack management server:
     cp .env.local.example .env.local
     Change the `CS_URL` in the `.env.local` file
 
+To configure https, you may use `.env.local.https.example`.
+
 Build and run:
 
     npm start
diff --git a/vue.config.js b/vue.config.js
index c02cac9..ef4c105 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -17,6 +17,7 @@
 
 const path = require('path')
 const webpack = require('webpack')
+const fs = require('fs')
 
 function resolve (dir) {
   return path.join(__dirname, dir)
@@ -114,7 +115,15 @@ module.exports = {
         ws: false,
         changeOrigin: true
       }
-    }
+    },
+    https: process.env.HTTPS_KEY ? {
+      key: process.env.HTTPS_KEY ? fs.readFileSync(process.env.HTTPS_KEY) : undefined,
+      cert: process.env.HTTPS_CERT ? fs.readFileSync(process.env.HTTPS_CERT) : undefined,
+      ca: process.env.HTTPS_CA ? fs.readFileSync(process.env.HTTPS_CA) : undefined,
+      dhparam: process.env.HTTPS_DHPARAM ? fs.readFileSync(process.env.HTTPS_DHPARAM) : undefined
+    } : false,
+    public: process.env.PUBLIC_HOST || undefined,
+    allowedHosts: process.env.ALLOWED_HOSTS ? JSON.parse(process.env.ALLOWED_HOSTS) : undefined
   },
 
   lintOnSave: undefined,


Mime
View raw message