Job unipi
README
Skip to buildsUnipi - serve git repository content as HTTPS
Unipi is a MirageOS unikernel that provides the contents of a git repository via HTTP and HTTPS. It embeds (optional) let's encrypt provisioning.
A webhook is provided to update the internal state of the git repository. An example deployment is robur.coop, which serves the robur website (using the pages branch).
Some HTTP headers are added: "content-type", which value is looked up of the file ending using magic-mime. "last-modified" and "etag" are the timestamp of the most recent commit to the git remore, respective the hash of the most recent commit. If the client sends "if-modified-since" or "if-none-match", and either matches the most recent commit, the HTTP status Not modified (304) is returned with an empty body.
Inspiration for this unikernel is taken from Canopy after discussion with the Muen developers.
Configuration
Unipi is only configured via boot parameters, as follows:
--port
configures the TCP port to listen on (defaults to 80)--remote
configures the git remote url (e.g. https://github.com/mirage/ocaml-dns.git#gh-pages)--hook
configures the (secret) url of the webhook, if requested unipi updates its internal git remote (default is "hook")--ipv4
configures the IPv4 address of unipi (e.g. 192.168.2.2/24)--ipv4-gateway
configures the IPv4 gateway
To use git via ssh (only public/private key authentication is supported):
--ssh-key
for the ssh private key - either rsa: or ed25519: (you can use the toolawa_gen_key
to produce a random seed and public key)--ssh-authenticator
to authenticate the ssh remote (format is SHA256:b64-encoded-public-key hash, the output ofssh-keygen -lf <(ssh-keyscan -t rsa|ed25519 remote-host 2>/dev/null)
)
For HTTPS service with let's encrypt certificate:
--tls=true
enables tls--hostname=my-server.example.com
configuring the server name--production=true
for let's encrypt production environment (default is false, which uses the let's encrypt staging environment)- (optional)
--cert-seed=<my-seed>
seed for the private key of the certificate (dd if=/dev/random bs=32 count=1 | b64encode -m -
) - (optional)
--account-seed=<my-seed>
seed for the let's encrypt account (see above how to generate this) - (optional)
--email=<account email>
email address used for let's encrypt account registration
For a complete list of boot parameters, execute the binary with --help
as
argument.
Installation from source
To install this unikernel from source, you need to have opam (>= 2.1.0) and ocaml (>= 4.08.0) installed. Also, mirage is required (>= 4.5.0). Please follow the installation instructions.
The following steps will clone this git repository and compile the unikernel:
$ git clone https://github.com/robur-coop/unipi.git
$ cd unipi
$ mirage configure -t <your-favourite-target> #i.e. hvt, spt, xen
$ make depend
$ make build
Installing as binary
Binaries are available at Reproducible OPAM builds, see Deploying binary MirageOS unikernels and Reproducible MirageOS unikernel builds for details.
Questions?
Please open an issue if you have questions, feature requests, or comments.
Builds
Back to readme- ☑ freebsd-14 2024-12-21 02:11:54Z unipi.hvt
SHA256:d06b8a92b92b26e533f83dd4874e2b81973d721f5c8a4b6e00a6045b0d85faf6
(9.62MB) - ☑ freebsd-14 2024-12-10 03:05:31Z unipi.hvt
SHA256:34e4081e122be5d5e9f64d89ec93d74b62421d93f57b63e8ba12572aac01a548
(9.62MB) - ☒ freebsd-14 2024-12-05 02:12:38Z Build failure: exited 125
- ☒ freebsd-14 2024-12-04 01:06:16Z Build failure: exited 125
- ☒ freebsd-14 2024-12-03 01:55:57Z Build failure: exited 125
- ☒ freebsd-14 2024-12-02 02:21:19Z Build failure: exited 125
- ☒ freebsd-14 2024-12-01 03:13:32Z Build failure: exited 125
- ☒ freebsd-14 2024-11-30 02:02:50Z Build failure: exited 125
- ☑ freebsd-14 2024-11-28 01:02:02Z unipi.hvt
SHA256:73b00ee6a79bb5a5089fc2f61cdf5e410f0a45f47267ab78fa510209b4ec46a3
(9.62MB) - ☑ freebsd-14 2024-11-15 01:49:18Z unipi.hvt
SHA256:a8d53e981bba6d0cfe723baf8e633a7cce0e93b6f244a57a4d2d031d85f0f64e
(9.62MB) - ☒ freebsd-14 2024-11-08 00:51:33Z Build failure: exited 1
- ☑ freebsd-14 2024-11-07 02:31:33Z unipi.hvt
SHA256:3839e9d877f3e9f210b2ba1570237998048d0d0c2243459db8f37c0cab3a3b93
(9.62MB) - ☑ freebsd-14 2024-10-24 00:31:26Z unipi.hvt
SHA256:60c2306dac44f123135dc5b89aaa3771af947a97c3839f1deb92f04d15a787da
(9.62MB) - ☑ freebsd-14 2024-10-23 00:30:34Z unipi.hvt
SHA256:1a8a36fd748487ba4a965545d78d225f03db55609ffcf16f3a5a51ed87836c14
(9.62MB) - ☑ freebsd-14 2024-10-14 11:23:14Z unipi.hvt
SHA256:7acefeb027fd3c2cd2ca0aa4a241b812d2f7d7e31e50d1a979ef6639f4e8765e
(9.62MB)
Excluding failed builds here.