Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
c57c31e
refactor: optimize agent mode
pigri Jan 21, 2026
035f251
build: update build scripts and Dockerfile for improved compatibility…
pigri Jan 21, 2026
39277c8
feat: implement nftables firewall backend for access rules enforcement
pigri Jan 21, 2026
4ee730e
build: refactor CI workflows to use Docker for building binaries and …
pigri Jan 21, 2026
1a8cde6
build: update CI workflows to reference the correct Dockerfile for bu…
pigri Jan 21, 2026
a6ad3a0
feat: enhance TCP fingerprinting with new struct and reduced instruct…
pigri Jan 22, 2026
3056612
feat: add iptables firewall backend for access rules enforcement and …
pigri Jan 22, 2026
c384cd3
build: optimize build process by updating compiler flags and restruct…
pigri Jan 22, 2026
414876e
feat: add GitHub Actions workflow for building and testing DEB and RP…
pigri Jan 22, 2026
5113076
refactor: remove unused variable for BPF load failure tracking in asy…
pigri Jan 22, 2026
ba19950
feat: add support for iptables and nix dependencies, update builder s…
pigri Jan 22, 2026
9776c61
build: update CI workflow to reference new Dockerfile location and re…
pigri Jan 22, 2026
f576d19
refactor: change CMD to ENTRYPOINT in Dockerfile and update entrypoin…
pigri Jan 22, 2026
939801a
feat: add firewall mode configuration options to config.yaml for enha…
pigri Jan 22, 2026
4532d28
refactor: remove domain_filter and wirefilter modules to streamline c…
pigri Jan 22, 2026
35250bb
refactor: update configuration structure to replace deprecated AX_ pr…
pigri Jan 22, 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
66 changes: 24 additions & 42 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache target
uses: actions/cache@v4
with:
path: |
~/.cargo/git/
~/.cargo/registry/
target/
key: ${{ runner.os }}-synapse-${{ hashFiles('**/Cargo.toml') }}
restore-keys: ${{ runner.os }}-synapse
- name: Install package
- name: Build binary using Docker
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y git build-essential clang llvm libelf-dev libssl-dev \
zlib1g-dev libzstd-dev pkg-config libcap-dev binutils-multiarch-dev curl cmake ca-certificates libelf-dev libelf1 libssl3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
set -euxo pipefail
mkdir -p /tmp/build-output
docker build -t synapse-builder:latest -f pkg/docker/build.Dockerfile .
docker create --name synapse-build synapse-builder:latest
docker cp synapse-build:/output/synapse /tmp/build-output/synapse
docker rm synapse-build
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
toolchain: stable
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
# - name: Multi-core Test - Free github runners is not multi-core
# run: cargo test --test multicore_test --verbose
name: synapse-amd64
path: /tmp/build-output/synapse

build-arm64:
name: Build arm64
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Cache target
uses: actions/cache@v4
with:
path: |
~/.cargo/git/
~/.cargo/registry/
target/
key: ${{ runner.os }}-synapse-${{ hashFiles('**/Cargo.toml') }}
restore-keys: ${{ runner.os }}-synapse
- name: Install package
- name: Build binary using Docker
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y git build-essential clang llvm libelf-dev libssl-dev \
zlib1g-dev libzstd-dev pkg-config libcap-dev binutils-multiarch-dev curl cmake ca-certificates libelf-dev libelf1 libssl3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
set -euxo pipefail
mkdir -p /tmp/build-output
docker build -t synapse-builder:latest -f pkg/docker/build.Dockerfile .
docker create --name synapse-build synapse-builder:latest
docker cp synapse-build:/output/synapse /tmp/build-output/synapse
docker rm synapse-build
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
toolchain: stable
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
# - name: Multi-core Test - Free github runners is not multi-core
# run: cargo test --test multicore_test --verbose
name: synapse-arm64
path: /tmp/build-output/synapse
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Synapse Build
name: Synapse DEB and RPM Build and test
on:
pull_request:
branches:
Expand All @@ -13,13 +13,16 @@ jobs:
- name: Check out repository code, branch='${{ github.ref }}'
uses: actions/checkout@v4

- name: Building package
run: sudo ./builder.sh
working-directory: ./pkg/deb
- name: Build DEB using Docker
shell: bash
run: |
set -euxo pipefail
mkdir -p /tmp/deb-build-output
docker build -t synapse-builder-deb:latest -f pkg/deb/Dockerfile .
docker run -v "${GITHUB_WORKSPACE}:/tmp/repo" -v /tmp/deb-build-output:/tmp/output --rm synapse-builder-deb:latest

- name: Installing package
run: sudo dpkg --install ./synapse*.deb
working-directory: ./pkg/deb
run: sudo dpkg --install /tmp/deb-build-output/synapse*.deb

- name: Start Synapse service
run: sudo systemctl start synapse
Expand Down
122 changes: 118 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ port_check = "0.3.0"
notify = "8.2.0"
privdrop = "0.5.6"
base16ct = { version = "0.3.0", features = ["alloc"] }
nftables = "0.6"
iptables = "0.5"
actix-web = "4.12"
actix-files = "0.6"
instant-acme = "0.8"
Expand Down
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ fn main() {
vmlinux_include.as_os_str(),
OsStr::new("-I"),
bpf_include.as_os_str(),
OsStr::new("-O2"), // Enable level 2 optimizations
OsStr::new("-g"), // Keep debug info for verifier
OsStr::new("-O3"), // Maximum optimizations to reduce program size
OsStr::new("-fno-unroll-loops"), // Prevent loop unrolling to reduce instruction count
OsStr::new("-Wall"), // Enable all warnings
OsStr::new("-Wextra"), // Extra warnings
OsStr::new("-DBPF_NO_PRESERVE_ACCESS_INDEX"), // Disable preserve_access_index for older clang
OsStr::new("-Ubpf"), // Undefine bpf macro to avoid conflict with struct netns_bpf bpf
])
.build_and_generate(skel_path.to_str().expect("Invalid UTF-8 in path"))
.expect("Failed to generate skeleton");
Expand Down
Loading