Skip to content

Commit

Permalink
Merge branch 'main' into unit-test-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sahil143 authored Nov 18, 2024
2 parents 29c6b41 + 4d0c39a commit 5f7144b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,59 @@ A step by step series of examples that tell you how to get a development environ
```
yarn start
```
## Running with Konflux-ci
By default, the UI uses the stage cluster for API calls. However, if you want to run the UI with a local Konflux deployment, follow the steps below.
1. Follow the guide at https://github.com/konflux-ci/konflux-ci to deploy Konflux locally (use branch: `new-ui`)
2. Once you have Konflux deployed, make the following changes to your .env file:
```diff
# .env
+ AUTH_URL=https://127.0.0.1:9443/
+ REGISTRATION_URL=https://127.0.0.1:9443/
+ PROXY_URL=https://127.0.0.1:9443/
+ PROXY_WEBSOCKET_URL=wss://127.0.0.1:9443
- AUTH_URL= https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
- REGISTRATION_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
- PROXY_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
- PROXY_WEBSOCKET_URL=wss://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
```
3. Update your webpack.dev.config.js file with the following changes:

```diff
@@ webpack.dev.config.js:14 @@
historyApiFallback: true,
hot: true,
server: 'https',
proxy: [
{
+ context: (path) => path.includes('/oauth2/') || path.includes('/idp/'),
- context: (path) => path.includes('/oauth2/'),
target: process.env.AUTH_URL,
secure: false,
changeOrigin: true,
+ autoRewrite: true,
- autoRewrite: false,
toProxy: true,
headers: {
'X-Forwarded-Host': `localhost:${DEV_SERVER_PORT}`,
},
onProxyRes: (proxyRes) => {
const location = proxyRes.headers['location'];
if (location) {
proxyRes.headers['location'] = location.replace(
+ 'localhost:9443',
+ `localhost:${DEV_SERVER_PORT}`,
- 'konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com%2Foauth2',
- `localhost:${DEV_SERVER_PORT}/oauth2`,
);
}
},

```

## Available Scripts

Expand Down

0 comments on commit 5f7144b

Please sign in to comment.