Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tteeoo/lc19
♊ A simple server for the Gemini protocol written in C.
https://github.com/tteeoo/lc19
c gemini gemini-protocol gemini-server hypertext openssl protocol server
Last synced: 4 days ago
JSON representation
♊ A simple server for the Gemini protocol written in C.
- Host: GitHub
- URL: https://github.com/tteeoo/lc19
- Owner: tteeoo
- License: unlicense
- Created: 2021-02-10T19:53:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T07:07:45.000Z (5 months ago)
- Last Synced: 2024-06-11T09:57:09.290Z (5 months ago)
- Topics: c, gemini, gemini-protocol, gemini-server, hypertext, openssl, protocol, server
- Language: C
- Homepage:
- Size: 59.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lc19
A simple (<500 SLOC) server for the Gemini protocol written in C.
The name is an allusion to Launch Complex 19, where NASA launched the Gemini spaceflights.
Tested on GNU/Linux (probably works on other Unix-like systems). Created by Theo Henson .## Installation
The requirements are minimal and should already be on most GNU/Linux distributions:
* glibc
* openssl > 1.0.1```
$ make
# make install
```### macOS compatibility
The server should also work on macOS, but you will need to `brew install argp-standalone` and at the `-I`, `-L`, and `-l` options to the Makefile for the installed location.
## Usage
Create the file "endpoints" in the root of the specified directory, with tab separated values for each endpoint:
```
[url path]
...
```Example:
```
text/gemini index.gmi
text/gemini index.gmi /
text/gemini about.gmi
image/png images/cats.png /cats.png
```(By default files will be served at `/`, but if `[url path]` is specified then that will be used.)
Run the server with the following syntax:
```
lc19 [-p PORT] [-d DIR] [-c CERT] [-k KEY]
```Example:
```
$ lc19 -d gemini/ -c cert.pem -k key.pem
```(The port defaults to 1965.)
Reload the endpoints file without restarting the server by sending a SIGHUP signal, e.g.:
```
$ pkill -HUP lc19
```Creating the endpoints file may seem cumbersome, but its generation can be automated and it provides many benefits:
* Security — Only the files listed are able to be accessed.
* Customization — You are able to directly change the URL path that files are found at.
* Simplicity — Specifying the MIME types of files yourself is the most portable (and simple) method, as you needn't rely on having everything built into the code, or having external files/programs like `/etc/mime.types` or `file`.## License
All files are released under the Unlicense, a public domain equivalent license.