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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2026 ff, Scalytics, Inc. - https://www.scalytics.io
# SPDX-License-Identifier: Apache-2.0

EUOSINT_SITE_ADDRESS=:80
EUOSINT_HTTP_PORT=8080
EUOSINT_HTTPS_PORT=8443
59 changes: 6 additions & 53 deletions .github/workflows/alerts-feed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
node-version-file: .nvmrc
cache: npm
go-version-file: go.mod
cache: true

- name: Install deps
run: npm ci

- name: Fetch alerts
run: node scripts/fetch-alerts.mjs
- name: Fetch alerts with Go collector
run: go run ./cmd/euosint-collector
env:
MAX_PER_SOURCE: "20"
OUTPUT_PATH: "public/alerts.json"
Expand All @@ -54,47 +51,3 @@ jobs:
git add public/alerts.json public/alerts-filtered.json public/alerts-state.json public/source-health.json
git commit -m "chore: update alerts feed"
git push
*** Add File: /Users/alo/Development/scalytics/EUOSINT/.github/workflows/ci.yml
name: CI

on:
pull_request:
push:
branches: [main]
workflow_dispatch: {}

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
name: quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Toolchain check
run: make check

- name: Lint
run: make lint

- name: Typecheck
run: make test

- name: Build
run: make build
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2026 ff, Scalytics, Inc. - https://www.scalytics.io
# SPDX-License-Identifier: Apache-2.0

name: CI

on:
pull_request: {}
push:
branches: [main]
workflow_dispatch: {}

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
name: quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install dependencies
run: npm ci

- name: UI lint
run: npm run lint

- name: UI typecheck
run: npm run typecheck

- name: UI build
run: npm run build

- name: Go format check
run: make go-fmt-check

- name: Go tests
run: make go-test

- name: Go race
run: make go-race

- name: Go coverage
run: make go-cover

- name: Go vet
run: make go-vet
14 changes: 12 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,29 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
languages: go, javascript-typescript

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install dependencies
run: npm ci

- name: Build
- name: Build UI
run: npm run build

- name: Build collector
run: go build ./cmd/euosint-collector

- name: Analyze
uses: github/codeql-action/analyze@v3
continue-on-error: true
22 changes: 20 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ on:
pull_request:
paths:
- "Dockerfile"
- "Dockerfile.collector"
- "docker-compose.yml"
- "docker/**"
- "cmd/**"
- "internal/**"
- "registry/**"
- "go.mod"
- "package.json"
- "package-lock.json"
- "src/**"
Expand All @@ -15,8 +20,13 @@ on:
branches: [main]
paths:
- "Dockerfile"
- "Dockerfile.collector"
- "docker-compose.yml"
- "docker/**"
- "cmd/**"
- "internal/**"
- "registry/**"
- "go.mod"
- "package.json"
- "package-lock.json"
- "src/**"
Expand All @@ -29,8 +39,16 @@ permissions:

jobs:
build:
name: build
name: build-${{ matrix.image.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- name: web
dockerfile: Dockerfile
- name: collector
dockerfile: Dockerfile.collector
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -42,7 +60,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
file: ./${{ matrix.image.dockerfile }}
push: false
load: false
provenance: false
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ permissions:

jobs:
release:
name: publish
name: publish-${{ matrix.image.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- name: web
dockerfile: Dockerfile
image_suffix: -web
- name: collector
dockerfile: Dockerfile.collector
image_suffix: -collector
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -31,13 +41,14 @@ jobs:
run: npm run build

- name: Archive dist
if: matrix.image.name == 'web'
run: |
tar -czf euosint-dist-${GITHUB_REF_NAME}.tar.gz dist
shasum -a 256 euosint-dist-${GITHUB_REF_NAME}.tar.gz > euosint-dist-${GITHUB_REF_NAME}.tar.gz.sha256

- name: Prepare image name
id: image
run: echo "name=ghcr.io/${GITHUB_REPOSITORY@L}" >> "$GITHUB_OUTPUT"
run: echo "name=ghcr.io/${GITHUB_REPOSITORY@L}${{ matrix.image.image_suffix }}" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -64,7 +75,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
file: ./${{ matrix.image.dockerfile }}
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
Expand All @@ -73,6 +84,7 @@ jobs:
cache-to: type=gha,mode=max

- name: Publish GitHub release
if: matrix.image.name == 'web'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dist/
dist-ssr/
coverage/
.tmp/
/euosint-collector

# Runtime logs
logs/
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN npm install -g npm@11.11.0 && npm ci
COPY . .
RUN npm run build

FROM nginx:1.27-alpine
FROM caddy:2.10-alpine

COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
COPY docker/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist /srv

EXPOSE 8080
EXPOSE 80 443

CMD ["nginx", "-g", "daemon off;"]
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
29 changes: 29 additions & 0 deletions Dockerfile.collector
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 ff, Scalytics, Inc. - https://www.scalytics.io
# SPDX-License-Identifier: Apache-2.0

FROM golang:1.25-alpine AS build

WORKDIR /app

COPY go.mod ./
COPY cmd ./cmd
COPY internal ./internal
COPY registry ./registry
COPY public ./public

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/euosint-collector ./cmd/euosint-collector

FROM alpine:3.20

RUN apk add --no-cache ca-certificates

WORKDIR /app

COPY --from=build /out/euosint-collector /usr/local/bin/euosint-collector
COPY registry ./registry
COPY public ./public-defaults
COPY docker/collector-entrypoint.sh /usr/local/bin/collector-entrypoint.sh

RUN chmod +x /usr/local/bin/collector-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/collector-entrypoint.sh"]
Loading
Loading