inz.fi

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8c6a74faeafc3ebec45f7cd00f1966259a7d4eee
parent d93656504e6d48a65a30aa264b96d2c961119763
Author: Santtu Lakkala <inz@inz.fi>
Date:   Sat, 19 Feb 2022 17:38:13 +0200

Initial content

Diffstat:
Aconfig.ini | 5+++++
Apages/git | 2++
Apages/tskrtt.md | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aposts/tskrtt-0.1.md | 10++++++++++
Atemplates/index.gph/footer.gph | 0
Atemplates/index.gph/header.gph | 6++++++
Atemplates/index.html/footer.html | 2++
Atemplates/index.html/header.html | 11+++++++++++
Atemplates/index.html/section.html | 1+
Atemplates/page.html/footer.html | 2++
Atemplates/page.html/header.html | 11+++++++++++
Atemplates/post.html/footer.html | 3+++
Atemplates/post.html/header.html | 11+++++++++++
13 files changed, 160 insertions(+), 0 deletions(-)

diff --git a/config.ini b/config.ini @@ -0,0 +1,5 @@ +output_html=/home/inzane/public_html +output_gopher=/home/inzane/public_gopher +pages_dir=pages +posts_dir=posts +title=inz diff --git a/pages/git b/pages/git @@ -0,0 +1 @@ +gopher://inz.fi/1git +\ No newline at end of file diff --git a/pages/tskrtt.md b/pages/tskrtt.md @@ -0,0 +1,96 @@ +# tskrtt + +A gopherd for Linux (and possibly others) + +Features: +* gopher menus (gophermap or gph) +* dir listings +* CGI support +* access logging +* TLS using libtls + +## Usage + + tskrtt [-46d] [-t key cert] [-l logfile] [-b rootdir] [-p port] + [-o outport] [-u user] [-g group] [-h host] + [-i listen address] + -4 Only listen for IPv4 connections. + + -6 Only listen for IPv6 connections. + + -c Chroot to root directory. + + -d Don't fork into background. + + -l logfile Location for an access log file (no default). + + -b rootdir Root directory of served content + (default: /var/gopher). + + -h host Hostname used in generated content (default: listen + address or system hostname) + + -p port Port on which the daemon will listen (default: 70). + + -o oport Port shown on generated content (default: same as + port). + + -u user Change to user after startup. + + -g group Change to group after startup. + + -i address Listen for incoming connections on given address + (default: listen on any address). + + -t key cert Allow connections using TLS using the given key and + cert (default: only plain text connection). + +## Requirements + +tskrtt is based on libev event loop (tested with 4.25 and 4.33). For +TLS support, LibreSSL libtls or libretls is required. + +## Building + +Build using make. If TLS support is not wanted, edit Makefile. + +## GPH format + +tskrtt supports GPH formatting and should be compatible with that +of geomyidae. In addition tskrtt allows for server and/or port not +to be defined, in which case server's hostname and port (or 70 if +server is defined) are used. + +## Dynamic content + +Executable files ending in .cgi are run and the input is forwarded +to client as-is. A well behaving .cgi should output well formed +gopher data (for text and menu content), including using CR + LF as +line ending and ending transmission with a dot on an otherwise +empty line, and take care not to have it anywhere else in the output. +Also note that if root is served by a .cgi, and support for gopher+ +clients is wanted, then the script needs to talk gopher+ if client so +requests. + +Executable files ending in .dcgi are similarily run, but they should +output GPH formatted text instead, which is parsed by tskrtt before +passing on to the client. + +Note that while striving to be able to be compatible with HTTP CGI, +a major difference is that neither type should print HTTP headers. For +example a PHP script should begin with + +#!/usr/bin/php-cgi --no-header + +to avoid HTTP headers in the output. + +## Chroot + +tskrtt can chroot to root dir (if built with support, chroot() is not +part of POSIX. Note that this has immerse effect on d?cgi, whereas +their interpreter / dynamic libraries need to be available inside the +chroot. + +## Reporting bugs + +Bugs can be reported to inz@inz.fi via email. diff --git a/posts/tskrtt-0.1.md b/posts/tskrtt-0.1.md @@ -0,0 +1,10 @@ +# tskrtt 0.1 released + + m # m m + mm#mm mmm # m m mm mm#mm mm#mm + # # " # m" #" " # # + # """m #"# # # # + "mm "mmm" # "m # "mm "mm + +An libev based gopherd has reached 0.1. +Check out the source from [the git repo](gopher://inz.fi/1git/tskrtt/). diff --git a/templates/index.gph/footer.gph b/templates/index.gph/footer.gph diff --git a/templates/index.gph/header.gph b/templates/index.gph/header.gph @@ -0,0 +1,6 @@ +t " m"" " +t mmm m mm mmmmm mm#mm mmm +t # #" # m" # # +t # # # m" # # +t mm#mm # # #mmmm # # mm#mm +t diff --git a/templates/index.html/footer.html b/templates/index.html/footer.html @@ -0,0 +1,2 @@ + </body> +</html> diff --git a/templates/index.html/header.html b/templates/index.html/header.html @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" type="text/css" href="resources/style.css" /> + <title>{{title}}</title> + </head> + <body> diff --git a/templates/index.html/section.html b/templates/index.html/section.html @@ -0,0 +1 @@ + <h2>${section_title}</h2> diff --git a/templates/page.html/footer.html b/templates/page.html/footer.html @@ -0,0 +1,2 @@ + </body> +</html> diff --git a/templates/page.html/header.html b/templates/page.html/header.html @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" type="text/css" href="../resources/style.css" /> + <title>{{title}} — {{page_title}}</title> + </head> + <body> diff --git a/templates/post.html/footer.html b/templates/post.html/footer.html @@ -0,0 +1,3 @@ + <footer><small>Created on {{date_created}}, last modified {{date_modified}}</small></footer> + </body> +</html> diff --git a/templates/post.html/header.html b/templates/post.html/header.html @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" type="text/css" href="../resources/style.css" /> + <title>{{title}} — {{post_title}}</title> + </head> + <body>