Site doctor
The install health and permissions checker, with safe automatic fixes.
Site doctor
lazysite-check verifies that a site's docroot is set up so the
web-server CGI identity can read its configuration and write what it
must write (cache, logs, locks, secrets), that secrets are hidden from
other users, and that the manager is bootstrapped. Run it through the
CLI or directly:
lazysite check --docroot /path/to/public_html
perl tools/lazysite-check.pl --docroot /path/to/public_html [--fix]
Through the CLI, lazysite check --domain example.com or
lazysite check --all checks registered sites by name, reading each
site's docroot and cgi-bin from the site registry.
Options: --cgibin PATH (default <docroot>/../cgi-bin),
--owner USER and --group GROUP (defaults derived from the docroot
itself), --fix, --check-dav URL, --check-acl URL, --sinks,
--dependencies, --help.
Evaluated as the CGI identity
Every effective-access check is computed by ownership-and-mode
arithmetic for the CGI user, never by the process's own -r/-w/-x
tests - run as root, those answer for root, which bypasses permissions
and would silently pass files the CGI cannot actually use.
What it evaluates
- ownership of the
lazysite/tree (no foreign-owned files) - the dirs the CGI must write: group-writable, setgid, correct group, traversable, including every level of the template compile cache
- secrets and account stores: readable by the CGI yet closed to world
access (the signing secrets, the group capability and user settings,
oauth.json, the session registry and revocation files, and the SMTP and XMPP settings); the user store must never be world-writable lazysite.confpresent and readable by the CGI; the cgi-bin scripts present and executable- manager bootstrap (group, user, password) and the manager layout present and usable by the CGI
- content-history repo health:
lazysite/authexcluded, repo internals usable by the CGI, shared-repository mode set - system pages (login, claim, 40x) resolving via the fallback chain,
and OAuth/remote-discovery coherence of
site_url - content provenance: which pages are pristine seeds, customised, or operator-authored (left alone by upgrades)
It also reports on:
- a stale group
dav_scopeand a retiredanonymise_ipsetting - who an
@groupaccess entry admits, data tables without a domain scope, unsafe navigation addresses and the CSP allow-lists - protected content that also sits in the public docroot, and whether the private store can be written
- whether the login rate limiter is counting
- the Odoo extension: keys used by scheduled bindings that expire soon, the resident OOM, the Odoo sign-in and read-binding caps
- where the engine tree lives and whether there is only one copy
- registry files left from before registries were served
- templates written for 0.12's raw database values, retired configuration keys and the installable-app settings
- whether front-door mode is on, whether the persistent runtime is armed, and whether the active theme's stylesheet is served
Opt-in probes:
--check-dav URLrequestsURL/dav/unauthenticated and expects a 401 challenge (route wired) rather than a 404 (the front end does not forward/dav/)--check-acl URLbriefly gates a probe folder, fetches it anonymously fromURLunder several file extensions, and FAILs if any bytes come back; the temporary access entry is removed afterwards, including after an interrupt--sinkssends one marked line through the engine's syslog forwarding and reports whether the system log received it--dependenciesreports the OS Perl packages lazysite needs, present versus missing, with the install line - no docroot required
Report versus --fix
A plain run prints one OK / WARN / FAIL line per check with a
remediation hint, and exits non-zero if anything FAILs. With --fix
it applies the safe repairs - chmod always, chown only when run as
root - then re-runs every check (repeating until stable), so the
printed report reflects the post-fix state. On the docroot's own
content directories --fix restores group write only; any other mode
difference is reported and left as it is.
When to run it
Run the doctor after a hand-run or tarball install, after moving or
restoring a site tree, or whenever the manager reports it cannot write
something. Sites provisioned with the lazysite CLI are owned
correctly by construction, so there the doctor is a diagnostic
rather than a routine repair step.