Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
35a23e4
feat: add tunnel, add device doe
snkzhong Jul 31, 2026
71c5313
feat: refactor api tokens auth
snkzhong Jul 31, 2026
956e230
feat: update api tokens
snkzhong Jul 31, 2026
8f175d0
feat: refactoring permission verfication logic
snkzhong Jul 31, 2026
8d09aab
feat: refactor permissions, support multiple roles
snkzhong Jul 31, 2026
af82cfa
feat: improve permissions function
snkzhong Jul 31, 2026
f521ee7
feat: Content types support grouping
snkzhong Jul 31, 2026
f4fa28c
feat: update content types use group
snkzhong Aug 2, 2026
d2b4950
feat: refactoring project directory structure using workspace
snkzhong Aug 2, 2026
2c6ffae
feat: add mcp server
snkzhong Aug 2, 2026
db361f2
feat: improve mcp structure
snkzhong Aug 3, 2026
52715a7
fix: fix permission verification vulnerability
snkzhong Aug 3, 2026
0094cc1
feat: content types add batch operation
snkzhong Aug 3, 2026
78d2467
feat: improve content types file type
snkzhong Aug 4, 2026
ef236d9
feat: improve content tyeps medis and blob field
snkzhong Aug 4, 2026
d2ba6ea
feat: enhance content types
snkzhong Aug 4, 2026
b7e86e2
feat: enhance content types
snkzhong Aug 4, 2026
631e051
feat: resolve postgres compatibility issues
snkzhong Aug 4, 2026
2eeacb0
feat: improve mysql worker, add visibility timeout sweeper
snkzhong Aug 4, 2026
f1f4cfd
feat: improve event register
snkzhong Aug 5, 2026
2b1c566
feat: Clear aspects and simplify the architecture
snkzhong Aug 5, 2026
f6dee28
feat: improve UserRole enum, improve rbac, update webhook
snkzhong Aug 5, 2026
acc6da7
feat: improve cron handler
snkzhong Aug 5, 2026
93a1242
feat: refactoring cron system
snkzhong Aug 5, 2026
9bb56ce
feat: add system script cron
snkzhong Aug 5, 2026
ba66f8b
fix: resolve sql compbatibility
snkzhong Aug 7, 2026
b2a4384
fix: resolve sql compatibility
snkzhong Aug 7, 2026
e70a4f8
feat: modify json fields
snkzhong Aug 9, 2026
cc2babb
feat: All dependencies use the latest stable version
snkzhong Aug 10, 2026
066cbe0
feat: add panic log and webhook
snkzhong Aug 10, 2026
470fed4
ci: improve ci process
snkzhong Aug 10, 2026
fbd50d7
fix: resolve test error
snkzhong Aug 10, 2026
42990b5
Major Update
snkzhong Aug 10, 2026
5c6b740
release: v0.3.0
snkzhong Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
228 changes: 228 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: Build All Backends

on:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v0.2.20)"
required: true
type: string

