chiark / gitweb /
a9e4d1acdfe30bef97f12a67fcda01790ca45b26
[modbot-ulm.git] / stump / etc / modenv.INO
1 #!/bin/bash
2 #
3 # MAIN CONFIGURATION FILE
4 #
5 # ### Administrators of STUMP robomoderator systems:
6 #
7 # set environment variables according to config of your site. 
8 # this script is normally invoked from procmail, as a wrapper
9 # to real moderation scripts. Follow the instructions.
10 #
11
12 #######################################################################
13 # this is the root directory where moderation software & config
14 # resides. Make sure that sendmail is in the PATH.
15 # (most likely it is in /usr/lib/sendmail).
16 #
17
18 MNG_ROOT=%BASEDIR%/stump
19 exec >>%BASEDIR%/errs 2>&1
20
21 printf "============ %s" "$*"
22 date
23
24 export MNG_ROOT BASEDIR
25
26 # Add bin and local/bin to PATH
27 PATH=$MNG_ROOT/bin:$MNG_ROOT/local/bin:$MNG_ROOT/etc:$PATH:/usr/sbin
28 PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/sbin:$HOME/bin
29 export PATH
30
31 #######################################################################
32 # Name of moderated group. Put the name of your group in here.
33 #
34
35 NEWSGROUP="%GROUP%"; export NEWSGROUP
36
37 #######################################################################
38 # STUMP enforces limitations on the maximum number of newsgroups
39 # used in Newsgroups: header line. The default value is 5. I
40 # You can change this value. If you do not want to enforce limitations 
41 # on crossposting, set MAX_CROSSPOSTS to 1000.
42
43 MAX_CROSSPOSTS=1
44 export MAX_CROSSPOSTS
45
46
47 ######################################################################
48 # Do you really want to use PGP? PGP (Pretty Good Privacy) is a 
49 # program that allows you (among other things) digitally sign messages
50 # and check digital signatures.
51 #
52 # It can make certain transactions more non-repudiable and secure.
53 # however, for most newsgroups the benefits of security are not as
54 # important and many users prefer not to use PGP. 
55 #
56 # Those users may set PGP to "none" (lowercase). 
57 #
58 # This ENTIRELY DISABLES use of PGP. That also disables PGPMoose, a 
59 # program that relies on PGP to digitally sign all approvals. 
60 # PGP Moose can help you combat forged approvals.
61 #
62 # My suggestion is, if you are not comfortable with PGP and have other
63 # things on your plate, set PGP to "none" and set it up later when
64 # time permits. Get other stuff working first.
65 #
66 # Alternatively, you could set PGP to the path to the actual PGP executable,
67 # as in:
68 #
69 # PGP=/usr/local/bin/pgp262
70 #
71 # Note that STUMP _requires_ pgp v. 2.6.2.
72 #
73
74 PGP="gpg"
75 export PGP
76
77 ######################################################################
78 # for pmapp - digital signing
79
80 ######################################################################
81 # PGP key names.
82 # PMUSER must be exactly as the PGP key named in the keyring
83 # Refer to the online documentation on how to create PGP keys.
84 #
85 # *IF* you do not plan to use PGP at all, define it like this:
86 # PMUSER_APPROVAL="SCRM Moderators <scrm-board@algebra.com>"
87 # and make sure that PMAPP is defined as "cat".
88 #
89 # this MUST be dfined EVEN if PGP is set to "none".
90 # This goes into your Approved: field.
91 PMUSER_APPROVAL="%GROUP% approval key <urcm-moderators@chiark.greenend.org.uk>"
92 export PMUSER_APPROVAL
93
94 ######################################################################
95 # type in the passphrase for PGP Moose (passphrase for the Approval Key
96 # named right above that you generated)
97 # ONLY if pgp moose is used
98 #
99 # (in turn, PGP Moose is used only if PGP is NOT set to "none")
100 #
101 PMPASSWORD=""
102 export PMPASSWORD
103
104 ######################################################################
105 #
106 # PMAPP is the name of the PGP Moose signing program. If you do not
107 # want to use it, define PMAPP as "cat", like this: 
108 # PMAPP="cat"; export PMAPP
109 #
110 # otherwise, use "pmapp":
111 # PMAPP="pmapp"; export PMAPP
112 #
113 # NOTE!!! PMApp is disabled if PGP is set to "none"!
114 #
115
116 PMAPP="pmapp"; export PMAPP
117
118 ######################################################################
119 #
120 # DECISION_ADDRESS is the address for approved AND rejected submissions
121 # Used by ModScape subsystem only.
122 #
123 #DECISION_ADDRESS=scrm-approved@algebra.com
124 #export DECISION_ADDRESS
125
126 ######################################################################
127 # put a munged address for your group here. It should best resolve to
128 # a devnulled address, since a lot of rejections/acks will bounce
129 # and there is no need for a human being to see the bounces.
130 #
131 MUNGED_ADDRESS=%OURUSER%+urcm-bounces@%DOMAIN%
132 export MUNGED_ADDRESS
133
134
135 ######################################################################
136 # Where to submit ready and signed articles
137 # You do not need this if you set RNEWS (below) to sendmail, as
138 # instructed.
139 #IHAVE_SERVER=news.uu.net; export IHAVE_SERVER
140
141 ######################################################################
142 # Path: suffix for news
143 # Put something similar here, it is not a very important value.
144 #
145 PATH_SUFFIX="%GROUP%-moderators!robomod!not-for-mail"; export PATH_SUFFIX
146
147 ######################################################################
148 # Do we want to work in paranoid PGP mode? YES or NO
149 #
150 # NOTE: it means more work for the maintainer
151 #
152 # I suggest STRONGLY that you should set it to NO!!!!!!!!!!
153 #
154 # This is disabled If PGP is set to "none".
155 #
156 STUMP_PARANOID_PGP=NO
157 export STUMP_PARANOID_PGP
158
159 ######################################################################
160 # reachable email address of a real person who is responsible
161 # for maintaining the robomoderator.
162 #
163 ADMIN=%ADMIN%; export ADMIN
164
165 ######################################################################
166 # Address of the moderator's board (little private mailing list
167 # for moderators only) where posters can send their complaints about the
168 # moderation policy.
169 #
170 BOARD=%MODEMAIL%; export BOARD
171
172 ######################################################################
173 # address for the no-ack requests.
174 NOACK=%OURUSER%+urcm-noack@chiark.greenend.org.uk
175 export NOACK
176
177 ######################################################################
178 # Official address for submissions to the newsgroup.
179 #
180 SUBMIT=%OURUSER%+urcm+%KEYSUBMIT%@chiark.greenend.org.uk; export SUBMIT
181
182 ###################################################################### Flags
183 #
184 # ATTENTION!!! Flags must be YES or NO, in capital letters.
185 #
186
187 ######################################################################
188 # set this flag to YES if you want to REQUIRE all preapproved
189 # posters to use PGP to sign their messages. Typically you
190 # do not want to do it, unless your group has
191 # been SEVERELY invaded by malicious forgers.
192 #
193 # disabled if PGP is set to "none"
194 #
195 WHITELIST_MUST_SIGN=NO; export WHITELIST_MUST_SIGN
196
197 ########################################################## where is your rnews
198 # find out where is rnews program in your system - there may be
199 # several ones called `rnews'. Yours must be setuid or setgid, 
200 # typically.
201 #
202 # Below are several variants of defining RNEWS. The simplest one involves
203 # use of my mail2news gateway for STUMP users.
204 #
205 # Use this one if you want to use my gateway -- SIMPLEST way to do it.
206 # RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com"
207 #
208 # Note that the -f flag is used to prevent any antispamming system from
209 # rejecting email to the news gateway.
210 #
211 # Use this only if you want to use your own rnews -- a pain in the
212 # neck if you do not know well how news servers work.
213 # RNEWS="/usr/lib/news/rnews -h $IHAVE_SERVER -S $IHAVE_SERVER "
214 #
215 # OR may be something like this if you have inews only:
216 # [you may have problems with "hostname" on bsd-derived systems]
217 #RNEWS="/usr/lib/news/inews -h "; export RNEWS
218 RNEWS="%BASEDIR%/inews"
219
220 #RNEWS="sendmail -f devnull@stump.algebra.com news-gateway@stump.algebra.com"
221 export RNEWS
222
223 # ATTENTION!!!
224 # MORE ABOUT RNEWS/INEWS: unfortunately, these programs differ on many
225 # systems. Some of the BSD-derived systems have "broken" inews and rnews
226 # that does not like another program "hostname".
227 #
228 # If you see error messages about "hostname" in ~/Mail/from, you should 
229 # either disregard them, or use the "hostname" shell script provided in 
230 # stump/etc. Do the following: 
231 #
232 # cd $HOME/stump/etc
233 # mv hostname.REPLACEMENT hostname
234 #
235 # Edit "hostname" and set your host name and fully qualified hostname.
236 #
237
238 ############################################################ Internal vars
239 #
240 # Do NOT change this section
241 #
242
243 if [ "$PGP" = "none" ] ; then
244   PMAPP=cat
245   export PMAPP
246 fi
247
248 #######################################################################
249 # Directory for temp files. This directory must NOT be writable by general
250 # public, for security reasons. I suggest keeping this intact.
251 #
252
253 TMP=$MNG_ROOT/tmp; export TMP
254
255 BEGIN_PGP_SIGNED_MESSAGE="-----BEGIN PGP SIGNED MESSAGE-----"
256 BOT_SUBJECT_PREFIX="KEGHF894ND50MJ"
257
258 export BEGIN_PGP_SIGNED_MESSAGE BOT_SUBJECT_PREFIX
259
260
261 ################################################################# Invocation
262 #
263 # DO NOT EDIT
264 #
265 # I use `antivirus' program as additional protection from all sorts
266 # of attempts to exploit bugs in moderation programs. Antivirus replaces
267 # all suspicious characters by '_' and splits too long lines.
268 #
269
270 if [ "x$1" != "x" ]; then
271   umask 077
272   antivirus | decodeBase64 | "$@"
273 fi