A very simple static Gemini server, now with Titan support!
This codebase is now 351 lines of lines-of-code!
The statement "... written within a single file and liberally spanning 159 lines-of-code." has been removed.
If you would still like the minimal 159-LOC experience, checkout
49ce0f8!
(Docker tag 0.1.4
) Do note, that version of this project is outdated and only
has Gemini support.
A Docker Compose file is already setup here. The only
field which should be modified is the ports
, if need be.
docker-compose up -d
docker run -p 1965:1965 -v ./your_capsules_directory:/maple/.maple fuwn/maple:latest
- Build:
tup
(requires Tup) - Run:
build/maple
, orTITAN=1 TITAN_TOKEN=secret TITAN_MAX_SIZE=2048 build/maple
Before any possible method of usage; you must generate or use a preexisting server certificate.
If you do not have an existing certificate, generate one using the provided
certificate generations script: bin/genkey
(requires
OpenSSL).
The server certificate must be placed in a directory -- directly adjacent to the
Docker Compose file or executable -- named .maple
. The public and
private keys must be named public.pem
and private.pem
, respectively.
Gemini content must be placed in a directory -- directly adjacent to the
Docker Compose file or executable -- named .maple/gmi
and
ending with the file extension .gmi
.
Maple can be configured with three optional environment variables:
Enable Titan support.
Takes a value of either true
or 1
, case-insensitive.
Defaults to off.
Set a token to restrict Titan access.
Takes a string value, case-sensitive.
Defaults to no token, anyone can upload!
The maximum size in bytes which a Titan upload is permitted to perform.
Takes an integer.
Default to 1024
.
If you decide to tamper with Maple, you should give your commits a test. As there isn't a test suite yet, feel free to use any of these examples:
# Using OpenSSL directly to debug different requests:
$ openssl s_client -ign_eof -quiet -connect localhost:1965 <<< \
> "gemini://localhost:1965"
# Using Bollux to debug proper requests... or any client!
$ bollux localhost
- gemini://gem.rest/ (https://gem.rest/)
This project is licensed with the GNU General Public License v3.0.