permissions:
contents: write

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build ${{ matrix.binary }} (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
# Three DB variants, each for all target platforms
include:
# ── SQLite (default) ──
- { binary: raisfast, db: sqlite, features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast, db: sqlite, features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast, db: sqlite, features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-apple-darwin, runner: macos-13 }
- { binary: raisfast, db: sqlite, features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-apple-darwin, runner: macos-14 }
- { binary: raisfast, db: sqlite, features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-pc-windows-msvc, runner: windows-latest }

# ── PostgreSQL ──
- { binary: raisfast-postgres, db: postgres, features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast-postgres, db: postgres, features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast-postgres, db: postgres, features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-apple-darwin, runner: macos-13 }
- { binary: raisfast-postgres, db: postgres, features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-apple-darwin, runner: macos-14 }
- { binary: raisfast-postgres, db: postgres, features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-pc-windows-msvc, runner: windows-latest }

# ── MySQL ──
- { binary: raisfast-mysql, db: mysql, features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast-mysql, db: mysql, features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-unknown-linux-musl, runner: ubuntu-22.04 }
- { binary: raisfast-mysql, db: mysql, features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-apple-darwin, runner: macos-13 }
- { binary: raisfast-mysql, db: mysql, features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: aarch64-apple-darwin, runner: macos-14 }
- { binary: raisfast-mysql, db: mysql, features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system", target: x86_64-pc-windows-msvc, runner: windows-latest }

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
key: build-${{ matrix.binary }}-${{ matrix.target }}

- name: Install cross-compilation dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev musl-tools

- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features ${{ matrix.db == 'sqlite' && 'sqlite' || matrix.db == 'postgres' && 'postgres' || 'mysql' }} || true

- name: Setup database and generate sqlx cache
shell: bash
env:
DB_FEATURES: "db-${{ matrix.db }} plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"
run: |
DB="${{ matrix.db }}"
if [ "$DB" = "sqlite" ]; then
mkdir -p /tmp/sqlx_prepare
sqlite3 /tmp/sqlx_prepare/raisfast.db < migrations/sqlite/schema.sqlite.sql
export DATABASE_URL="sqlite:/tmp/sqlx_prepare/raisfast.db"
elif [ "$DB" = "postgres" ]; then
sudo apt-get install -y postgresql-client
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE raisfast_prepare" 2>/dev/null || true
PGPASSWORD=postgres psql -h localhost -U postgres -d raisfast_prepare -f migrations/postgres/schema.postgres.sql
export DATABASE_URL="postgres://postgres:postgres@localhost:5432/raisfast_prepare"
else
sudo systemctl start mysql 2>/dev/null || true
mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS raisfast_prepare" 2>/dev/null || true
mysql -u root -proot raisfast_prepare < migrations/mysql/schema.mysql.sql
export DATABASE_URL="mysql://root:root@127.0.0.1:3306/raisfast_prepare"
fi
SQLX_OFFLINE=false cargo sqlx prepare --workspace -- --tests --no-default-features --features "$DB_FEATURES"

- name: Build
env:
SQLX_OFFLINE: true
run: cargo build --release --no-default-features --features "${{ matrix.features }}" --target ${{ matrix.target }}

- name: Get version
id: version
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
fi

- name: Package (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p dist
BINARY="${{ matrix.binary }}"
TARGET="${{ matrix.target }}"
VERSION="${{ steps.version.outputs.version }}"
EXT=""

if [ "$RUNNER_OS" = "Windows" ]; then
cp "target/$TARGET/raisfast.exe" "dist/$BINARY.exe"
else
cp "target/$TARGET/raisfast" "dist/$BINARY"
fi

cd dist
tar -czf "$BINARY-$TARGET.tar.gz" "$BINARY"
cd ..
echo "artifact=dist/$BINARY-$TARGET.tar.gz" >> "$GITHUB_OUTPUT"

- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
mkdir -p dist
$target = "${{ matrix.target }}"
Copy-Item "target/$target/raisfast.exe" "dist/${{ matrix.binary }}.exe"
Compress-Archive -Path "dist/${{ matrix.binary }}.exe" -DestinationPath "dist/${{ matrix.binary }}-$target.zip"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}-${{ matrix.target }}
path: |
dist/${{ matrix.binary }}-*.tar.gz
dist/${{ matrix.binary }}-*.zip

release:
name: Publish to GitHub Release
needs: build
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${GITHUB_REF_NAME}"
gh release create "$TAG" \
--title "$TAG" \
--generate-notes \
artifacts/*.tar.gz \
artifacts/*.zip

- name: Sign artifacts with cosign
uses: sigstore/cosign-installer@v3

- run: |
cd artifacts
for f in *.tar.gz *.zip; do
[ -f "$f" ] || continue
cosign sign-blob --yes --bundle "${f}.bundle" "$f"
done
gh release upload "${GITHUB_REF_NAME}" *.bundle || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Build Docker Images
needs: build
runs-on: ubuntu-22.04
permissions:
packages: write
id-token: write
steps:
- uses: actions/checkout@v4

- name: Download Linux musl binaries
uses: actions/download-artifact@v4
with:
pattern: raisfast-*x86_64-unknown-linux-musl*
path: binaries
merge-multiple: true

- name: Extract binaries
run: |
mkdir -p dist
for variant in raisfast raisfast-postgres raisfast-mysql; do
tar -xzf "binaries/$variant-x86_64-unknown-linux-musl.tar.gz" -C dist/
if [ -f "dist/$variant" ]; then
mv "dist/$variant" "dist/raisfast-$variant" 2>/dev/null || true
fi
done

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push images
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.ci
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
build-args: |
BINARY=dist/raisfast
103 changes: 95 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SQLX_OFFLINE: true

jobs:
fmt:
Expand All @@ -23,31 +22,119 @@ jobs:
- run: cargo fmt --all -- --check

clippy:
name: Clippy
name: Clippy (${{ matrix.db }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [sqlite, postgres, mysql]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
with:
key: clippy-${{ matrix.db }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev

- name: Setup PostgreSQL
if: matrix.db == 'postgres'
run: |
sudo apt-get install -y postgresql-client
sudo -u postgres createuser --superuser --login postgres 2>/dev/null || true
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE raisfast_prepare" 2>/dev/null || true
PGPASSWORD=postgres psql -h localhost -U postgres -d raisfast_prepare -f migrations/postgres/schema.postgres.sql

- name: Setup MySQL
if: matrix.db == 'mysql'
run: |
sudo systemctl start mysql
mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS raisfast_prepare"
mysql -u root -proot raisfast_prepare < migrations/mysql/schema.mysql.sql

- name: Setup SQLite
if: matrix.db == 'sqlite'
run: |
mkdir -p /tmp/sqlite_prepare
sqlite3 /tmp/sqlite_prepare/raisfast.db < migrations/sqlite/schema.sqlite.sql

- name: Prepare sqlx cache
env:
DATABASE_URL: ${{ matrix.db == 'sqlite' && 'sqlite:/tmp/sqlite_prepare/raisfast.db' || matrix.db == 'postgres' && 'postgres://postgres:postgres@localhost:5432/raisfast_prepare' || 'mysql://root:root@127.0.0.1:3306/raisfast_prepare' }}
run: |
SQLX_OFFLINE=false cargo sqlx prepare --workspace -- --tests --no-default-features --features "db-${{ matrix.db }} plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"

- name: Clippy
run: cargo clippy --no-default-features --features "db-sqlite plugin-all search-tantivy" -- -D warnings
env:
SQLX_OFFLINE: true
DATABASE_URL: ${{ matrix.db == 'sqlite' && 'sqlite:/tmp/sqlite_prepare/raisfast.db' || matrix.db == 'postgres' && 'postgres://postgres:postgres@localhost:5432/raisfast_prepare' || 'mysql://root:root@127.0.0.1:3306/raisfast_prepare' }}
run: cargo clippy -p raisfast --tests --no-default-features --features "db-${{ matrix.db }} plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system" -- -D warnings

test:
name: Test
name: Test (${{ matrix.db }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- db: sqlite
features: "db-sqlite plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"
test_threads: ""
- db: postgres
features: "db-postgres plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"
test_threads: "-- --test-threads=1"
- db: mysql
features: "db-mysql plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"
test_threads: "-- --test-threads=1"

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
with:
key: test-${{ matrix.db }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev
- name: Test
run: cargo test --no-default-features --features "db-sqlite plugin-all search-tantivy"

- name: Setup PostgreSQL
if: matrix.db == 'postgres'
run: |
sudo apt-get install -y postgresql-client
sudo -u postgres createuser --superuser --login postgres 2>/dev/null || true
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE raisfast_test"
PGPASSWORD=postgres psql -h localhost -U postgres -d raisfast_test -f migrations/postgres/schema.postgres.sql
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE raisfast_prepare"
PGPASSWORD=postgres psql -h localhost -U postgres -d raisfast_prepare -f migrations/postgres/schema.postgres.sql

- name: Setup MySQL
if: matrix.db == 'mysql'
run: |
sudo systemctl start mysql
mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS raisfast_test"
mysql -u root -proot raisfast_test < migrations/mysql/schema.mysql.sql
mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS raisfast_prepare"
mysql -u root -proot raisfast_prepare < migrations/mysql/schema.mysql.sql

- name: Setup SQLite
if: matrix.db == 'sqlite'
run: sqlite3 /tmp/sqlite_prepare.db < migrations/sqlite/schema.sqlite.sql

- name: Prepare sqlx cache
env:
DATABASE_URL: ${{ matrix.db == 'sqlite' && 'sqlite:/tmp/sqlite_prepare.db' || matrix.db == 'postgres' && 'postgres://postgres:postgres@localhost:5432/raisfast_prepare' || 'mysql://root:root@127.0.0.1:3306/raisfast_prepare' }}
run: |
SQLX_OFFLINE=false cargo sqlx prepare --workspace -- --tests --no-default-features --features "db-${{ matrix.db }} plugin-js plugin-rhai search-tantivy payment-all tunnel mcp cron-system"

- name: Run tests
env:
SQLX_OFFLINE: true
DATABASE_URL: ${{ matrix.db == 'sqlite' && 'sqlite::memory:' || matrix.db == 'postgres' && 'postgres://postgres:postgres@localhost:5432/raisfast_test' || 'mysql://root:root@127.0.0.1:3306/raisfast_test' }}
RAISFAST_TEST_DB_URL: ${{ matrix.db == 'sqlite' && 'sqlite::memory:' || matrix.db == 'postgres' && 'postgres://postgres:postgres@localhost:5432/raisfast_test' || 'mysql://root:root@127.0.0.1:3306/raisfast_test' }}
run: cargo test -p raisfast --no-default-features --features "${{ matrix.features }}" ${{ matrix.test_threads }}

2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
type: string
workflow_run:
workflows: ["Release"]
workflows: ["Build All Backends"]
types: [completed]

env:
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/publish-crates.yml

This file was deleted.

Loading
Loading