2020-04-10 19:35:22 +00: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.
|
|
|
|
|
2020-04-15 16:09:53 +00:00
|
|
|
`build.sh` and you're set to go! Just put `gophor` somewhere in your path.
|
2020-04-11 10:45:12 +00:00
|
|
|
|
2020-04-10 19:38:17 +00:00
|
|
|
Linux only FOR NOW.
|
2020-04-10 19:35:22 +00:00
|
|
|
|
2020-04-15 16:01:00 +00:00
|
|
|
# Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
gophor [args]
|
|
|
|
-root Change server root directory.
|
|
|
|
-port Change server listening port.
|
|
|
|
-hostname Change server hostname (FQDN, used to craft dir lists).
|
|
|
|
-bind-addr Change server bind-address (used in creating socket).
|
|
|
|
-uid Change UID to drop privileges to.
|
|
|
|
-gid Change GID to drop privileges to.
|
|
|
|
-system-log Path to gophor system log file, else use stderr.
|
|
|
|
-access-log Path to gophor access log file, else use stderr.
|
|
|
|
-cache-check Change file-cache freshness check frequency (in secs).
|
|
|
|
-cache-size Change max no. files in file-cache.
|
|
|
|
-cache-file-max Change maximum allowed size of a cached file.
|
|
|
|
```
|
|
|
|
|
2020-04-13 21:49:25 +00:00
|
|
|
# Features
|
|
|
|
|
|
|
|
- ZERO external dependencies
|
|
|
|
|
|
|
|
- Item type characters beyond RFC 1436 standard (see below)
|
|
|
|
|
2020-04-15 11:51:34 +00:00
|
|
|
- Security focused -- chroots and into server direrctory and drops
|
|
|
|
privileges. `maybe wait until stable release before use outside of hobby
|
|
|
|
setups.`
|
2020-04-13 21:49:25 +00:00
|
|
|
|
2020-04-15 11:51:34 +00:00
|
|
|
- LRU file caching -- with user-controlled file count and max file size.
|
2020-04-13 21:49:25 +00:00
|
|
|
|
|
|
|
- Separate system and access logging with output to file if requested (or
|
2020-04-15 11:51:34 +00:00
|
|
|
disable both!).
|
2020-04-13 21:49:25 +00:00
|
|
|
|
2020-04-12 20:31:50 +00:00
|
|
|
# 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
|
|
|
|
|
2020-04-15 16:14:18 +00:00
|
|
|
. -- Lastline if this followed by CrLf
|
2020-04-12 20:31:50 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-04-13 19:22:50 +00:00
|
|
|
Unavailable for now due to issues with accessing path within chroot:
|
2020-04-13 21:58:21 +00:00
|
|
|
$ -- Execute shell command and print stdout here
|
2020-04-12 20:31:50 +00:00
|
|
|
```
|
|
|
|
|
2020-04-10 19:35:22 +00:00
|
|
|
# Todos
|
|
|
|
|
|
|
|
- TLS support
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Connection throttling + timeouts
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Header + footer text
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Rotating logs
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Set default page width (modifies max UserName / Selector fields)
|
2020-04-11 13:21:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Set default charset
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Autogenerated caps.txt
|
2020-04-11 13:17:21 +00:00
|
|
|
|
2020-04-15 11:46:05 +00:00
|
|
|
- Toggleable server status page (?)
|
2020-04-11 13:32:00 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Proxy over HTTP support
|
2020-04-11 13:32:00 +00:00
|
|
|
|
2020-04-13 21:51:43 +00:00
|
|
|
- Finish inline shell scripting support
|
2020-04-13 21:49:25 +00:00
|
|
|
|
|
|
|
- Allow setting UID+GID via username string
|
|
|
|
|
2020-04-15 10:57:12 +00:00
|
|
|
- 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)
|
|
|
|
|
2020-04-15 11:51:34 +00:00
|
|
|
- More fine-tuned handling of OS signals
|
|
|
|
|
2020-04-15 16:04:13 +00:00
|
|
|
- Add suport for `$hostname` in gophermaps to insert current hostname
|
|
|
|
|
2020-04-15 16:23:04 +00:00
|
|
|
- Add support for banned file extensions (i.e. not shown in dir listing)
|
|
|
|
|
2020-04-13 21:55:06 +00:00
|
|
|
# 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.
|
|
|
|
|
2020-04-11 13:21:21 +00:00
|
|
|
# Standards followed
|
2020-04-11 13:17:21 +00:00
|
|
|
|
|
|
|
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:
|
2020-04-11 13:21:21 +00:00
|
|
|
https://gopher.floodgap.com/gopher/gw
|
2020-04-11 13:17:21 +00:00
|
|
|
|
|
|
|
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
|