Skip to content

Commit 3de4543

Browse files
authored
Refactored web-ui ENV and apply-headers.sh
1 parent 1a0887e commit 3de4543

File tree

22 files changed

+232
-188
lines changed

22 files changed

+232
-188
lines changed

apply-headers.sh

+20-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33

44
SPDX_TEXT="SPDX-License-Identifier: MIT"
55

6+
# List of files to exclude
7+
exclude_files=("auto-imports.d.ts" "components.d.ts" "typed-router.d.ts")
8+
9+
# Function to check if a file is in the exclude list
10+
function is_excluded() {
11+
local file=$1
12+
filename=$(basename "$file")
13+
for excluded in "${exclude_files[@]}"; do
14+
if [[ "$filename" == "$excluded" ]]; then
15+
return 0
16+
fi
17+
done
18+
return 1
19+
}
20+
621
function isColoredTerminal(){
722
# check if stdout is a terminal...
823
if test -t 1; then
@@ -29,12 +44,16 @@ function applySPDXline {
2944
echo -e " ${LIGHT_GREEN}Scanning '*.$fileEnding' files${NC}"
3045
# Loop over all files matching the pattern, but skip some patterns like generated files
3146
find . -type f -iname \*.$fileEnding \
32-
| grep -v '^./.git\|/build/\|/\.gradle/\|gradlew.bat\|sechub-cli/pkg/mod\|sechub-cli/src/mercedes-benz.com/sechub/pkg/mod/' \
47+
| grep -v '^./.git\|/build/\|/node_modules/\|/\.gradle/\|gradlew.bat\|sechub-cli/pkg/mod\|sechub-cli/src/mercedes-benz.com/sechub/pkg/mod/' \
3348
| while read file ; do
49+
if ! is_excluded "$file"; then
3450
if ! grep -q "$SPDX_TEXT" $file ; then
3551
sed -i "${line}i $spdxMessage" "$file"
3652
echo -e "${BROWN}$file${NC} - ${LIGHT_GREEN}copyright appended.${NC}"
3753
fi
54+
else
55+
echo "Skipping excluded file: $file"
56+
fi
3857
done
3958
}
4059

@@ -98,7 +117,6 @@ applySPDXonFirstLine "sql" "-- $SPDX_TEXT"
98117
applySPDXonFirstLine "yaml" "# $SPDX_TEXT"
99118
applySPDXonFirstLine "yml" "# $SPDX_TEXT"
100119
applySPDXonFirstLine "ts" "// $SPDX_TEXT"
101-
applySPDXonFirstLine "d.ts" "// $SPDX_TEXT"
102120
applySPDXonFirstLine "vue" "<!-- $SPDX_TEXT -->"
103121

104122

sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/login/WebLoginVerificationConfiguration.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: MIT
12
package com.mercedesbenz.sechub.commons.model.login;
23

34
import java.net.URL;

sechub-commons-model/src/test/java/com/mercedesbenz/sechub/commons/model/login/WebLoginVerificationConfigurationTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: MIT
12
package com.mercedesbenz.sechub.commons.model.login;
23

34
import static org.junit.jupiter.api.Assertions.*;

sechub-doc/src/main/java/com/mercedesbenz/sechub/docgen/ConfigurationPropertiesData.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: MIT
12
package com.mercedesbenz.sechub.docgen;
23

34
import java.lang.reflect.Constructor;

sechub-web-ui-solution/README.adoc

+5-8
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,23 @@ remove the root `redirect / to login page` if you do not have login enabled in t
1414

1515
2. Adjust the docker/nginx/config.json to your needs: +
1616
+
17-
If you do not have login enabled, you can set basic auth for the Web-UI in the config.json file. +
17+
If you do not have login enabled, you can set basic auth for the Web-UI in the config.json file. in docker/nginx/ +
18+
The values can be changed at runtime +
1819
+
1920
.ENV that can be set in the config.json file
2021
|===
2122
|Name |Default Value |Description
2223

23-
|HOST
24-
|http://localhost
25-
|The URL of the Web-UI (used as API Endpoint to prevent CORS issues)
26-
27-
|LOCAL_DEV
24+
|BASIC_AUTH_DEV
2825
|false
2926
|Sets Basic Auth for the Web-UI (only for development, username and password must be set)
3027

3128
|USERNAME
32-
|''
29+
|undefined
3330
|Basic Auth username (only for development)
3431

3532
|PASSWORD
36-
|''
33+
|undefined
3734
|Basic Auth password (only for development)
3835
|===
3936

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
{
2-
"HOST": "https://localhost"
32
}

sechub-web-ui/README.md

+27-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
This project is a web application that provides a user interface for the SecHub API. It is built with [Vite](https://vitejs.dev/), [Vue 3](https://v3.vuejs.org/), and [Vuetify](https://vuetifyjs.com/en/).
55

6-
## Usage
6+
## Prequisites
77

88
### Installation
99

@@ -24,17 +24,6 @@ Install the project dependencies:
2424
npm install
2525
```
2626

27-
### Create a local configuration (.env)
28-
29-
Create a `.env` file in the sechub-webui directory
30-
31-
```bash
32-
VITE_API_HOST=http://localhost:3000
33-
VITE_API_USER=<your-api-user>
34-
VITE_API_PASSWORD=<your-api-password>
35-
VITE_API_LOCAL_DEV=true
36-
```
37-
3827
### Building openAPI SecHub Client
3928

4029
To generate the SecHub openAPI Client use:
@@ -43,25 +32,45 @@ To generate the SecHub openAPI Client use:
4332
npm run generate-api-client
4433
```
4534

46-
### Starting the Development Server
35+
## Usage
36+
37+
### Running local development server with SecHub Integrationtest Server
38+
39+
#### Create a local configuration (.env) with Basic Auth
40+
41+
Create a `.env` file in the sechub-webui directory
42+
43+
```bash
44+
VITE_API_USERNAME=<your-api-user>
45+
VITE_API_PASSWORD=<your-api-password>
46+
VITE_API_BASIC_AUTH_DEV=true
47+
```
48+
49+
#### Start the Development Server
4750

4851
To start the development server with hot-reload, run the following command. The server will be accessible at [http://localhost:3000](http://localhost:3000):
4952

5053
```bash
5154
npm run dev
5255
```
5356

54-
#### Running in Development mode with SecHub Integrationtest Server and PDS Integrationtest Server (using Mocked scan products)
57+
#### Start SecHub Integrationtest Server
58+
59+
If you want to get Server responses, start the SecHub integrationtest Server e.g. via your IDE see the [developer guide](https://mercedes-benz.github.io/sechub/latest/sechub-developer-quickstart-guide.html#run-integration-tests-from-ide) for instructions.
60+
Use the SecHub user and password for your basic auth .env file.
61+
You can use the sechub-api.sh script to manage your user and project.
62+
63+
### Running local development server with SecHub Integrationtest Server and PDS Integrationtest Server (Mocked Products)
5564
> Only useful If you want to get mocked scan results
56-
1. Follow the steps above
65+
1. Follow all steps above
5766
2. Start the integration test PDS
5867
(for the correct run configuration follow the [developer guide](https://mercedes-benz.github.io/sechub/latest/sechub-developer-quickstart-guide.html#run-integration-tests-from-ide))
59-
3. (Optional) Initial setup: execute /test-setups/setup-integration-test-server.sh
68+
3. (Optional) Initial setup: execute `test-setups/setup-integration-test-server.sh`. Make sure the .env file contains the correct values for basic auth.
6069

61-
#### Running in Development mode with SecHub Server and PDS as Docker Container
70+
### Running local development server with SecHub Docker Container and PDS Docker Container (Real Products)
6271
> Only useful If you want to get real scan results
6372
1. Start the SecHub Server as Docker Container (see sechub-solution/01-...)
64-
2. Start the required PDS as Docker (e.g. sechub-pds-solutions/gosec/05-...)
73+
2. Start the required PDS as Docker Container (e.g. sechub-pds-solutions/gosec/05-...)
6574
3. Set up PDS in sechub-solution/setups/ e.g. setup-gosec.sh
6675
4. Make sure your user is assigned to the project you want to scan
6776

0 commit comments

Comments
 (0)