Initial checkin.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2022-01-29 10:22:11 +01:00
commit 30132626b8
68 changed files with 5497 additions and 0 deletions

12
doc/CONTRIBUTORS Normal file
View file

@ -0,0 +1,12 @@
The following is a list of the people (in roughly chronological order)
who've helped out.
Roman Racine:
Designed and wrote most of it.
Alexander Bartolich:
Took over development in autumn 2009, added support for CSS,
multiple languages and procmail.
Thomas Hochstein:
X-Huhu-Submission-Date, option "Put back in queue" on delete

63
doc/environment.txt Normal file
View file

@ -0,0 +1,63 @@
== Operation ==
Required by all commands.
HUHU_DIR
== Installation ==
Additional variables required by "sbin/create-procmail-user.sh".
DIR and URL point to the same location.
HUHU_WWW_BASE_DIR
HUHU_WWW_BASE_URL
DIR and URL point to the same location, but in different ways.
DIR is a file system path while URL is the base of the address
used in a web browser.
Example:
HUHU_WWW_BASE_DIR="/srv/www/albasani.net/html/huhu"
HUHU_WWW_BASE_URL="http://albasani.net/huhu"
HUHU_EMAIL_DOMAIN
Right-hand part of the email address used to submit posts.
Example:
HUHU_EMAIL_DOMAIN="albasani.net"
HUHU_EMAIL_LIST
This is a file name. If variable is defined then the submission
address is appended to the file.
Example:
HUHU_EMAIL_LIST="/etc/amavis/spam_lovers"
HUHU_EMAIL_POSTFIX_ALIAS
This is the name of a file defining virtual aliases for Postfix.
If variable is defined then the submission address and the user
name is appended to the file.
Example:
HUHU_EMAIL_POSTFIX_ALIAS="/etc/postfix/maps/virtual_alias"
== Skeleton Templates ==
Used internally by "sbin/create-procmail-user.sh" when copying
template files from directory "etc/skel".
MODERATED_GROUP
MODERATED_GROUP_ABBR
MYSQL_DB
MYSQL_PASSWORD
MYSQL_TABLE
MYSQL_USERNAME
TODAY
USER_HOME
USER_ID
USER_NAME
WWW_DIR

7
doc/extra-modules.txt Normal file
View file

@ -0,0 +1,7 @@
# Dependencies for CPAN modules
apt-get install libnet-irc-perl
apt-get install liblog-log4perl-perl
# Modules only available through CPAN
cpan i News::Article::Cancel
cpan i Text::Language::Guess

36
doc/get-perl-modules.sh Normal file
View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# $Id: $
#
# Search for required Perl modules, translate to required package names.
#
export "LANG=C"
export "LC_ALL=C"
set -o nounset
set -o errexit
req_modules="required-perl-modules.txt"
req_deb="required-deb-packages.txt"
req_rpm="required-rpm-packages.txt"
find "${HUHU_DIR}" -type f -name '*.p[lm]' -exec \
gawk -F '[[:space:]();]+' '
$1 == "use" && $2 ~ /::/ && $2 !~ /^MOD::/ { print $2 }
' {} \+ |
sort -u > "${req_modules}"
if [ -f /etc/debian_version ]; then
xargs locate < "${req_modules}" |
sort -u |
xargs -n1 dpkg -S |
sed -ne 's/: .*//p' |
sort -u > "${req_deb}"
elif [ -f /etc/redhat-release ]; then
xargs locate < "${req_modules}" |
sort -u |
xargs rpm -qf |
sed -e '/ /d' |
sort -u > "${req_rpm}"
fi

208
doc/html/huhu.css Normal file
View file

