Skip to content

Commit

Permalink
Merge pull request #5878 from psafont/up
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Jul 26, 2024
2 parents 842de7b + 34ee1ef commit 231bb73
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 139 deletions.
64 changes: 62 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
(synopsis "Xen-API client library for remotely-controlling a xapi host")
(authors "David Scott" "Anil Madhavapeddy" "Jerome Maloberti" "John Else" "Jon Ludlam" "Thomas Sanders" "Mike McClurg")
(depends

(alcotest :with-test)
astring
(cohttp (>= "0.22.0"))
Expand Down Expand Up @@ -188,7 +187,6 @@
(description "This daemon monitors 'datasources' i.e. time-varying values such as performance counters and records the samples in RRD archives. These archives can be used to examine historical performance trends.")
(depends
(ocaml (>= "4.02.0"))

(alcotest :with-test)
astring
(gzip (= :version))
Expand Down Expand Up @@ -301,6 +299,68 @@

(package
(name xapi)
(synopsis "The toolstack daemon which implements the XenAPI")
(description "This daemon exposes the XenAPI and is used by clients such as 'xe' and 'XenCenter' to manage clusters of Xen-enabled hosts.")
(depends
alcotest ; needed for the quicktest binary
angstrom
base-threads
base64
cdrom
conf-pam
(crowbar :with-test)
ctypes
ctypes-foreign
domain-name
(ezxenstore (= :version))
(fmt :with-test)
hex
(http-lib (and :with-test (= :version))) ; the public library is only used for testing
ipaddr
mirage-crypto
mirage-crypto-pk
(mirage-crypto-rng (>= "0.11.0"))
(message-switch-unix (= :version))
mtime
opentelemetry-client-ocurl
pci
(pciutil (= :version))
ppx_deriving_rpc
ppx_sexp_conv
ppx_deriving
psq
rpclib
(rrdd-plugin (= :version))
rresult
sexpr
sha
(stunnel (= :version))
tar
tar-unix
(uuid (= :version))
x509
(xapi-client (= :version))
(xapi-cli-protocol (= :version))
(xapi-consts (= :version))
(xapi-datamodel (= :version))
(xapi-expiry-alerts (= :version))
(xapi-idl (= :version))
(xapi-inventory (= :version))
(xapi-log (= :version))
(xapi-stdext-date (= :version))
(xapi-stdext-pervasives (= :version))
(xapi-stdext-std (= :version))
(xapi-stdext-threads (= :version))
(xapi-stdext-unix (= :version))
(xapi-stdext-zerocheck (= :version))
(xapi-test-utils :with-test)
(xapi-tracing (= :version))
(xapi-types (= :version))
(xapi-xenopsd (= :version))
(xml-light2 (= :version))
yojson
(zstd (= :version))
)
)

(package
Expand Down
2 changes: 2 additions & 0 deletions ocaml/gencert/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
forkexec
mirage-crypto
mirage-crypto-pk
mirage-crypto-rng
mirage-crypto-rng.unix
ptime
ptime.clock.os
Expand Down Expand Up @@ -52,6 +53,7 @@
gencertlib
mirage-crypto
mirage-crypto-pk
mirage-crypto-rng
mirage-crypto-rng.unix
ptime
result
Expand Down
2 changes: 0 additions & 2 deletions ocaml/gencert/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ open Rresult

type t_certificate = Leaf | Chain

let () = Mirage_crypto_rng_unix.initialize ()

let validate_private_key pkcs8_private_key =
let ensure_rsa_key_length = function
| `RSA priv ->
Expand Down
8 changes: 4 additions & 4 deletions ocaml/gencert/selfcert.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ let valid_from' date =
| None, false ->
Ptime_clock.now ()

(** initialize the random number generator at program startup when this
module is loaded. *)
let () = Mirage_crypto_rng_unix.initialize ()
(* Needed to initialize the rng to create random serial codes when signing
certificates *)
let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)

(** [write_cert] writes a PKCS12 file to [path]. The typical file
extension would be ".pem". It attempts to do that atomically by
Expand Down Expand Up @@ -158,7 +158,7 @@ let host ~name ~dns_names ~ips ?valid_from ~valid_for_days pemfile cert_gid =
in
R.failwith_error_msg res

let serial_stamp () = Unix.gettimeofday () |> string_of_float
let serial_stamp () = Ptime_clock.now () |> Ptime.to_float_s |> string_of_float

let xapi_pool ?valid_from ~valid_for_days ~uuid pemfile cert_gid =
let valid_from = valid_from' valid_from in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/gencert/test_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open Rresult.R.Infix
let ( let* ) = Rresult.R.bind

(* Initialize RNG for testing certificates *)
let () = Mirage_crypto_rng_unix.initialize ()
let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)

let time_of_rfc3339 date =
match Ptime.of_rfc3339 date with
Expand Down
2 changes: 0 additions & 2 deletions ocaml/xapi/certificates.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ module D = Debug.Make (struct let name = "certificates" end)

open D

let () = Mirage_crypto_rng_unix.initialize ()

(* Certificate locations:
* a) stunnel external = /etc/xensource/xapi-ssl.pem
* b) stunnel SNI (internal) = /etc/xensource/xapi-pool-tls.pem
Expand Down
1 change: 0 additions & 1 deletion ocaml/xapi/dune
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
message-switch-core
message-switch-unix
mirage-crypto
mirage-crypto-rng.unix
mtime
mtime.clock.os
pam
Expand Down
102 changes: 54 additions & 48 deletions xapi.opam
Original file line number Diff line number Diff line change
@@ -1,88 +1,94 @@
# This file is generated by dune, edit dune-project instead
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
opam-version: "2.0"
maintainer: "[email protected]"
authors: [ "[email protected]" ]
homepage: "https://github.com/xapi-project/xen-api"
synopsis: "The toolstack daemon which implements the XenAPI"
description:
"This daemon exposes the XenAPI and is used by clients such as 'xe' and 'XenCenter' to manage clusters of Xen-enabled hosts."
maintainer: ["Xapi project maintainers"]
authors: ["[email protected]"]
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
homepage: "https://xapi-project.github.io/"
bug-reports: "https://github.com/xapi-project/xen-api/issues"
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
build: [
["dune" "build" "-p" name "-j" jobs ]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml"
"dune"
"alcotest" # needed to generate the quicktest binary
"dune" {>= "3.15"}
"alcotest"
"angstrom"
"base-threads"
"base64"
"cdrom"
"conf-pam"
"crowbar" {with-test}
"ctypes"
"ctypes-foreign"
"domain-name"
"ezxenstore"
"ezxenstore" {= version}
"fmt" {with-test}
"hex"
"http-lib" {with-test} # the public library is only used for testing
"http-lib" {with-test & = version}
"ipaddr"
"mirage-crypto" {with-test}
"mirage-crypto"
"mirage-crypto-pk"
"mirage-crypto-rng" {with-test}
"message-switch-unix"
"mirage-crypto-rng" {>= "0.11.0"}
"message-switch-unix" {= version}
"mtime"
"opentelemetry-client-ocurl"
"pci"
"pciutil"
"pciutil" {= version}
"ppx_deriving_rpc"
"ppx_sexp_conv"
"ppx_deriving"
"psq"
"rpclib"
"rrdd-plugin"
"rrdd-plugin" {= version}
"rresult"
"sexpr"
"sha"
"stunnel"
"stunnel" {= version}
"tar"
"tar-unix"
"base-threads"
"base-unix"
"uuid"
"uuid" {= version}
"x509"
"xapi-client"
"xapi-cli-protocol"
"xapi-consts"
"xapi-datamodel"
"xapi-expiry-alerts"
"xapi-stdext-date"
"xapi-stdext-pervasives"
"xapi-stdext-std"
"xapi-stdext-threads"
"xapi-stdext-unix"
"xapi-stdext-zerocheck"
"xapi-client" {= version}
"xapi-cli-protocol" {= version}
"xapi-consts" {= version}
"xapi-datamodel" {= version}
"xapi-expiry-alerts" {= version}
"xapi-idl" {= version}
"xapi-inventory" {= version}
"xapi-log" {= version}
"xapi-stdext-date" {= version}
"xapi-stdext-pervasives" {= version}
"xapi-stdext-std" {= version}
"xapi-stdext-threads" {= version}
"xapi-stdext-unix" {= version}
"xapi-stdext-zerocheck" {= version}
"xapi-test-utils" {with-test}
"xapi-tracing"
"xapi-types"
"xapi-xenopsd"
"xapi-idl"
"xapi-inventory"
"xml-light2"
"xapi-tracing" {= version}
"xapi-types" {= version}
"xapi-xenopsd" {= version}
"xml-light2" {= version}
"yojson"
"zstd"
"zstd" {= version}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
depexts: [
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "debian"}
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "ubuntu"}
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "centos"}
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "fedora"}
["hwdata" "xxhash-dev" "xxhash"] {os-distribution = "alpine"}
]
synopsis: "The xapi toolstack daemon which implements the XenAPI"
description: """
This daemon exposes the XenAPI and is used by clients such as 'xe'
and 'XenCenter' to manage clusters of Xen-enabled hosts."""
url {
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
}
79 changes: 0 additions & 79 deletions xapi.opam.template
Original file line number Diff line number Diff line change
@@ -1,86 +1,7 @@
opam-version: "2.0"
maintainer: "[email protected]"
authors: [ "[email protected]" ]
homepage: "https://github.com/xapi-project/xen-api"
bug-reports: "https://github.com/xapi-project/xen-api/issues"
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
build: [
["dune" "build" "-p" name "-j" jobs ]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml"
"dune"
"alcotest" # needed to generate the quicktest binary
"angstrom"
"base64"
"cdrom"
"conf-pam"
"crowbar" {with-test}
"ctypes"
"ctypes-foreign"
"domain-name"
"ezxenstore"
"fmt" {with-test}
"hex"
"http-lib" {with-test} # the public library is only used for testing
"ipaddr"
"mirage-crypto" {with-test}
"mirage-crypto-pk"
"mirage-crypto-rng" {with-test}
"message-switch-unix"
"mtime"
"opentelemetry-client-ocurl"
"pci"
"pciutil"
"ppx_deriving_rpc"
"ppx_sexp_conv"
"ppx_deriving"
"psq"
"rpclib"
"rrdd-plugin"
"rresult"
"sexpr"
"sha"
"stunnel"
"tar"
"tar-unix"
"base-threads"
"base-unix"
"uuid"
"x509"
"xapi-client"
"xapi-cli-protocol"
"xapi-consts"
"xapi-datamodel"
"xapi-expiry-alerts"
"xapi-stdext-date"
"xapi-stdext-pervasives"
"xapi-stdext-std"
"xapi-stdext-threads"
"xapi-stdext-unix"
"xapi-stdext-zerocheck"
"xapi-test-utils" {with-test}
"xapi-tracing"
"xapi-types"
"xapi-xenopsd"
"xapi-idl"
"xapi-inventory"
"xml-light2"
"yojson"
"zstd"
]
depexts: [
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "debian"}
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "ubuntu"}
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "centos"}
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "fedora"}
["hwdata" "xxhash-dev" "xxhash"] {os-distribution = "alpine"}
]
synopsis: "The xapi toolstack daemon which implements the XenAPI"
description: """
This daemon exposes the XenAPI and is used by clients such as 'xe'
and 'XenCenter' to manage clusters of Xen-enabled hosts."""
url {
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
}

0 comments on commit 231bb73

Please sign in to comment.