Domain delegation

On a multi-site instance, each domain can name who may manage it (SM154/SM155/SM165). Access lives on the domain, with two separate controls: an allow-list of groups (additive) and a set of user locks (subtractive). The Domains page shows a domain's whole access picture in one place.

Configuration

Two per-domain keys in lazysite.conf:

alias.clienta.com.content_root:   sites/clienta
alias.clienta.com.allowed_groups: clienta-editors, agency-leads
alias.clienta.com.locked_users:   alice, clienta-bot
allowed_groups
The groups permitted to manage this domain. A user is allowed a domain when they belong to one of its allowed groups. A non-default domain with an empty allow-list is operator-only.
locked_users
Accounts confined to this domain. A locked user reaches only the domain(s) they are locked to, intersected with what their groups allow - a lock only narrows.

Access is written through one action, domain-set, whichever surface calls it: the Domains page, the control API, MCP domain_set, or the lazysite-domains CLI, which also has group-add, group-remove, user-add and user-remove for changing one name at a time. Setting allowed_groups or locked_users needs the Users & groups permission (manage_users) as well as manage_domains; the other domain keys need manage_domains alone.

Each new name must be a group or account the site already has; a misspelt name is refused, named in the reply, and nothing is written. A group may be written @staff or staff and is stored as staff.

Who reaches what

The effective set resolves to a list of content-root scopes and feeds one rule, applied to every action addressed to a host or content root on every channel: the manager UI, control-API tokens, MCP, WebDAV and the processor's file-browser rooting.

  • The operator, and a signed-in manager with no lock and no allow-entry, reach every domain.
  • An account whose groups a domain allows reaches that domain's content and is refused every other domain.
  • A token or MCP grant whose groups no domain names reaches the primary site only, and is refused the domain writes (domain-set, domain-add, domain-alias-add, domain-remove, remap-save, site-backup-apply). Name its group in a domain's allowed_groups to give it that domain.
  • A locked user whose effective set is empty is confined to nothing.

What a confined account can do

An account or agent confined to some domains works on those domains through the actions' host forms. Since 0.15.3 it is refused the actions that change the whole instance: config-set, instance-wide theme and layout activation, the extensions, the instance backups, rotate-auth-secret, and the handler and schedule registries. It writes into a theme or layout only when no other site serves it, and activates a theme or layout on its own domain with host (since 0.15.4). It backs up its own site with a site package.

A manage_domains token with no scope may create a domain with domain-add when the new domain's allowed_groups names one of the token account's own groups and its content root lies outside every existing domain. It then reaches that domain and no other.

The sub-user ceiling

A created account can never out-reach its creator: effective scope is intersected up the created_by chain at resolve time, and disjoint scopes resolve to deny-all. An MCP agent minted by a delegated user is therefore confined to a subset of that user's own domains by construction.

Pre-DNS preview

The domain-preview action renders a registered domain's home page server-side under its own Host, with auth cleared (an anonymous public render), so a team can prepare and debug a new domain before DNS or TLS is live. Only registered hosts can be previewed, and a preview is left out of the visitor log.

The Domains panel checks

domain-check verifies a registered domain is live on this install, running four ordered checks the panel renders in order:

  • DNS resolves - the name has an address
  • Points to this server - a resolved address matches this install's public IP (discovered from canonical_ip, or by resolving the install's own domain; indeterminate behind an unknown proxy/NAT)
  • HTTPS certificate valid - a trusted certificate covers the host; a trusted certificate that does not cover the host is reported as a coverage gap, listing the names it does cover
  • Serves this lazysite - an HTTPS request lands back on this instance, verified by the /.well-known/lazysite-instance.json marker

The outbound probes are SSRF-guarded: the check refuses to connect when any resolved address is non-public (loopback, RFC1918, link-local and the metadata endpoint, CGNAT, IPv6 ULA), keyed on the resolved IPs so DNS rebinding is closed too, and only operator-registered hosts may be probed at all.

Notes

  • Adding a domain validates the host as a strict DNS name and the content root against traversal and the reserved lazysite/ area; values are rejected if they could smuggle a second conf line
  • Removing a domain leaves its content directory in place by default; purge removes it, and the domain's files in the private store, confined to the docroot
  • A second host can share a domain's content with domain-alias-add; see Multi-site
  • Domain access is shown and edited on the Domains page; the group editor leaves it out. The earlier group-side binding (dav_scope/home_domain, SM155) was replaced by this domain-owned model
  • DNS, the web-server alias and TLS are preconditions handled by the operator or panel, outside lazysite