+-----------------------------------------------------------------------
| Running wpchroot-0.1p3 on amd64
+-----------------------------------------------------------------------

First deployment, order
=======================
The play (the web_wp role of infra.git) calls these commands, so the packages
must exist before the first play that reaches them:

  1. sbin/ship.sh promote ports-hn, then sbin/ship.sh deploy ports-hn:
     publishes wpchroot AND wpchroot-mu on the package repository, BEFORE
     any play.
  2. the first play on the web host installs both packages (sys_pkg), and
     writes /etc/wpchroot.conf and the doas rule. Before it, a "check infra"
     has neither the commands nor the settings to preview: the sync is
     skipped then, and says so.

First install, by the maintainer
================================
wpchroot changes no site by itself. Once, as root (the deployment does 2 and 3
itself):

1. The account. The package creates _wp (uid 1003, group daemon). Its
   supplementary group www, which lets it read the uploads, and its locked
   password are not in the package: add _wp to www and lock the password
   (usermod -G www _wp; usermod -p '*' _wp).

2. The settings. Copy the example and edit it; the file must belong to
   root:wheel and be writable by root alone, the commands refuse it
   otherwise:

   # install -o root -g wheel -m 0644 \
         /usr/local/share/examples/wpchroot/wpchroot.conf /etc/wpchroot.conf

   Every key is described in wpchroot.conf(5).

3. The doas rule that lets _wp switch the owner of the uploads, the one
   thing it cannot do itself (/usr/local/share/examples/wpchroot/doas.conf):

   permit nopass _wp cmd /usr/local/bin/wpchroot-owner

   The command only takes a docroot that is a WordPress site of _wp: a
   wp-config.php owned by _wp must stand in the parent of an isolated
   htdocs, or in a shared docroot (wpchroot(8), wpchroot-owner).

4. Sync the mu-plugins into the sites, then fix the ownership:

   # doas -u _wp wpchroot sync
   # wpchroot perms /var/www/sites/<site>/htdocs \
         _wp www 0750 0640

   (use the modes of CODE_DIR_MODE and CODE_FILE_MODE).

Daily use is in wpchroot(8); the architecture, and what the package does
not do, is in /usr/local/share/doc/wpchroot/README. The cron, newsyslog
and doas lines are examples in /usr/local/share/examples/wpchroot/: the
files they belong to have a single writer, the play that deploys the
sites.
