Implements option D of docs/Design/Multitenancy/Multitenancy.md, which that document now describes as shipped. An Organization may claim hostnames (Admin Panel / People / Organizations -> Edit), carry its own branding - product name, logos, help link, legal notice and theme colour - and have its own Organization admins, appointed from the row's "..." menu. The request's host picks the Organization; its branding replaces the instance branding for that request, and the client bundle that host serves points its DDP connection back at that host instead of at the one ROOT_URL. An Organization admin administers their own Organization and nothing else: its people, its Organizations row, its theme colour and its backups. They can never grant the site-wide Admin flag, never manage a site admin, and never see another Organization's people or archives. Per-tenant backup and restore is one new control in Admin Panel / Attachments / Backup - Scope. An Organization's archive holds its boards and everything on them plus the attachments those boards use, and no accounts, no instance settings and no org/team documents, because those are shared. A restore may only write to boards that Organization owns: the board ids are the intersection of what the archive claims with what the Organization really owns, every document is checked against that, and "replace all" replaces that Organization's documents rather than everyone's. Admin Panel / Settings / Visibility gains a Change color section above Logo: the site theme, rendered by the SAME shared picker as Board Settings and Member Settings - one template for all three, the way one shared table page serves every table. Its design is the new docs/Design/Page/Theme.md. The order of themes is WeKan's default theme, then the site theme (an Organization's own value on its own hosts), then a user's own override; a board's own colour still owns the board page. All of it is OFF unless the server is started with MULTITENANCY=true (plus MULTITENANCY_TRUST_PROXY_HOST=true when a trusted proxy sets X-Forwarded-Host), so an instance that has never heard of tenants answers exactly as before. One WeKan server per customer remains the supported topology for customers who must not share a process, and the design says plainly what this does NOT isolate. The decisions are three pure modules - models/lib/tenants.js, tenantAdmin.js and tenantBackup.js - so the same rules run on the client, on the server and in the tests. Four new suites pin the separation rather than the plumbing: forged Host headers, cross-tenant queries, privilege escalation and cross-tenant restores. Thanks to xet7 !
4.1 KiB
Admin Panel / Attachments
Where files live, how big they may be, moving them between storages, and backups. One heading per menu entry, in menu order. Backup is first and is the pane that opens; arriving there also asks once whether a backup is already running, so an in-progress backup shows its status.
Backup
Take a backup now — attachments, avatars and the database, each a checkbox — choose where it is written, and schedule it (daily, weekly on a chosen day, or monthly on a chosen date, at a chosen time). List backups shows what exists; a backup can be restored, either adding only what is missing or replacing.
A restored archive is checked entry by entry: an entry that resolves outside the directory it belongs in is skipped and reported, never written (ZipBleed).
Scope: the whole instance, or one Organization
Backup scope chooses what is backed up. A site admin sees Whole instance plus every Organization; an Organization's own admin sees only the Organizations they administer, and cannot take an instance backup.
An Organization's backup holds its boards and everything on them — lists, swimlanes, cards, comments, checklists, custom fields, activities, rules, integrations — and the attachments those boards use. It does not hold user accounts, the instance settings, or the Organization and Team documents themselves: those are shared by every Organization, so they belong to the instance backup.
Restoring an Organization's backup only ever writes to boards that Organization owns. Board ids the archive claims but the Organization does not own are dropped, every document is checked against what is left, and "replace all" replaces that Organization's documents rather than everyone's. An Organization's admin can never restore an instance backup, because it contains every Organization.
Instance archives are written to <files>/backup/YYYY/MM/DD/HH_MM_SS/backup.zip and an
Organization's to <files>/backup/org/<orgId>/…, so the list shows only the archives
you may restore. See
Design / Multitenancy (D.8).
The schedule is instance-wide, and stays with the site admin: one cron, one archive of everything.
Move attachment
Move attachments and/or avatars between storages: choose the scope (attachments, avatars, both), the source (all, or one specific storage) and the destination. The last move is reported, and Repair file locations re-scans files whose recorded location no longer matches where they actually are.
Default save storage
Which storage new files go to.
Limits
Upload and download size limits, for attachments and for the API, each with a unit; and whether avatar uploads are blocked entirely.
MongoDB GridFS storage · Filesystem storage · S3 / MinIO storage · Azure Blob Storage · Google Cloud Storage
One pane per backend, each with its own read / write switches and its own settings — paths for the filesystem, bucket and credentials for S3 / MinIO, account and container for Azure, bucket and service-account permissions for GCS. Every pane says which environment variable or console path each field corresponds to.
Database migration
The MongoDB ↔ FerretDB v1 (SQLite) text-data migration, with the progress dashboard. See Problems / Migrations.
Sandstorm — removed from the menu
There is no Sandstorm pane any more. It only had content inside a Sandstorm grain —
the MongoDB 3 → FerretDB migration status, disk usage per storage, and a button that
deleted the raw MongoDB 3 files to reclaim grain disk. Compacting the MongoDB
database frees that space as well, so WeKan does not offer to delete raw database
files. The pane, its menu entry, its helpers and its handler are commented out in
client/components/settings/attachments.jade and .js.
The grain migration itself is unchanged: it runs in sandstorm-src/start.js before
the app boots — see
Sandstorm migration.
Related
- Attachments (cards) — what a user sees.
- Attachment migration system