Skip to content
Open
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
.git
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
.env
10 changes: 10 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# These variables are used for development environment
VITE_SOARCA_URI=http://localhost:8080 # for vite each env var must start with VITE_ otherwise it won't be exposed to the client side
VITE_SOARCA_GUI_DOMAIN=http://localhost
VITE_PORT="3000"
VITE_OIDC_ISSUER="https://localhost:9443/application/u/test/"
VITE_OIDC_CLIENT_ID="SOME_CLIENT_ID"
VITE_OIDC_CLIENT_SECRET="SOME_CLIENT_SECRET"
VITE_OIDC_REDIRECT_URL="http://localhost:3000/auth/soarca_gui/callback"
VITE_COOKIE_SECRET_KEY="SOME_COOKIE_SECRET" #openssl rand -base64 32 or head -c 32 /dev/urandom | base64
VITE_OIDC_SKIP_TLS_VERIFY=true
10 changes: 0 additions & 10 deletions .env.example

This file was deleted.

164 changes: 93 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,93 @@
name: Ci

on:
pull_request:
branches: [ master, development ]

jobs:
build:
name: Build binary
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Make repo safe
run: git config --global --add safe.directory /__w/SOARCA-GUI/SOARCA-GUI
- name: Install Templ
run: go install github.com/a-h/templ/cmd/templ@v0.3.819

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci

- name: Build with make
run: make build

lint:
name: Lint go code with golangci
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Templ
run: go install github.com/a-h/templ/cmd/templ@v0.3.819

- name: lint
run: |
ls -la
make lint
shell: bash


test:
name: Run ci-tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2' #
- name: Make repo safe
run: git config --global --add safe.directory /__w/SOARCA-GUI/SOARCA-GUI
- name: Install Templ
run: go install github.com/a-h/templ/cmd/templ@v0.3.819
timeout-minutes: 12
- name: Run tests
run: |
make test
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

- 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
tags: cossas/soarca-gui:pr-${{ env.describe_version }}
build-args: |
VERSION=${{ env.describe_version }}
builder: default
57 changes: 32 additions & 25 deletions .github/workflows/development-release.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
name: development-release
name: CD-Development

on:
push:
branches:
- development
workflow_dispatch: {} # Allow manual triggering

jobs:
build:
name: Build binary
name: Build with npm
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Make repo safe
run: git config --global --add safe.directory /__w/SOARCA-GUI/SOARCA-GUI
- name: Install Templ
run: go install github.com/a-h/templ/cmd/templ@v0.3.819
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Setup node
uses: actions/setup-node@v4
- name: Cache node modules
uses: actions/cache@v5
with:
node-version: 18
- run: npm ci

- name: Build with make
run: make compile
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
- name: Build with npm
run: npm run build

- name: "Upload Artifact"
uses: actions/upload-artifact@v6
with:
name: ${{ github.sha }}
path: bin/*
path: dist/*
retention-days: 1


docker-build:
needs: build
name: Build docker image and push it to docker hub
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Make repo safe
Expand All @@ -55,9 +62,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download bin
uses: actions/download-artifact@v4
with:
- name: Download dist
uses: actions/download-artifact@v7
with:
pattern: ${{ github.sha }}

- name: Move files to bin folder and make executable
Expand All @@ -78,10 +85,10 @@ jobs:
echo "describe_version=$(git describe --tags --dirty)" >> "$GITHUB_ENV"

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
build-args: |
VERSION=${{ env.describe_version }}
push: true
push: false
tags: cossas/soarca-gui:${{ env.describe_version }},cossas/soarca-gui:development
Loading