Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7112a0b
ci: modernize Docker CICD workflow
Mar 31, 2026
3973c53
build: switch to musl targets and rustls for portable binaries
Mar 31, 2026
4601763
chore: add pre-commit hook and apply cargo fmt
Mar 31, 2026
fa74035
fix: resolve all clippy warnings
Mar 31, 2026
cc4a9b2
fix: use _pid consistently in get_process_comm
Mar 31, 2026
db9e5c0
fix: resolve clippy errors in Linux-only firewall modules
Mar 31, 2026
a22ab6d
fix: remove redundant to_string() in format! args
Mar 31, 2026
431089b
fix: convert NfTable to string before passing to args()
Mar 31, 2026
ebf9310
chore: bump VERSION.md to 0.2.0
Mar 31, 2026
1cf2162
fix: resolve warnings in tests and examples
Mar 31, 2026
56dcd95
fix: restore mutable enricher in enrichment tests
Mar 31, 2026
7824052
fix: align test mutability and silence unused ptrace events var
Mar 31, 2026
77ed42a
fix(tests): clean remaining all-target warnings and invalid literal
Mar 31, 2026
f1ed8e7
fix: restore used enrichment vars and silence ptrace unused vars
Mar 31, 2026
f919cc9
fix: handle non-linux unused vars in enrichment tests
Mar 31, 2026
c8a2b84
test: fix ebpf loader creation assertion for linux builds
Mar 31, 2026
ad49047
test: use valid 64-char hex container ID in enrichment test
Mar 31, 2026
bc6967c
ci: fallback to npm install when web lockfile is missing
Mar 31, 2026
a9757d4
web: add webpack config with TS entrypoint for dashboard build
Mar 31, 2026
8d37e7b
web: fix dashboard import paths and TypeScript build errors
Mar 31, 2026
2cf69c4
log: show API URL instead of dashboard bind address
Mar 31, 2026
4229627
web: default API/WS endpoints to APP_PORT or 5555
Mar 31, 2026
f3b23e9
web: normalize container API payloads to prevent runtime crashes
Mar 31, 2026
3e6cae5
web: fix threat statistics endpoint path
Mar 31, 2026
a0508b0
web: guard ThreatMap against missing stats buckets
Mar 31, 2026
9366741
web: restore CSS injection and degrade gracefully without WS endpoint
Mar 31, 2026
99c85b1
web: add left sidebar navigation to dashboard layout
Mar 31, 2026
a6aac14
web: move logo to sidebar and add top actions bar
Mar 31, 2026
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
18 changes: 18 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
set -e

echo "🐕 Stackdog pre-commit: running cargo fmt..."
cargo fmt --all -- --check || {
echo "❌ cargo fmt failed. Run 'cargo fmt --all' to fix."
exit 1
}

echo "🐕 Stackdog pre-commit: running cargo clippy..."
cargo clippy 2>&1
CLIPPY_EXIT=$?
if [ $CLIPPY_EXIT -ne 0 ]; then
echo "❌ cargo clippy failed to compile. Fix errors before committing."
exit 1
fi

echo "✅ Pre-commit checks passed."
167 changes: 49 additions & 118 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,163 +2,94 @@ name: Docker CICD

on:
push:
branches:
- master
- testing
branches: [main, dev]
pull_request:
branches:
- master
branches: [main, dev]

jobs:
cicd-linux-docker:
name: Cargo and npm build
#runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: docker-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-registry-
docker-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: docker-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-index-
docker-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Generate Secret Key
run: |
head -c16 /dev/urandom > src/secret.key
run: head -c16 /dev/urandom > src/secret.key

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: docker-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-build-
docker-

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Check
run: cargo check

- name: Cargo test
if: ${{ always() }}
uses: actions-rs/cargo@v1
with:
command: test
- name: Format check
run: cargo fmt --all -- --check

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
command: fmt
args: --all -- --check

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
command: clippy
args: -- -D warnings

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Clippy
run: cargo clippy -- -D warnings

- name: Test
run: cargo test

- name: npm install, build, and test
- name: Build release
run: cargo build --release

- name: Build frontend
working-directory: ./web
run: |
npm install
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
npm run build
# npm test

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist-without-markdown
path: |
web/dist
!web/dist/**/*.md

# - name: Archive code coverage results
# uses: actions/upload-artifact@v4
# with:
# name: code-coverage-report
# path: output/test/code-coverage.html
- name: Display structure of downloaded files
run: ls -R web/dist

- name: Copy app files and zip
- name: Package app
run: |
mkdir -p app/stackdog/dist
cp target/release/stackdog app/stackdog
cp -a web/dist/. app/stackdog
cp target/release/stackdog app/stackdog/
cp -a web/dist/. app/stackdog/
cp docker/prod/Dockerfile app/Dockerfile
cd app
touch .env
tar -czvf ../app.tar.gz .
cd ..
touch app/.env
tar -czf app.tar.gz -C app .

- name: Upload app archive for Docker job
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: artifact-linux-docker
name: app-archive
path: app.tar.gz
retention-days: 1

cicd-docker:
name: CICD Docker
#runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
needs: cicd-linux-docker
docker:
name: Docker Build & Push
runs-on: ubuntu-latest
needs: build
steps:
- name: Download app archive
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: artifact-linux-docker
name: app-archive

- name: Extract app archive
run: tar -zxvf app.tar.gz
- name: Extract archive
run: tar -xzf app.tar.gz

- name: Display structure of downloaded files
run: ls -R
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker build and publish
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: trydirect/stackdog:latest
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
artifact: stackdog-linux-x86_64
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
artifact: stackdog-linux-aarch64

steps:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ r2d2 = "0.8"
bollard = "0.16"

# HTTP client (for LLM API)
reqwest = { version = "0.12", features = ["json", "blocking"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "rustls-tls"] }

# Compression
zstd = "0.13"
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.2.0
13 changes: 5 additions & 8 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# base image
FROM debian:buster-slim
FROM debian:bookworm-slim

# create app directory
RUN mkdir app
WORKDIR /app

# install libpq
RUN apt-get update; \
apt-get install --no-install-recommends -y libpq-dev; \
# install ca-certificates for HTTPS requests
RUN apt-get update && \
apt-get install --no-install-recommends -y ca-certificates && \
rm -rf /var/lib/apt/lists/*

# copy binary and configuration files
COPY ./stackdog .
COPY ./.env .
# expose port

EXPOSE 5000

# run the binary
ENTRYPOINT ["/app/stackdog"]
2 changes: 1 addition & 1 deletion ebpf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

#![no_std]

pub mod syscalls;
pub mod maps;
pub mod syscalls;
Loading
Loading