mirror of
https://github.com/EasyTier/EasyTier.git
synced 2025-09-26 20:51:17 +08:00
contributing.md (#1084)
Some checks failed
EasyTier Core / pre_job (push) Has been cancelled
EasyTier Core / build_web (push) Has been cancelled
EasyTier Core / build (freebsd-13.2-x86_64, 13.2, ubuntu-22.04, x86_64-unknown-freebsd) (push) Has been cancelled
EasyTier Core / build (linux-aarch64, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-arm, ubuntu-22.04, arm-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armhf, ubuntu-22.04, arm-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-armv7, ubuntu-22.04, armv7-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armv7hf, ubuntu-22.04, armv7-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-mips, ubuntu-22.04, mips-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-mipsel, ubuntu-22.04, mipsel-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (macos-aarch64, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (macos-x86_64, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (windows-arm64, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-i686, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / core-result (push) Has been cancelled
EasyTier Core / magisk_build (push) Has been cancelled
EasyTier GUI / pre_job (push) Has been cancelled
EasyTier GUI / build-gui (linux-aarch64, aarch64-unknown-linux-gnu, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (linux-x86_64, x86_64-unknown-linux-gnu, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (macos-aarch64, aarch64-apple-darwin, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (macos-x86_64, x86_64-apple-darwin, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (windows-arm64, aarch64-pc-windows-msvc, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-i686, i686-pc-windows-msvc, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-x86_64, x86_64-pc-windows-msvc, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / gui-result (push) Has been cancelled
EasyTier Mobile / pre_job (push) Has been cancelled
EasyTier Mobile / build-mobile (android, ubuntu-22.04, android) (push) Has been cancelled
EasyTier Mobile / mobile-result (push) Has been cancelled
EasyTier OHOS / pre_job (push) Has been cancelled
EasyTier OHOS / build-ohos (push) Has been cancelled
EasyTier Test / pre_job (push) Has been cancelled
EasyTier Test / test (push) Has been cancelled
Some checks failed
EasyTier Core / pre_job (push) Has been cancelled
EasyTier Core / build_web (push) Has been cancelled
EasyTier Core / build (freebsd-13.2-x86_64, 13.2, ubuntu-22.04, x86_64-unknown-freebsd) (push) Has been cancelled
EasyTier Core / build (linux-aarch64, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-arm, ubuntu-22.04, arm-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armhf, ubuntu-22.04, arm-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-armv7, ubuntu-22.04, armv7-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armv7hf, ubuntu-22.04, armv7-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-mips, ubuntu-22.04, mips-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-mipsel, ubuntu-22.04, mipsel-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (macos-aarch64, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (macos-x86_64, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (windows-arm64, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-i686, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / core-result (push) Has been cancelled
EasyTier Core / magisk_build (push) Has been cancelled
EasyTier GUI / pre_job (push) Has been cancelled
EasyTier GUI / build-gui (linux-aarch64, aarch64-unknown-linux-gnu, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (linux-x86_64, x86_64-unknown-linux-gnu, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (macos-aarch64, aarch64-apple-darwin, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (macos-x86_64, x86_64-apple-darwin, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (windows-arm64, aarch64-pc-windows-msvc, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-i686, i686-pc-windows-msvc, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-x86_64, x86_64-pc-windows-msvc, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / gui-result (push) Has been cancelled
EasyTier Mobile / pre_job (push) Has been cancelled
EasyTier Mobile / build-mobile (android, ubuntu-22.04, android) (push) Has been cancelled
EasyTier Mobile / mobile-result (push) Has been cancelled
EasyTier OHOS / pre_job (push) Has been cancelled
EasyTier OHOS / build-ohos (push) Has been cancelled
EasyTier Test / pre_job (push) Has been cancelled
EasyTier Test / test (push) Has been cancelled
This commit is contained in:
225
CONTRIBUTING.md
Normal file
225
CONTRIBUTING.md
Normal file
@@ -0,0 +1,225 @@
|
||||
# Contributing to EasyTier
|
||||
|
||||
[中文版](CONTRIBUTING_zh.md)
|
||||
|
||||
Thank you for your interest in contributing to EasyTier! This document provides guidelines and instructions for contributing to the project.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Development Environment Setup](#development-environment-setup)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installation Steps](#installation-steps)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Build Guide](#build-guide)
|
||||
- [Building Core](#building-core)
|
||||
- [Building GUI](#building-gui)
|
||||
- [Building Mobile](#building-mobile)
|
||||
- [Development Workflow](#development-workflow)
|
||||
- [Testing Guidelines](#testing-guidelines)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Additional Resources](#additional-resources)
|
||||
|
||||
## Development Environment Setup
|
||||
|
||||
### Prerequisites
|
||||
|
||||
#### Required Tools
|
||||
- Node.js v21 or higher
|
||||
- pnpm v9 or higher
|
||||
- Rust toolchain (version 1.86)
|
||||
- LLVM and Clang
|
||||
- Protoc (Protocol Buffers compiler)
|
||||
|
||||
#### Platform-Specific Dependencies
|
||||
|
||||
**Linux (Ubuntu/Debian)**
|
||||
```bash
|
||||
# Core build dependencies
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
musl-tools \
|
||||
libappindicator3-dev \
|
||||
llvm \
|
||||
clang \
|
||||
protobuf-compiler
|
||||
|
||||
# GUI build dependencies
|
||||
sudo apt install -y \
|
||||
libwebkit2gtk-4.1-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
file \
|
||||
libgtk-3-dev \
|
||||
librsvg2-dev \
|
||||
libxdo-dev \
|
||||
libssl-dev \
|
||||
patchelf
|
||||
|
||||
# Testing dependencies
|
||||
sudo apt install -y bridge-utils
|
||||
```
|
||||
|
||||
**For Cross-Compilation**
|
||||
- musl-cross toolchain (for MIPS and other architectures)
|
||||
- Additional setup may be required (see `.github/workflows/` for details)
|
||||
|
||||
**For Android Development**
|
||||
- Java 20
|
||||
- Android SDK (Build Tools 34.0.0)
|
||||
- Android NDK (26.0.10792818)
|
||||
|
||||
### Installation Steps
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/EasyTier/EasyTier.git
|
||||
cd EasyTier
|
||||
```
|
||||
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
# Install Rust toolchain
|
||||
rustup install 1.86
|
||||
rustup default 1.86
|
||||
|
||||
# Install project dependencies
|
||||
pnpm -r install
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
easytier/ # Core functionality and libraries
|
||||
easytier-web/ # Web dashboard and frontend
|
||||
easytier-gui/ # Desktop GUI application
|
||||
.github/workflows/ # CI/CD configuration files
|
||||
```
|
||||
|
||||
## Build Guide
|
||||
|
||||
### Building Core
|
||||
|
||||
```bash
|
||||
# Standard build
|
||||
cargo build --release
|
||||
|
||||
# Platform-specific builds
|
||||
cargo build --release --target x86_64-unknown-linux-musl # Linux x86_64
|
||||
cargo build --release --target aarch64-unknown-linux-musl # Linux ARM64
|
||||
cargo build --release --target x86_64-apple-darwin # macOS x86_64
|
||||
cargo build --release --target aarch64-apple-darwin # macOS M1/M2
|
||||
cargo build --release --target x86_64-pc-windows-msvc # Windows x86_64
|
||||
```
|
||||
|
||||
Build artifacts: `target/[target-triple]/release/`
|
||||
|
||||
### Building GUI
|
||||
|
||||
```bash
|
||||
# 1. Build frontend
|
||||
pnpm -r build
|
||||
|
||||
# 2. Build GUI application
|
||||
cd easytier-gui
|
||||
|
||||
# Linux
|
||||
pnpm tauri build --target x86_64-unknown-linux-gnu
|
||||
|
||||
# macOS
|
||||
pnpm tauri build --target x86_64-apple-darwin # Intel
|
||||
pnpm tauri build --target aarch64-apple-darwin # Apple Silicon
|
||||
|
||||
# Windows
|
||||
pnpm tauri build --target x86_64-pc-windows-msvc # x64
|
||||
```
|
||||
|
||||
Build artifacts: `easytier-gui/src-tauri/target/release/bundle/`
|
||||
|
||||
### Building Mobile
|
||||
|
||||
```bash
|
||||
# 1. Install Android targets
|
||||
rustup target add aarch64-linux-android
|
||||
rustup target add armv7-linux-androideabi
|
||||
rustup target add i686-linux-android
|
||||
rustup target add x86_64-linux-android
|
||||
|
||||
# 2. Build Android application
|
||||
cd easytier-gui
|
||||
pnpm tauri android build
|
||||
```
|
||||
|
||||
Build artifacts: `easytier-gui/src-tauri/gen/android/app/build/outputs/apk/universal/release/`
|
||||
|
||||
### Build Notes
|
||||
|
||||
1. Cross-compilation for ARM/MIPS requires additional setup
|
||||
2. Windows builds need correct DLL files
|
||||
3. Check `.github/workflows/` for detailed build configurations
|
||||
|
||||
## Development Workflow
|
||||
|
||||
1. Create a feature branch from `develop`:
|
||||
```bash
|
||||
git checkout develop
|
||||
git checkout -b feature/your-feature-name
|
||||
```
|
||||
|
||||
2. Make your changes following our coding standards
|
||||
|
||||
3. Write or update tests as needed
|
||||
|
||||
4. Use conventional commit messages:
|
||||
```
|
||||
feat: add new feature
|
||||
fix: resolve bug
|
||||
docs: update documentation
|
||||
test: add tests
|
||||
chore: update dependencies
|
||||
```
|
||||
|
||||
5. Submit a pull request to `develop`
|
||||
|
||||
## Testing Guidelines
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
# Configure system (Linux)
|
||||
sudo modprobe br_netfilter
|
||||
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
||||
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
||||
|
||||
# Run tests
|
||||
cargo test --no-default-features --features=full --verbose
|
||||
```
|
||||
|
||||
### Test Requirements
|
||||
|
||||
- Write tests for new features
|
||||
- Maintain existing test coverage
|
||||
- Tests should be isolated and repeatable
|
||||
- Include both unit and integration tests
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
1. Target the `develop` branch
|
||||
2. Ensure all tests pass
|
||||
3. Include clear description and purpose
|
||||
4. Reference related issues
|
||||
5. Keep changes focused and atomic
|
||||
6. Update documentation as needed
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Issue Tracker](https://github.com/EasyTier/EasyTier/issues)
|
||||
- [Project Documentation](https://github.com/EasyTier/EasyTier/wiki)
|
||||
|
||||
## Questions or Need Help?
|
||||
|
||||
Feel free to:
|
||||
- Open an issue for questions
|
||||
- Join our community discussions
|
||||
- Reach out to maintainers
|
||||
|
||||
Thank you for contributing to EasyTier!
|
225
CONTRIBUTING_zh.md
Normal file
225
CONTRIBUTING_zh.md
Normal file
@@ -0,0 +1,225 @@
|
||||
# EasyTier 贡献指南
|
||||
|
||||
[English Version](CONTRIBUTING.md)
|
||||
|
||||
感谢您对 EasyTier 项目的关注!本文档提供了参与项目贡献的指南和说明。
|
||||
|
||||
## 目录
|
||||
|
||||
- [开发环境配置](#开发环境配置)
|
||||
- [前置要求](#前置要求)
|
||||
- [安装步骤](#安装步骤)
|
||||
- [项目结构](#项目结构)
|
||||
- [构建指南](#构建指南)
|
||||
- [构建核心组件](#构建核心组件)
|
||||
- [构建桌面应用](#构建桌面应用)
|
||||
- [构建移动应用](#构建移动应用)
|
||||
- [开发工作流](#开发工作流)
|
||||
- [测试指南](#测试指南)
|
||||
- [Pull Request 规范](#pull-request-规范)
|
||||
- [其他资源](#其他资源)
|
||||
|
||||
## 开发环境配置
|
||||
|
||||
### 前置要求
|
||||
|
||||
#### 必需工具
|
||||
- Node.js v21 或更高版本
|
||||
- pnpm v9 或更高版本
|
||||
- Rust 工具链(版本 1.86)
|
||||
- LLVM 和 Clang
|
||||
- Protoc(Protocol Buffers 编译器)
|
||||
|
||||
#### 平台特定依赖
|
||||
|
||||
**Linux (Ubuntu/Debian)**
|
||||
```bash
|
||||
# 核心构建依赖
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
musl-tools \
|
||||
libappindicator3-dev \
|
||||
llvm \
|
||||
clang \
|
||||
protobuf-compiler
|
||||
|
||||
# GUI 构建依赖
|
||||
sudo apt install -y \
|
||||
libwebkit2gtk-4.1-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
file \
|
||||
libgtk-3-dev \
|
||||
librsvg2-dev \
|
||||
libxdo-dev \
|
||||
libssl-dev \
|
||||
patchelf
|
||||
|
||||
# 测试依赖
|
||||
sudo apt install -y bridge-utils
|
||||
```
|
||||
|
||||
**交叉编译依赖**
|
||||
- musl-cross 工具链(用于 MIPS 和其他架构)
|
||||
- 可能需要额外配置(详见 `.github/workflows/` 目录)
|
||||
|
||||
**Android 开发依赖**
|
||||
- Java 20
|
||||
- Android SDK(Build Tools 34.0.0)
|
||||
- Android NDK(26.0.10792818)
|
||||
|
||||
### 安装步骤
|
||||
|
||||
1. 克隆仓库:
|
||||
```bash
|
||||
git clone https://github.com/EasyTier/EasyTier.git
|
||||
cd EasyTier
|
||||
```
|
||||
|
||||
2. 安装依赖:
|
||||
```bash
|
||||
# 安装 Rust 工具链
|
||||
rustup install 1.86
|
||||
rustup default 1.86
|
||||
|
||||
# 安装项目依赖
|
||||
pnpm -r install
|
||||
```
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
easytier/ # 核心功能和库
|
||||
easytier-web/ # Web 仪表盘和前端
|
||||
easytier-gui/ # 桌面 GUI 应用
|
||||
.github/workflows/ # CI/CD 配置文件
|
||||
```
|
||||
|
||||
## 构建指南
|
||||
|
||||
### 构建核心组件
|
||||
|
||||
```bash
|
||||
# 标准构建
|
||||
cargo build --release
|
||||
|
||||
# 特定平台构建
|
||||
cargo build --release --target x86_64-unknown-linux-musl # Linux x86_64
|
||||
cargo build --release --target aarch64-unknown-linux-musl # Linux ARM64
|
||||
cargo build --release --target x86_64-apple-darwin # macOS x86_64
|
||||
cargo build --release --target aarch64-apple-darwin # macOS M1/M2
|
||||
cargo build --release --target x86_64-pc-windows-msvc # Windows x86_64
|
||||
```
|
||||
|
||||
构建产物位置:`target/[target-triple]/release/`
|
||||
|
||||
### 构建桌面应用
|
||||
|
||||
```bash
|
||||
# 1. 构建前端
|
||||
pnpm -r build
|
||||
|
||||
# 2. 构建 GUI 应用
|
||||
cd easytier-gui
|
||||
|
||||
# Linux
|
||||
pnpm tauri build --target x86_64-unknown-linux-gnu
|
||||
|
||||
# macOS
|
||||
pnpm tauri build --target x86_64-apple-darwin # Intel
|
||||
pnpm tauri build --target aarch64-apple-darwin # Apple Silicon
|
||||
|
||||
# Windows
|
||||
pnpm tauri build --target x86_64-pc-windows-msvc # x64
|
||||
```
|
||||
|
||||
构建产物位置:`easytier-gui/src-tauri/target/release/bundle/`
|
||||
|
||||
### 构建移动应用
|
||||
|
||||
```bash
|
||||
# 1. 安装 Android 目标平台
|
||||
rustup target add aarch64-linux-android
|
||||
rustup target add armv7-linux-androideabi
|
||||
rustup target add i686-linux-android
|
||||
rustup target add x86_64-linux-android
|
||||
|
||||
# 2. 构建 Android 应用
|
||||
cd easytier-gui
|
||||
pnpm tauri android build
|
||||
```
|
||||
|
||||
构建产物位置:`easytier-gui/src-tauri/gen/android/app/build/outputs/apk/universal/release/`
|
||||
|
||||
### 构建注意事项
|
||||
|
||||
1. ARM/MIPS 的交叉编译需要额外配置
|
||||
2. Windows 构建需要正确的 DLL 文件
|
||||
3. 详细构建配置请参考 `.github/workflows/` 目录
|
||||
|
||||
## 开发工作流
|
||||
|
||||
1. 从 `develop` 分支创建特性分支:
|
||||
```bash
|
||||
git checkout develop
|
||||
git checkout -b feature/your-feature-name
|
||||
```
|
||||
|
||||
2. 按照代码规范进行修改
|
||||
|
||||
3. 编写或更新测试
|
||||
|
||||
4. 使用规范的提交信息:
|
||||
```
|
||||
feat: 添加新功能
|
||||
fix: 修复问题
|
||||
docs: 更新文档
|
||||
test: 添加测试
|
||||
chore: 更新依赖
|
||||
```
|
||||
|
||||
5. 提交 Pull Request 到 `develop` 分支
|
||||
|
||||
## 测试指南
|
||||
|
||||
### 运行测试
|
||||
|
||||
```bash
|
||||
# 配置系统(Linux)
|
||||
sudo modprobe br_netfilter
|
||||
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
||||
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
||||
|
||||
# 运行测试
|
||||
cargo test --no-default-features --features=full --verbose
|
||||
```
|
||||
|
||||
### 测试要求
|
||||
|
||||
- 为新功能编写测试
|
||||
- 维护现有测试覆盖率
|
||||
- 测试应该是独立且可重复的
|
||||
- 包含单元测试和集成测试
|
||||
|
||||
## Pull Request 规范
|
||||
|
||||
1. 目标分支为 `develop`
|
||||
2. 确保所有测试通过
|
||||
3. 包含清晰的描述和目的
|
||||
4. 关联相关的 issues
|
||||
5. 保持变更的原子性和聚焦性
|
||||
6. 及时更新相关文档
|
||||
|
||||
## 其他资源
|
||||
|
||||
- [问题追踪](https://github.com/EasyTier/EasyTier/issues)
|
||||
- [项目文档](https://github.com/EasyTier/EasyTier/wiki)
|
||||
|
||||
## 需要帮助?
|
||||
|
||||
欢迎:
|
||||
- 提出问题
|
||||
- 参与社区讨论
|
||||
- 联系维护者
|
||||
|
||||
感谢您为 EasyTier 做出贡献!
|
Reference in New Issue
Block a user