@ -0,0 +1,208 @@
@charset "ISO-8859-1";
/*
* $Id: huhu.css 286 2011-02-18 00:18:19Z alba $
*
* #d3d3d3 = lightgray
*/
body, html {
height:100%;
text-align:left;
margin:0;
padding:0;
font-family:sans-serif;
background-color:#ccccff;
color:black;
}
h1 {
font-size:132%;
}
table.huhuPostList,
table.huhuArticle {
border-collapse:separate;
border-spacing:0;
empty-cells:show;
background-color:white;
}
table.huhuPostList td,
table.huhuPostList th,
table.huhuArticle th,
table.huhuArticle td {
padding:2px;
margin:0;
border-left:1px #FFFFFF solid;
border-top:1px #FFFFFF solid;
border-right:1px #000000 solid;
border-bottom:1px #000000 solid;
}
table.huhuPostList th {
text-align:center;
background-color:#d3d3d3;
}
div.huhuContents {
display:block;
float:left; /* to keep huhuVersion aligned on left border */
width:84%;
margin-top:0.5em;
margin-left:0.5em;
margin-right:0.5em;
/* border:1px solid black; */
}
ul.huhuMainMenu0 {
width:12%;
background-color:#d3d3d3;
margin-left:0.5em;
/* no margin-right, use margin-left of div.huhuContents instead */
margin-top:0.5em;
margin-bottom:0;
padding:0;
float:left; /* menu on the left, huhuContents on the right */
/* border:1px solid black; */
}
ul.huhuMainMenu0 span {
padding-left:0.5em;
padding-top:0.5ex;
padding-right:0.5em;
padding-bottom:0.5ex;
display:block;
font-weight:bold;
}
ul.huhuMainMenu1 {
margin:0;
padding:0;
}
ul.huhuMainMenu1 span {
font-weight:normal;
margin:0;
padding:0;
}
ul.huhuMainMenu0 li,
ul.huhuMainMenu1 li {
text-indent:0;
list-style-type:none;
}
ul.huhuMainMenu0 li {
font-size:80%;
border-top:1px #000000 solid;
border-left:1px #000000 solid;
border-right:1px #FFFFFF solid;
border-bottom:1px #FFFFFF solid;
}
ul.huhuMainMenu1 li {
font-weight:normal;
border-top:1px #FFFFFF solid;
border-left:1px #FFFFFF solid;
border-right:1px #000000 solid;
border-bottom:1px #000000 solid;
padding:4px;
}
div.huhuNavigation {
padding-top:0.5ex;
padding-bottom:0;
margin-top:1ex;
margin-bottom:0;
margin-left:0;
margin-right:0;
}
div.huhuNavigation span {
border-top:1px #FFFFFF solid;
border-left:1px #FFFFFF solid;
border-right:1px #000000 solid;
border-bottom:1px #000000 solid;
font-size:80%;
padding:4px;
}
ul.huhuMainMenu0 li a,
div.huhuNavigation span a {
/* remove underlined attribute for "a href" */
text-decoration:none;
/* remove color distinction between visited and unvisited links */
color:black;
}
ul.huhuMainMenu0 li a:hover,
div.huhuNavigation span a:hover {
/* while mouse is hovering over "a href" */
color:#FFFFFF;
text-decoration:none;
background-color:black;
}
div.huhuVersion,
div.huhuArticleInfo {
margin-top:1ex;
font-size:80%;
font-style:italic;
}
table.huhuArticle {
/* Opera and IE applie margin above caption
* Mozilla between caption and table */
margin-top:2mm;
border-top:1px #000000 solid;
border-left:1px #000000 solid;
width:100%;
}
table.huhuArticle th,
table.huhuArticle td {
padding-left:1ex;
padding-right:1ex;
}
tr.huhuArticleHeader th,
tr.huhuArticleHeader td {
border-bottom:1px #000000 solid;
}
tr.huhuArticleHeader th {
background-color:#d3d3d3;
border-right:1px #000000 solid;
text-align:right;
width:10em;
}
tr.huhuArticleHeader td {
background-color:#FFFFCC;
}
div.huhuReason,
div.huhuErrorMessage {
margin-bottom:1ex;
padding:1ex;
background-color:white;
border:1px #000000 solid;
}
tr.huhuFlag {
background-color:#FFCCCC;
}
tr.huhuOdd {
background-color:#FCFCFC;
}
tr.huhuEven {
background-color:#FFFFCC;
}
td.huhuNoRows {
background-color:#ccccff;
}
div.huhuSubtitle {
font-size:80%;
margin-bottom:0.5ex;
}

