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