Skip to content

Commit

Permalink
Add console proxy and USE_CLOUD env variable (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
karelhala authored Jul 29, 2021
1 parent 1cdbc59 commit 31b6681
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ $ bash scripts/run.sh
$ SPANDX_CONFIG=/path/to/custom/config.js bash ~/path/to/insights-proxy/scripts/run.sh
```

### Run the container with cloud proxy

In order to run the container with cloud.redhat.com as main source of data you have to set `USE_CLOUD` env variable.
```
$ USE_CLOUD=true ~/path/to/insights-proxy/scripts/run.sh
```

### Run with local Insights Chrome (for chrome developers only)
This is for Chrome developers only.
If you are developing an application on the platform you need not do this!
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "insights-proxy",
"version": "3.1.9",
"version": "3.1.10",
"description": "Proxy for local Insights development",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 5 additions & 4 deletions spandx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const url = require('url-parse');
const localhost = (process.env.PLATFORM === 'linux') ? 'localhost' : 'host.docker.internal';
const protocol = (process.env.SSL === 'true') ? 'https' : 'http';
const port = process.env.PORT || 8002;
const useCloud = process.env.USE_CLOUD;

const PORTAL_BACKEND_MARKER = 'PORTAL_BACKEND_MARKER';

Expand Down Expand Up @@ -55,22 +56,22 @@ const buildUser = input => {
const envMap = {
ci: {
keycloakPubkey: keycloakPubkeys.qa,
target: 'https://ci.cloud.redhat.com',
target: `https://ci.${useCloud ? 'cloud' : 'console'}.redhat.com`,
str: 'ci'
},
qa: {
keycloakPubkey: keycloakPubkeys.qa,
target: 'https://qa.cloud.redhat.com',
target: `https://qa.${useCloud ? 'cloud' : 'console'}.redhat.com`,
str: 'qa'
},
stage: {
keycloakPubkey: keycloakPubkeys.stage,
target: 'https://cloud.stage.redhat.com',
target: `https://${useCloud ? 'cloud' : 'console'}.stage.redhat.com`,
str: 'stage'
},
prod: {
keycloakPubkey: keycloakPubkeys.prod,
target: 'https://cloud.redhat.com',
target: `https://${useCloud ? 'cloud' : 'console'}.redhat.com`,
str: 'prod'
}
};
Expand Down

0 comments on commit 31b6681

Please sign in to comment.