inz.fi

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

tskrtt.md (2798B)


      1 # tskrtt
      2 
      3 A gopherd for Linux (and possibly others)
      4 
      5 Features:
      6 * gopher menus (gophermap or gph)
      7 * dir listings
      8 * CGI support
      9 * access logging
     10 * TLS using libtls
     11 
     12 ## Usage
     13 
     14 	tskrtt [-46d] [-t key cert] [-l logfile] [-b rootdir] [-p port]
     15 	       [-o outport] [-u user] [-g group] [-h host]
     16 	       [-i listen address]
     17 	-4		Only listen for IPv4 connections.
     18 	
     19 	-6		Only listen for IPv6 connections.
     20 
     21 	-c		Chroot to root directory.
     22 	
     23 	-d		Don't fork into background.
     24 	
     25 	-l logfile	Location for an access log file (no default).
     26 	
     27 	-b rootdir	Root directory of served content
     28 			(default: /var/gopher).
     29 	
     30 	-h host		Hostname used in generated content (default: listen
     31 			address or system hostname)
     32 	
     33 	-p port		Port on which the daemon will listen (default: 70).
     34 	
     35 	-o oport	Port shown on generated content (default: same as
     36 			port).
     37 	
     38 	-u user		Change to user after startup.
     39 	
     40 	-g group	Change to group after startup.
     41 	
     42 	-i address	Listen for incoming connections on given address
     43 			(default: listen on any address).
     44 	
     45 	-t key cert	Allow connections using TLS using the given key and
     46 			cert (default: only plain text connection).
     47 
     48 ## Requirements
     49 
     50 tskrtt is based on libev event loop (tested with 4.25 and 4.33). For
     51 TLS support, LibreSSL libtls or libretls is required.
     52 
     53 ## Building
     54 
     55 Build using make. If TLS support is not wanted, edit Makefile.
     56 
     57 ## GPH format
     58 
     59 tskrtt supports GPH formatting and should be compatible with that
     60 of geomyidae. In addition tskrtt allows for server and/or port not
     61 to be defined, in which case server's hostname and port (or 70 if
     62 server is defined) are used.
     63 
     64 ## Dynamic content
     65 
     66 Executable files ending in .cgi are run and the input is forwarded
     67 to client as-is. A well behaving .cgi should output well formed
     68 gopher data (for text and menu content), including using CR + LF as
     69 line ending and ending transmission with a dot on an otherwise
     70 empty line, and take care not to have it anywhere else in the output.
     71 Also note that if root is served by a .cgi, and support for gopher+
     72 clients is wanted, then the script needs to talk gopher+ if client so
     73 requests.
     74 
     75 Executable files ending in .dcgi are similarily run, but they should
     76 output GPH formatted text instead, which is parsed by tskrtt before
     77 passing on to the client.
     78 
     79 Note that while striving to be able to be compatible with HTTP CGI,
     80 a major difference is that neither type should print HTTP headers. For
     81 example a PHP script should begin with
     82 
     83 #!/usr/bin/php-cgi --no-header
     84 
     85 to avoid HTTP headers in the output.
     86 
     87 ## Chroot
     88 
     89 tskrtt can chroot to root dir (if built with support, chroot() is not
     90 part of POSIX. Note that this has immerse effect on d?cgi, whereas
     91 their interpreter / dynamic libraries need to be available inside the
     92 chroot.
     93 
     94 ## Reporting bugs
     95 
     96 Bugs can be reported to inz@inz.fi via email.