JJ: Description from the destination commit:

wip customize skeleton

JJ: Description from source commit:
.
This commit is contained in:
swrup 2025-11-02 13:32:06 +01:00
parent f4d9f8e618
commit 2b02e8ff9d
16 changed files with 48 additions and 24 deletions

19
.gitignore vendored
View file

@ -1,8 +1,13 @@
_build/
mirage/
dist/
dune.build
dune.config
dune-project
dune-workspace
duniverse/
data/tls/keys/**
!data/tls/keys/.gitkeep
data/tls/certificates/**
!data/tls/certificates/.gitkeep
unikernel/mirage/
unikernel/dist/
unikernel/dune
unikernel/dune.build
unikernel/dune.config
unikernel/dune-project
unikernel/dune-workspace
unikernel/duniverse/

View file

@ -1 +1,2 @@
dist/dune
unikernel/dist/*
unikernel/mirage/*

View file

@ -1,9 +1,9 @@
# Generated by mirage.v4.10.3
-include Makefile.user
BUILD_DIR = ./
MIRAGE_DIR = ./mirage
UNIKERNEL_NAME = minipaf-unix
BUILD_DIR = unikernel/
MIRAGE_DIR = unikernel/mirage
UNIKERNEL_NAME = mte-unix
OPAM = opam
all::
@ -57,7 +57,7 @@ depends depend::
build::
dune build --profile release --root . $(BUILD_DIR)dist
@echo "Your unikernel binary is now ready in $(BUILD_DIR)dist/minipaf"
@echo "Your unikernel binary is now ready in $(BUILD_DIR)dist/mte"
@echo "Execute the binary using solo5-hvt, solo5-spt, xl, ..."
clean::

7
dune-project Normal file
View file

@ -0,0 +1,7 @@
(lang dune 2.9)
(name mte-unix)
(implicit_transitive_deps true)
;; Generated by mirage.v4.10.3

5
dune-workspace Normal file
View file

@ -0,0 +1,5 @@
(lang dune 2.9)
(context (default))
;; Generated by mirage.v4.10.3

5
gen.sh
View file

@ -1,5 +0,0 @@
#!/bin/sh
hostname="${2:-localhost}"
openssl req -x509 -newkey rsa:4096 -keyout keys/$1 -out certificates/$1 -sha256 -days 365 -subj "/CN=$hostname" -nodes

7
gen_tls.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
hostname="${2:-localhost}"
mkdir data/tls/keys
mkdir data/tls/certificates
openssl req -x509 -newkey rsa:4096 -keyout data/tls/keys/$1 -out data/tls/certificates/$1 -sha256 -days 365 -subj "/CN=$hostname" -nodes

View file

4
src/dune Normal file
View file

@ -0,0 +1,4 @@
(library
(name mte)
(wrapped false)
(libraries logs))

1
src/mte.ml Normal file
View file

@ -0,0 +1 @@
let uuu = "uuu"

View file

@ -5,8 +5,8 @@ type conn = Connect
let conn = typ Connect
let minipaf =
main "Unikernel.Make"
let mte =
main "Unikernel.Make" ~local_libs:[ "mte" ]
~packages:
[
package "digestif"; package ~min:"0.0.9" "mimic-happy-eyeballs";
@ -27,8 +27,8 @@ let stackv4v6 = generic_stackv4v6 default_network
let tcpv4v6 = tcpv4v6_of_stackv4v6 stackv4v6
let he = generic_happy_eyeballs stackv4v6
let dns = generic_dns_client stackv4v6 he
let certificates = crunch "certificates"
let keys = crunch "keys"
let certificates = crunch "../data/tls/certificates"
let keys = crunch "../data/tls/keys"
let conn =
let happy_eyeballs = mimic_happy_eyeballs stackv4v6 he dns in
@ -38,5 +38,4 @@ let port = Runtime_arg.create ~pos:__POS__ "Unikernel.port"
let http_server = paf_server ~port tcpv4v6
let () =
register "minipaf"
[ minipaf $ certificates $ keys $ tcpv4v6 $ conn $ http_server ]
register "mte" [ mte $ certificates $ keys $ tcpv4v6 $ conn $ http_server ]

View file

@ -4,7 +4,7 @@ open Cmdliner
let port =
let doc = Arg.info ~doc:"Port of HTTP service." [ "p"; "port" ] in
Arg.(value & opt int 8080 doc)
Arg.(value & opt int 3434 doc)
let use_tls =
let doc =