README
1# Gemserv
2
3A gemini server written in rust.
4
5## Features
6
7 - Vhosts
8 - CGI
9 - User directories
10 - Reverse proxy
11 - Redirect
12 - SCGI
13
14## Installation and running
15
16OpenSSL 1.1.0g or LibreSSL 2.7.0 or newer is required.
17
18 - Clone the repo
19 - If you want to use all features run 'cargo build --release' or if you only
20 want to serve static files run 'cargo build --release --no-default-features'
21 - Modify the config.toml to your needs
22 - Run './target/release/gemserv config.toml'
23
24### Init scripts
25
26In the init-scripts directory there's OpenRC(Courtesy of Tastytea) and systemd
27service files.
28
29### NetBSD
30If running on NetBSD you'll need to set the environmental variable OPENSSL_DIR
31before compiling.
32
33'export OPENSSL_DIR="/usr/pkg"'
34
35Also to run you'll need to symlink libssl, and libcrypt to "/usr/lib" by
36running:
37
38'ln -s /usr/pkg/lib/libssl.so.1.1 /usr/lib'
39'ln -s /usr/pkg/lib/libcrypt.so.1.1 /usr/lib'
40
41Thanks to tiwesdaeg for figuring it out.
42
43## CGI and SCGI
44
45There's example SCGI scripts for python and perl in the cgi-scripts directory.
46
47In the configuration file there's "cgi" which is an optional bool to turn cgi
48on. If it's true it'll run scripts from any directory. To limit it to only one
49directory set "cgipath"
50
51If "cgi" is false or not set the server will respond "Not Found" to any
52executable file.
53
54Scripts have 5 seconds to complete or they will be terminated.
55
56### CGI Environments
57
58
59These variables are preset for you. If you need more you can define them in the
60config file under "cgienv"
61
62 - GEMINI_URL
63 - SERVER_NAME
64 - SERVER_PROTOCOL
65 - SERVER_SOFTWARE
66 - SCRIPT_NAME
67 - REMOTE_ADDR
68 - REMOTE_HOST
69 - REMOTE_PORT
70 - QUERY_STRING
71 - PATH_INFO
72
73TLS variables
74 - AUTH_TYPE
75 - TLS_CLIENT_HASH
76 - REMOTE_USER
77
78