Skip to content

Latest commit

 

History

History
132 lines (95 loc) · 3.16 KB

CONTRIBUTING.md

File metadata and controls

132 lines (95 loc) · 3.16 KB

Contributing Guide

Thank you for your interest in contributing to eBPF Firewall! This guide will help you get started with the contribution process.

Table of Contents

Getting Started

Fork and Clone

  1. Fork the eBPF Firewall repository
  2. Clone your fork:
git clone https://github.com/YOUR_USERNAME/ebpf-firewall.git
cd ebpf-firewall

Development Setup

  1. Install dependencies:
apt update && apt upgrade
apt install llvm clang libbpf-dev build-essential linux-headers-$(uname -r)

# If asm/types.h reference error occurs:
ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
  1. Build frontend:
cd web
npm install
npm run build
  1. Generate eBPF object files:
cd ../internal/ebpf
go generate

Create a Branch

Create a new branch for your contribution:

git checkout -b your-branch-name

Development Workflow

Code Style

  • Go code should follow the standard Go style guidelines
  • TypeScript code should follow the project's ESLint configuration
  • C code (eBPF) should follow the Linux kernel coding style

Commit Convention

type(scope): body

Type

Must be one of the following:

  • feat: A new feature (minor version bump)
  • fix: A bug fix (patch version bump)
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • test: Adding missing tests or correcting existing tests
  • docs: Documentation only changes
  • chore: Changes to the build process or auxiliary tools
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • revert: Reverts a previous commit
  • improvement: Improvements to existing features

Note: Adding BREAKING CHANGE: in commit body will trigger a major version bump.

Scope

Must be one of the following:

  • ebpf: Changes to eBPF programs
  • usercomm: Changes to user space communication
  • dataproc: Changes to data processing logic
  • frontend: Changes to frontend components
  • ui: Changes to UI/UX
  • docs: Changes to documentation
  • build: Changes to build configurations
  • deploy: Changes to deployment process
  • other: Other changes

Sync with Upstream

Keep your fork up to date:

git remote add upstream https://github.com/danger-dream/ebpf-firewall.git
git fetch upstream
git merge upstream/main

Submit Pull Request

  1. Push your changes to your fork
  2. Go to the original repository and create a Pull Request
  3. Follow the Pull Request template
  4. Wait for review and address any feedback

Additional Notes

  • All PRs should target the dev branch
  • Include tests for new features
  • Update documentation when necessary
  • Ensure all tests pass before submitting