Skip to content

Architecture & Getting Started

FynnCloud apps are self-contained HTTP servers packaged as OCI container images (any language or framework) paired with a declarative manifest.json and—for apps with a web UI—the lightweight @fynncloud/app-bridge browser library.

Browser (FynnCloud Host Shell)
│ renders sandboxed opaque-origin <iframe> (no cookies, no host DOM access)
│ exchanges typed RPCs & tokens via postMessage (@fynncloud/app-bridge)
▼
FynnCloud Server Gateway (/api/apps/:appId/proxy/**)
├─ Verifies user session / AppAccessToken / cross-app compatibility.apps
├─ Strips Set-Cookie & Access-Control-*, merges sandbox CSP
├─ Injects X-FynnCloud-User-ID, X-FynnCloud-Caller-App, Authorization
└─ Signs identity proof: X-FynnCloud-Gateway-Timestamp + X-FynnCloud-Gateway-Signature
▼
App Container (isolated per-app network: fynncloud-app-net-<appId>)
├─ Serves static SPA shell (public GET/HEAD outside /api/**) & /api/** routes
├─ Connects to its dedicated PostgreSQL schema (DATABASE_URL) & volume (/data)
└─ Calls FynnCloud Core via FYNNCLOUD_INTERNAL_API_URL (scoped JWT or App-Secret)

Clone the official FynnCloudProject/apps monorepo alongside FynnCloud-Backend and fynncloud-web-svelte:

Terminal window
git clone https://github.com/FynnCloudProject/apps.git
cd apps
# Install workspace dependencies (including @fynncloud/app-bridge)
npm install
# Run an app locally with hot-reload wired against your local FynnCloud Server
./dev.sh calendar
apps/<app-id>/
├── manifest.json # Required: schema-validated app manifest (v1)
├── icon.svg # Required: monochrome glyph using fill="currentColor"
├── hero.png # Required for App Store: >= 1280x720 showcase image
├── gallery/ # Optional: up to 10 screenshots
├── Dockerfile # Multi-arch (linux/amd64, linux/arm64), non-root USER
├── src/ # App backend + frontend source
└── README.md # Store description

During development, register your locally running server via POST /api/apps/install with an external dev endpoint URL (when running fynncloud-server in development mode, or with AIO_ALLOW_HOST_LOOPBACK_DEV=true in AIO). Your app receives the exact same gateway proxy headers, HMAC signatures, and @fynncloud/app-bridge context as in production.


Exact Core REST API Allowlist for AppAccessToken

Section titled “Exact Core REST API Allowlist for AppAccessToken”

AppAuthorizationPolicy uses default-deny whole-segment matching. An AppAccessToken JWT (issued to an app’s iframe, background file action, or native OAuth companion client) may only call the endpoints below—every other endpoint (admin, settings, user security, sharing management, core document editor) returns 403 Forbidden:

Endpoint HTTP Methods Required Scope(s) Additional Constraints
/api/files/:id, /api/files/:id/download, /api/files/:id/thumbnail, /api/files/:id/versions GET, HEAD files:all:read or files:selected:read files:selected:read is strictly confined to allowedFileIds / allowedFolderIds
/api/files/all, /search, /recent, /favorites, /shared, /shared-with-others, /trash, /resolve GET, HEAD files:all:read (required) Drive-wide routes reject files:selected:read-only tokens
/api/files/:id/activity GET, HEAD (files:all:read or files:selected:read) AND user:read Requires both file read and user:read
/api/files/** (uploads, mkdir, rename, move, delete, version restore) POST, PUT, PATCH, DELETE files:all:write or files:selected:write Always forbidden: /api/files/:id/share-links, /internal-shares, /editor (403)
/api/activities GET, HEAD files:all:read AND user:read Disallowed for anonymous share-link tokens
/api/user/me, /api/user/quotas, /api/user/:userID/avatar GET, HEAD user:read Disallowed for anonymous share-link tokens
/api/user/status PUT presence:write Updates signed-in user’s Core presence mode & status message
/api/directory/recipients, /api/directory/groups GET, HEAD user:read Group member lists (/groups/:id/members) are not accessible to AppAccessToken—use backend X-FynnCloud-App-Secret with groups:read
/api/presence GET, HEAD user:read Live presence resolution (?userIds=..., max 200)
/api/events GET realtime:push or user:read or notifications:send SSE stream strictly filtered to appToken.appID (plus presence.updated when user:read is granted)
/api/push/devices, /api/push/devices/:id, /api/push/devices/installation/:id PUT, GET, DELETE notifications:send apns-voip additionally requires rtc:rooms
/api/apps/integrations GET, HEAD (any non-share app token) Discovers status of target apps declared in compatibility.apps
/api/apps/:selfAppId/proxy/** All proxy methods (any token for that app) Always allowed (including share-scoped tokens)
/api/apps/:targetAppId/proxy/** All proxy methods compatibility.apps declaration Only for non-share tokens whose allowedTargetApps includes targetAppId
/api/auth/logout POST Grant-bound OAuth app token (grantID != nil) Revokes the app’s own OAuth grant

Server-to-server app backend endpoints (/api/apps/notifications, /api/apps/badges, /api/apps/presence, /api/apps/presence/activity, /api/apps/realtime/publish, /api/apps/capabilities, /api/rtc/*, /api/directory/groups/:id/members) authenticate with X-FynnCloud-App-ID + X-FynnCloud-App-Secret instead of an AppAccessToken.