1
0
mirror of https://git.sr.ht/~sircmpwn/gmnisrv synced 2024-06-01 17:21:10 +00:00
Go to file
William Casarin ea40fb5a53 tls: fix crash when opening priv key for writing
The open syscall will return a negative value if the call fails. Switch
the check to look for this instead of 0.

before:

[gmnisrv] generating certificate for localhost
gmnisrv: src/tls.c:68: tls_host_gencert: Assertion `pf' failed.
abort (core dumped)  ./gmnisrv -C config.ini

after:

[gmnisrv] generating certificate for localhost
[gmnisrv] opening private key for writing failed: No such file or directory
[gmnisrv] TLS initialization failed

Signed-off-by: William Casarin <jb55@jb55.com>
2020-11-08 09:38:04 -05:00
doc Implement URL rewrites with regex capture groups 2020-11-01 11:19:51 -05:00
include Implement URL rewrites with regex capture groups 2020-11-01 11:19:51 -05:00
src tls: fix crash when opening priv key for writing 2020-11-08 09:38:04 -05:00
.gitignore Initial commit 2020-09-23 10:21:44 -04:00
config.ini config.ini: change suggested root directory 2020-09-26 17:46:56 -04:00
config.sh Implement MIME database support 2020-10-28 12:38:32 -04:00
configure Initial pass on regex routing support 2020-10-29 22:47:56 -04:00
COPYING Initial commit 2020-09-23 10:21:44 -04:00
Makefile Documentation 2020-09-26 16:45:06 -04:00
README.md Add mailcap to dependencies 2020-11-01 14:24:31 -05:00

gmnisrv

gmnisrv is a simple Gemini protocol server.

Installation

Dependencies:

  • A C11 compiler and a POSIX-like system
  • OpenSSL
  • Mailcap (for /etc/mime.types)
  • scdoc (optional)
$ mkdir build
$ cd build
$ ../configure --prefix=/usr
$ make
# make install

Configuration

By default it reads from /etc/gmnisrv.ini, but this can be changed by passing the -C flag to the gmnisrv daemon. A sample config.ini is provided at /usr/share/gmnisrv/gmnisrv.ini:

# Space-separated list of hosts
listen=0.0.0.0:1965 [::]:1965

[:tls]
# Path to store certificates on disk
store=/var/lib/gemini/certs

# Optional details for new certificates
organization=gmnisrv user

[example.org]
root=/srv/gemini/example.org

[example.com]
root=/srv/gemini/example.com

For full details on gmnisrv configuration, consult the gmnisrv(5) manual page.

Usage

See gmnisrv(1).