You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/21 02:34:52 UTC

[GitHub] mhamann closed pull request #269: add PUBLIC_MANAGEDURL_CONNECT to override HOST:PORT assumption

mhamann closed pull request #269: add PUBLIC_MANAGEDURL_CONNECT to override HOST:PORT assumption
URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/269
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/api-gateway.conf b/api-gateway.conf
index ecf7b22..f82e06f 100644
--- a/api-gateway.conf
+++ b/api-gateway.conf
@@ -31,6 +31,7 @@ env REDIS_PASS;
 env REDIS_TIMEOUT;
 env PUBLIC_MANAGEDURL_HOST;
 env PUBLIC_MANAGEDURL_PORT;
+env PUBLIC_GATEWAY_URL;
 env HOST;
 env PORT;
 
diff --git a/scripts/lua/management/lib/apis.lua b/scripts/lua/management/lib/apis.lua
index c27564e..04161f2 100644
--- a/scripts/lua/management/lib/apis.lua
+++ b/scripts/lua/management/lib/apis.lua
@@ -27,6 +27,8 @@ local MANAGEDURL_HOST = os.getenv("PUBLIC_MANAGEDURL_HOST")
 MANAGEDURL_HOST = (MANAGEDURL_HOST ~= nil and MANAGEDURL_HOST ~= '') and MANAGEDURL_HOST or "0.0.0.0"
 local MANAGEDURL_PORT = os.getenv("PUBLIC_MANAGEDURL_PORT")
 MANAGEDURL_PORT = (MANAGEDURL_PORT ~= nil and MANAGEDURL_PORT ~= '') and MANAGEDURL_PORT or "8080"
+local GATEWAY_URL = os.getenv("PUBLIC_GATEWAY_URL")
+GATEWAY_URL = (GATEWAY_URL ~= nil and GATEWAY_URL ~= '') and GATEWAY_URL or utils.concatStrings({"http://", MANAGEDURL_HOST, ":", MANAGEDURL_PORT})
 
 local _M = {}
 
@@ -87,7 +89,7 @@ function _M.addAPI(dataStore, decoded, existingAPI)
   basePath = basePath:sub(-1) == '/' and basePath:sub(1, -2) or basePath
   -- Create managedUrl object
   local uuid = existingAPI ~= nil and existingAPI.id or utils.uuid()
-  local managedUrl = utils.concatStrings({"http://", MANAGEDURL_HOST, ":", MANAGEDURL_PORT, "/api/", decoded.tenantId})
+  local managedUrl = utils.concatStrings({GATEWAY_URL, "/api/", decoded.tenantId})
   if basePath:sub(1,1) ~= '' then
     managedUrl = utils.concatStrings({managedUrl, "/", basePath})
   end


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services