From 3757fffbef2055bb479771bd8f53f90d20fac001 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 24 Jan 2024 10:00:41 +0100 Subject: [PATCH 1/5] Gently update --- .ocamlformat | 2 +- bin/dune | 8 ++++---- bin/lipap.ml | 2 +- bin/mti_gf.ml | 2 +- lib/dune | 2 +- test/test.ml | 16 ++++++++-------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.ocamlformat b/.ocamlformat index cbc75aa..c472f64 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version=0.24.1 +version=0.26.1 module-item-spacing=compact break-struct=natural break-infix=fit-or-vertical diff --git a/bin/dune b/bin/dune index 872463a..ac561eb 100644 --- a/bin/dune +++ b/bin/dune @@ -3,7 +3,7 @@ (public_name ptt.mti_gf) (package ptt-bin) (modules mti_gf) - (libraries bos ca-certs mirage-time-unix mirage-clock-unix dns-client.lwt + (libraries bos ca-certs mirage-time-unix mirage-clock-unix dns-client-lwt tcpip.stack-socket ptt.mti-gf logs.fmt mirage-crypto-rng)) (executable @@ -12,7 +12,7 @@ (package ptt-bin) (modules lipap) (libraries digestif.c ca-certs mirage-time-unix bos mirage-clock-unix - dns-client.lwt tcpip.stack-socket ptt.lipap logs.fmt mirage-crypto-rng)) + dns-client-lwt tcpip.stack-socket ptt.lipap logs.fmt mirage-crypto-rng)) (executable (name adduser) @@ -27,5 +27,5 @@ (public_name ptt.spf) (package ptt-bin) (modules spf) - (libraries cmdliner dns-tsig ptime.clock.os dns-client.lwt mirage-crypto-rng - tcpip.stack-socket uspf uspf.lwt dns-mirage)) + (libraries cmdliner dns-tsig ptime.clock.os dns-client-lwt mirage-crypto-rng + tcpip.stack-socket uspf uspf-lwt dns-mirage)) diff --git a/bin/lipap.ml b/bin/lipap.ml index 27d81ce..0d88cec 100644 --- a/bin/lipap.ml +++ b/bin/lipap.ml @@ -6,7 +6,7 @@ let () = Fmt.set_style_renderer Fmt.stdout `Ansi_tty let () = Fmt.set_style_renderer Fmt.stderr `Ansi_tty let () = Logs.set_level ~all:true (Some Logs.Debug) let () = Logs.set_reporter reporter -let () = Mirage_crypto_rng_unix.initialize () +let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna) let ( <.> ) f g x = f (g x) module Random = struct diff --git a/bin/mti_gf.ml b/bin/mti_gf.ml index 9012fcd..66bea61 100644 --- a/bin/mti_gf.ml +++ b/bin/mti_gf.ml @@ -6,7 +6,7 @@ let () = Fmt.set_style_renderer Fmt.stdout `Ansi_tty let () = Fmt.set_style_renderer Fmt.stderr `Ansi_tty let () = Logs.set_level ~all:true (Some Logs.Debug) let () = Logs.set_reporter reporter -let () = Mirage_crypto_rng_unix.initialize () +let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna) let ( <.> ) f g x = f (g x) module Random = struct diff --git a/lib/dune b/lib/dune index 2607384..af8988c 100644 --- a/lib/dune +++ b/lib/dune @@ -42,7 +42,7 @@ (name hm) (public_name ptt.hm) (modules hm) - (libraries dns-client.mirage uspf mirage-random ptt.transmit)) + (libraries dns-client-mirage uspf mirage-random ptt.transmit)) (library (name ptt_value) diff --git a/test/test.ml b/test/test.ml index 54eee02..c690c30 100644 --- a/test/test.ml +++ b/test/test.ml @@ -6,7 +6,7 @@ let () = Fmt.set_style_renderer Fmt.stdout `Ansi_tty let () = Fmt.set_style_renderer Fmt.stderr `Ansi_tty let () = Logs.set_level ~all:true (Some Logs.Debug) let () = Logs.set_reporter reporter -let () = Mirage_crypto_rng_unix.initialize () +let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna) let () = Sys.set_signal Sys.sigpipe Sys.Signal_ignore module Scheduler = Colombe.Sigs.Make (struct type +'a t = 'a Lwt.t end) @@ -875,12 +875,12 @@ let full_test_0 = let romain_calascibetta = (Rresult.R.get_ok <.> Colombe_emile.to_forward_path) (let open Mrmime.Mailbox in - Local.[w "romain"; w "calascibetta"] - @ Domain.(domain, [a "gmail"; a "com"])) in + Local.[w "romain"; w "calascibetta"] + @ Domain.(domain, [a "gmail"; a "com"])) in let anil = (Rresult.R.get_ok <.> Colombe_emile.to_reverse_path) (let open Mrmime.Mailbox in - Local.[w "anil"] @ Domain.(domain, [a "recoil"; a "org"])) in + Local.[w "anil"] @ Domain.(domain, [a "recoil"; a "org"])) in let recoil = (Colombe.Domain.of_string_exn <.> Domain_name.to_string) recoil in let sendmail contents = sendmail @@ -923,16 +923,16 @@ let full_test_1 = let romain_calascibetta = (Rresult.R.get_ok <.> Colombe_emile.to_forward_path) (let open Mrmime.Mailbox in - Local.[w "romain"; w "calascibetta"] - @ Domain.(domain, [a "gmail"; a "com"])) in + Local.[w "romain"; w "calascibetta"] + @ Domain.(domain, [a "gmail"; a "com"])) in let anil = (Rresult.R.get_ok <.> Colombe_emile.to_reverse_path) (let open Mrmime.Mailbox in - Local.[w "anil"] @ Domain.(domain, [a "recoil"; a "org"])) in + Local.[w "anil"] @ Domain.(domain, [a "recoil"; a "org"])) in let thomas = (Rresult.R.get_ok <.> Colombe_emile.to_reverse_path) (let open Mrmime.Mailbox in - Local.[w "thomas"] @ Domain.(domain, [a "gazagnaire"; a "org"])) in + Local.[w "thomas"] @ Domain.(domain, [a "gazagnaire"; a "org"])) in let recoil = (Colombe.Domain.of_string_exn <.> Domain_name.to_string) recoil in let gazagnaire = (Colombe.Domain.of_string_exn <.> Domain_name.to_string) gazagnaire in From a3b7efe018efe324ba675b586dd52fa92519ef5b Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 24 Jan 2024 10:02:39 +0100 Subject: [PATCH 2/5] Delete useless pin-depends --- ptt.opam | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ptt.opam b/ptt.opam index 21ab6e3..875c21b 100644 --- a/ptt.opam +++ b/ptt.opam @@ -53,8 +53,4 @@ pin-depends: [ [ "spamtacus-bayesian.dev" "git+https://github.com/mirage/spamtacus.git#25dbb19afc8344f6933652ab8f6c590d887583bc" ] [ "spamtacus.dev" "git+https://github.com/mirage/spamtacus.git#25dbb19afc8344f6933652ab8f6c590d887583bc" ] [ "spamtacus-mirage.dev" "git+https://github.com/mirage/spamtacus.git#25dbb19afc8344f6933652ab8f6c590d887583bc" ] - [ "colombe.dev" "git+https://github.com/mirage/colombe.git#96c2e9ba6cd04b87879e048110df2fa3f7f0644f" ] - [ "sendmail.dev" "git+https://github.com/mirage/colombe.git#96c2e9ba6cd04b87879e048110df2fa3f7f0644f" ] - [ "sendmail-lwt.dev" "git+https://github.com/mirage/colombe.git#96c2e9ba6cd04b87879e048110df2fa3f7f0644f" ] - [ "mrmime.dev" "git+https://github.com/mirage/mrmime.git#a9bbd8e3773e404c1b70687d566c4194af3f0529" ] ] From a58f93d1923fabd2c821f19f5ab9495836ebccdd Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 24 Jan 2024 10:18:30 +0100 Subject: [PATCH 3/5] Update the opam-repository used by containers --- Dockerfile.relay | 2 +- Dockerfile.signer | 2 +- Dockerfile.spamfilter | 2 +- Dockerfile.submission | 2 +- Dockerfile.verifier | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.relay b/Dockerfile.relay index 474ce47..4c0d431 100644 --- a/Dockerfile.relay +++ b/Dockerfile.relay @@ -1,6 +1,6 @@ FROM ocaml/opam:ubuntu-20.04-ocaml-4.14 RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam -RUN cd ~/opam-repository && git pull origin master && git reset --hard 789990a742984743e12a872912ab71b023b031e7 && opam update +RUN cd ~/opam-repository && git pull origin master && git reset --hard cd449b28e1149a5bafa7f1c6262879ce509b7eea && opam update RUN opam depext -ui mirage RUN mkdir -p /home/opam/src WORKDIR /home/opam/src diff --git a/Dockerfile.signer b/Dockerfile.signer index 057b884..00e891a 100644 --- a/Dockerfile.signer +++ b/Dockerfile.signer @@ -1,6 +1,6 @@ FROM ocaml/opam:ubuntu-20.04-ocaml-4.14 RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam -RUN cd ~/opam-repository && git pull origin master && git reset --hard 34576e67c88137d40ce6ff9e252d549e9e87205f && opam update +RUN cd ~/opam-repository && git pull origin master && git reset --hard cd449b28e1149a5bafa7f1c6262879ce509b7eea && opam update RUN opam depext -ui mirage RUN mkdir -p /home/opam/src WORKDIR /home/opam/src diff --git a/Dockerfile.spamfilter b/Dockerfile.spamfilter index 5ceb06c..a845c8b 100644 --- a/Dockerfile.spamfilter +++ b/Dockerfile.spamfilter @@ -1,6 +1,6 @@ FROM ocaml/opam:ubuntu-20.04-ocaml-4.14 RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam -RUN cd ~/opam-repository && git pull origin master && git reset --hard 34576e67c88137d40ce6ff9e252d549e9e87205f && opam update +RUN cd ~/opam-repository && git pull origin master && git reset --hard cd449b28e1149a5bafa7f1c6262879ce509b7eea && opam update RUN opam depext -ui mirage RUN mkdir -p /home/opam/src WORKDIR /home/opam/src diff --git a/Dockerfile.submission b/Dockerfile.submission index cdfd758..eb8f654 100644 --- a/Dockerfile.submission +++ b/Dockerfile.submission @@ -1,6 +1,6 @@ FROM ocaml/opam:ubuntu-20.04-ocaml-4.14 RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam -RUN cd ~/opam-repository && git pull origin master && git reset --hard 789990a742984743e12a872912ab71b023b031e7 && opam update +RUN cd ~/opam-repository && git pull origin master && git reset --hard cd449b28e1149a5bafa7f1c6262879ce509b7eea && opam update RUN opam depext -ui mirage RUN mkdir -p /home/opam/src WORKDIR /home/opam/src diff --git a/Dockerfile.verifier b/Dockerfile.verifier index 6203992..3c5228d 100644 --- a/Dockerfile.verifier +++ b/Dockerfile.verifier @@ -1,6 +1,6 @@ FROM ocaml/opam:ubuntu-20.04-ocaml-4.14 RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam -RUN cd ~/opam-repository && git pull origin master && git reset --hard 34576e67c88137d40ce6ff9e252d549e9e87205f && opam update +RUN cd ~/opam-repository && git pull origin master && git reset --hard cd449b28e1149a5bafa7f1c6262879ce509b7eea && opam update RUN opam depext -ui mirage RUN mkdir -p /home/opam/src WORKDIR /home/opam/src From b3cfe127aafa094acff6a8f50cb3a182cd999ea2 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 24 Jan 2024 10:19:17 +0100 Subject: [PATCH 4/5] Add uspf-lwt as a new dependency for ptt --- ptt-bin.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/ptt-bin.opam b/ptt-bin.opam index 920eae4..5189711 100644 --- a/ptt-bin.opam +++ b/ptt-bin.opam @@ -21,6 +21,7 @@ depends: [ "cmdliner" {>= "1.1.0"} "mirage-clock-unix" {>= "3.1.0"} "mirage-crypto-rng" + "uspf-lwt" "mirage-time-unix" {>= "2.0.0"} "mimic" {>= "0.0.1"} "alcotest-lwt" {with-test} From 60a54555239946e6b76c4cfcb07f00d105df2871 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 24 Jan 2024 10:28:53 +0100 Subject: [PATCH 5/5] Upgrade unikernels with new Mirage devices --- unikernel/relay/config.ml | 8 ++++++-- unikernel/submission/config.ml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/unikernel/relay/config.ml b/unikernel/relay/config.ml index 71c25a7..2896968 100644 --- a/unikernel/relay/config.ml +++ b/unikernel/relay/config.ml @@ -8,6 +8,10 @@ let ssh_key = let doc = Key.Arg.info ~doc:"The private SSH key." [ "ssh-key" ] in Key.(create "ssh_key" Arg.(opt (some string) None doc)) +let ssh_password = + let doc = Key.Arg.info ~doc:"The SSH password." [ "ssh-password" ] in + Key.(create "ssh_password" Arg.(opt (some string) None doc)) + let ssh_authenticator = let doc = Key.Arg.info ~doc:"SSH public key of the remote Git repository." [ "ssh-authenticator" ] in Key.(create "ssh_authenticator" Arg.(opt (some string) None doc)) @@ -48,8 +52,8 @@ let stack = generic_stackv4v6 default_network let dns = generic_dns_client ~nameservers stack let tcp = tcpv4v6_of_stackv4v6 stack let git_client = - let happy_eyeballs = git_happy_eyeballs stack dns (generic_happy_eyeballs stack dns) in - git_ssh ~key:ssh_key tcp happy_eyeballs + let happy_eyeballs = mimic_happy_eyeballs stack dns (generic_happy_eyeballs stack dns) in + git_ssh ~password:ssh_password ~key:ssh_key tcp happy_eyeballs let () = register "relay" diff --git a/unikernel/submission/config.ml b/unikernel/submission/config.ml index 10f5b6c..5937258 100644 --- a/unikernel/submission/config.ml +++ b/unikernel/submission/config.ml @@ -8,6 +8,10 @@ let ssh_key = let doc = Key.Arg.info ~doc:"The private SSH key." [ "ssh-key" ] in Key.(create "ssh_key" Arg.(opt (some string) None doc)) +let ssh_password = + let doc = Key.Arg.info ~doc:"The SSH password." [ "ssh-password" ] in + Key.(create "ssh_password" Arg.(opt (some string) None doc)) + let ssh_authenticator = let doc = Key.Arg.info ~doc:"SSH public key of the remote Git repository." [ "ssh-authenticator" ] in Key.(create "ssh_authenticator" Arg.(opt (some string) None doc)) @@ -77,8 +81,8 @@ let stack = generic_stackv4v6 default_network let dns = generic_dns_client stack let tcp = tcpv4v6_of_stackv4v6 stack let git_client = - let happy_eyeballs = git_happy_eyeballs stack dns (generic_happy_eyeballs stack dns) in - git_ssh ~key:ssh_key tcp happy_eyeballs + let happy_eyeballs = mimic_happy_eyeballs stack dns (generic_happy_eyeballs stack dns) in + git_ssh ~password:ssh_password ~key:ssh_key tcp happy_eyeballs let () = register "submission"