gemini/README.md
2022-01-05 17:02:05 -03:00

76 lines
2 KiB
Markdown

# gemini
This is a Gemini server for ad-hoc hosting. It depends on a TLS
termination service like Nginx or HAProxy. This allow us to configure
TLS like we need to and offload safety to a better reviewed project.
## Installation
```bash
crystal build --release src/gemini.cr
strip --strip-all ./gemini
install -m 755 ./gemini /usr/local/bin/gemini
# Or
make gemini
sudo make install
```
## Usage
`gemini` runs on port 19650/tcp without security on. Make sure to keep
this port closed on your firewall, but open 1965/tcp for TLS
connections.
`gemini` expects to serve files from the directory it's run from, and
serves several hosts under their own directory.
```bash
# Enter the directory you're hosting capsules from
cd /srv/gemini
# Create a directory for the capsule
install -dm 750 -o user -g gemini gemini.sutty.coop.ar
# Create a Gemtext file
echo "Hi" > gemini.sutty.coop.ar/index.gmi
# Run the server
gemini
```
Configure your Nginx server to proxy Gemini requests to
`gemini`. There's an example configuration on `contrib/`.
To test your setup, visit <gemini://gemini.sutty.coop.ar>
### Self-signed certificates
The example configuration reuses the Let's Encrypt certificates we
already issue at [Sutty](https://sutty.coop.ar/) for our sites. If you
want to use a self-signed certificate, GnuTLS provides the simplest way.
```bash
certtool --generate-privkey --outfile gemini.key
certtool --generate-self-signed --load-privkey gemini.key --outfile gemini.crt
```
The only fields required are `CN` for your domain, and a certification
duration in days, you can press Enter for everything else.
## Development
You'll need to install Crystal ~>1.2.2.
[Gemini Specification v0.16.0](https://gemini.circumlunar.space/docs/specification.gmi)
## Contributing
```bash
# 1. Fork it
git clone https://gitea.sutty.coop.ar/Sutty/gemini.git
cd gemini
git remote rename origin upstream
# 2. Work on your changes
# [...]
# 3. Send patches
git format-patch upstream
git send-email --to=f@sutty.coop.ar *.patch
```