Skip to content

Commit c775fa3

Browse files
authored
Merge branch 'main' into adding-sentry
2 parents bb98d53 + 9688ee6 commit c775fa3

File tree

12 files changed

+193
-114
lines changed

12 files changed

+193
-114
lines changed

.env.template

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
VITE_ENVIRONMENT=
2+
# Sentry DSN configuration, no need to be set for local setup
3+
VITE_SENTRY_DSN=
4+
BFF_SENTRY_DSN=
5+
26

37
# OpenID Connect Configuration for Onboarding API
48
OIDC_ISSUER=
@@ -21,5 +25,5 @@ SESSION_SECRET=
2125
FEEDBACK_SLACK_URL=
2226
FEEDBACK_URL_LINK=
2327

24-
# Sentry DSN
25-
VITE_SENTRY_DSN=
28+
# frame-ancestors attribute of CSP. Separate multiple values with a space
29+
FRAME_ANCESTORS=

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Use the latest LTS version of Node.js
22
# https://hub.docker.com/_/node
3-
FROM node:22@sha256:2fa6c977460b56d4d8278947ab56faeb312bc4cc6c4cf78920c6de27812f51c5 AS build-stage
3+
FROM node:22@sha256:9e6918e8e32a47a58ed5fb9bd235bbc1d18a8c272e37f15d502b9db9e36821ee AS build-stage
44
WORKDIR /usr/src/app
55

66
# Copy package.json and package-lock.json
@@ -15,7 +15,7 @@ COPY . .
1515
RUN npm run build
1616

1717
# The same image but now only install the production dependencies as the frontend is already built using vite in the build-stage
18-
FROM gcr.io/distroless/nodejs22-debian12@sha256:fd90468f47e91d0d3c9bc055c8c09edbf0c225c3c795d0c266e2ca94b3ba17e3 AS production
18+
FROM gcr.io/distroless/nodejs22-debian12@sha256:b765815eafacee5222bfa50179028f41dd8c642b68ad68ec4e6922d3b1ff2710 AS production
1919

2020
WORKDIR /usr/src/app
2121

README.md

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,72 @@
22

33
# ui-frontend
44

5-
## About this project
5+
## About This Project
66

77
This repository contains code relevant for the frontend component required in the Managed Control Plane UI (MCP UI), which is part of the @openmcp-project, more info [here](https://github.com/openmcp-project).
88

99
The MCP UI enables endusers to work with Managed Control Planes, without having to use kubectl. Note that the current focus of the UI is on displaying information about the various managed resources, as well as the MCP instances themselves. It is also possible to check the status of the resources, and display / copy their YAML representations.
1010

1111
Overall, the UI provides an easy jump-start for everyone interested in checking the status of Managed Control Planes, without having to use kubectl.
1212

13-
## Requirements and Setup
13+
## Getting Started
1414

15-
### Development
15+
### Development Setup
1616

17-
1. install dependencies: `npm i`
17+
#### Install Dependencies
1818

19-
1. Copy the `frontend-config.json` to `public/frontend-config.json` and adapt the `backendUrl` according to your setup (see section Dynamic Frontend Config).
19+
```bash
20+
npm i
21+
```
22+
23+
#### Configure Frontend
24+
25+
- Copy `frontend-config.json` to `public/frontend-config.json` and adapt the `backendUrl` according to your setup (see section Dynamic Frontend Config).
26+
- Copy `.env.template` to `.env` and fill in the missing values.
2027

21-
1. Connect to the ui-backend server
22-
**Run it locally**:
23-
- See `https://github.com/openmcp-project/ui-backend`
28+
#### Run the Application
29+
30+
```bash
31+
npm run dev
32+
```
2433

25-
1. Start the application:
34+
The UI will be served on http://localhost:5173.
2635

27-
Run `npm run dev`
2836

29-
### Build
37+
#### Safari Support
3038

31-
1. Build the application:
39+
**Note:** The frontend is currently incompatible with Safari when running locally on `localhost`.
3240

33-
Run `npm run build`
41+
To enable local development with Safari, follow these steps on your local machine:
3442

35-
2. Serve the application locally:
43+
1. **Update Cookie Settings:**
44+
In [`server/encrypted-session.js`](server/encrypted-session.js), set the `secure` property to `false` in both occurrences.
3645

37-
Run `npm run preview`
46+
2. **Disable Helmet Registration:**
47+
In [`server.js`](server.js), comment out or remove the registration of `helmet`.
3848

39-
3. For production:
4049

41-
Use the docker image which uses nginx for best performance and small bundle size.
42-
`docker build -t my-label .`
50+
### Build & Production
51+
52+
#### Build the Application
53+
54+
```bash
55+
npm run build
56+
```
57+
58+
#### Serve the Production Build Locally
59+
60+
```bash
61+
npm run preview
62+
```
63+
64+
#### Production Deployment
65+
66+
Use the docker image which uses nginx for best performance and small bundle size.
67+
68+
```bash
69+
docker build -t my-label .
70+
```
4371

4472
### Dynamic FrontendConfig
4573

@@ -50,11 +78,11 @@ An example docker run command would be
5078
docker run -p 5001:80 -e BACKEND_CONFIG="$(cat frontend-config.json)" -t ui-test
5179
```
5280

53-
## Support, Feedback, Contributing
81+
## Support & Contributing
5482

5583
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/openmcp-project/ui-frontend/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
5684

57-
## Security / Disclosure
85+
## Security & Disclosure
5886
If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openmcp-project/ui-frontend/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
5987

6088
## Code of Conduct
@@ -64,3 +92,7 @@ We as members, contributors, and leaders pledge to make participation in our com
6492
## Licensing
6593

6694
Copyright 2025 SAP SE or an SAP affiliate company and ui-frontend contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openmcp-project/ui-frontend).
95+
96+
---
97+
98+
**Happy contributing! 🚀**

index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88
<title>MCP</title>
99
</head>
1010

11-
<script>
12-
window.global ||= window;
13-
</script>
14-
1511
<body>
1612
<div id="root"></div>
1713
<script type="module" src="/src/mount.ts"></script>
1814
</body>
1915

20-
</html>
16+
</html>

0 commit comments

Comments
 (0)