diff --git a/index.mdwn b/index.mdwn index 2976961..ea4faad 100644 --- a/index.mdwn +++ b/index.mdwn @@ -1,7 +1,7 @@ Title: Home
Username @@ -10,9 +10,11 @@ Title: Home
+3 Feb: Web Server Change +------------------------ -Jan 18: Blacked Out for SOPA -============================ - -SOPAStrike.com +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. diff --git a/lists.cgi b/lists.cgi index 7036cf1..350a3ca 100755 --- a/lists.cgi +++ b/lists.cgi @@ -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 = "

Uh oh. That didn't work.

" content += "
%s
" % cgi.escape(str(err)) else: - desc = getdesc(listdir) content = '

%s@woozle.org' % l - if desc: - content += ": %s" % cgi.escape(desc) + content += ": %s" % getdesc(listdir) content += '

' content += '

To subscribe to or unsubscribe from the %s list,' % l content += ' just enter your email address in this handy dandy form!

' @@ -83,7 +81,7 @@ else: continue l = os.path.basename(d) - content += '%s' % (l, l) + content += '%s' % (l, l) content += '%s' % getdesc(d) content += '
' content += ' ' diff --git a/mail.cgi.c b/mail.cgi.c new file mode 100644 index 0000000..b729c39 --- /dev/null +++ b/mail.cgi.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +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; +} diff --git a/people.sh b/people.sh index 5d9f1aa..edd2576 100755 --- a/people.sh +++ b/people.sh @@ -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 diff --git a/style-black.css b/style-black.css index da83989..e464d44 100644 --- a/style-black.css +++ b/style-black.css @@ -4,7 +4,6 @@ html { } body { - max-width: 700px; margin: auto; color: #636; background: black; diff --git a/template.html.m4 b/template.html.m4 index f393317..c9fe4da 100644 --- a/template.html.m4 +++ b/template.html.m4 @@ -3,7 +3,7 @@ TITLE - + @@ -11,9 +11,9 @@ divert(1) diff --git a/woozle.mk b/woozle.mk index d748525..25832c8 100644 --- a/woozle.mk +++ b/woozle.mk @@ -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 $@ $<