package mehari

All checked builds pass
  1. Overview
  2. Docs
A library for building Gemini servers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.5.tar.gz
md5=035934743b73b6b5a593d3146533b0b2
sha512=570071e2fadd19e396f8fe86162c75069761acbe5c3b2ab3791c7c30a543a174b7f65bf5ba73bf5842ad5b071faabab071db23c19275b8ee8673190af9007cff

Description

Mehari is a library for building Gemini servers. It fully implements the Gemini protocol specification. It takes heavy inspiration from Dream, a tidy, feature-complete Web framework.

Added to opam-repository:

README

Mehari

Mehari is a library for building Gemini servers. It fully implements the Gemini protocol specification.

It takes inspiration from Dream, a tidy feature-complete Web framework, and from Nightmare, a powerful typesafe layer compatible with Dream.

banner

Mehari provides several packages. See here. Many examples are also provided.

Installation

opam install mehari

Features

  • Mirage OS friendly
  • Type safe route API
  • Static files serving
  • MIME type inference from file content (using experimental Conan support)
  • Rate limiting
  • Virtual hosting using TLS SNI
  • CGI support
  • API documentation: https://docs.heyplzlookat.me/mehari/
  • Tutorial: https://docs.heyplzlookat.me/mehari/index.html#tutorial
  • Issues: https://github.com/Psi-Prod/Mehari/issues

Building the unikernel

Setup dev environment:

$ opam install mehari-mirage solo5 ocaml-solo5
$ opam install ca-certs-nss dns dns-client mfat
$ opam pin zarith.dev git+https://github.com/mirage/Zarith.git#df8969d9bb95cffca13e31a615189ab27ada0684

Vendor dependencies:

$ ./unikernel/vendor.sh

Setup network bridge:

$ ip link add name service type bridge
$ ip addr add 10.0.0.1/24 dev service
$ ip tuntap add name tap0 mode tap
$ ip link set tap0 master service
$ ip link set service up
$ ip link set tap0 up

Create dune and dune-workspace files at the root of the repo:

$ cat >dune<<EOF
(vendored_dirs vendors)
EOF
$ cat >dune-workspace<<EOF
(lang dune 3.23)
(context (default))
(context (default
 (name solo5)
 (host default)
 (toolchain solo5)
 (disable_dynamically_linked_foreign_archives true)))
EOF
$ mfat make -s 2048 certs.img
$ mfat write certs.img key.pem key.pem
$ mfat write certs.img certs.pem cert.pem

Compile and run the unikernel:

$ dune build --profile=release
$ solo5-hvt --net:service=tap0 --block:certs=certs.img -- ./_build/solo5/unikernel/unikernel.exe --solo5:quiet --ipv4=10.0.0.2/8

License

Distributed under the LGPL-3.0 License. See license for more information.

Dependencies (11)

  1. uri >= "4.4.0"
  2. tls >= "2.1.5"
  3. mirage-ptime >= "5.2.0"
  4. flux >= "0.0.1~beta8"
  5. logs >= "0.10.0"
  6. ipaddr >= "5.6.2"
  7. conan-database >= "0.0.7"
  8. conan >= "0.0.7"
  9. angstrom >= "0.16.1"
  10. ocaml >= "5.5"
  11. dune >= "3.21"

Dev Dependencies (7)

  1. odoc with-doc
  2. ocaml-lsp-server with-dev-setup
  3. merlin with-dev-setup
  4. ocp-indent with-dev-setup
  5. ocamlformat with-dev-setup
  6. utop with-dev-setup
  7. alcotest with-test

Optional Dependencies

None

Used by (2)

  1. mehari-miou
  2. mehari-mirage >= "0.5"

Conflicts

None

Build status

Results of building mehari with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.5 (this version) n/a n/a n/a n/a good
0.4 n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure