migration to fnord

This commit is contained in:
Neale Pickett 2012-02-04 11:16:01 -06:00
parent a6271987b4
commit 1fc2574edd
7 changed files with 44 additions and 17 deletions

View File

@ -1,7 +1,7 @@
Title: Home
<form class="login"
action="https://woozle.org/mail/index.php"
action="https://woozle.org/mail.cgi/"
method="post">
Username
<input type="text" name="user" size="15" />
@ -10,9 +10,11 @@ Title: Home
<input type="submit" value="Read Email" />
</form>
3 Feb: Web Server Change
------------------------
Jan 18: Blacked Out for SOPA
============================
<a href="http://sopastrike.com/">SOPAStrike.com</a>
Because of a newly-discovered security bug in the web server software
I was using, I had to do an unplanned emergency changeover to something
else. I think everything is working now, including webmail.
Please let me know if you find anything broken.

View File

@ -23,7 +23,7 @@ def getdesc(d):
return '(none)'
ret = desc_re.search(hdrs)
if ret:
return ret.group(1)
return cgi.escape(ret.group(1)).replace('#', '')
else:
return '(none)'
@ -47,10 +47,8 @@ if l and os.path.isdir(os.path.join(listdir, 'control')):
content = "<p>Uh oh. That didn't work.</p>"
content += "<pre>%s</pre>" % cgi.escape(str(err))
else:
desc = getdesc(listdir)
content = '<h2>%s@woozle.org' % l
if desc:
content += ": %s" % cgi.escape(desc)
content += ": %s" % getdesc(listdir)
content += '</h2>'
content += '<p>To subscribe to or unsubscribe from the %s list,' % l
content += ' just enter your email address in this handy dandy form!</p>'
@ -83,7 +81,7 @@ else:
continue
l = os.path.basename(d)
content += '<tr><td><a href="/lists/%s">%s</a></td>' % (l, l)
content += '<tr><td><a href="/lists.cgi/%s">%s</a></td>' % (l, l)
content += '<td>%s</td>' % getdesc(d)
content += '<td><form action="lists">'
content += ' <input name="addr" />'

22
mail.cgi.c Normal file
View File

@ -0,0 +1,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
const char *basepath = "/usr/share/IlohaMail/source";
int
main(int argc, char *argv[])
{
char *pathinfo = getenv("PATH_INFO");
char filename[512];
if ((! pathinfo) || (0 == strcmp(pathinfo, "/index.html"))) {
pathinfo = "/index.php";
}
snprintf(filename, sizeof filename, "%s%s", basepath, pathinfo);
setenv("SCRIPT_FILENAME", filename, 1);
execl("/usr/bin/php-cgi", filename, NULL);
return 0;
}

View File

@ -6,6 +6,8 @@ echo
ls /home/*/public_html/index.html | while read fn; do
a=${fn#/home/}
u=${a%/public_html/index.html}
l=/srv/www/woozle.org/~$u
echo "* [$u](/~$u)"
echo "* [$u](/~$u/)"
[ -h $l ] || ln -s /home/$u/public_html $l
done

View File

@ -4,7 +4,6 @@ html {
}
body {
max-width: 700px;
margin: auto;
color: #636;
background: black;

View File

@ -3,7 +3,7 @@
<head>
<title>TITLE</title>
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="/style-black.css" type="text/css" />
<link rel="stylesheet" href="/style.css" type="text/css" />
<link rel="icon" type="image/png" href="/icon.png" />
</head>
<body>
@ -11,9 +11,9 @@
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/lists">Email lists</a></li>
<li><a href="/wishlists">Wish lists</a></li>
<li><a href="/people">People</a><li>
<li><a href="/lists.cgi">Email lists</a></li>
<li><a href="/wishlist.cgi">Wish lists</a></li>
<li><a href="/people.html">People</a><li>
</ul>
</nav>
divert(1)

View File

@ -1,6 +1,10 @@
PLAIN += .
COPY += icon.png style.css style-black.css lists.cgi wishlist.cgi set.cgi $(TEMPLATE)
COPY += mail.cgi
HTML += people.html
$(DESTDIR)/people.html: people.sh
$(DESTDIR)/people.html: people.sh template.html.m4
sh $< | $(MDWNTOHTML) > $@
$(DESTDIR)/mail.cgi: mail.cgi.c
$(CC) -Wall -Werror -o $@ $<