summaryrefslogtreecommitdiff
path: root/README.md
blob: 9a134ddf8a130f6d6440fb936a9eacbabcfb3b1a (plain)
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
Sheldon Director
================

A [Gemini](https://gemini.circumlunar.space/) Server written in Rust.

Features
--------

This can't do much right now besides hosting some static files. In fact, the
feature set happens to be limited to what I need to host my own Gemini page.
Coincidence?

More is to come however. Specifically I'd want to add CGI support. And maybe
reverse proxy support as well, depending on how much stuff I'll be hosting over
Gemini.

Platform Support
----------------

This currently only works on Unix platforms as `setuid` and `setgid` system
calls are used to drop the privilege level after initialization. Currently
there is no way to disable this. Of course, Gemini's default port (1965) can be
opened in user-mode, but not changing the user after startup would retain read
permissions to the private key.

Building
--------

Set up a Cargo build environment, then simply run
```sh
cargo build
```
to create a debug build or
```sh
cargo build --release
```
to create a release build.

Starting
--------

Sheldon Director looks for a config file in `/etc/sheldond.conf`. If you want
to change this, pass an alternative path on startup using the `-c` parameter.
Use `-h` to get a list of all supported command line arguments.

You'll need a TLS certificate, I've chosen not to include an example in this
repository. Use OpenSSL to quickly generate one:

```sh
openssl req -x509 -newkey rsa:4096 -keyout doc/key.pem -out doc/cert.pem -days 365 -nodes
```

An example config file can be found in this repository in `doc/sheldond.conf`.
Use it to serve the content of the `doc/` directory on localhost:

```sh
sudo ./target/debug/sheldond -c ./doc/sheldond.conf
```

Try connecting to `gemini://localhost` via your favorite Gemini client!

Note: This sets the user to `nobody` and the group to `nobody` as well. This
naming scheme is not consistent for all Unix systems... Try changing the group
name to `nogroup` if the software fails to start.

Why "Sheldon Director"?
-----------------------

Because it is the real name of that villain in _Kim Possible_ who went by the
pseudonym "Gemini". (https://kimpossible.fandom.com/wiki/Gemini)

Though you are free to imagine the shortened name stands for Sheldon Daemon.
But in that case you'll have to come up with your own explanation.