Go to file
kim (grufwub) c57939c470 custom max cache size + max file in cache size, improve cache.go readability
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
2020-04-15 12:43:02 +01:00
.gitignore update .gitignore + README.md 2020-04-11 14:17:21 +01:00
cache.go custom max cache size + max file in cache size, improve cache.go readability 2020-04-15 12:43:02 +01:00
dir.go file-cache implementation now working! pushing files out of cache TBA 2020-04-13 14:39:35 +01:00
entities.go big code refactoring + work on supporting new item types 2020-04-12 21:32:09 +01:00
error.go add support for some auto-formatting of gophermap files 2020-04-12 16:12:56 +01:00
file_gophermap.go refactor cache code, move flags to separate file 2020-04-15 11:57:42 +01:00
file.go refactor cache code, move flags to separate file 2020-04-15 11:57:42 +01:00
flags.go custom max cache size + max file in cache size, improve cache.go readability 2020-04-15 12:43:02 +01:00
gophor.go refactor cache code, move flags to separate file 2020-04-15 11:57:42 +01:00
LICENSE Create LICENSE 2020-04-10 18:54:44 +01:00
logger.go add support for different types of logging 2020-04-12 09:49:13 +01:00
README.md add new todos to README.md 2020-04-15 11:57:12 +01:00
sample.gophermap add sample gophermap 2020-04-13 14:40:03 +01:00
worker.go minor bug fixes during serving of gophermap / dir listings 2020-04-15 10:52:03 +01:00

Gophor

A Gopher server written in GoLang as a means of learning about the Gopher protocol, and more GoLang.

Possibly beta quality soon? More likely alpha right now.

go build and you're set to go! (...phor ha)

Linux only FOR NOW.

Features

  • ZERO external dependencies

  • Item type characters beyond RFC 1436 standard (see below)

  • Security focused -- Until we reach beta/stable, maybe don't trust this...

  • File caching -- default size is 100 files and 100 gophermaps

  • Separate system and access logging with output to file if requested (or disable both!)

Supported gophermap item types

0 -- regular file (text)
1 -- directory (menu)
2 -- CSO phone-book server... should you be using this in 2020 lmao
3 -- Error
4 -- Binhexed macintosh file
5 -- DOS bin archive
6 -- Unix uuencoded file
7 -- Index-search server
8 -- Text-based telnet session
9 -- Binary file
T -- Text-based tn3270 session... in 2020???
g -- Gif format graphic
I -- Image file of some kind

+ -- Redundant server

. -- Lastline if online this followed by CrLf

i -- Info message
h -- HTML document
s -- Audio file
p -- PNG image
d -- Document

M -- MIME type file
; -- Video file
c -- Calendar file
! -- Title
# -- Comment (not displayed)
- -- Hide file from directory listing
= -- Include subgophermap (prints file output here)
* -- Act as-if lastline and print directory listing below

Unavailable for now due to issues with accessing path within chroot:
$ -- Execute shell command and print stdout here

Todos

  • TLS support

  • Connection throttling + timeouts

  • Header + footer text

  • Support proposed protocol extensions (Gopher+ etc)

  • Toggleable logging

  • Rotating logs

  • Set default page width (modifies max UserName / Selector fields)

  • Set default charset

  • Autogenerated caps.txt

  • Server status page (?)

  • Proxy over HTTP support

  • Gopher servemux (?)

  • Treat plain line of text (no tabs) as info line

  • Finish inline shell scripting support

  • Implement LRU in file cache

  • Allow setting UID+GID via username string

  • Neaten-up newly added file caching code

  • Take file size into account (don't cache if size over __)

  • Fix file cache only updating if main gophermap changes (but not sub files)

  • Add automatic truncating of subgophermap line lengths (e.g. at 70char automatically introduce new-line)

  • Adding LastLine to end of text files??

Please note

During the initial writing phase the quality of git commit messages may be low and many changes are likely to be bundled together at a time, just because the pace of development right now is rather break-neck.

As soon as we reach a stable point in development, or if other people start contributing issues or PRs, whichever comes first, this will be changed right away.

Standards followed

Gopher-II (The Next Generation Gopher WWIS): https://tools.ietf.org/html/draft-matavka-gopher-ii-00

All of the below can be viewed from your standard web browser using floodgap's Gopher proxy: https://gopher.floodgap.com/gopher/gw

RFC 1436 (The Internet Gopher Protocol: gopher://gopher.floodgap.com:70/0/gopher/tech/rfc1436.txt

Gopher+ (upward compatible enhancements): gopher://gopher.floodgap.com:70/0/gopher/tech/gopherplus.txt