Skip to content

About

Cloudillo Server in Rust

Resources

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Cloudillo

Your Data, Your Rules

CI crates.io License: MPL-2.0

What is Cloudillo?

Online collaboration platforms typically fall into two categories:

  1. Cloud-based services — convenient but may raise concerns about privacy, data ownership, and censorship.
  2. Self-hosted applications — provide control but are challenging to set up and don't integrate well with each other.

Cloudillo bridges this gap. It is a federated, self-hosted web application platform that gives you the convenience of cloud services without sacrificing privacy or control over your data. Each user runs their own Cloudillo instance and connects with others through open federation protocols — no central server required.

Key Features

  • Federation — Instances communicate using signed activity tokens, so users on different servers can interact seamlessly
  • Real-time collaboration — Collaborative document editing via CRDT (Yjs), plus a Firebase-style real-time database over WebSocket
  • File storage — Content-addressed immutable blob storage with automatic image processing and variant generation
  • Social features — Posts, comments, reactions, and community spaces with role-based access control
  • Identity portability — Your identity is a cryptographic key pair, not an account on someone else's server
  • Self-hosted — Runs on your own hardware with automatic TLS via ACME/Let's Encrypt

Architecture

Cloudillo-RS is a Rust workspace with 20 crates organized into three layers:

Layer Crates Purpose
Feature crates cloudillo-action, cloudillo-auth, cloudillo-file, cloudillo-crdt, cloudillo-rtdb, cloudillo-profile, and more Business logic for each feature area
Core cloudillo, cloudillo-types, cloudillo-core Shared types, middleware, extractors, scheduling, and the application builder
Adapters auth-adapter-sqlite, meta-adapter-sqlite, blob-adapter-fs, rtdb-adapter-redb, crdt-adapter-redb Pluggable storage backends behind trait interfaces

Key technologies: Axum (HTTP), SQLite (metadata and auth), redb (real-time and CRDT storage), Tokio (async runtime), Yrs (Yjs CRDT).

The codebase enforces #![forbid(unsafe_code)] — no unsafe anywhere.

Getting Started

Prerequisites

  • Rust 1.75+ (2021 edition)
  • For production deployment:
    • DNS A (or CNAME) records for your domain and cl-o.<domain> pointing to your server IP
    • Ports 443 (HTTPS) and 80 (HTTP / ACME challenges) open

Build and Run

# Build everything
cargo build

# Build the server binary
cargo build -p cloudillo-server

# Run (see Configuration below for all env vars)
BASE_ID_TAG=dev cargo run -p cloudillo-server

# Optimized release build (LTO, stripped)
cargo build --profile release-lto

Frontend

The server serves a frontend built from the separate cloudillo/cloudillo repository. You need Node.js 22+ and pnpm.

# Clone and build the frontend
git clone https://github.com/cloudillo/cloudillo.git
cd cloudillo
pnpm install --frozen-lockfile
pnpm -r --filter '!@cloudillo/storybook' build

# Assemble into the dist directory (adjust path to your cloudillo-rs checkout)
mkdir -p ../cloudillo-rs/dist/apps
cp -r shell/dist/* ../cloudillo-rs/dist/
for app in apps/*/; do
  name=$(basename "$app")
  if [ -d "$app/dist" ]; then
    cp -r "$app/dist" "../cloudillo-rs/dist/apps/$name"
  fi
done

The server looks for these files in DIST_DIR (./dist by default).

Configuration

The server is configured through environment variables:

Variable Description Default
BASE_ID_TAG Tenant identifier / domain (required) —
LOCAL_ADDRESS Comma-separated server IP(s) for DNS validation —
BASE_APP_DOMAIN App domain for the base tenant BASE_ID_TAG
BASE_PASSWORD Initial admin password —
ACME_EMAIL Email for Let's Encrypt certificates —
MODE standalone, proxy, or stream-proxy standalone
PROXY_PROTOCOL Comma-separated IPs/CIDRs of the trusted proxies, e.g. 127.0.0.1,172.16.0.0/12: only they may connect, and each connection must carry a PROXY protocol v1/v2 header (stream-proxy only; nginx proxy_protocol on;, HAProxy send-proxy-v2). Without it, stream-proxy sees the proxy's IP — forwarding headers are never trusted in that mode —
LISTEN HTTPS bind address 127.0.0.1:1443
LISTEN_HTTP HTTP bind address (ACME challenges) 127.0.0.1:1080
DB_DIR Database directory ./data
DATA_DIR Blob storage directory ./data
DIST_DIR Frontend static files directory ./dist
RUST_LOG Log level filter —
DISABLE_CACHE Set to any value to disable HTTP caching —

