Skip to content

Commit 4b5e054

Browse files
committed
feat(ui): moved WebUI code from separate repository to components/secutils-webui
1 parent 65f75c7 commit 4b5e054

File tree

150 files changed

+21455
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+21455
-594
lines changed

.dockerignore

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +0,0 @@
1-
target
2-
dev/api
3-
4-
.env
5-
.github
6-
.gitignore
7-
8-
LICENSE
9-
*.md
10-
11-
*.json
12-
13-
secutils.toml

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ on:
66
paths-ignore:
77
- 'dev/**'
88
- 'Dockerfile'
9+
- 'Dockerfile.webui'
910
- 'Dockerfile.aarch64-unknown-linux-musl'
1011
- 'LICENSE'
1112
- '*.md'
1213
- '.husky/**'
13-
- '*.json'
1414

1515
env:
1616
CARGO_TERM_COLOR: always
1717
DATABASE_URL: postgres://postgres@localhost:5432/secutils
1818

1919
jobs:
20-
ci:
21-
name: Build (Linux)
20+
ci-api:
21+
name: Build API (Linux)
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
@@ -32,7 +32,6 @@ jobs:
3232
- 5432:5432
3333
steps:
3434
- uses: actions/checkout@v4
35-
name: Checkout
3635

3736
- name: Install Protoc
3837
uses: arduino/setup-protoc@v3
@@ -53,7 +52,7 @@ jobs:
5352

5453
- name: Check database schema
5554
run: |
56-
cargo install --force sqlx-cli
55+
cargo install --locked --force sqlx-cli
5756
cargo sqlx database create
5857
cargo sqlx migrate run
5958
cargo sqlx prepare --check
@@ -66,3 +65,19 @@ jobs:
6665

6766
- name: Clippy
6867
run: cargo clippy --workspace --all-targets -- -D warnings
68+
ci-webui:
69+
name: Build Web UI (Linux)
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- uses: actions/setup-node@v4
75+
with:
76+
node-version-file: '.nvmrc'
77+
cache: 'npm'
78+
79+
- name: Install dependencies
80+
run: npm ci --ws
81+
82+
- name: Build
83+
run: npm run build -w components/secutils-webui

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules/
22
target/
3+
dist
4+
.parcel-cache
35

46
.idea/
57
.env

.proxyrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"/api": {
3+
"target": "http://127.0.0.1:7070/"
4+
},
5+
"/docs": {
6+
"target": "http://127.0.0.1:7373/"
7+
},
8+
"/self-service": {
9+
"target": "http://127.0.0.1:4433/"
10+
}
11+
}

Dockerfile.dockerignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Paths that should be ignored by all Docker images
2+
node_modules
3+
.idea
4+
.DS_Store
5+
dev
6+
.parcel-cache
7+
target
8+
dist
9+
.env
10+
.nvmrc
11+
.github
12+
.husky
13+
Dockerfile
14+
Dockerfile.webui
15+
*.md
16+
LICENSE
17+
secutils.toml
18+
rustfmt.toml
19+
20+
# Path that should be ignored by api Docker image
21+
/components
22+
*.json

Dockerfile.webui

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM --platform=$BUILDPLATFORM node:22-alpine3.21 AS builder
4+
WORKDIR /app
5+
6+
# See, https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
7+
RUN apk add --no-cache python3 make g++
8+
9+
# Copy workspace root `package.json` and `package-lock.json` files,
10+
# and `package.json` file from the component, to just install dependencies.
11+
COPY ["./*.json", "./"]
12+
COPY ["./components/secutils-webui/package.json", "./components/secutils-webui/"]
13+
RUN set -x && npm ci --ws
14+
15+
# Now copy the rest of the component files and build it.
16+
COPY ["./components/secutils-webui", "./components/secutils-webui"]
17+
RUN set -x && npm run build --ws
18+
19+
FROM nginxinc/nginx-unprivileged:alpine3.21-slim
20+
COPY --from=builder ["/app/components/secutils-webui/dist/", "/usr/share/nginx/html/"]
21+
COPY ["./components/secutils-webui/config/nginx.conf", "/etc/nginx/conf.d/default.conf"]

Dockerfile.webui.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Paths that should be ignored by all Docker images
2+
node_modules
3+
.idea
4+
.DS_Store
5+
dev
6+
.parcel-cache
7+
target
8+
dist
9+
.env
10+
.nvmrc
11+
.github
12+
.husky
13+
Dockerfile
14+
*.md
15+
LICENSE
16+
secutils.toml
17+
rustfmt.toml

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
Secutils.dev is an open-source, versatile, yet simple security toolbox for engineers and researchers built by
44
application security engineers.
55

6-
Refer to [secutils-dev/secutils-webui](https://github.com/secutils-dev/secutils-webui) for the web interface component
7-
of Secutils.dev.
8-
96
## Why Secutils.dev?
107

118
Big security solutions are impressive, but often too expensive, complex, and kind of overkill for us regular engineers.
@@ -127,10 +124,13 @@ SELFSERVICE_FLOWS_REGISTRATION_AFTER_WEBAUTHN_HOOKS_0_CONFIG_AUTH_CONFIG_VALUE="
127124
COURIER_HTTP_REQUEST_CONFIG_AUTH_CONFIG_VALUE="Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NDcyMDExNTcsInN1YiI6IkBrcmF0b3MifQ.O506N__dZu7ZM6p-rEr_QkMn3jp0mRyBwKP7jstRHV8"
128125
```
129126

127+
### Web UI
128+
129+
Install all the required dependencies with `npm install` and run the UI in watch mode with `npm run watch -w components/secutils-webui`. The UI should be accessible at http://localhost:7171.
130+
130131
### Usage
131132

132-
At this point, it is recommended to use the Secutils.dev APIs through
133-
the [Web UI](https://github.com/secutils-dev/secutils-webui), but you can also generate a JSON Web Token and use the
133+
At this point, it is recommended to use the Secutils.dev APIs through the Web UI, but you can also generate a JSON Web Token and use the
134134
APIs directly with `curl` or any other HTTP client. To generate a token, run the following command:
135135

136136
```shell
@@ -167,9 +167,11 @@ Build images with the following commands:
167167
```shell
168168
# Host architecture
169169
docker build --tag secutils-api:latest .
170+
docker build --tag secutils-webui:latest -f Dockerfile.webui .
170171

171172
# Cross-compile to ARM64 architecture
172173
docker build --platform linux/arm64 --tag secutils-api:latest .
174+
docker build --platform linux/arm64 --tag secutils-webui:latest -f Dockerfile.webui .
173175

174176
# Cross-compile to ARM64 musl architecture
175177
docker build --platform linux/arm64 --tag secutils-api:latest -f Dockerfile.aarch64-unknown-linux-musl .
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"compressors": {
4+
"*.{html,css,js,svg,map}": [
5+
"...",
6+
"@parcel/compressor-gzip",
7+
"@parcel/compressor-brotli"
8+
]
9+
},
10+
"transformers": {
11+
"favicon.ico": ["@parcel/transformer-raw"],
12+
"*.{mp4,webm}": ["@parcel/transformer-raw"],
13+
"*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
14+
},
15+
"validators": {
16+
"*.{ts,tsx}": ["@parcel/validator-typescript"]
17+
}
18+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"tabWidth": 2
7+
}

0 commit comments

Comments
 (0)