diff --git a/.rhdh/docker/Dockerfile b/.rhdh/docker/Dockerfile index a4dabd9ecd..0b32f955e9 100644 --- a/.rhdh/docker/Dockerfile +++ b/.rhdh/docker/Dockerfile @@ -233,6 +233,13 @@ ENV CHOKIDAR_USEPOLLING='1' CHOKIDAR_INTERVAL='10000' # To avoid running scripts when using `npm pack` to install dynamic plugins ENV NPM_CONFIG_ignore-scripts='true' +# RHIDP-2217: corporate proxy support (configured using 'global-agent') +# This is to avoid having to define several environment variables for the same purpose, +# i.e, GLOBAL_AGENT_HTTP(S)_PROXY (for 'global-agent') and the conventional HTTP(S)_PROXY (honored by other libraries like Axios). +# By setting GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE to an empty value, +# 'global-agent' will use the same HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. +ENV GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE='' + ENTRYPOINT ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.example.yaml", "--config", "app-config.example.production.yaml"] # append Brew metadata here diff --git a/docker/Dockerfile b/docker/Dockerfile index b1277c0e30..cd9882dbce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -137,6 +137,13 @@ ENV CHOKIDAR_USEPOLLING='1' CHOKIDAR_INTERVAL='10000' # To avoid running scripts when using `npm pack` to install dynamic plugins ENV NPM_CONFIG_ignore-scripts='true' +# RHIDP-2217: corporate proxy support (configured using 'global-agent') +# This is to avoid having to define several environment variables for the same purpose, +# i.e, GLOBAL_AGENT_HTTP(S)_PROXY (for 'global-agent') and the conventional HTTP(S)_PROXY (honored by other libraries like Axios). +# By setting GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE to an empty value, +# 'global-agent' will use the same HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. +ENV GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE='' + ENTRYPOINT ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.example.yaml", "--config", "app-config.example.production.yaml"] # append Brew metadata here diff --git a/showcase-docs/corporate-proxy.md b/showcase-docs/corporate-proxy.md index 2ffeab3561..d9e7bffb06 100644 --- a/showcase-docs/corporate-proxy.md +++ b/showcase-docs/corporate-proxy.md @@ -2,7 +2,6 @@ Out of the box, the Showcase application can be run behind a corporate proxy, by setting any of the following environment variables prior to starting the application: -- `GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE` to an empty value - `HTTP_PROXY`: HTTP proxy to use. - `HTTPS_PROXY`: distinct proxy to use for HTTPS requests. @@ -16,8 +15,6 @@ You can set the proxy information in your Helm `values` file, like so: upstream: backstage: extraEnvVars: - - name: GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE - value: '' - name: HTTP_PROXY # HTTP proxy to use value: '' @@ -38,14 +35,12 @@ upstream: upstream: backstage: extraEnvVars: - - name: GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE - value: '' - name: HTTP_PROXY value: 'http://10.10.10.105:3128' - name: HTTPS_PROXY value: 'http://10.10.10.106:3128' - name: NO_PROXY - value: 'localhost,internal.example.org' + value: 'localhost,example.org' ``` @@ -59,8 +54,6 @@ spec: application: extraEnvs: envs: - - name: GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE - value: '' - name: HTTP_PROXY # HTTP proxy to use value: '' @@ -82,14 +75,26 @@ spec: application: extraEnvs: envs: - - name: GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE - value: '' - name: HTTP_PROXY value: 'http://10.10.10.105:3128' - name: HTTPS_PROXY value: 'http://10.10.10.105:3128' - name: NO_PROXY - value: 'localhost,internal.example.org' + value: 'localhost,example.org' ``` + +## Local development + +If you are behind a corporate proxy and are running the Showcase locally, as depicted in [Running locally with a basic configuration](./getting-started.md#running-locally-with-a-basic-configuration) or [Running locally with the Optional Plugins](./getting-started.md#running-locally-with-the-optional-plugins), you will need to additionally set the `GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE` to an empty value prior to running `yarn start`. + +Example: + +```shell +$ GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE='' \ + HTTP_PROXY=http://10.10.10.105:3128 \ + HTTPS_PROXY=http://10.10.10.106:3128 \ + NO_PROXY='localhost,example.org' \ + yarn start +```