A lightweight Gemini server with inline Lua scripting. Forked from: https://git.sr.ht/~panda-roux/MoonGem
- C 91.9%
- CMake 3.2%
- Python 2.3%
- Shell 1.4%
- Dockerfile 1.2%
MoonGem
Introduction
MoonGem is a Gemini protocol server written in C. It supports serving static files as well as Gemtext (.gmi) files with inline Lua scripting.
Examples can be found in the man pages or in 'docs/moongem.sc'.
Dependencies
- OpenSSL 1.1.1 or later
- Lua 5.4 (5.3 may work but I haven't tried it)
- LibMagic
- LibEvent 2.1
- scdoc (optional, for man pages)
Installation
git clone https://git.panda-roux.dev/MoonGem
cd MoonGem && git submodule update --init
cmake -B build . && cd build
make && sudo make install
Usage
See man pages, 'docs/moongem.sc' or use:
./moongem
Docker Compose Example Usage
# clone the repository
git clone https://git.panda-roux.dev/MoonGem && cd MoonGem
# generate a self-signed certificate
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes -subj "/CN=localhost"
# create a document
echo "Hi you!" > index.gmi
# allow the container to read files
chmod 644 *.pem
chmod 644 index.gmi
# start the container
docker-compose up
API
See the man pages or view 'docs/lua.sc'.