Multiple tenants
One xixo serves one catalog, named by XIXO_TENANT. It can serve several. Each one is a tenant: a
separate catalog with its own resources, feeds, analyses, runs, settings, and audit trail, at its own
host. Every request and every job runs inside exactly one tenant. Nothing in the catalog, the
index, or the browser app is shared between tenants.
The self-hosting guide sets up one tenant. This page says what changes with several.
Declaring tenants
Section titled “Declaring tenants”A deployment declares its tenants in one of two ways. Setting both stops xixo:tenants with
Tenant::TenancyConflict, and the container exits.
| Declared by | A request resolves by | |
|---|---|---|
| Single | XIXO_TENANT=xixo |
Nothing. Every host is that tenant. |
| Multi | XIXO_TENANTS=demo,acme |
The first label of the host name. demo.xixo.example.com is demo. |
The container entrypoint runs bin/rails xixo:tenants on boot, which creates each declared tenant
that does not exist, in xixo and in the built-in masks, and then bin/rails xixo:resources, which
declares the resources in config/resources.yml in every tenant. A request resolves against the
tenants in the database, so removing a name from XIXO_TENANTS neither deletes that tenant nor
stops xixo from serving it. A host that names no tenant gets 404 Unknown tenant. The health check
at /up is the only path served outside a tenant.
-
Set
XIXO_TENANTSto the tenants’ names, separated by commas. -
Set
XIXO_HOST_SUFFIXto the domain the tenants answer under, such asxixo.example.com. Rails answers403to aHostoutside it, except at/up. -
Set
XIXO_PUBLIC_ORIGINwith%{subdomain}standing for the tenant’s name:Terminal window XIXO_PUBLIC_ORIGIN=https://%{subdomain}.xixo.example.com -
Point DNS for each tenant’s host, or a wildcard under the suffix, at the reverse proxy, and send every host to xixo:
*.xixo.example.com {reverse_proxy xixo:80}
The proxy must pass the original Host header, because xixo finds the tenant from the host. To add
a tenant later, add it to XIXO_TENANTS and recreate the web container.
Signing in
Section titled “Signing in”Each xixo tenant is a client of a masks tenant with the same name. With the built-in masks, each
tenant signs in at /id on its own origin, so demo.xixo.example.com signs in at
demo.xixo.example.com/id. xixo:tenants prints a setup token for each masks tenant that has no
account yet, and the first sign-in at each tenant goes as the self-hosting
guide describes.
With a masks server of your own, %{subdomain} in MASKS_ISSUER_TEMPLATE
names the masks tenant each xixo tenant signs in through:
MASKS_ISSUER_TEMPLATE=https://%{subdomain}.auth.example.comA token is accepted only at the tenant it was issued for. Its issuer must be that tenant’s issuer,
its audience that tenant’s origin followed by /mcp, and any tenant claim it carries must name
that tenant. A token whose tenant claim names acme is refused at demo. See
tokens.
xixo link beside the server
Section titled “xixo link beside the server”xixo link beside the server serves one tenant. Run one link container for each tenant, each with
its own state volume and these settings:
XIXO_LINK_XIXO |
The tenant’s origin, such as https://acme.xixo.example.com. |
XIXO_LINK_ISSUER |
The tenant’s masks issuer, the origin followed by /id with the built-in masks. |
XIXO_LINK_HANDOFF |
/handoff/<tenant>, in the volume the web and worker containers mount at XIXO_LOCAL_LINK. |
XIXO_LINK_WRITABLE |
/data/files/<tenant>, where config/resources.yml puts the tenant’s Files resource. |
Each one enrolls itself after the first sign-in connects its tenant to masks, as xixo link beside the server describes.
Isolation
Section titled “Isolation”Isolation has two layers:
| Layer | What it does |
|---|---|
| Default scope | Every tenant model is scoped to the current tenant, and new rows take its id. |
| Row-level security | Every tenant table has FORCE ROW LEVEL SECURITY and a tenant_isolation policy. |
The policy compares each row’s tenant_id with the tenant the database session is in, for reads and
writes. Outside a tenant the policy matches no rows, so code that skips the default scope still
finds nothing from another tenant. Active Storage’s tables carry the same policy, so a signed blob
id from one tenant finds no row in another.
A Postgres role with SUPERUSER or BYPASSRLS ignores every policy. xixo checks its role the first
time a process enters a tenant, and raises Tenant::Exposed if the role can bypass the policies.
See the database role.
Every job records the tenant it was enqueued in and runs inside it. A job enqueued outside a tenant raises an error. All tenants share one OpenSearch index, and each searches through a filtered alias of its own. See search.
Jobs, limits, and updates
Section titled “Jobs, limits, and updates”ANALYSIS_PER_TENANT, 2 by default, is how many analyses one tenant may run at the same time across every process, so one tenant cannot fill the pool.XIXO_MCP_LIMITandXIXO_RUN_BUDGETcount per tenant. See budgets and gates.XIXO_ITERATORS_DISABLED=truestops every sync, analysis, export, and reindex in every tenant.- Mission Control at
/jobswould list every tenant’s jobs, because Solid Queue’s tables sit outside row-level security. xixo sets no user or password for it, so it answers401. Leave it closed, or block/jobsat the proxy. - Settings > Updates belongs to one tenant. Set
XIXO_UPDATES_TENANTto its name, and its administrators see and control the server’s updates. Without it, no one controls them from xixo. See keep xixo up to date.
If it doesn’t work
Section titled “If it doesn’t work”- Every page answers
404 Unknown tenant: neitherXIXO_TENANTnorXIXO_TENANTSis set, or the host’s first label names no declared tenant. Tenant::TenancyConflict: bothXIXO_TENANTandXIXO_TENANTSare set. Remove one.- A token works at one tenant and is refused at another: that is by design. Each MCP client and each browser session belongs to the tenant that issued its token.
- Only one tenant’s xixo link shows as This server: each tenant needs a
linkcontainer of its own, with its ownXIXO_LINK_HANDOFFfolder and state volume.