wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
845 stars 785 forks source link

Gateway environments endpoint toml configuration does not support environment variable #8324

Open dushansilva opened 4 years ago

dushansilva commented 4 years ago

Description:

When the following configuration is used in the deployment.toml https_endpoint = "https://$env{WSO2_BASE_DOMAIN}"

and when we take a look at api-manager.xml it is

https://$env{WSO2_BASE_DOMAIN},http://localhost:${http.nio.port}

seems like toml configuration is not properly parsed when reading it. I also checked this in APIM 3.0 WUM UPDATED, it works without any issue. Therefore it seems like it has been broken on APIM 3.1

Affected Product Version:

APIM 3.1

juanledesma84 commented 3 years ago

Hi @dushansilva

I'm trying to configure those parameters in deployment.toml:

[[apim.gateway.environment]]
ws_endpoint = "ws://$env{HOST}:9099"
wss_endpoint = "wss://$env{HOST}:8099"
http_endpoint = "http://$env{HOST}:${http.nio.port}"
https_endpoint = "https://$env{HOST}:${https.nio.port}"

[apim.devportal]
url = "https://$env{DNS}:${mgt.transport.https.port}/devportal"

And when I checked at api-manager.xml it is:

<Environment type="hybrid" api-console="true" isDefault="true">
  <!-- Endpoint URLs for the APIs hosted in this API gateway.-->
  <GatewayEndpoint>https://$env{DNS}:${https.nio.port},http://$env{DNS}:${http.nio.port}</GatewayEndpoint>
  <!-- Endpoint URLs of the WebSocket APIs hosted in this API Gateway -->
  <GatewayWSEndpoint>ws://$env{DNS}:9099,wss://$env{DNS}:8099</GatewayWSEndpoint>
</Environment>

I wonder if there is a workaround to solve this issue.

PRODUCT: Docker APIM 3.2.0 Image: wso2/wso2am:3.2.0-alpine