Sandra Snan 851f2f77e8 Handle image/right hai 1 ano
..
edit-buttons a70618c3be Moving a whole bunch of files %!s(int64=9) %!d(string=hai) anos
inkscape a70618c3be Moving a whole bunch of files %!s(int64=9) %!d(string=hai) anos
templates a70618c3be Moving a whole bunch of files %!s(int64=9) %!d(string=hai) anos
README.md 3c7a56ba5a gopher-server: documentation in the README %!s(int64=5) %!d(string=hai) anos
expire-bans.pl 75ce7d745e expire-bans.pl is new %!s(int64=8) %!d(string=hai) anos
gemini-server.pl 851f2f77e8 Handle image/right hai 1 ano
gopher-server.pl 46580a3958 gopher-server: fix linebreaks in links %!s(int64=5) %!d(string=hai) anos
hypnotoad.pl b89c8b99e8 Example configs for Mojolicious %!s(int64=5) %!d(string=hai) anos
mojolicious-app.pl b89c8b99e8 Example configs for Mojolicious %!s(int64=5) %!d(string=hai) anos
oddtrans ce355499c7 oddtrans: fix missing . in @INC %!s(int64=6) %!d(string=hai) anos
release ceb4c3a9cc Release process: master → main %!s(int64=3) %!d(string=hai) anos
server.pl 7094ec098b stuff/server: fix UTF-8 encoding problem %!s(int64=5) %!d(string=hai) anos
toadfarm.pl b89c8b99e8 Example configs for Mojolicious %!s(int64=5) %!d(string=hai) anos
upgrade-files.pl 5130a92f9c upgrade_files.pl: Get rid of a warning %!s(int64=9) %!d(string=hai) anos
wiki2html a70618c3be Moving a whole bunch of files %!s(int64=9) %!d(string=hai) anos
wikiimg 72cd669bf0 Changed nearly remaining code from GPLv2 to GPLv3 %!s(int64=8) %!d(string=hai) anos

README.md

Extra Files

Some of the modules requires extra files -- graphics, templates, and so on.

Gopher Server

Example usage:

Change your working directory to the root of the Oddmuse repository (the parent directory of this directory).

Set the environment variable WikiDataDir to test-data:

export WikiDataDir=test-data

Test that the simple web server works by running stuff/server.pl. This should start the web server on http://localhost:8080/. Visit the link using your web browser and edit HomePage.

You should see a test-data directory containing the new page.

Now start the gopher server on port 7070 by running stuff/gopher-server.pl --port=7070. If you don't provide an explicit port a random port is used and you'll need to read the server output to determine the actual port. That's why we're setting the port ourselves. Remember that using ports below 1024 require special privileges. Don't use them unless you know what you're doing.

Test the gopher server by simulating a request using echo HomePage | nc localhost 7070. You should get back the content of the page you wrote.

Let's test encryption. Create a self-signed certificate and a private key. If you use the following command, you can leave all the fields empty except for the common name. The common name you provide must match the server name you are using. In our case, that would be localhost.

openssl req -new -x509 -days 365 -nodes -out \
        gopher-server-cert.pem -keyout gopher-server-key.pem

Start the gopher server on port 7443 using this information with stuff/gopher-server.pl --port=7443 --wiki_key_file=gopher-server-key.pem --wiki_cert_file=gopher-server-cert.pem.

If you test this by simulating an unencrypted request using echo HomePage | nc localhost 7443, you shouldn't get any output. Use echo HomePage | gnutls-cli --no-ca-verification localhost:7443 and you should get back your page. Actually, you have the certificate right there so you might as well provide it: echo HomePage | gnutls-cli --x509cafile=gopher-server-cert.pem localhost:7443

What you'd expect to see is a lot of cryptography output by gnutls-cli and at the very end the content of the page. If you're seeing Fatal error: Error in the pull function instead, then perhaps the timing of things is a bit off. Introducing a short wait fixed this for me. (sleep 1;echo HomePage) | gnutls-cli --x509cafile=gopher-server-cert.pem localhost:7443

Good luck!