* feat(sharelink): add sharelink watermark support
* fix(sharelink): harden watermark feature against races, crashes, and tenant leaks
Addresses review findings on the sharelink watermark feature:
- fix(watermark): read back sharelink via transaction client so the
updateShareLinkWatermark response reflects the just-committed state
(global-client reads on a pooled connection miss uncommitted changes)
- fix(watermark): use prisma upsert on the config hash instead of
find-then-create to avoid P2002 races on concurrent enables
- fix(watermark): resolve nested symlinks when walking the share tree and
batch the walk level-by-level instead of one query per node
- fix(watermark): keep watermark tasks in flight from being purged by
orphan-config GC (avoids FK violations in completing activities)
- fix(transcode): re-transcode stale 'processing' watermark rows instead
of silently skipping (crash recovery); downscale embedded block images;
use pino structured logging; drop unused any casts
- fix(api): scope watermark-template list/create to the caller's teams,
reject teamless template creation, and make teamless templates
read-only; validate watermark config required when enabling (400);
map sharelink-not-found to 404
- fix(api): resolve symlink target ids once in public share children
endpoint instead of twice per item
- refactor(db): dedicated WatermarkFileStatus enum (migration included)
- test: activity unit tests (init crash recovery, image + video transcode
paths), concurrent upsert, nested-symlink resolution, API scoping and
validation, e2e video watermark path
* refactor(transcode): move sharp usage out of watermark activity into transcodeService
The transcode package does not declare sharp as a dependency (only
@shumai/core does), so importing it directly in the watermark activity
broke CI typecheck for the transcode package.
- add transcodeService.renderSvgToPng, downscaleImageToPng and
compositeOverlayToWebpFile encapsulating the sharp logic
- watermark activity now calls these methods instead of importing sharp
- activity tests mock the new methods (no sharp/real fixture needed)
- add unit tests for the new transcodeService helpers
* feat(watermark): restrict watermark transcode to existing image and video transcodes
* refactor(transcode): reuse transcodeVideo in watermark activity
* refactor(watermark): use Bun.hash instead of node crypto for watermark config hash
* refactor(watermark): move computeWatermarkConfigHash from dtos to core watermark-hash module
* refactor(api): delegate watermark DB queries from public-share route to watermarkService
* refactor(share): replace dynamic watermarkService import with static import
* feat(watermark): add waitForWatermarkFileActivity for in-flight watermark transcoding tasks
* refactor(asset): replace dynamic watermarkService import with static import
* test(watermark): harden purgeOrphanWatermarkConfigs coverage
Replace the single happy-path GC test with a dedicated suite covering:
- orphan config with proxies: purged, watermarkFiles removed, all four
proxy keys deleted from S3 while the original key is preserved
- config still referenced by a share link is not purged
- config with pending/processing transcode_watermark tasks is not purged
(in-flight guard), but completed tasks do not block purging
- pending tasks of other types (transcode_video) do not protect a config
- an S3 delete failure is non-fatal: remaining keys still deleted and the
config is still purged
- mixed run: only the orphan config is purged while a referenced one
survives (exact count assertion)
* feat(webui): add sharelink watermark editor and sidebar controls
* style(webui): enlarge watermark editor dialog and allocate 2/3 width to preview column
* fix(webui): override sm:max-w-lg in DialogContent to allow full 1400px width
* fix(webui): stop block click propagation and remove preview mode toggles
* fix(webui): store watermark block size as fraction of canvas width
The editor stored block.size in pixels (slider 10-120px, preview
fontSize: `${block.size}px`) while the SVG generator
(generateWatermarkSvg) interprets size as a fraction (0..1) of canvas
width. A 36px block therefore rendered as a ~36x-canvas glyph covering
the entire image.
- Keep backend fraction semantics (canvasWidth * size) so watermarks
scale proportionally with output resolution across proxies
- Editor: defaults (text 5%, image 15%), slider ranges (1-12% / 2-50%)
and number input now work in percent, storing a fraction
- Preview: scales blocks by the measured canvas width so WYSIWYG
- DTO schema: size constrained to (0..1) to enforce the contract
- Update DTO/editor tests to fraction sizes
* feat(webui): add single-row aspect ratio selector and 5 predefined background colors to watermark editor preview
* feat(webui): update aspect ratio to multi-toggle group and enable dot-grid pattern for all background colors
* fix(webui): update background swatches to distinct colors and share PRESET_BACKGROUND_OPTIONS array
* fix(webui): hide redundant absolute close button on watermark editor dialog header
* fix(transcode): skip raw video transcode when generating watermark proxies
The raw marker entry (isRaw: true) in videoTranscodes points at the
original source file and is only used to offer the 'Original' playback
option. It is not a transcoded proxy, so watermarking it produced a
redundant full-resolution transcode (the most expensive pass) plus an
unneeded S3 upload.
Skip entries with isRaw: true in transcodeWatermarkMediaActivity, and
cover the behavior with a unit regression test plus an e2e assertion
that exactly one watermark proxy is produced for a video asset.
* feat(webui): replace watermark image asset ID with 1MB file uploader
* fix(webui): correct watermark editor preview block sizing
The preview canvas width was measured in a useEffect([open]) that ran
before the Radix Dialog had mounted its content, so canvasRef.current was
still null, canvasWidthPx stayed 0, and every block silently fell back to
the hardcoded 640px width (block.size * (canvasWidthPx || 640)). A 100%
size therefore rendered at ~640px on an ~876px canvas (~72%), making the
preview smaller than the real watermarked output for both image and text
blocks.
- Measure the canvas via a ref callback (fires exactly when the node
mounts, regardless of dialog mount timing) and keep a ResizeObserver
attached for aspect-ratio/window changes.
- Use clientWidth (padding-box width) instead of getBoundingClientRect(),
which includes the dialog's zoom-in-95 animation transform.
- Drop max-w-full/max-h-full on the preview <img> so logos scale up to
the block size like the backend SVG rendering does, instead of being
capped at their natural pixel size.
* fix(webui): keep watermark editor preview aspect ratio and restore config scroll
- Compute the preview canvas size with a JS contain-fit (ResizeObserver on the
frame) instead of relying on CSS aspect-ratio + w-full/max-h-full, which
broke the selected ratio on wide-and-short (or tall-and-narrow) windows.
- Add min-h-0 to the config ScrollArea so it shrinks to the column's remaining
height instead of growing to its content height, restoring the scroll range.
* fix(webui): remove toast notification on template load
* fix(share): serve per-file watermark proxies in public share APIs
Stop gating watermark replacement on the share-link-wide watermarkStatus.
Public share endpoints now resolve each asset's own completed watermark
proxy and:
- replace videoTranscodes/imageTranscodes with the watermarked entries
when the watermark file is completed;
- empty those arrays when no completed proxy exists yet (still
transcoding or failed) so original, unwatermarked media is never
exposed while a newly added file is being processed;
- leave non-video/image media (pdf, audio, ...) untouched, since they
never receive watermark transcodes.
This removes the previous behavior where adding a file to a ready
watermark share flipped the whole share link to processing and served
original media for every file until the new transcode finished.
Adds API tests for detail/children endpoints (ready, in-flight, pdf, and
watermark-disabled cases) and a workflow E2E test for adding an asset to
an already-ready watermark sharelink.
Shumai
An open-source platform for all your creative work.
Website | Docs | Demo | Discord | 中文
Features
Shumai is an open-source Frame.io alternative built for creative teams to collaborate and share media with ease:
- S3-Compatible & Local Storage: Store and serve creative assets securely using the local filesystem or any S3-compatible storage service, including AWS S3, Cloudflare R2, and MinIO.
- Frame-by-Frame Annotations & Comments: Leave precise feedback with frame-specific drawing tools and timestamped comments on both video and image assets.
- Secure Sharing & Collections: Create private share links and curated media collections for clients, stakeholders, and collaborators.
- Granular Access Control: Manage workspace permissions with team-level and project-level role-based access control.
- Distributed Transcoding via Temporal: Offload resource-intensive video transcoding to a background worker pool orchestrated by Temporal.
- Custom Asset Metadata: Define dynamic metadata fields tailored to your production pipeline.
But Shumai goes beyond being a Frame.io alternative. With modern models like GPT-Image-2 and Seedance 2.5, AI can already handle a surprising amount of creative work. That means you can create or update videos and images from a simple prompt without having to jump back into Photoshop, Premiere or Houdini. That is why Shumai includes a powerful agent system:
- Agent as a Team Member: Mention a context-aware AI agent with
@mentionsdirectly in asset comments, just like a real teammate. - Agent as a One-to-One Assistant: Chat privately with the agent and ask it to help with tasks.
- Custom Skills & Tools: Extend the agent by registering custom scripts, tools, and automation skills.
- Isolated Sandbox Execution: Run agent-submitted scripts safely in a sandboxed environment.
- AI Metadata Autofill: Automatically fill in custom metadata for new assets.
- Semantic Search: Find assets by visual or conceptual meaning using vector embeddings (Gemini Embedding 2).
Here is a short demo video showing what the Shumai agent can do:
https://github.com/user-attachments/assets/1186067a-72c0-41b9-836f-987438f2332a
Note
Media Processing & Storage: When uploading media, Shumai always preserves and stores your original raw file. Note that the file size shown in the system represents the original file size and does not include the size of any transcoded files. For all media types (both images and videos), Shumai creates a 480p WebP poster image to serve as the preview in the file list view. Additionally:
- For Images: Shumai generates a high-quality WebP proxy at the exact same resolution as your original file for optimized viewing.
- For Videos: It generates at least one proxy video (depending on your transcoding settings), alongside a sprite image and a small preview video (capped at 1600 frames) to enable fast timeline scrubbing and lightning-quick previews.
Installation
Below is a quickstart guide for running Shumai with local storage. For advanced configuration options (including S3-compatible storage and Temporal workflow orchestration), see our Documentation.
Option 1: Docker Compose
Docker Compose is the fastest way to get Shumai running. You do not need to clone the repository or install packages manually. Ensure you have Docker and Docker Compose installed, then follow these steps:
-
Create and navigate to a new directory for your configuration and data volumes:
mkdir shumai && cd shumai -
Download the
docker-compose.yamlfile:curl -o docker-compose.yaml https://raw.githubusercontent.com/shumaiOne/shumai/main/docker-compose/local/docker-compose.yaml -
Configure environment variables (optional):
-
SHUMAI_SERVER_PORTcontrols the port the Shumai server listens on. The default is3000. -
By default, Shumai uses the bundled local storage service in this Docker Compose setup. To use an external S3-compatible storage instead, configure the environment variables for your S3 provider. Here are examples for AWS S3 and Cloudflare R2:
AWS S3 Example:
STORAGE_BACKEND: s3 S3_BUCKET: your-bucket-name S3_ACCESS_KEY_ID: your-access-key-id S3_SECRET_ACCESS_KEY: your-secret-access-key AWS_ENDPOINT_URL_S3: https://s3.us-east-1.amazonaws.comCloudflare R2 Example:
STORAGE_BACKEND: s3 S3_BUCKET: your-bucket-name S3_REGION: auto S3_ACCESS_KEY_ID: your-access-key-id S3_SECRET_ACCESS_KEY: your-secret-access-key AWS_ENDPOINT_URL_S3: https://<account-id>.r2.cloudflarestorage.com -
By default,
AWS_ENDPOINT_URL_S3is set to:http://localhost:{SHUMAI_SERVER_PORT}, if you use local storage and expose Shumai on a custom host/port combination, setAWS_ENDPOINT_URL_S3to the external URL that browsers will use to upload files.For example, if you change the port mapping in
docker-compose.yamlfrom3000:3000to12345:3000and deploy on a server with IP address12.34.56.78, set:AWS_ENDPOINT_URL_S3: http://12.34.56.78:12345This value must be reachable from client browsers and should include the externally exposed port.
-
-
Start the services in detached mode:
docker compose up -d -
Open your browser and access Shumai at
http://localhost:3000(orhttp://<your-server-ip>:3000for remote deployments).
Option 2: Install via NPM / Package Manager
Shumai is published as @shumai-one/shumai on NPM. This option allows you to run Shumai globally or locally.
Step 1: Start PostgreSQL with pgvector
Shumai requires PostgreSQL with the pgvector extension. Start a pre-configured database container using Docker:
docker run --name shumai_postgres \
-e POSTGRES_USER=shumai \
-e POSTGRES_PASSWORD=shumai_password \
-e POSTGRES_DB=shumai_db \
-p 5432:5432 \
-d pgvector/pgvector:pg18
Step 2: Create a workspace folder
Create a dedicated directory to store your environment configuration and media files (which are saved in a ./data directory by default):
mkdir shumai && cd shumai
Step 3: Install Platform-Specific Dependencies
Linux
Shumai requires the following system packages on Linux:
ffmpeg– Used for media transcoding and metadata extraction.poppler(poppler-utils) – Used for PDF page image extraction and PDF sprite preview generation (pdftoppm).imagemagick– Used for PSD format transcoding and color profile conversion to sRGB.bubblewrap,socat, andripgrep– Required by the AI agent sandbox (anthropic-experimental/sandbox-runtime) for process isolation, networking, and workspace search.
Install all required packages with one command:
Ubuntu/Debian
sudo apt install -y ffmpeg poppler-utils imagemagick bubblewrap socat ripgrep
Fedora
sudo dnf install -y ffmpeg poppler-utils ImageMagick bubblewrap socat ripgrep
Arch Linux
sudo pacman -S --noconfirm ffmpeg poppler imagemagick bubblewrap socat ripgrep
Note
Ubuntu 24.04+ restricts unprivileged user namespaces by default. This prevents
anthropic-experimental/sandbox-runtimefrom usingbubblewrapfor sandbox isolation.To temporarily allow user namespaces:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0Alternatively, configure an AppArmor profile that grants the required
usernspermission to the relevant binaries.
macOS
Shumai requires:
ffmpeg– Used for media transcoding and metadata extraction.poppler– Used for PDF page image extraction and PDF sprite preview generation (pdftoppm).imagemagick– Used for PSD format transcoding and color profile conversion to sRGB.ripgrep– Required by the AI agent sandbox (anthropic-experimental/sandbox-runtime).
Install the required packages with Homebrew:
brew install ffmpeg poppler imagemagick ripgrep
Windows (alpha)
Warning
Windows support in anthropic-experimental/sandbox-runtime is alpha and the design is in flux.
The current implementation provides:
- Network egress filtering via the Windows Filtering Platform (WFP).
- File read/write denial via ACL stamping.
However, it is not a security boundary against a deliberately adversarial sandboxed process.
The sandbox implementation will be substantially revised in a future release, where sandboxed processes will run under a dedicated sandbox user account.
Shumai requires:
ffmpeg– Used for media transcoding and metadata extraction.imagemagick– Used for PSD format transcoding and color profile conversion to sRGB.
Install required packages using your preferred package manager:
winget
winget install Gyan.FFmpeg ImageMagick.ImageMagick
Chocolatey
choco install ffmpeg imagemagick
Step 4: Install Shumai globally
Install Shumai globally using your preferred package manager:
# NPM
npm install -g @shumai-one/shumai
# PNPM
pnpm add -g @shumai-one/shumai
# Bun
bun add -g @shumai-one/shumai
Step 5: Configure Environment Variables
Create a .env file in your workspace folder (shumai/) and add the following configuration:
DATABASE_URL=postgresql://shumai:shumai_password@localhost:5432/shumai_db?schema=public
BETTER_AUTH_SECRET=ySxs7DxzHDZBbeeHNPEwBuspYwipBqz5Gk5XdBjNhWw=
STORAGE_BACKEND=local
SHUMAI_SERVER_PORT=3000
AWS_ENDPOINT_URL_S3=http://localhost:3000
Note
SHUMAI_SERVER_PORTsets the port the server starts on, whileAWS_ENDPOINT_URL_S3is used by the browser to build file upload URLs. If deploying on a remote server (e.g.http://123.456.7.8) with a mapped port (e.g.12345:3000in docker-compose), setAWS_ENDPOINT_URL_S3tohttp://123.456.7.8:12345.
Step 6: Run Shumai
Important
For Bun Users: Since the published package binaries contain a
#!/usr/bin/env nodeshebang, running the global command directly (e.g.,shumai) will execute under Node.js. If you installed with Bun and want to run under the Bun runtime, you must prefix all commands withbun run --bun(e.g.,bun run --bun shumai,bun run --bun shumai -d,bun run --bun shumai stop).
Start the application from your workspace folder:
shumai
Alternatively, you can run and manage Shumai in daemon mode:
- Start in daemon mode:
shumai -d - Stop Shumai:
shumai stop - Restart Shumai:
shumai restart - Show/tail logs:
shumai logs
On startup, Shumai will automatically run database migrations and start the web server at http://localhost:3000.
Option 3: Run from Source (Development)
To set up Shumai locally for development:
- Clone the repository and install dependencies:
git clone https://github.com/shumaiOne/shumai.git cd shumai bun install - Start the
pgvectordatabase container (as described in Option 2, Step 1). - Create a
.envfile at the root of the workspace using the configuration from Option 2, Step 5. - Apply the database schema migrations:
bun run db:migrate - Start the local development server:
bun run dev
Command Line Interface (CLI)
Shumai provides a Command Line Interface (CLI) tool to manage projects, folders, and assets, upload files/folders, and create new versions directly from your terminal.
For more details on installation and usage, see the CLI Readme.

