A high-performance Rust-powered image hosting service featuring dynamic resizing, re-encoding, and flexible storage support for SQLite or PostgreSQL.
Warning
This application is currently under development. Please do not rely on it as your primary or sole backup for important photos. We cannot guarantee the absolute security or permanence of your data.
- Go to Releases and download the binary compatible with your system.
- Rename
.env.exampleto.envand update the values to match your environment. - Download
config.tomlto configure the project. (Check out the documentation for further information of the config file) - Run the executable to start the service.
Use the docs site for production deployment walkthroughs instead of duplicating those steps here:
- Systemd deployment
- Docker deployment with SQLite
- Docker deployment with PostgreSQL
- 中文:Systemd 部署
- 中文:Docker 部署(SQLite)
- 中文:Docker 部署(PostgreSQL)
This repository is organized as a monorepo, containing the core service, the web dashboard and the documentation.
Below is the project structure of our image hosting service.
.
├── docs
├── frontend
├── migrations
│ ├── pgsql
│ └── sqlite
├── src
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── config.toml
└── openapi.json
docs/: Documentation Site (built with Astro (Starlight))frontend/: Web Dashboard / Client (Svelte + Vite)migrations/: Databse Migrations (supports PostgreSQL & SQLite)src/: Backend Source Codeopenapi.json: API Specification generated byutopia
cargo build
cargo test
cargo runcargo run -- export-openapiRun these inside frontend/.
pnpm install
pnpm gen:api
pnpm check
pnpm build- Export OpenAPI JSON from the backend:
cargo run -- export-openapi frontend/openapi.json
- Generate the frontend SDK:
cd frontend pnpm gen:api - Start the backend:
cargo run
- Start the frontend dev server:
cd frontend pnpm dev
cargo runprints a CLI login URL that targets/login?token=....- Opening that link in the browser lets the frontend call
/api/auth/cliand establish the auth cookie. - The frontend SDK uses
credentials: 'include'for authenticated admin requests.
frontend/openapi.jsonis the exported OpenAPI source used for SDK generation.- Generated SDK output lives in
frontend/src/lib/sdk/. - Re-export the OpenAPI spec and re-run
pnpm gen:apiafter backend API changes.