Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
npm-debug.log
node_modules
dist
Dockerfile
Dockerfile.dev
.dockerignore
.gitignore
.env
npm-debug.log
node_modules
dist
Dockerfile
Dockerfile.dev
.dockerignore
.gitignore
.env
.env.example
84 changes: 42 additions & 42 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# .env.example — example environment variables for SOARCA-GUI
# Copy this file to `.env.development` for local dev or to `.env` for Docker Compose
# Notes:
# - Vite exposes ONLY variables prefixed with `VITE_` to the client (import.meta.env).
# - Client-visible `VITE_` values are embedded at *build time* (rebuild to change).
# - Docker Compose reads the project `.env` for substitution and container envs.
# - We also follow a consumer based prefix convention for clarity, so variables used by nginx start with NGINX_, those used by the dev server start with VITE_ etc.
# - Login providers are not set here. They live in config/auth-config.json (see config/auth-config.example.json and the README).
########## Development (Vite) ##########
# Used by `npm run dev` / Vite dev server. Client-facing variables MUST start with VITE_.
# copy these lines into `.env.development` or `.env` (see Vite docs at https://vite.dev/guide/env-and-mode) and adjust as needed for local development
VITE_BACKEND_URL=http://localhost:8080 # backend API URL used by the frontend (dev server proxy target)
VITE_SERVER_PORT=5173 # dev server port
VITE_ENABLE_HTTPS=false # set true to serve the GUI over HTTPS
VITE_HTTPS_CERT_FILE= # required when VITE_ENABLE_HTTPS=true
VITE_HTTPS_KEY_FILE= # required when VITE_ENABLE_HTTPS=true
VITE_VERIFY_SSL=false # set true to verify the backend TLS certificate
VITE_USE_POLLING=false # set true when the filesystem does not emit file events reliably
########## Docker Compose (dev) ##########
# Values used by `docker-compose.dev.yml`. Compose will substitute ${VAR} from the
# project `.env` or the shell environment when you run `docker compose`.
VITE_APP_VERSION=development
VITE_BACKEND_URL=http://host.docker.internal:8080 # backend API URL used by the frontend inside the container (resolved via Compose host mapping)
VITE_SERVER_PORT=5173 # dev server port inside the container
VITE_ENABLE_HTTPS=false # set true to serve the GUI over HTTPS
VITE_HTTPS_CERT_FILE=/app/certs/server.crt # certificate mounted from ./certs
VITE_HTTPS_KEY_FILE=/app/certs/server.key # certificate key mounted from ./certs
VITE_VERIFY_SSL=false # set true to verify the backend TLS certificate
DOCKER_HOST_PORT=5173 # port on the host machine mapped to the container's VITE_SERVER_PORT (for browser access)
########## Production (nginx) ##########
# Values used at container runtime by nginx to serve HTTPS and proxy /api/.
SOARCA_GUI_VERSION=latest # Docker Hub image tag
SOARCA_CERTS_VOLUME=soarca_certs_data_container # external volume created by SOARCA
NGINX_BACKEND_URL=https://host.docker.internal:8080/ # backend API URL used by nginx inside the container
NGINX_SERVER_PORT=8081 # port nginx listens on inside the container
NGINX_CERT_FILE=/app/certs/server.crt # TLS certificate mounted from SOARCA_CERTS_VOLUME
NGINX_CERT_KEY_FILE=/app/certs/server.key # TLS certificate key mounted from SOARCA_CERTS_VOLUME
NGINX_PROXY_SSL_VERIFY=off # set to on when the backend certificate is trusted
SOARCA_GUI_CONFIG_DIR=./config # Docker Compose only: host directory with auth-config.json (login providers), mounted read-only at /app/config. `npm run dev` and `npm run preview` always read ./config
# .env.example — example environment variables for SOARCA-GUI
# Copy this file to `.env.development` for local dev or to `.env` for Docker Compose
# Notes:
# - Vite exposes ONLY variables prefixed with `VITE_` to the client (import.meta.env).
# - Client-visible `VITE_` values are embedded at *build time* (rebuild to change).
# - Docker Compose reads the project `.env` for substitution and container envs.
# - We also follow a consumer based prefix convention for clarity, so variables used by nginx start with NGINX_, those used by the dev server start with VITE_ etc.
# - Login providers are not set here. They live in config/auth-config.json (see config/auth-config.example.json and the README).

