From: Ian Jackson Date: Sat, 27 Feb 2010 21:27:55 +0000 (+0000) Subject: Big changes to fully configure for group X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?p=modbot-mtm.git;a=commitdiff_plain;h=dba7b54b3cc0c7f2a56ec6da37ac86bc80756b4a Big changes to fully configure for group --- diff --git a/.gitignore b/.gitignore index 83b6faf..aea3361 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /errs.[0-9].gz /stump/data /stump/tmp +/webstump/Makefile /webstump/bin/q /webstump/bin/wrapper /webstump/config/* @@ -13,11 +14,24 @@ /xlog/log/*/event.log.[0-9] /xlog/log/*/event.log.[0-9].gz /crontab.part +/stump/etc/modenv /stump/etc/added-headers /stump/etc/added-footer /stump/etc/added-footer.new /stump/etc/approval.key.txt +/stump/etc/modack.approved +/stump/etc/modack.received +/stump/etc/modack.approved.new +/stump/etc/modack.received.new +/stump/etc/moderators /sballot/issues +/inews +/mailinglists_dir.part +/forward-slimy.part +/forward-suffix.part +/cgi/logs +/README.auto /settings /moderators +/persistent-autosettings diff --git a/README.auto.INO b/README.auto.INO new file mode 100644 index 0000000..b2bf310 --- /dev/null +++ b/README.auto.INO @@ -0,0 +1,8 @@ + +The logs are at + %CGIBASEURL%/l.%ABBREV% + +The submission addresses are + %OURUSER%+%ABBREV%+%KEYSUBMIT%@%SLIMYDOMAIN% + %OURUSER%+%ABBREV%+test-submission@%SLIMYDOMAIN% + diff --git a/cgi/logs.INO b/cgi/logs.INO new file mode 100755 index 0000000..9936de2 --- /dev/null +++ b/cgi/logs.INO @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +cd %BASEDIR%/xlog/log +exec ../bin/report %GROUP% "$@" diff --git a/cgi/webstump b/cgi/webstump new file mode 120000 index 0000000..efc2c66 --- /dev/null +++ b/cgi/webstump @@ -0,0 +1 @@ +../webstump/bin/wrapper \ No newline at end of file diff --git a/crontab.part.INO b/crontab.part.INO index 4704cd1..48b5c68 100644 --- a/crontab.part.INO +++ b/crontab.part.INO @@ -3,5 +3,5 @@ # ssh webstump@chiark live/crontab-install # #m h d m dow -50 7 12 * * savelog live-%ABBREV%/xlog/log/%GROUP%/event.log +50 7 * * 1,4 savelog live-%ABBREV%/xlog/log/%GROUP%/event.log 50 7 12 * * savelog live-%ABBREV%/errs diff --git a/forward-slimy.part b/forward-slimy.part deleted file mode 100644 index 82361c2..0000000 --- a/forward-slimy.part +++ /dev/null @@ -1,9 +0,0 @@ -if $local_part_suffix is +urcm+nmw7gihi -or $local_part_suffix is +urcm+test-submission -then - unseen pipe "mail -s submission list-webstump+urcm+log+submissions" - unseen pipe "/home/webstump/live/xlog/bin/record submission uk.rec.cycling.moderated" - pipe "/home/webstump/live/stump/etc/modenv stump.pl submission.pl" - finish -endif - diff --git a/forward-slimy.part.INO b/forward-slimy.part.INO new file mode 100644 index 0000000..a4f6ec8 --- /dev/null +++ b/forward-slimy.part.INO @@ -0,0 +1,9 @@ +if $local_part_suffix is +%ABBREV%+%KEYSUBMIT% +or $local_part_suffix is +%ABBREV%+test-submission +then + unseen pipe "mail -s submission %LOGGROUPEMAILPREFIX%+%ABBREV%+log+submissions" + unseen pipe "/home/webstump/live/xlog/bin/record submission %GROUP%" + pipe "/home/webstump/live/stump/etc/modenv stump.pl submission.pl" + finish +endif + diff --git a/forward-suffix.part b/forward-suffix.part deleted file mode 100644 index 8205c58..0000000 --- a/forward-suffix.part +++ /dev/null @@ -1,43 +0,0 @@ -if $local_part_suffix is +urcm-bounces -then - seen deliver list-webstump+urcm+log+bounces - finish -endif - -if $local_part_suffix is +urcm-noack -then - unseen deliver list-webstump+urcm+log+noack - pipe "/home/webstump/live/stump/etc/modenv stump.pl processNoack.pl" - finish -endif - -if $local_part_suffix is +urcm-internal-webstump/4norttu6 -then - unseen deliver list-webstump+urcm+log+stump2webstump - unseen pipe "/home/webstump/live/xlog/bin/record stump2webstump uk.rec.cycling.moderated" - pipe "/home/webstump/live/webstump/scripts/file-message.pl" - finish -endif - -if $local_part_suffix is +urcm-internal-approve/pzv4uztw -then - unseen deliver list-webstump+urcm+log+webstump2stump - unseen pipe "/home/webstump/live/xlog/bin/record webstump2stump uk.rec.cycling.moderated" - pipe "/home/webstump/live/stump/etc/modenv stump.pl acceptFromMod.pl" - seen finish -endif - -if $local_part_suffix is +urcm-internal-log+mailout -then - unseen deliver list-webstump+urcm+log+mailout - pipe "/home/webstump/live/xlog/bin/record mailout uk.rec.cycling.moderated" - finish -endif - -if $local_part_suffix is +urcm-internal-reject-copy -then - seen deliver urcm-rejections@chiark.greenend.org.uk - finish -endif - -unseen finish diff --git a/forward-suffix.part.INO b/forward-suffix.part.INO new file mode 100644 index 0000000..c15f009 --- /dev/null +++ b/forward-suffix.part.INO @@ -0,0 +1,43 @@ +if $local_part_suffix is +%ABBREV%-bounces +then + seen deliver %LOGGROUPEMAILPREFIX%+%ABBREV%+log+bounces + finish +endif + +if $local_part_suffix is +%ABBREV%-noack +then + unseen deliver %LOGGROUPEMAILPREFIX%+%ABBREV%+log+noack + pipe "%BASEDIR%/stump/etc/modenv stump.pl processNoack.pl" + finish +endif + +if $local_part_suffix is +%ABBREV%-internal-webstump/%KEYSTUMP2WEB% +then + unseen deliver %LOGGROUPEMAILPREFIX%+%ABBREV%+log+stump2webstump + unseen pipe "%BASEDIR%/xlog/bin/record stump2webstump %GROUP%" + pipe "%BASEDIR%/webstump/scripts/file-message.pl" + finish +endif + +if $local_part_suffix is +%ABBREV%-internal-approve/%KEYWEB2STUMP% +then + unseen deliver %LOGGROUPEMAILPREFIX%+%ABBREV%+log+webstump2stump + unseen pipe "%BASEDIR%/xlog/bin/record webstump2stump %GROUP%" + pipe "%BASEDIR%/stump/etc/modenv stump.pl acceptFromMod.pl" + seen finish +endif + +if $local_part_suffix is +%ABBREV%-internal-log+mailout +then + unseen deliver %LOGGROUPEMAILPREFIX%+%ABBREV%+log+mailout + pipe "%BASEDIR%/xlog/bin/record mailout %GROUP%" + finish +endif + +if $local_part_suffix is +%ABBREV%-internal-reject-copy +then + seen deliver %ABBREV%-rejections@chiark.greenend.org.uk + finish +endif + +unseen finish diff --git a/get-settings b/get-settings new file mode 100644 index 0000000..5c55e77 --- /dev/null +++ b/get-settings @@ -0,0 +1,48 @@ +# + +paskeys='KEYSUBMIT KEYSTUMP2WEB KEYWEB2STUMP' +pas="$paskeys" +for k in $pas; do eval "$k=''"; export $k; done + +. settings +export GROUP ABBREV INFOHEADER MODEMAIL GROUPURL + +. ../global-settings +export ROOTBASEDIR CGIBASEURL DOMAIN SLIMYDOMAIN OURUSER ADMIN +export LOGGROUPPREFIX LOGGROUPEMAILPREFIX TESTGROUP +export STATICFILESURL STATICFILESDIR CGISCRIPTDIR + +BASEDIR=$ROOTBASEDIR/live-$ABBREV +export BASEDIR + + +# derivative settings: + +test -f persistent-autosettings || touch persistent-autosettings +. persistent-autosettings + +exec 3>persistent-autosettings.new +cat >&3 persistent-autosettings + +for k in $pas; do + eval "v=\$$k" + if [ "x$v" != x ]; then continue; fi + + v="`dd if=/dev/urandom count=6 ibs=1 2> /dev/null \ + | uuencode -m - \ + | perl -ne 'y/A-Z\+\//a-z01/; print if $.==2;' `" + case $v in + ????????) ;; + *) exit 1;; + esac + case $v in + *[^0-9a-z]*) echo >&2 "unexpected from dd etc.: $v"; exit 1 ;; + esac + echo >&3 "$k='$v'" +done + +mv -f persistent-autosettings.new persistent-autosettings + +exec 3>&- +. persistent-autosettings + diff --git a/inews b/inews.INO old mode 100755 new mode 100644 similarity index 83% rename from inews rename to inews.INO index 6ee5968..a2bbc54 --- a/inews +++ b/inews.INO @@ -21,7 +21,7 @@ output=` inews -h -Q -R <$tf else (set -e - echo "Newsgroups: chiark.test.moderated" + echo "Newsgroups: %TESTGROUP%" sed 's/^Newsgroups:/X-Would-Newsgroups:/' $tf) | inews -h fi ` @@ -31,7 +31,7 @@ set -e if [ $rc = 0 ] then echo 'posted ok!' - $HOME/live/xlog/bin/record posted uk.rec.cycling.moderated <$tf + $HOME/live/xlog/bin/record posted %GROUP% <$tf exit 0 fi diff --git a/inews.test b/inews.test deleted file mode 100755 index 6ee5968..0000000 --- a/inews.test +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -set -e - -#real=false -real=true - -export NNTPSERVER=nnrp.chiark.greenend.org.uk -export NNTPAUTH='md5cookie1way chiark' - -trap 'rm -f "$tf"' 0 - -tf=`mktemp` - -sed '${ /^$/d }' >$tf - -set +e -output=` - set -e - exec 2>&1 - if $real; then - inews -h -Q -R <$tf - else - (set -e - echo "Newsgroups: chiark.test.moderated" - sed 's/^Newsgroups:/X-Would-Newsgroups:/' $tf) | inews -h - fi -` -rc=$? -set -e - -if [ $rc = 0 ] -then - echo 'posted ok!' - $HOME/live/xlog/bin/record posted uk.rec.cycling.moderated <$tf - exit 0 -fi - -( - printf "Errors: %s" "$output" - echo - echo ====================== - cat $tf -) | mail -s 'lost moderated newsgroup submission' webstump diff --git a/install-aggregates b/install-aggregates index 10e2e6d..41856f9 100755 --- a/install-aggregates +++ b/install-aggregates @@ -8,7 +8,16 @@ case "$basedir" in esac cd $basedir -for f in crontab forward-suffix forward-slimy +. global-settings + +if [ x"`whoami`" != x"$OURUSER" ]; then + echo >&2 "$0 must be run as $OURUSER, skipping" + exit 0 +fi + +fall-over-now + +for f in crontab forward-suffix forward-slimy mailinglists_dir do d=$f g=$f.combined diff --git a/install-newsgroup b/install-newsgroup new file mode 100755 index 0000000..1eb261f --- /dev/null +++ b/install-newsgroup @@ -0,0 +1,86 @@ +#!/bin/bash +set -e + +. settings +. ../global-settings +. persistent-autosettings + +mkdir -p webstump/queues/$GROUP +mkdir -p xlog/log/$GROUP + +ngdir=webstump/config/newsgroups/$GROUP +mkdir -p $ngdir +cp webstump/skeleton/*.IN[1O] $ngdir/. + +exec $mods.new + +test -f $mods || touch $mods + +while read name email; do + set +e + grep "^$name " $mods >$mods.tmp + rc=$? + set -e + case $rc in + 0) ;; + 1) + pass=`perl -e $mods.tmp + + mail -s "your $ABBREV moderator password" <&2 "huh $rc ?"; exit 1 + ;; + esac + cat $mods.tmp >&3 + rm $mods.tmp +done + +exec <$mods +while read name pass; do + set +e + grep "^$name " $mods.new >$mods.tmp + rc=$? + set -e + case $rc in + 0) ;; + 1) + echo "*** Preserving obsolete moderator $name" + cat $mods.tmp >&3 + ;; + *) + echo >&2 "huh2 $rc ?"; exit 1 + ;; + esac + rm $mods.tmp +done + +mv -f $mods.new $mods diff --git a/install-substitutions b/install-substitutions index b0349fa..8df87c0 100755 --- a/install-substitutions +++ b/install-substitutions @@ -1,10 +1,9 @@ #!/bin/bash set -e -. settings -export GROUP -export ABBREV -export INFOHEADER -find -name '*.IN[O1]' -exec perl -e ' + +. ./get-settings + +find -name '*.IN[O1]' ! -path '*/skeleton/*' -exec perl -e ' use IO::Handle; use POSIX; my $f= shift; @@ -14,6 +13,8 @@ find -name '*.IN[O1]' -exec perl -e ' my $g= "$d.new"; open F, "< $f" or die "$f $!"; open G, "> $g" or die "$g $!"; + stat F or die "$f $!"; + my $mode= (stat F)[2]; while () { s/\%(\w+)\%/ exists($ENV{$1}) ? $ENV{$1} : die "$1 ?" @@ -21,8 +22,11 @@ find -name '*.IN[O1]' -exec perl -e ' print G or die $!; } F->error and die $!; - close F or die $!; close G or die $!; + if ($mode & 01) { + chmod 0755, $g or die "$g $!"; + } + close F or die $!; if ($overwrite) { rename $g, $d or die "$g $d $!"; } else { diff --git a/install-weblinks b/install-weblinks new file mode 100755 index 0000000..459001c --- /dev/null +++ b/install-weblinks @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +. ./get-settings + +install_link () { + rm -f $2.new + ln -s $1 $2.new + mv -f -T $2.new $2 +} + +install_link $BASEDIR/cgi $CGISCRIPTDIR/g.$ABBREV +install_link $BASEDIR/cgi/logs $CGISCRIPTDIR/l.$ABBREV +install_link $BASEDIR/public-html $STATICFILESDIR/g.$ABBREV + diff --git a/mailinglists_dir.part.INO b/mailinglists_dir.part.INO new file mode 100644 index 0000000..db00972 --- /dev/null +++ b/mailinglists_dir.part.INO @@ -0,0 +1,6 @@ +%OURUSER%+%ABBREV%+log+submissions: %LOGGROUPPREFIX%.%ABBREV%.submissions +%OURUSER%+%ABBREV%+log+stump2webstump: %LOGGROUPPREFIX%.%ABBREV%.stump2webstump +%OURUSER%+%ABBREV%+log+webstump2stump: %LOGGROUPPREFIX%.%ABBREV%.webstump2stump +%OURUSER%+%ABBREV%+log+mailout: %LOGGROUPPREFIX%.%ABBREV%.mailout +%OURUSER%+%ABBREV%+log+bounces: %LOGGROUPPREFIX%.%ABBREV%.bounces +%OURUSER%+%ABBREV%+log+noack: %LOGGROUPPREFIX%.%ABBREV%.noack diff --git a/public-html/images b/public-html/images new file mode 120000 index 0000000..dd5964c --- /dev/null +++ b/public-html/images @@ -0,0 +1 @@ +../webstump/images \ No newline at end of file diff --git a/setup b/setup index 980a5a5..032af1c 100755 --- a/setup +++ b/setup @@ -4,6 +4,17 @@ set -e # # Some things are idempotent, others are once-only. -./install-key -./install-substitutions -./install-aggregates +x () { + echo "==== $* ====" + "$@" +} + +x ./install-key +x ./install-newsgroup +x ./install-substitutions +x make -C webstump +x ./install-aggregates + +echo ==== DONE ==== + +x cat README.auto diff --git a/stump/etc/conforms_charter b/stump/etc/conforms_charter new file mode 100755 index 0000000..71e7985 --- /dev/null +++ b/stump/etc/conforms_charter @@ -0,0 +1,13 @@ +#!/bin/sh +# +# This script checks whether the article conforms to the charter. +# It accepts the article from stdin. +# +# should be individual for every newsgroup +# + +if isbinary ; then + exit 1 # does NOT conform +fi + +exit 0 # conforms diff --git a/stump/etc/crontab b/stump/etc/crontab new file mode 100644 index 0000000..064d0fe --- /dev/null +++ b/stump/etc/crontab @@ -0,0 +1,33 @@ +# This is a crontab file for your newsgroup. Crontab is a Unix table that +# specifies when and which programs should be run at regular intervals. +# +# If you do not know what is cron and crontab, do not bother editing this +# file. It is not needed to provide the core functionality for your +# newsgroup. +# +# Its primary use is for regular cleanups, posting monthly summaries +# of approved and rejected messages, and so on. You can set it up +# later when the core of the STUMP functionality is working. +# + +# Every sunday at midnight, create and compress an archive of approved +# and rejected postings. Saves disk space. +# +0 0 * * sun $HOME/stump/etc/modenv createArchive < /dev/null + +# every night send me the report about the number of articles +# actually posted to the newsgroup. PLease replace "ichudov" with +# your own email address, e.g. johndoe@yoursite.com +# +0 0 * * * $HOME/stump/etc/posted_log ichudov < /dev/null > /dev/null 2>/dev/null + +# Every month on the 5th, post a neat summary of approved rejected +# articles. +# +5 0 1 * * $HOME/stump/etc/modenv report.sh + +# +# resubmit failed articles +# +10 * * * * $HOME/stump/etc/modenv submitFailed 2>/dev/null + diff --git a/stump/etc/email-server.cfg b/stump/etc/email-server.cfg new file mode 100644 index 0000000..5cbd239 --- /dev/null +++ b/stump/etc/email-server.cfg @@ -0,0 +1,3 @@ +moderators etc/moderators1 File with the list of current active/inactive moderators +bad.guys.list data/bad.guys.list1 Blacklist -- file with posters who are not allowed to post. +tmp tmp TEST: Temp directory... diff --git a/stump/etc/email-server.pwd b/stump/etc/email-server.pwd new file mode 100644 index 0000000..decd44f --- /dev/null +++ b/stump/etc/email-server.pwd @@ -0,0 +1 @@ +vorona diff --git a/stump/etc/modack.approved.IN1 b/stump/etc/modack.approved.IN1 new file mode 100644 index 0000000..9e96268 --- /dev/null +++ b/stump/etc/modack.approved.IN1 @@ -0,0 +1,25 @@ +#!/bin/sh + +( + cat $@ | formail -rt -I "Reply-To: $NOACK" \ + -I "X-Webstump-Event: approve" \ + -I 'Bcc: %OURUSER%+%ABBREV%-internal-log+mailout' + cat <<_EOB_ +Hello, + +$EXPLANATION + +This is an automatic notification that your message has been APPROVED +for posting to moderated newsgroup $NEWSGROUP. + +For details of the moderation arrangements see + %GROUPURL% + +If you do not want to receive automatic acknowledgments in the future, +simply reply to this message, QUOTING ITS TEXT IN FULL. + +_EOB_ + + sed 's/^/> /; s/%OURUSER%+[-+/0-9a-z]*@%DOMAIN%/%OURUSER%+?@%DOMAIN%/' \ + $@ +) | sendmail -t -f $MUNGED_ADDRESS diff --git a/stump/etc/modack.received.IN1 b/stump/etc/modack.received.IN1 new file mode 100644 index 0000000..e030aff --- /dev/null +++ b/stump/etc/modack.received.IN1 @@ -0,0 +1,34 @@ +#!/bin/sh + +TMPFILE=$TMP/reply.$$ + +cat > $TMPFILE + +( + formail -rt -I "Reply-To: $NOACK" \ + -I "X-Webstump-Event: ack" \ + -I 'Bcc: %OURUSER%+%ABBREV%-internal-log+mailout' \ + < $TMPFILE + cat <<_EOB_ +Hello, + +This is an automatic acknowledgement that your message has been RECEIVED +by the robomoderation program for newsgroup $NEWSGROUP. + +This message has been queued and will be reviewed by the moderators +as necessary, and you will receive another email when a decision +about your article has been made. + +If you do not want to receive automatic acknowledgments in the future, +simply reply to this message, QUOTING ITS TEXT IN FULL. + +For details of the moderation arrangements see + %GROUPURL% + +_EOB_ + + sed 's/^/> /; s/%OURUSER%+[-+/0-9a-z]*@%DOMAIN%/%OURUSER%+?@%DOMAIN%/' \ + < $TMPFILE +) | sendmail -t -f $MUNGED_ADDRESS + +rm $TMPFILE diff --git a/stump/etc/modenv.INO b/stump/etc/modenv.INO new file mode 100644 index 0000000..0375428 --- /dev/null +++ b/stump/etc/modenv.INO @@ -0,0 +1,270 @@ +#!/bin/bash +# +# MAIN CONFIGURATION FILE +# +# ### Administrators of STUMP robomoderator systems: +# +# set environment variables according to config of your site. +# this script is normally invoked from procmail, as a wrapper +# to real moderation scripts. Follow the instructions. +# + +####################################################################### +# this is the root directory where moderation software & config +# resides. Make sure that sendmail is in the PATH. +# (most likely it is in /usr/lib/sendmail). +# + +MNG_ROOT=%BASEDIR%/stump +exec >>%BASEDIR%/errs 2>&1 + +export MNG_ROOT BASEDIR + +# Add bin and local/bin to PATH +PATH=$MNG_ROOT/bin:$MNG_ROOT/local/bin:$MNG_ROOT/etc:$PATH:/usr/sbin +PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/sbin:$HOME/bin +export PATH + +####################################################################### +# Name of moderated group. Put the name of your group in here. +# + +NEWSGROUP="%GROUP%"; export NEWSGROUP + +####################################################################### +# STUMP enforces limitations on the maximum number of newsgroups +# used in Newsgroups: header line. The default value is 5. I +# You can change this value. If you do not want to enforce limitations +# on crossposting, set MAX_CROSSPOSTS to 1000. +# +MAX_CROSSPOSTS=1 +export MAX_CROSSPOSTS + + +###################################################################### +# Do you really want to use PGP? PGP (Pretty Good Privacy) is a +# program that allows you (among other things) digitally sign messages +# and check digital signatures. +# +# It can make certain transactions more non-repudiable and secure. +# however, for most newsgroups the benefits of security are not as +# important and many users prefer not to use PGP. +# +# Those users may set PGP to "none" (lowercase). +# +# This ENTIRELY DISABLES use of PGP. That also disables PGPMoose, a +# program that relies on PGP to digitally sign all approvals. +# PGP Moose can help you combat forged approvals. +# +# My suggestion is, if you are not comfortable with PGP and have other +# things on your plate, set PGP to "none" and set it up later when +# time permits. Get other stuff working first. +# +# Alternatively, you could set PGP to the path to the actual PGP executable, +# as in: +# +# PGP=/usr/local/bin/pgp262 +# +# Note that STUMP _requires_ pgp v. 2.6.2. +# + +PGP="gpg" +export PGP + +###################################################################### +# for pmapp - digital signing + +###################################################################### +# PGP key names. +# PMUSER must be exactly as the PGP key named in the keyring +# Refer to the online documentation on how to create PGP keys. +# +# *IF* you do not plan to use PGP at all, define it like this: +# PMUSER_APPROVAL="SCRM Moderators " +# and make sure that PMAPP is defined as "cat". +# +# this MUST be dfined EVEN if PGP is set to "none". +# This goes into your Approved: field. +PMUSER_APPROVAL="%GROUP% approval key " +export PMUSER_APPROVAL + +###################################################################### +# type in the passphrase for PGP Moose (passphrase for the Approval Key +# named right above that you generated) +# ONLY if pgp moose is used +# +# (in turn, PGP Moose is used only if PGP is NOT set to "none") +# +PMPASSWORD="" +export PMPASSWORD + +###################################################################### +# +# PMAPP is the name of the PGP Moose signing program. If you do not +# want to use it, define PMAPP as "cat", like this: +# PMAPP="cat"; export PMAPP +# +# otherwise, use "pmapp": +# PMAPP="pmapp"; export PMAPP +# +# NOTE!!! PMApp is disabled if PGP is set to "none"! +# + +PMAPP="pmapp"; export PMAPP + +###################################################################### +# +# DECISION_ADDRESS is the address for approved AND rejected submissions +# Used by ModScape subsystem only. +# +#DECISION_ADDRESS=scrm-approved@algebra.com +#export DECISION_ADDRESS + +###################################################################### +# put a munged address for your group here. It should best resolve to +# a devnulled address, since a lot of rejections/acks will bounce +# and there is no need for a human being to see the bounces. +# +MUNGED_ADDRESS=%OURUSER%+urcm-bounces@%DOMAIN% +export MUNGED_ADDRESS + + +###################################################################### +# Where to submit ready and signed articles +# You do not need this if you set RNEWS (below) to sendmail, as +# instructed. +#IHAVE_SERVER=news.uu.net; export IHAVE_SERVER + +###################################################################### +# Path: suffix for news +# Put something similar here, it is not a very important value. +# +PATH_SUFFIX="%GROUP%-moderators!robomod!not-for-mail"; export PATH_SUFFIX + +###################################################################### +# Do we want to work in paranoid PGP mode? YES or NO +# +# NOTE: it means more work for the maintainer +# +# I suggest STRONGLY that you should set it to NO!!!!!!!!!! +# +# This is disabled If PGP is set to "none". +# +STUMP_PARANOID_PGP=NO +export STUMP_PARANOID_PGP + +###################################################################### +# reachable email address of a real person who is responsible +# for maintaining the robomoderator. +# +ADMIN=%ADMIN%; export ADMIN + +###################################################################### +# Address of the moderator's board (little private mailing list +# for moderators only) where posters can send their complaints about the +# moderation policy. +# +BOARD=%MODEMAIL%; export BOARD + +###################################################################### +# address for the no-ack requests. +NOACK=%OURUSER%+urcm-noack@chiark.greenend.org.uk +export NOACK + +###################################################################### +# Official address for submissions to the newsgroup. +# +SUBMIT=%OURUSER%+urcm+%KEYSUBMIT%@chiark.greenend.org.uk; export SUBMIT + +###################################################################### Flags +# +# ATTENTION!!! Flags must be YES or NO, in capital letters. +# + +###################################################################### +# set this flag to YES if you want to REQUIRE all preapproved +# posters to use PGP to sign their messages. Typically you +# do not want to do it, unless your group has +# been SEVERELY invaded by malicious forgers. +# +# disabled if PGP is set to "none" +# +WHITELIST_MUST_SIGN=NO; export WHITELIST_MUST_SIGN + +########################################################## where is your rnews +# find out where is rnews program in your system - there may be +# several ones called `rnews'. Yours must be setuid or setgid, +# typically. +# +# Below are several variants of defining RNEWS. The simplest one involves +# use of my mail2news gateway for STUMP users. +# +# Use this one if you want to use my gateway -- SIMPLEST way to do it. +# RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com" +# +# Note that the -f flag is used to prevent any antispamming system from +# rejecting email to the news gateway. +# +# Use this only if you want to use your own rnews -- a pain in the +# neck if you do not know well how news servers work. +# RNEWS="/usr/lib/news/rnews -h $IHAVE_SERVER -S $IHAVE_SERVER " +# +# OR may be something like this if you have inews only: +# [you may have problems with "hostname" on bsd-derived systems] +#RNEWS="/usr/lib/news/inews -h "; export RNEWS +RNEWS="%BASEDIR%/inews" + +#RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com" +export RNEWS + +# ATTENTION!!! +# MORE ABOUT RNEWS/INEWS: unfortunately, these programs differ on many +# systems. Some of the BSD-derived systems have "broken" inews and rnews +# that does not like another program "hostname". +# +# If you see error messages about "hostname" in ~/Mail/from, you should +# either disregard them, or use the "hostname" shell script provided in +# stump/etc. Do the following: +# +# cd $HOME/stump/etc +# mv hostname.REPLACEMENT hostname +# +# Edit "hostname" and set your host name and fully qualified hostname. +# + +############################################################ Internal vars +# +# Do NOT change this section +# + +if [ "$PGP" = "none" ] ; then + PMAPP=cat + export PMAPP +fi + +####################################################################### +# Directory for temp files. This directory must NOT be writable by general +# public, for security reasons. I suggest keeping this intact. +# + +TMP=$MNG_ROOT/tmp; export TMP + +BEGIN_PGP_SIGNED_MESSAGE="-----BEGIN PGP SIGNED MESSAGE-----" +BOT_SUBJECT_PREFIX="KEGHF894ND50MJ" + +export BEGIN_PGP_SIGNED_MESSAGE BOT_SUBJECT_PREFIX + + +################################################################# Invocation +# +# DO NOT EDIT +# +# I use `antivirus' program as additional protection from all sorts +# of attempts to exploit bugs in moderation programs. Antivirus replaces +# all suspicious characters by '_' and splits too long lines. +# + +if [ "x$1" != "x" ]; then + umask 077 + antivirus | decodeBase64 | "$@" +fi diff --git a/stump/etc/moderators.INO b/stump/etc/moderators.INO new file mode 100644 index 0000000..9034832 --- /dev/null +++ b/stump/etc/moderators.INO @@ -0,0 +1,28 @@ +####################################################################### +# +# This file contains a database of current moderators. Any moderator +# can be either in "active" or "inactive" status. (frequently the +# inactivbe status is called "vacation" :). The format of this +# file is: +# +# email Active? Mode +# +# (of course, with no leading "#" sign). Any line with the first +# character equal to # sign is ignored. +# +# Flag 1 means that the moderator is active, flag 0 means that the +# moderator is in vacation. +# +# Mode NO_ADVICE_LIST means that the moderator is not interested in the +# moderators-advice mailing list from isc.org. If you have not started +# receiving this list, do not worry -- you will find out whether you +# want to receive messages or not, later. +# +# Mode NOKOI means that the moderator is unable to read the upper part +# of the ascii table. Most likely it is NOT something that is of interest +# to you. +# +# EMPTY LINES ARE NOT ALLOWED!!! + +%MODEMAIL% 0 NO_BOARD_LIST,NO_ADVICE_LIST +%OURUSER%+%ABBREV%-internal-webstump/%KEYSTUMP2WEB%@%DOMAIN% 1 NO_BOARD_LIST,NO_ADVICE_LIST diff --git a/stump/etc/mods-message b/stump/etc/mods-message new file mode 100755 index 0000000..3d3c4c7 --- /dev/null +++ b/stump/etc/mods-message @@ -0,0 +1,29 @@ +#!/bin/sh +# +# This script sends an email to a group of people listed in +# env var RECIPIENTS (we create this var here from etc/moderators) +# +# It is used to maintain the little internal mailing list for all +# human moderators of your newsgroup. +# + +FILTER="NO_$2_LIST"; + +RECIPIENTS="`cat $MNG_ROOT/etc/moderators \ + | grep -v "$FILTER" \ + | grep -v '^#' \ + | awk '{print $1;}' \ + | tr '\n' ',' `" + +( + formail \ + -I "To: discard-all@chiark.greenend.org.uk" \ + -I "From " -I "Cc:" \ + -I "X-Loop: $BOARD" \ + -I "X-Mailing-List: $BOARD ($NEWSGROUP Moderators)" \ + -I "Reply-To: $1" \ + -I "Resent-To:" \ + -I "X-Maintainer: $ADMIN" \ + -I "Errors-To: $ADMIN" + cat $MNG_ROOT/etc/mods.sig +) | sed 's/^\.$/\.\./' | sendmail $RECIPIENTS diff --git a/stump/etc/mods.sig b/stump/etc/mods.sig new file mode 100644 index 0000000..e69de29 diff --git a/stump/etc/posted_log b/stump/etc/posted_log new file mode 100755 index 0000000..0f48c6c --- /dev/null +++ b/stump/etc/posted_log @@ -0,0 +1,24 @@ +#!/bin/sh + +# This file creates a little .posted_log file in your home +# directory. Runs if activeated by crontab. See your crontab +# file for more details. + +# You may omit this file when initially setting up STUMP. + +( + echo -n `date` "Number of articles: " + grep processApproved < $HOME/Mail/from | wc -l +) >> $HOME/.posted_log + +( +cat << _EOB_ +The information below shows the total number of articles posted +for the last 10 days. The totals start with some date in the past. +What is important is daily differences between totals. + +_EOB_ + +tail $HOME/.posted_log + +)| mail -s "Number of posted Articles" $1 diff --git a/stump/etc/rejection-reasons.lst b/stump/etc/rejection-reasons.lst new file mode 100644 index 0000000..9fc941c --- /dev/null +++ b/stump/etc/rejection-reasons.lst @@ -0,0 +1,5 @@ +UNUSED::AFAICT the contents of file is not used when using webstump -iwj +offtopic::Message is grossly off topic (spam, turks, etc) +crosspost::Inappropriate crossposting +hostile::Message of harassing/insulting/hatemongering content +format::Message is inappropriately formatted (eg, binary, HTML) diff --git a/webstump/Makefile b/webstump/Makefile.INO similarity index 90% rename from webstump/Makefile rename to webstump/Makefile.INO index 170612e..ba0e10a 100644 --- a/webstump/Makefile +++ b/webstump/Makefile.INO @@ -1,7 +1,7 @@ # Edit these variables -WEBSTUMP_HOME = /home/webstump/live/webstump +WEBSTUMP_HOME = %BASEDIR%/webstump CC = cc # do not edit below diff --git a/webstump/config/motd b/webstump/config/motd index 8be4b7e..bca471b 100644 --- a/webstump/config/motd +++ b/webstump/config/motd @@ -1,2 +1,2 @@ -Welcome to the new version of WebSTUMP. -This version supports picture attachments and makes other improvements. +Welcome to the chiark version/derivative of STUMP/WebSTUMP. +This version has been substantially modified. diff --git a/webstump/scripts/create-newsgroup.pl b/webstump/scripts/create-newsgroup.pl index e4e67a7..3c361da 100755 --- a/webstump/scripts/create-newsgroup.pl +++ b/webstump/scripts/create-newsgroup.pl @@ -41,12 +41,10 @@ print " done.\n"; print "Creating files in $dir..."; -&append_to_file( "$dir/blacklist", "" ); &append_to_file( "$dir/moderators", "ADMIN \U$password\n" ); &append_to_file( "$dir/rejection-reasons", "offtopic::a blatantly offtopic article, spam harassing::message of harassing content charter::message poorly formatted " ); -&append_to_file( "$dir/whitelist", "" ); print " done.\n"; diff --git a/webstump/scripts/html_output.pl b/webstump/scripts/html_output.pl index e99c8d1..59a6423 100644 --- a/webstump/scripts/html_output.pl +++ b/webstump/scripts/html_output.pl @@ -149,22 +149,22 @@ this page.
"; for example, \"xyzzy\" and \"XyZZY\" are equally valid.

"; - print " - Log in as \"admin\" if you want to -

    -
  • edit filtering lists."; - - &link_to_help( "filter-lists", "Filter Lists" ); - - print " -
  • add/delete users or change their passwords. -
  • First Time Users: You have to log in as admin and add a moderator user - who will be able to moderate the newsgroup. Then log in again as that - user. If you are a new user, you have to have your admin password assigned to - you by the administrator. -
- -"; +# print " +# Log in as \"admin\" if you want to +#
    +#
  • edit filtering lists."; +# +# &link_to_help( "filter-lists", "Filter Lists" ); +# +# print " +#
  • add/delete users or change their passwords. +#
  • First Time Users: You have to log in as admin and add a moderator user +# who will be able to moderate the newsgroup. Then log in again as that +# user. If you are a new user, you have to have your admin password assigned to +# you by the administrator. +#
+# +#"; &end_html; } @@ -371,7 +371,6 @@ sub admin_add_newsgroup { print "Creating files in $dir..."; - &append_to_file( "$dir/blacklist", "" ); &append_to_file( "$dir/address.txt", "$address\n" ); &append_to_file( "$dir/moderators", "ADMIN \U$password\n" ); &append_to_file( "$dir/rejection-reasons", @@ -379,7 +378,6 @@ sub admin_add_newsgroup { harassing::message of harassing content charter::message poorly formatted " ); - &append_to_file( "$dir/whitelist", "" ); print " done.\n"; diff --git a/webstump/skeleton/address.txt.INO b/webstump/skeleton/address.txt.INO new file mode 100644 index 0000000..1acedee --- /dev/null +++ b/webstump/skeleton/address.txt.INO @@ -0,0 +1 @@ +%OURUSER%+%ABBREV%-internal-approve/%KEYWEB2STUMP%@%DOMAIN% diff --git a/webstump/skeleton/bad.posters.list.IN1 b/webstump/skeleton/bad.posters.list.IN1 new file mode 100644 index 0000000..0ca6454 --- /dev/null +++ b/webstump/skeleton/bad.posters.list.IN1 @@ -0,0 +1 @@ +xdiscardddd-adll@chiark.greenend.org.uk diff --git a/webstump/skeleton/bad.subjects.list.IN1 b/webstump/skeleton/bad.subjects.list.IN1 new file mode 100644 index 0000000..e5eb865 --- /dev/null +++ b/webstump/skeleton/bad.subjects.list.IN1 @@ -0,0 +1 @@ +Fuckwit diff --git a/webstump/skeleton/change-notify-header.INO b/webstump/skeleton/change-notify-header.INO new file mode 100644 index 0000000..8e2da59 --- /dev/null +++ b/webstump/skeleton/change-notify-header.INO @@ -0,0 +1,5 @@ +From: %OURUSER%@%DOMAIN% +To: %MODEMAIL% +Subject: %ABBREV% webstump pass/block/holdlist update + +A change has been made to one of the control lists: diff --git a/webstump/skeleton/good.posters.list.IN1 b/webstump/skeleton/good.posters.list.IN1 new file mode 100644 index 0000000..e69de29 diff --git a/webstump/skeleton/rejection-reasons.IN1 b/webstump/skeleton/rejection-reasons.IN1 new file mode 100644 index 0000000..1a3cf94 --- /dev/null +++ b/webstump/skeleton/rejection-reasons.IN1 @@ -0,0 +1,9 @@ +discard::SILENTLY DISCARD (eg because message is spam) +abuse::message is rude and abusive +repetition::message is excessively repetitious +crosspost::crossposting to that newsgroup is not permitted +charter::not in accordance with the charter +test::message is a test +meta::unconstructive or excessive metadiscussion +inflammatory::needlessly inflammatory +mistake::appears to have been posted in error diff --git a/webstump/skeleton/watch.posters.list.IN1 b/webstump/skeleton/watch.posters.list.IN1 new file mode 100644 index 0000000..e69de29 diff --git a/webstump/skeleton/watch.subjects.list.IN1 b/webstump/skeleton/watch.subjects.list.IN1 new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/webstump/skeleton/watch.subjects.list.IN1 @@ -0,0 +1 @@ +test diff --git a/webstump/skeleton/watch.words.list.IN1 b/webstump/skeleton/watch.words.list.IN1 new file mode 100644 index 0000000..a388473 --- /dev/null +++ b/webstump/skeleton/watch.words.list.IN1 @@ -0,0 +1 @@ +fuckwit diff --git a/webstump/src/wrapper.c b/webstump/src/wrapper.c index a71bdb2..dd11db7 100644 --- a/webstump/src/wrapper.c +++ b/webstump/src/wrapper.c @@ -9,6 +9,7 @@ #include #include +#include #include #include