~seanld/june

A static file server for Gemini, via Houston.
c5380500 — Sean Wilkerson 2 years ago
Fix directory tree formatting in README
b6467482 — Sean Wilkerson 2 years ago
Add more info to README
1b926baf — Sean Wilkerson 2 years ago
Add address and port flags

clone

read-only
https://git.sr.ht/~seanld/june
read/write
git@git.sr.ht:~seanld/june

You can also use your local clone with git send-email.

#June

A static file server for the Gemini protocol.

June uses the Houston framework under the hood.

#Minimal

  • Literally just serves static files from a tree-like directory.
  • Configurable rate-limiting via token-bucket algorithm.
  • Written in Go, which means a lightweight binary, with wide system compatibility.
  • By leveraging Houston to do the heavy-lifting, there really isn't much code in June.

#Usage

You should have a certificate file and a key file (CA-signed, or self-signed) ready to go, and a directory that contains content you'd like to serve over Gemini.

Assuming your directory structure looked like this:

|-> june
|-> cert/
|---> main.crt
|---> main.key
|-> static/
|---> index.gmi

You would run:

./june -crt='cert/main.crt' -key='cert/main.key'

And that will start up June on 0.0.0.0:1965.

#On Rate-limiting

As previously stated, Houston (and by extension June) use a token-bucket algorithm to manage rate-limiting. It essentially functions by creating a bucket for each new client address that makes a request. For every single request made, a token is taken from the bucket. The default settings are set up to where no more than two requests can be made in a single second. And every second, 2 tokens are added back into the bucket. These two parameters can be adjusted by changing the -bs and -trickle flags.

In simpler terms, the default parameters mean that only two requests can be made per client per second.

The token-bucket algorithm itself helps with general spam and DoS attacks, but it does not help with DDoS attacks.