########## Development (Vite) ##########
# Used by `npm run dev` / Vite dev server. Client-facing variables MUST start with VITE_.
# copy these lines into `.env.development` or `.env` (see Vite docs at https://vite.dev/guide/env-and-mode) and adjust as needed for local development
VITE_BACKEND_URL=http://localhost:8080 # backend API URL used by the frontend (dev server proxy target)
VITE_SERVER_PORT=5173 # dev server port
VITE_ENABLE_HTTPS=false # set true to serve the GUI over HTTPS
VITE_HTTPS_CERT_FILE= # required when VITE_ENABLE_HTTPS=true
VITE_HTTPS_KEY_FILE= # required when VITE_ENABLE_HTTPS=true
VITE_VERIFY_SSL=false # set true to verify the backend TLS certificate
VITE_USE_POLLING=false # set true when the filesystem does not emit file events reliably

########## Docker Compose (dev) ##########
# Values used by `docker-compose.dev.yml`. Compose will substitute ${VAR} from the
# project `.env` or the shell environment when you run `docker compose`.
VITE_APP_VERSION=development
VITE_BACKEND_URL=http://host.docker.internal:8080 # backend API URL used by the frontend inside the container (resolved via Compose host mapping)
VITE_SERVER_PORT=5173 # dev server port inside the container
VITE_ENABLE_HTTPS=false # set true to serve the GUI over HTTPS
VITE_HTTPS_CERT_FILE=/app/certs/server.crt # certificate mounted from ./certs
VITE_HTTPS_KEY_FILE=/app/certs/server.key # certificate key mounted from ./certs
VITE_VERIFY_SSL=false # set true to verify the backend TLS certificate
DOCKER_HOST_PORT=5173 # port on the host machine mapped to the container's VITE_SERVER_PORT (for browser access)

########## Production (nginx) ##########
# Values used at container runtime by nginx to serve HTTPS and proxy /api/.
SOARCA_GUI_VERSION=latest # Docker Hub image tag
SOARCA_CERTS_VOLUME=soarca_certs_data_container # external volume created by SOARCA
NGINX_BACKEND_URL=https://host.docker.internal:8080/ # backend API URL used by nginx inside the container
NGINX_SERVER_PORT=8081 # port nginx listens on inside the container
NGINX_CERT_FILE=/app/certs/server.crt # TLS certificate mounted from SOARCA_CERTS_VOLUME
NGINX_CERT_KEY_FILE=/app/certs/server.key # TLS certificate key mounted from SOARCA_CERTS_VOLUME
NGINX_PROXY_SSL_VERIFY=off # set to on when the backend certificate is trusted
SOARCA_GUI_CONFIG_DIR=./config # Docker Compose only: host directory with auth-config.json (login providers), mounted read-only at /app/config. `npm run dev` and `npm run preview` always read ./config
DOCKER_HOST_PORT=8081 # port on the host machine mapped to the container's NGINX_SERVER_PORT (for browser access)
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto eol=lf
*.png binary
*.PNG binary
*.jpg binary
*.ico binary
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ name: Branch

on:
push:
branches:
- '**'
branches:
- "**"
pull_request:
branches:
- '**'
branches:
- "**"

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
check-branch-name:
runs-on: ubuntu-latest
steps:
- name: Check for branch name
run:
if [[ $BRANCH_NAME =~ (feature|bugfix|hotfix|development|dependabot|release|master)\/* ]]; then exit 0; else exit 1; fi
run: if [[ $BRANCH_NAME =~ (feature|bugfix|hotfix|development|dependabot|release|master)\/* ]]; then exit 0; else exit 1; fi
195 changes: 99 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,99 @@
name: ci

on:
pull_request:
branches: [master, development]
workflow_dispatch: {} # Allow manual triggering

jobs:
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Cache node modules
uses: actions/cache@v5
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Cache node modules
uses: actions/cache@v5
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test

docker-build:
needs: test
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get version
run: |
export VERSION=$(git describe --tags --dirty)
echo "describe_version=$(git describe --tags --dirty)" >> "$GITHUB_ENV"

- name: Build image (no push)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
target: production
tags: cossas/soarca-gui:pr-${{ env.describe_version }}
build-args: |
VITE_APP_VERSION=${{ env.describe_version }}
builder: default
name: ci

on:
pull_request:
branches: [master, development]
workflow_dispatch: {} # Allow manual triggering

jobs:
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Cache node modules
uses: actions/cache@v5
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Check formatting
run: npm run format:check

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Cache node modules
uses: actions/cache@v5
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test

docker-build:
needs: test
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get version
run: |
export VERSION=$(git describe --tags --dirty)
echo "describe_version=$(git describe --tags --dirty)" >> "$GITHUB_ENV"

- name: Build image (no push)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
target: production
tags: cossas/soarca-gui:pr-${{ env.describe_version }}
build-args: |
VITE_APP_VERSION=${{ env.describe_version }}
builder: default
Loading
Loading