From 6ef2e1bea348b536bd6fa7d93981beaca8dc5e4f Mon Sep 17 00:00:00 2001
From: Mark <mark@openappstack.net>
Date: Thu, 31 Oct 2019 15:04:46 +0100
Subject: [PATCH] Add nuxt configuration via environment

---
 frontend/nuxt.config.js | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js
index 2b10560..140ab77 100644
--- a/frontend/nuxt.config.js
+++ b/frontend/nuxt.config.js
@@ -1,11 +1,10 @@
 module.exports = {
   server: {
-    host: '0.0.0.0'
+    host: process.env.HOST || '0.0.0.0'
   },
   env: {
-    BACKEND_API_URL: 'http://localhost:5002/graphql',
-    baseUrl: 'http://oas.alumnicloud.net:3000'
-  },
+    BACKEND_API_URL: process.env.BACKEND_API_URL || 'http://localhost:5002/graphql',
+    baseUrl: process.env.BASE_URL || 'http://sso.example.net:3000'},
   serverMiddleware: [
     '~/api/index.js'
   ],
@@ -21,16 +20,16 @@ module.exports = {
     strategies: {
       oas: {
       _scheme: 'oauth2',
-      base_url: 'http://oas.alumnicloud.net:4444',
-      authorization_endpoint: 'http://oas.alumnicloud.net:4444/oauth2/auth',
-      userinfo_endpoint: 'http://oas.alumnicloud.net:4444/userinfo',
+      base_url: process.env.HYDRA_BASE_URL || 'http://oas.example.net:4444',
+      authorization_endpoint: process.env.AUTHORIZE_URL || 'http://oas.example.net:4444/oauth2/auth',
+      userinfo_endpoint: process.env.USERINFO_URL || 'http://oas.example.net:4444/userinfo',
       scope: ['openid', 'profile', 'email', 'openappstack_roles'],
-      access_token_endpoint: 'http://oas.alumnicloud.net:4444/oauth2/token',
+      access_token_endpoint: process.env.ACCESS_TOKEN_URL || 'http://oas.example.net:4444/oauth2/token',
       response_type: 'token',
       token_type: 'Bearer',
-      redirect_uri: 'http://oas.alumnicloud.net:3000/callback',
-      client_id: 'user-panel',
-      client_secret: 'secret_secret',
+      redirect_uri: process.env.REDIRECT_URL || 'http://oas.example.net:3000/callback',
+      client_id: process.env.OAUTH_CLIENT_ID || 'user-panel',
+      client_secret: process.env.OAUTH_CLIENT_SECRET || 'secret_secret',
       }
     },
     scopeKey: "openappstack_roles"
-- 
GitLab