89
doc/html/index.html Normal file
View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- $Id: index.html 301 2011-09-28 04:43:06Z alba $ -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<title>Huhu Overview</title>
<style type="text/css" media="all">@import "huhu.css";</style>
</head>
<body><div id="huhuContents">
<h2>Huhu</h2>
<p>Huhu is a web application to moderate Usenet groups.</p>
<h3>Basic workflow</h3>
<ol>
<li>Emails are sent to the submission address</li>
<li>Retrieved mails are stored in database</li>
<li>The web application visualizes the stored mails</li>
<li>Human moderators use the web application to classify mail:
<ul>
<li>Approved submissions are sent to the news server</li>
<li>For rejected submissions a rejection notice is sent to the author via mail</li>
<li>Submissions can also be silently ignored</li>
<li>Mails classified as spam are silently ignored but also train the spamfilter</li>
</ul></li>
</ol>
<h3>Requirements</h3>
<ul>
<li>Some kind of Unix (Huhu is developed on Ubuntu Linux)</li>
<li>A way to execute jobs in periodic intervals, e.g. crond</li>
<li>perl 5 (and a list of additional perl modules)</li>
<li>A web server cabaple of executing perl scripts (Huhu is developed on Apache/mod_perl)</li>
<li>A MySQL database</li>
<li>A mail box accessible through POP3 or procmail</li>
<li>NNTP access to a news server that allows to set the header "Approved:"</li>
</ul>
<h3>Features</h3>
<ul>
<li>Spam filtering with <tt>Mail::SpamAssassin</tt>.</li>
<li>Articles can be signed with a PGP key, using <tt>News::Article::sign_pgpmoose</tt>.</li>
<li>Submissions can be moderated automatically through procmail rules.</li>
<li>An IRC bot that notifies an IRC channel about pending submissions.</li>
<li>Multiple instances of Huhu can be run with a single installation.</li>
</ul>
<h3>Missing features</h3>
<ul>
<li>Documentation. (Harald M&auml;dl has written a
<a href="http://usenet-moderation.net/moderation_software_huhu.htm"
>German user's manual</a>, though.)</li>
<li>UNICODE. (Huhu currently uses ISO-8859-1 throughout.)</li>
<li>Web based installation. (Currently there is only <tt>sbin/create-procmail-user.sh</tt>).</li>
</ul>
<h3>Licence</h3>
<p>Huhu is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version.</p>
<h3>Availability</h3>
<p>The code is stored in a <a href="http://subversion.tigris.org/">subversion</a>
repository.</p>
<dl>
<dt>Anonymous read-only access</dt>
<!-- svn://albasani.net/huhu/trunk/ -->
<dd><a href="svn://svn.schnuerpel.eu/huhu/trunk/"
>svn://svn.schnuerpel.eu/huhu/trunk/</a></dd>
<dt>Web based revision browser</dt>
<!-- http://albasani.net/viewvc.cgi/?root=huhu -->
<dd><a href="http://svn.schnuerpel.eu/viewvc.cgi/?root=huhu"
>http://svn.schnuerpel.eu/viewvc.cgi/?root=huhu</a></dd>
<dt>Project home page</dt>
<!-- http://albasani.net/huhu/ -->
<dd><a href="http://huhu.albasani.net/">http://huhu.albasani.net/</a></dd>
</dl>
<h3>History</h3>
<p>Roman Racine developed Huhu in 2007 to moderate de.soc.familie.vaeter.<br>
In 2009 he adapted it to easily run multiple instances.<br>
In autumn 2009 Alexander Bartolich took over development, adding support for CSS, multiple languages, and procmail.</p>
</div></body></html>

View file

@ -0,0 +1,8 @@
libdigest-sha1-perl
libi18n-acceptlanguage-perl
libmail-sendmail-perl
libmailtools-perl
libnet-irc-perl
libnews-article-perl
perl-doc
spamassassin

View file

@ -0,0 +1,18 @@
CGI::Carp
CGI::Pretty
Data::Dumper
Digest::SHA1
I18N::AcceptLanguage
MIME::Base64
MIME::QuotedPrint
Mail::Mailer
Mail::Sendmail
Mail::SpamAssassin
Net::IRC
Net::NNTP
Net::POP3
News::Article
News::Article::Cancel
News::Article::Response
Text::Language::Guess
Time::Local

45
doc/security.txt Normal file
View file

@ -0,0 +1,45 @@
SYSTEM USER ACCOUNTS
* UID_ROOT ... A priviledged user able to create other users.
* UID_WWW ... The user id of the web server process.
* UID_HUHU ... The user that executes cron scripts and procmail scripts.
DATABASE USER ACCOUNTS
* DB_UID_ROOT ... This account is used by UID_ROOT to set up huhu.
* DB_UID_HUHU ... The account used by Huhu itself.
NEWS SERVER ACCOUNTS
* NNTP_UID_HUHU ... Used by UID_HUHU to post articles.
PROGRAMS
* Shell scripts executed as UID_ROOT
Used to set up Huhu instances
DB_UID_ROOT
sbin/create-procmail-user.sh
* Procmail script executed as UID_HUHU
DB_UID_HUHU
bin/read-mail.pl
* Crontab scripts executed as UID_HUHU
DB_UID_HUHU, NNTP_UID_HUHU
bin/*
* Scripts executed by web server as UID_WWW
Scripts can be run as true CGIs or within mod_perl
DB_UID_HUHU
cgi-bin/*
FLOW OF CONFIGURATION DATA
The path to the public configuration file is specified through environment
variable HUHU_PUB_CONFIG.
TODO
Authentication is done by the web server. It is recommended to use
"AuthType Digest", so that passwords are not transferred through the
net in plain text.