💾 Archived View for gemi.dev › gemini-mailing-list › 000389.gmi captured on 2024-08-25 at 11:28:39. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-12-28)
-=-=-=-=-=-=-
As promised, I have implemented a Gemini server in C11 for POSIX systems: gmnisrv. gemini://drewdevault.com/gmnisrv.gmi gmnisrv is a high-performance server which requires next to no configuration. You just write a file like this: listen=0.0.0.0:1965 [::]:1965 [:tls] store=/var/lib/gemini/certs organization=gmnisrv user [example.org] root=/srv/gemini/example.org [example.com] root=/srv/gemini/example.com Stick it in /etc/gmnisrv.ini, start the daemon, and you're done. It automatically generates and rotates certificates for you. The only dependencies are a C11 compiler, a POSIX-like system, and OpenSSL*. It clocks in at about 3,000 lines of code. In the future, I would like to add support for some simple URL rewrites and reverse proxy support.
Thanks again! This tiny server has around a 3MB resident footprint. I think having a server capable of managing its own certificates is a great idea - there have been plenty of issues where a certificate anomaly turned out to be the problem. One minor issue - I don't think that C11, as per the readme, supports the single argument version of static_assert, as used in include/server.h. The following is suggested: - 8< ---------- diff --git a/include/server.h b/include/server.h index c6f4a38..c4ea470 100644 --- a/include/server.h +++ b/include/server.h @@ -27,7 +27,7 @@ struct gmnisrv_client { BIO *bio, *sbio; char buf[4096]; - static_assert(GEMINI_MAX_URL + 3 < 4096); + static_assert(GEMINI_MAX_URL + 3 < 4096, "GEMINI_MAX_URL is too large"); size_t bufix, bufln; enum response_state state; 8< ---------- Kevin On Sat, 26 Sep 2020 at 23:36, Drew DeVault <sir at cmpwn.com> wrote: > As promised, I have implemented a Gemini server in C11 for POSIX > systems: gmnisrv. > > gemini://drewdevault.com/gmnisrv.gmi > > gmnisrv is a high-performance server which requires next to no > configuration. You just write a file like this: > > listen=0.0.0.0:1965 [::]:1965 > > [:tls] > store=/var/lib/gemini/certs > organization=gmnisrv user > > [example.org] > root=/srv/gemini/example.org > > [example.com] > root=/srv/gemini/example.com > > Stick it in /etc/gmnisrv.ini, start the daemon, and you're done. It > automatically generates and rotates certificates for you. > > The only dependencies are a C11 compiler, a POSIX-like system, and > OpenSSL*. It clocks in at about 3,000 lines of code. In the future, I > would like to add support for some simple URL rewrites and reverse proxy > support. > > * I actually mean OpenSSL when I say it, not LibreSSL or GNUTLS or > anything else. > > Development info can be found here: > > https://sr.ht/~sircmpwn/gmni/ > > Enjoy! > -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200927/9fe9 4936/attachment.htm>
On Sun Sep 27, 2020 at 3:56 PM EDT, Kevin Sangeelee wrote: > Thanks again! This tiny server has around a 3MB resident footprint. > > I think having a server capable of managing its own certificates is a > great idea - there have been plenty of issues where a certificate > anomaly turned out to be the problem. > > One minor issue - I don't think that C11, as per the readme, supports > the single argument version of static_assert, as used in > include/server.h. The following is suggested: - Thanks for the head's up! Could you rephrase this in the form of a git patch sent to ~sircmpwn/gmni-devel at lists.sr.ht? See https://git-send-email.io
---
Previous Thread: ANN: A new Gemini browser written in Go
Next Thread: [ANN] GemGoHaNe -- Gemini Gopher HackerNews Mirror