Upgrading from the version with setup-check
Older versions of Repo Renderer had built-in default paths, a shared hooks
directory at /usr/local/share/repo-render/hooks, and setup-check and
httpd-conf commands. They also kept httpd and mirroring settings in the
renderer's config. The new version won't start until the config has been
updated, so do all of these steps together. Pushes made partway through
won't be rendered.
1. Install the new version
Follow step 1 of openbsd.md: build the package on your
machine with make server, copy it to the server, and run install.sh
there as root.
2. Update the renderer's config
On the server, as root, edit /etc/repo-render/repo-render.yaml.
Add the paths that used to be defaults, with your own host name in
htdocs:
git_dir: /var/git
htdocs: /var/www/htdocs/code.example.com
spool_dir: /var/spool/repo-render
state_dir: /var/db/repo-render
log: syslog
git: /usr/local/bin/git
Then remove these settings, which the renderer no longer accepts:
listen,aliasesandhtpasswd. These now go in httpd's config (step 4), so make a note of their values first.ssh_key.mirrorsunder each repository. Make a note of these too, for step 3.
Check the result:
su -s /bin/sh git -c 'repo-render --config /etc/repo-render/repo-render.yaml check'
If any old settings are left, check names them and says where they
belong now.
3. Rewire the repositories
Each repository needs to link to the new hook, and needs the config's
path and its mirrors stored in its own git config. Rewiring also removes
the old core.hooksPath setting.
If your mirrors are your own GitHub repositories, the migration script can do all of this. On your machine:
tools/migrate-from-github --dry-run --key /etc/repo-render/mirror_key SERVER
tools/migrate-from-github --key /etc/repo-render/mirror_key SERVER
Use the path of your existing mirror key. Older versions used
/etc/repo-render/mirror_key, and before that
/etc/repo-render/github_key.
Otherwise, rewire each repository by hand. On the server, as root, run
this for each repository, with one -m for each of its mirrors:
su -s /bin/sh git -c 'repo-render-new-repo -c /etc/repo-render/repo-render.yaml -m URL /var/git/NAME.git'
su -s /bin/sh git -c 'git -C /var/git/NAME.git config core.sshCommand "ssh -o BatchMode=yes -o ConnectTimeout=30 -i /etc/repo-render/mirror_key"'
4. Replace httpd's config
Make a new /etc/repo-render/httpd.conf from
/usr/local/share/examples/repo-render/httpd.conf, as in step 4 of
openbsd.md. The example's paths don't include the host
name, but your existing site's do, so change root and errdocs to
"/htdocs/YOUR.HOST" and "/htdocs/YOUR.HOST/err", and each private
site root to "/private/YOUR.HOST" if you have one. Put back the
listen address, any alias lines, and the htpasswd file path from the
old settings you noted in step 2. Then reload httpd:
httpd -n && rcctl reload httpd
5. Re-render and clean up
On the server, as root, render everything, then remove the files the old version installed:
su -s /bin/sh git -c 'repo-render --config /etc/repo-render/repo-render.yaml render --all'
rm -r /usr/local/share/repo-render/hooks /usr/local/share/repo-render/lexers
rm -f /usr/local/share/repo-render/repo-render.yaml /usr/local/share/repo-render/httpd.conf
The syntax highlighters that used to live in lexers/ are now built into
the renderer.