Client: preload encrypted keys when running a daemon
This commit is contained in:
parent
da921a8f56
commit
370114eb8b
@ -62,6 +62,7 @@ let commands =
|
|||||||
with Failure _ -> failwith "Invalid port %s" x))))
|
with Failure _ -> failwith "Invalid port %s" x))))
|
||||||
(prefixes [ "launch" ; "socket" ; "signer" ] @@ stop)
|
(prefixes [ "launch" ; "socket" ; "signer" ] @@ stop)
|
||||||
(fun (host, port) cctxt ->
|
(fun (host, port) cctxt ->
|
||||||
|
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
|
||||||
Socket_daemon.run cctxt (Tcp (host, port))) ;
|
Socket_daemon.run cctxt (Tcp (host, port))) ;
|
||||||
command ~group
|
command ~group
|
||||||
~desc: "Launch a signer daemon over a local Unix socket."
|
~desc: "Launch a signer daemon over a local Unix socket."
|
||||||
@ -75,6 +76,7 @@ let commands =
|
|||||||
(parameter (fun _ s -> return s))))
|
(parameter (fun _ s -> return s))))
|
||||||
(prefixes [ "launch" ; "local" ; "signer" ] @@ stop)
|
(prefixes [ "launch" ; "local" ; "signer" ] @@ stop)
|
||||||
(fun path cctxt ->
|
(fun path cctxt ->
|
||||||
|
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
|
||||||
Socket_daemon.run cctxt (Unix path)) ;
|
Socket_daemon.run cctxt (Unix path)) ;
|
||||||
command ~group
|
command ~group
|
||||||
~desc: "Launch a signer daemon over HTTPS."
|
~desc: "Launch a signer daemon over HTTPS."
|
||||||
@ -106,6 +108,7 @@ let commands =
|
|||||||
~desc: "path to th TLS key"
|
~desc: "path to th TLS key"
|
||||||
(parameter (fun _ s -> return s)) @@ stop)
|
(parameter (fun _ s -> return s)) @@ stop)
|
||||||
(fun (host, port) cert key cctxt ->
|
(fun (host, port) cert key cctxt ->
|
||||||
|
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
|
||||||
Https_daemon.run cctxt ~host ~port ~cert ~key) ;
|
Https_daemon.run cctxt ~host ~port ~cert ~key) ;
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -8,6 +8,18 @@
|
|||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
let run (cctxt : #Proto_alpha.full) ?max_priority ~delay ?min_date delegates ~endorsement ~denunciation ~baking =
|
let run (cctxt : #Proto_alpha.full) ?max_priority ~delay ?min_date delegates ~endorsement ~denunciation ~baking =
|
||||||
|
begin
|
||||||
|
match delegates with
|
||||||
|
| [] ->
|
||||||
|
Tezos_signer_backends.Encrypted.decrypt_all cctxt
|
||||||
|
| _ :: _ ->
|
||||||
|
iter_s
|
||||||
|
(fun k ->
|
||||||
|
Client_keys.get_key cctxt k >>=? fun (_, _, sk_uri) ->
|
||||||
|
Client_keys.neuterize sk_uri >>=? fun _ ->
|
||||||
|
return ())
|
||||||
|
delegates
|
||||||
|
end >>=? fun () ->
|
||||||
(* TODO really detach... *)
|
(* TODO really detach... *)
|
||||||
let endorsement =
|
let endorsement =
|
||||||
if endorsement then
|
if endorsement then
|
||||||
|
Loading…
Reference in New Issue
Block a user