This commit is contained in:
parent
7ed875cd5e
commit
1cb9787c27
5 changed files with 35 additions and 38 deletions
1
.ocamlformat-ignore
Normal file
1
.ocamlformat-ignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
vendors/**
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
vendor_list := \
|
vendor_list := \
|
||||||
mkernel miou zarith bstr mnet mirage-crypto-rng-mkernel gmp digestif \
|
mkernel miou zarith bstr mnet mirage-crypto-rng-mkernel gmp digestif \
|
||||||
kdf utcp flux h1 httpcats mhttp multipart_form-miou prettym tls \
|
kdf utcp flux h1 httpcats mhttp multipart_form-miou prettym tls \
|
||||||
x509 vifu cachet mfat mirage-mtime caqti caqti-miou caqti-mnet caqti-driver-pgx
|
x509 vifu cachet mfat mirage-mtime caqti
|
||||||
|
|
||||||
secmod_fat=secrets/secmod.fat
|
secmod_fat=secrets/secmod.fat
|
||||||
tap_device=tap-mte
|
tap_device=tap-mte
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
let db_connection caqti_switch : (unit, Caqti_miou.connection) Vif.Device.device =
|
let db_connection caqti_switch : (unit, Caqti_miou.connection) Vif.Device.device
|
||||||
|
=
|
||||||
let f () =
|
let f () =
|
||||||
let db_uri = Config.Exchangedb_postgres.config in
|
let db_uri = Config.Exchangedb_postgres.config in
|
||||||
match Caqti_miou_unix.connect ~sw:caqti_switch db_uri with
|
match Caqti_miou_unix.connect ~sw:caqti_switch db_uri with
|
||||||
|
|
@ -17,10 +18,13 @@ in
|
||||||
|
|
||||||
let keys storage =
|
let keys storage =
|
||||||
let f (module Conn : Pg.CONN) () =
|
let f (module Conn : Pg.CONN) () =
|
||||||
let (module Fs) = (module (struct let t = storage end)) in
|
let (module Fs) =
|
||||||
|
(module struct
|
||||||
|
let t = storage
|
||||||
|
end)
|
||||||
|
in
|
||||||
let keys : (module Keys.S) = (module Keys.Make (Conn) (Fs)) in
|
let keys : (module Keys.S) = (module Keys.Make (Conn) (Fs)) in
|
||||||
keys
|
keys
|
||||||
in
|
in
|
||||||
let finally _key = () in
|
let finally _key = () in
|
||||||
Vif.Device.v ~name:"keys" ~finally [ Vif.Device.value db_connection ]
|
Vif.Device.v ~name:"keys" ~finally [ Vif.Device.value db_connection ] f
|
||||||
f
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
module Fat = Mfat.Make (struct
|
module Fat = Mfat.Make (struct
|
||||||
include Mkernel.Block
|
include Mkernel.Block
|
||||||
|
|
||||||
let read = atomic_read
|
let read = atomic_read
|
||||||
|
|
||||||
let write = atomic_write
|
let write = atomic_write
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,8 @@ let test (module Conn : Caqti_miou.CONNECTION) =
|
||||||
|
|
||||||
let disconnect (module Conn : Caqti_miou.CONNECTION) = Conn.disconnect ()
|
let disconnect (module Conn : Caqti_miou.CONNECTION) = Conn.disconnect ()
|
||||||
|
|
||||||
|
|
||||||
module RNG = Mirage_crypto_rng.Fortuna
|
module RNG = Mirage_crypto_rng.Fortuna
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
let ( let@ ) finally fn = Fun.protect ~finally fn in
|
let ( let@ ) finally fn = Fun.protect ~finally fn in
|
||||||
Util.Log_reporter.setup ();
|
Util.Log_reporter.setup ();
|
||||||
|
|
@ -122,16 +120,13 @@ in
|
||||||
Logs.app (fun m -> m "Test OK");
|
Logs.app (fun m -> m "Test OK");
|
||||||
(* -- *)
|
(* -- *)
|
||||||
(* -- start webserver -- *)
|
(* -- start webserver -- *)
|
||||||
let devices = [
|
let devices = [] in
|
||||||
]
|
|
||||||
in
|
|
||||||
let cfg = Vifu.Config.v Config.Exchange.port in
|
let cfg = Vifu.Config.v Config.Exchange.port in
|
||||||
let db_device = Devices.db_connection sw in
|
let db_device = Devices.db_connection sw in
|
||||||
let keys_device = Devices.keys storage (Vifu.Device.value db_device) in
|
let keys_device = Devices.keys storage (Vifu.Device.value db_device) in
|
||||||
let devices = Vifu.Devices.[ db_device; keys_device ] in
|
let devices = Vifu.Devices.[ db_device; keys_device ] in
|
||||||
Vifu.run ~cfg ~devices tcp routes ()
|
Vifu.run ~cfg ~devices tcp routes ()
|
||||||
|
|
||||||
|
|
||||||
(*
|
(*
|
||||||
Miou_unix.run @@ fun () ->
|
Miou_unix.run @@ fun () ->
|
||||||
Caqti_miou.Switch.run @@ fun caqti_switch ->
|
Caqti_miou.Switch.run @@ fun caqti_switch ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue