Skip to content

Commit

Permalink
Replace nuxt with blank vue (vuetify) project (#3608)
Browse files Browse the repository at this point in the history
* Replaced nuxt through vuetify project and adapt web-ui-solution to new build
* Added license headers and extended apply-headers script
  • Loading branch information
lorriborri authored Nov 14, 2024
1 parent 8844fc2 commit a8c3f3e
Show file tree
Hide file tree
Showing 57 changed files with 4,737 additions and 7,967 deletions.
4 changes: 4 additions & 0 deletions apply-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ applySPDXonSecondLine "sh" "# $SPDX_TEXT"
applySPDXonFirstLine "sql" "-- $SPDX_TEXT"
applySPDXonFirstLine "yaml" "# $SPDX_TEXT"
applySPDXonFirstLine "yml" "# $SPDX_TEXT"
applySPDXonFirstLine "ts" "// $SPDX_TEXT"
applySPDXonFirstLine "d.ts" "// $SPDX_TEXT"
applySPDXonFirstLine "vue" "<!-- $SPDX_TEXT -->"


# for plantuml we do no longer apply automatically, because a comment before
# a @startUml is problematic
Expand Down
2 changes: 2 additions & 0 deletions github-actions/scan/src/client-version-helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

import axios from 'axios';
import { load } from 'cheerio';
import * as core from '@actions/core';
Expand Down
2 changes: 2 additions & 0 deletions github-actions/scan/src/json-helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

import * as core from '@actions/core';

/**
Expand Down
2 changes: 2 additions & 0 deletions github-actions/scan/src/platform-helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

import * as os from 'os';

export function getPlatform() {
Expand Down
2 changes: 2 additions & 0 deletions sechub-web-ui-solution/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Attention: currently only self-signed certificates are used.
----
./01-start-single-docker-compose.sh
----

The current webui is available at https://localhost
6 changes: 3 additions & 3 deletions sechub-web-ui-solution/docker-compose_web_ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ services:
- BUILD_TYPE=${BUILD_TYPE}
- BASE_IMAGE=${BASE_IMAGE}
- WEB_UI_VERSION=${WEB_UI_VERSION}
- TAG=${TAG}
- BRANCH=${BRANCH}
- GIT_TAG=${GIT_TAG}
- GIT_BRANCH=${GIT_BRANCH}
context: docker/
dockerfile: Web-UI-Debian.dockerfile
working_dir: /var/www/html/web-ui
container_name: web-ui
ports:
- "443:8443"
- "443:4443"
env_file:
- .env
networks:
Expand Down
14 changes: 7 additions & 7 deletions sechub-web-ui-solution/docker/Web-UI-Debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ RUN cd "${WEB_UI_BUILD_FOLDER}" && \
./clone.sh "$GIT_URL" "$GIT_BRANCH" "$GIT_TAG" && \
cd "sechub/sechub-web-ui" && \
npm install && \
npx nuxi generate && \
cp -r .output "${WEB_UI_ARTIFACTS}"
npm run build && \
cp -r dist "${WEB_UI_ARTIFACTS}"


#-------------------
Expand Down Expand Up @@ -69,15 +69,15 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get install --assume-yes --quiet unzip wget && \
apt-get clean

RUN mkdir -p "${WEB_UI_ARTIFACTS}/.output/public" && \
cd "${WEB_UI_ARTIFACTS}/.output/public" && \
RUN mkdir -p "${WEB_UI_ARTIFACTS}/dist" && \
cd "${WEB_UI_ARTIFACTS}/dist" && \
wget "https://github.com/mercedes-benz/sechub/releases/download/v${WEB_UI_VERSION}-web-ui/${WEB_UI_RELEASE_ZIP}" && \
wget "https://github.com/mercedes-benz/sechub/releases/download/v${WEB_UI_VERSION}-web-ui/${WEB_UI_RELEASE_ZIP}.sha256sum" && \
sha256sum --check "${WEB_UI_RELEASE_ZIP}.sha256sum" && \
unzip ${WEB_UI_RELEASE_ZIP} && \
rm -f "${WEB_UI_RELEASE_ZIP}" "${WEB_UI_RELEASE_ZIP}.sha256sum"


#-------------------
# Builder
#-------------------
Expand Down Expand Up @@ -143,7 +143,7 @@ RUN mkdir -p "$CERTIFICATE_DIRECTORY" && \
openssl dhparam -out "$CERTIFICATE_DIRECTORY"/certsdhparam.pem 2048 2>&1 | sed 's/\.//g'

# Copy content to web server's document root
COPY --from=builder "${WEB_UI_ARTIFACTS}/.output/public" "${HTDOCS_FOLDER}"
COPY --from=builder "${WEB_UI_ARTIFACTS}/dist" "${HTDOCS_FOLDER}"

# Create PID file and set permissions
RUN touch /var/run/nginx.pid && \
Expand Down
3 changes: 2 additions & 1 deletion sechub-web-ui-solution/env
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ WEB_UI_VERSION="0.1.0"

# Git information if the BUILD_TYPE is set to `build`
GIT_TAG=""
GIT_BRANCH=""
GIT_BRANCH=""
WEB_UI_SSL_KEYSTORE_ALIAS="undefined"
4 changes: 4 additions & 0 deletions sechub-web-ui/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11
5 changes: 5 additions & 0 deletions sechub-web-ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
76 changes: 76 additions & 0 deletions sechub-web-ui/.eslintrc-auto-import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"WritableComputedRef": true,
"computed": true,
"createApp": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"effectScope": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useRoute": true,
"useRouter": true,
"useSlots": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"DirectiveBinding": true,
"MaybeRef": true,
"MaybeRefOrGetter": true,
"onWatcherCleanup": true,
"useId": true,
"useModel": true,
"useTemplateRef": true
}
}
20 changes: 20 additions & 0 deletions sechub-web-ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* .eslint.js
*
* ESLint configuration file.
*/

module.exports = {
root: true,
env: {
node: true,
},
extends: [
'vuetify',
'@vue/eslint-config-typescript',
'./.eslintrc-auto-import.json',
],
rules: {
'vue/multi-word-component-names': 'off',
},
}
41 changes: 18 additions & 23 deletions sechub-web-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
.DS_Store
node_modules
/dist

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea
# local env files
.env.local
.env.*.local

# Local env files
.env
.env.*
!.env.example
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Local certificates
certs
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions sechub-web-ui/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.9.0
49 changes: 16 additions & 33 deletions sechub-web-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,39 @@
<!-- SPDX-License-Identifier: MIT --->
# Nuxt 3 Minimal Starter
# SecHub Web UI

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
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/).

## Setup
## Usage

Make sure to install the dependencies:
### Installation

```bash
# npm (initial build with npm 10.8.3)
npm install
```

## Development Server (per default on https)

Start the development server on `https://localhost:3000`:
Install the node version manager (nvm) and use it to install the correct version of Node.js:

```bash
# generate local certificates (only once)
./generate-certificate.sh

# npm
npm run dev -- -o
nvm use
```

## Production

Build the application for production:
Install the project dependencies:

```bash
# npm
npm run build
npm install
```

Locally preview production build:
### Starting the Development Server

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

```bash
# npm
npm run preview
npm run dev
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
> Add NODE_OPTIONS='--no-warnings' to suppress the JSON import warnings that happen as part of the Vuetify import mapping. If you are on Node [v21.3.0](https://nodejs.org/en/blog/release/v21.3.0) or higher, you can change this to NODE_OPTIONS='--disable-warning=5401'. If you don't mind the warning, you can remove this from your package.json dev script.
## Deployment
### Building for Production

### Entrypoint
To build your project for production, use:

```bash
# node (tested with node v22.9.0)
node .output/server/index.mjs
npm run build
```

### Port and Host

listening to default environment variables 'HOST' (default: 0.0.0.0) and PORT (default 3000)
5 changes: 0 additions & 5 deletions sechub-web-ui/app.vue

This file was deleted.

9 changes: 0 additions & 9 deletions sechub-web-ui/generate_local_certificates.sh

This file was deleted.

16 changes: 16 additions & 0 deletions sechub-web-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to Vuetify 3</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
30 changes: 0 additions & 30 deletions sechub-web-ui/nuxt.config.ts

This file was deleted.

Loading

0 comments on commit a8c3f3e

Please sign in to comment.