Getting Started
安装
几秒钟安装 RaisFast — 支持 curl、npm、Homebrew、Docker、cargo 或从源码编译。
一键安装(推荐)
macOS / Linux
curl -fsSL https://raisfast.com/install.sh | shWindows (PowerShell)
irm https://raisfast.com/install.ps1 | iex验证
raisfast --version所有安装方式
全局安装:
npm install -g raisfast免安装直接运行:
npx raisfast --helpnpm 包封装的是原生二进制文件 — 运行时不需要 Node.js。
brew tap RaisFast/homebrew-tap
brew install raisfast从 GitHub Container Registry 拉取:
docker pull ghcr.io/raisfast/raisfast:latest运行:
docker run -d \
--name raisfast \
-p 9898:9898 \
-v ./data:/app/data \
ghcr.io/raisfast/raisfast:latest或使用 Docker Compose 启动完整服务栈(后端 + 前端 + S3 存储):
curl -O https://raw.githubusercontent.com/RaisFast/raisfast/main/docker-compose.yml
docker compose up -d可用标签:latest、0.2、0.2.23(语义化版本)。
cargo install raisfast需要 Rust 工具链。从 crates.io 安装。
从 GitHub Releases 下载预编译二进制文件:
| 平台 | Target |
|---|---|
| macOS (Apple Silicon) | aarch64-apple-darwin |
| macOS (Intel) | x86_64-apple-darwin |
| Linux (ARM64) | aarch64-unknown-linux-gnu |
| Linux (ARM64, 静态) | aarch64-unknown-linux-musl |
| Linux (x86_64) | x86_64-unknown-linux-gnu |
| Linux (x86_64, 静态) | x86_64-unknown-linux-musl |
| Windows (x86_64) | x86_64-pc-windows-msvc |
下载、解压、加入 PATH 即可。
从源码编译
如需自定义特性集或参与贡献。
前置要求
- Rust 1.85+ (edition 2024)
- C 编译器 — Linux 上需要
cc,macOS 上需要 Xcode 命令行工具 - SQLite3 开发头文件
- just — 命令运行器(推荐)
安装 just:
# macOS
brew install just
# Linux
curl -LsSf https://github.com/casey/just/releases/latest/download/just-installer.sh | sh
# 或通过 cargo
cargo install just
# Windows
winget install --id Casey.Just使用 just 快速编译
git clone https://github.com/RaisFast/raisfast.git
cd raisfast
# 编译发布版本(SQLite + 所有插件 + 搜索)
just build
# 编译包含 Admin UI 的完整版本(前端 + 后端)
just build-full
# 启动开发服务器
just dev编译产物位于 target/release/raisfast。
just 常用命令
| 命令 | 描述 |
|---|---|
just build | 编译发布版本(SQLite + 所有插件 + 搜索) |
just build-full | 编译包含内嵌 Admin UI 的发布版本 |
just dev | 启动开发服务器 |
just check | 编译检查(快速,不输出二进制) |
just lint | 运行 clippy,警告视为错误 |
just test | 运行所有测试 |
just qa | 格式检查 + lint |
just ci | 完整 CI 流水线:fmt → lint → test |
切换数据库后端
通过覆盖 db 变量切换数据库:
just db=postgres check
just db=mysql check手动编译
不使用 just 时,可直接使用 cargo:
# 默认特性(SQLite + 所有插件 + 搜索 + OpenAPI)
cargo build --release
# 自定义特性
SQLX_OFFLINE=false DATABASE_URL="sqlite:./storage/db/raisfast.db?mode=rwc" \
cargo build --release --no-default-features \
--features "db-sqlite,plugin-all,search-tantivy,openapi"默认特性
不使用 --no-default-features 时,默认启用:
db-sqlite, search-tantivy, plugin-js, plugin-lua, plugin-rhai, openapi, proxy特性标志
数据库(选择其一)
| 标志 | 描述 |
|---|---|
db-sqlite | SQLite 后端 |
db-postgres | PostgreSQL 后端 |
db-mysql | MySQL 后端 |
插件引擎
| 标志 | 描述 |
|---|---|
plugin-js | JavaScript (QuickJS) |
plugin-lua | Lua 5.4 (mlua) |
plugin-rhai | Rhai 脚本 |
plugin-wasm | WebAssembly (wasmtime) |
plugin-all | 四种引擎全部启用 |
搜索与存储
| 标志 | 描述 |
|---|---|
search-tantivy | 基于 Tantivy 的全文搜索 |
storage-s3 | S3 兼容对象存储 |
支付提供商
| 标志 | 描述 |
|---|---|
payment-alipay | 支付宝 |
payment-wechat | 微信支付 |
payment-stripe | Stripe |
payment-dodo | Dodo Payments |
payment-creem | Creem |
payment-all | 所有支付提供商 |
其他
| 标志 | 描述 |
|---|---|
tls | 通过 rustls 启用 HTTPS |
openapi | Swagger UI,位于 /api/docs |
proxy | 多租户反向代理 |
tauri | Tauri 桌面模式 |
系统诊断
安装完成后,运行内置健康检查:
raisfast doctor它会验证环境、配置、数据库连接和安全设置。
