[gopher] Gophernicus Server 0.6 released

Kim Holviala kim at holviala.com
Sun Apr 11 18:35:32 UTC 2010


I don't normally want to spam everybody with new releases, but since 
this version implements stuff that was *cough* deemed impossible I 
thought I'd make an exception. I'm sorry about the current state of 
documentation - if you try this you either have to be able to read C 
fluently, or have the courage to ask me how it works :-).

Download link:
gopher://gophernicus.org/1/software/gophernicus/server/

Primary changes between 0.5 and 0.6:
* removed most Linuxisms from the code (tested & working with AIX)
* gopher filetypes can be overridden (-e argument + in gophermaps)
* output filters (the "impossible" feature)


Running on an ancient version of AIX (IPv6 only host):
gopher://rs6k.holviala.com/

Output filtering with php5-cli:
gopher://holviala.com/0/~kimmy/code/gophernicus/testsuite/hello.php
gopher://holviala.com/0/~kimmy/code/gophernicus/testsuite/phpinfo.php

Live image transcoding (double-check the images you're getting):
gopher://holviala.com/1/~kimmy/images/

Comparison between a transcoded and the original image:
gopher://holviala.com/I/~kimmy/images/riku.jpg
gopher://holviala.com/I/~kimmy/images/riku.jpg?raw


The output filtering needs a little explanation... By default it's 
turned off as it's probably a security risk, but if you want to use it 
you can specify a directory which contains your output filters.

Output filters in that directory are named either by file suffix, or by 
the one-char gopher filetype. Any file matching the suffix or filetype 
gets filtered through that external binary (or script) before it gets 
sent out to the client.

Simple, huh?

Anyway.. To enable php support all I had to do was to link my php5-cli 
binary to the filter directory with the name "php". After that all files 
with the suffix "php" get executed as php scripts.

$ ln -s /usr/bin/php5-cli /usr/lib/gophernicus/filters/php


The live image transcoding was done with this leetle script named "I":

====================================================================
#!/bin/sh

##
## Scale images to a resonable size
##

SIZE="800x800>"
FORMAT="GIF"

SRC="$1"
SCALED=/tmp/`echo "$1" | md5sum | cut -d" " -f1`

# Output raw unmodified version
if [ "$QUERY_STRING" = "raw" ]; then
         cat "$1"
         exit
fi

# Already converted?
if [ -f "$SCALED" ]; then
         cat "$SCALED"
         exit
fi

# Convert & output converted image
/usr/bin/convert -geometry "$SIZE" "$1" "$FORMAT:$SCALED"
cat "$SCALED"
====================================================================

Not terribly complicated, and my server hasn't blown up yet...


- Kim












More information about the Gopher-Project mailing list