For Docker deployment instructions, see DOCKER.md.

Development

# Run all tests
cargo test

# Run tests for a specific crate
cargo test -p cloudillo

# Lint (matches CI strictness)
cargo clippy -- -D warnings

# Check formatting (uses hard tabs)
cargo fmt --check

# Apply formatting
cargo fmt

CI runs tests, formatting checks, and Clippy on every push and pull request.

Releasing

Releases are built, signed and published from the maintainer's workstation with release.sh: ./release.sh vX.Y.Z.

Prerequisites: git, jq, cargo with cargo-deny, cargo-llvm-cov and cargo-cyclonedx, the cyclonedx CLI, syft, cosign, docker with buildx (a builder that can push attestations), gh, pnpm, npx and sha256sum; logged in with docker login, cargo login and gh auth login; the release key from the one-time setup below. The frontend checkout is ../cloudillo (override with FRONTEND_DIR), the key ~/.cosign/cloudillo.key (COSIGN_KEY).

  1. Set the same version X.Y.Z in the workspace Cargo.toml and the frontend's package.json, and rename ## [Unreleased] in CHANGELOG.md and in ../cloudillo/CHANGELOG.md to ## [X.Y.Z] - YYYY-MM-DD, keeping their Security sections. The frontend section is drafted from the release post, keeping only what the web client implements. release.sh publishes a GitHub release in both repositories from these sections.
  2. Push the same annotated tag to both repositories, the frontend first (the image build clones both from GitHub at the tag). Both local checkouts must be clean and checked out at the tag:
    git -C ../cloudillo tag -a vX.Y.Z -m "Cloudillo X.Y.Z" && git -C ../cloudillo push origin vX.Y.Z
    git tag -a vX.Y.Z -m "Cloudillo X.Y.Z" && git push origin vX.Y.Z
    vX.Y.0 is tagged on main. Later vX.Y.Z are tagged on release/X.Y or lts/X.Y once the line has such a branch (on main before that).
  3. ./release.sh vX.Y.Z checks that both tags are pushed unchanged, the versions and the changelog, runs cargo deny check, the frontend pnpm audit and the full test suite with coverage (including the access matrix), then asks you to type X.Y.Z to go on. Nothing is pushed before that.
  4. It builds the image from the tag, generates the CycloneDX SBOMs, cross-checks them with syft, signs the image and the SBOM attestation with the project's cosign key, tags the image X.Y.Z, X.Y and (for the newest release) latest, publishes the crates, and creates the GitHub release vX.Y.Z with these assets: cloudillo-X.Y.Z.cdx.json (release SBOM), cloudillo-X.Y.Z-{server,frontend,native}.cdx.json (SBOM parts), cloudillo-X.Y.Z.image-digest.txt, cloudillo-X.Y.Z-access-matrix.md, cloudillo-X.Y.Z-coverage.txt, SHA256SUMS and SHA256SUMS.sigstore.json.

Verify a release before installing it (full steps, including the SBOM attestation, in DOCKER.md):

# cosign.pub from the repository at the release tag
cosign verify-blob --key cosign.pub --bundle SHA256SUMS.sigstore.json SHA256SUMS
sha256sum -c SHA256SUMS
cosign verify --key cosign.pub "cloudillo/cloudillo@$(cat cloudillo-X.Y.Z.image-digest.txt)"

One-time setup: generate the release key pair with cosign generate-key-pair --output-key-prefix ~/.cosign/cloudillo, commit ~/.cosign/cloudillo.pub as cosign.pub in this repository, and back up the private key offline. Tag protection for v* in both repositories.

Project Status

Cloudillo is in alpha. The core platform is functional, but APIs may change and some features are still in development. Feedback, bug reports, and contributions are welcome.

License

MPL-2.0

Links

About

Cloudillo Server in Rust

Resources

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages