/xlog/log/*/event.log
/xlog/log/*/event.log.[0-9]
/xlog/log/*/event.log.[0-9].gz
-/master/moderators
+/crontab.part
+/stump/etc/added-headers
+/stump/etc/added-footer
+/stump/etc/added-footer.new
+/stump/etc/approval.key.txt
+
+/settings
+/moderators
+++ /dev/null
-#
-# install with
-# ssh webstump@chiark crontab live/crontab
-#
-#m h d m dow
-50 7 12 * * savelog live/xlog/log/uk.rec.cycling.moderated/event.log
-50 7 12 * * savelog live/errs
--- /dev/null
+#
+# install with
+# ssh webstump@chiark live/crontab-install
+#
+#m h d m dow
+50 7 12 * * savelog live-%ABBREV%/xlog/log/%GROUP%/event.log
+50 7 12 * * savelog live-%ABBREV%/errs
--- /dev/null
+#!/bin/bash
+set -e
+
+basedir=`dirname "$0"`
+case "$basedir" in
+.|..) basedir="$basedir/.." ;;
+*) basedir=`dirname "$basedir"` ;;
+esac
+cd $basedir
+
+for f in crontab forward-suffix forward-slimy
+do
+ d=$f
+ g=$f.combined
+ >$g
+
+ case $f in
+ forward-*) d=.$d; echo '# Exim filter' >>$g ;;
+ esac
+
+ echo '# autogenerated - do not edit' >>$g
+ if test -f $f.part; then cat $f.part >>$g; fi
+ cat live-*/$f.part >>$g
+
+ mv -f $g $d
+ case $f in
+ crontab) crontab crontab ;;
+ esac
+done
--- /dev/null
+#!/bin/bash
+set -e
+
+fail () { echo >&2 "fatal: $*"; exit 1; }
+
+. settings
+
+armorout=stump/etc/approval.key.txt
+if test -f $armorout; then exit 0; fi
+
+if [ x"`whoami`" != xwebstump ]; then fail "wrong user"; fi
+
+gpg --batch --gen-key - <<END
+%echo Generating key...
+Key-Type: RSA
+Key-Length: 2048
+Key-Usage: sign
+Name-Real: $GROUP approval key
+Name-Email: $MODEMAIL
+%commit
+%echo Key generated.
+END
+
+gpg --export --armor "$GROUP approval key <$MODEMAIL>" >$armorout
--- /dev/null
+#!/bin/bash
+set -e
+. settings
+export GROUP
+export ABBREV
+export INFOHEADER
+find -name '*.IN[O1]' -exec perl -e '
+ use IO::Handle;
+ use POSIX;
+ my $f= shift;
+ my $d= $f;
+ $d =~ s/\.IN([O1])$//;
+ my $overwrite= ($1 eq 'O');
+ my $g= "$d.new";
+ open F, "< $f" or die "$f $!";
+ open G, "> $g" or die "$g $!";
+ while (<F>) {
+ s/\%(\w+)\%/
+ exists($ENV{$1}) ? $ENV{$1} : die "$1 ?"
+ /ge;
+ print G or die $!;
+ }
+ F->error and die $!;
+ close F or die $!;
+ close G or die $!;
+ if ($overwrite) {
+ rename $g, $d or die "$g $d $!";
+ } else {
+ if (link $g, $d) {
+ unlink $g or die $!;
+ } else {
+ die "$g $d $!" unless $!==&EEXIST;
+ }
+ }
+' '{}' \;
--- /dev/null
+#!/bin/bash
+set -e
+# To set up a new newsgroup, run this script.
+#
+# Some things are idempotent, others are once-only.
+
+./install-key
+./install-substitutions
+./install-aggregates
--- /dev/null
+X-Moderation: %INFOHEADER%
+++ /dev/null
-#!/bin/sh
-#
-# This is a shell script that replaces "hostname" on bsd-derived systems
-# where inews conflicts with system-provided "hostname" program.
-#
-# This is a drop-in replacement for hostname.
-#
-# Edit this file and set HOSTNAME and FULL_HOSTNAME to the right values,
-# according to your machine's system name.
-#
-# Read instructions in "modenv" file (close to RNEWS) where I explain when
-# you should use this script, and how.
-#
-# Example:
-# HOSTNAME=galaxy
-# FULL_HOSTNAME=galaxy.galstar.com
-
-HOSTNAME=manifold
-FULL_HOSTNAME=manifold.algebra.com
-
-if [ "x$1" = "-f" ] ; then
- echo $HOSTNAME
-else
- echo $FULL_HOSTNAME
-fi