machines are removed from the DNS during their maintenance.
The term static mirroring infrastructure includes:
• components, specifying the data source and other config options.
See `modules/roles/misc/static-components.yaml`
• a `master` host for each component, responsible only for distributing data,
not for serving data to end users.
• machines with the `static_mirror` Puppet role
• a few scripts around `rsync(1)`
### Change process
When data changes, the `source` is responsible for running
`static-update-component`, which instructs the `master` via SSH to run
...
...
@@ -213,11 +217,153 @@ point the updated data will be served to end users.
<!-- end of the copy -->
TODO: expand design. talk about mininag and walk through the [scripts overview](https://salsa.debian.org/dsa-team/mirror/dsa-puppet/-/blob/master/modules/staticsync/files/OVERVIEW)
### Source code inventory
The source code of the static mirror system is spread out in different
files and directories in the `tor-puppet.git` repository:
*`modules/roles/misc/static-components.yaml` lists the "components"
*`modules/roles/manifests/` holds the different Puppet roles:
*`roles::static_mirror` - a generic mirror, see
`staticsync::static_mirror` below
*`roles::static_mirror_web` - a web mirror, including most (but
not necessarily all) components defined in the YAMl
configuration. configures Apache (which the above
doesn't). includes `roles::static_mirror` (and therefore
`staticsync::static_mirror`)
*`roles::static_mirror_onion` - configures the hidden services for
the web mirrors defined above
*`roles::static_source` - a generic static source, see
`staticsync::static_source`, below
*`roles::static_master` - a generic static master, see
`staticsync::static_master` below
*`modules/staticsync/` is the core Puppet module holding most of the
source code:
*`staticsync::static_source` - source, which:
* exports the static user SSH key to the master, punching a hole
in the firewall
* collects the SSH keys from the master(s)
*`staticsync::static_mirror` - a mirror which does the above and:
* deploys the `static-mirror-run` and `static-mirror-run-all`
scripts (see below)
* configures a cron job for `static-mirror-run-all`
* exports a configuration snippet of `/etc/static-clients.conf`
for the **master**
*`staticsync::static_master` - a master which:
* deploys the `static-master-run` and
`static-master-update-component` scripts (see below)
* collects the `static-clients.conf` configuration file, which
is the hostname (`$::fqdn`) of each of the
`static_sync::static_mirror` exports
* configures the `basedir` (currently
`/srv/static.torproject.org`) and `user` home directory
(currently `/home/mirroradm`)
* collects the SSH keys from sources, mirrors and other masters
* exports the SSH key to the mirrors and sources
*`staticsync::base`, included by all of the above, deploys:
*`/etc/static-components.conf`: a file derived from the
`static-components.yaml` config file
*`/etc/staticsync.conf`: polyglot (bash and Python)
configuration file propagating the `base` (currently