This commit is contained in:
parent
cf4da6b382
commit
8db7d7bd36
4 changed files with 36 additions and 19 deletions
|
|
@ -1,6 +1,5 @@
|
|||
(* TODO
|
||||
- clean up cmdliner
|
||||
- don't depends on wget
|
||||
- setup: need public key in config file
|
||||
- check sigs *)
|
||||
(* doc: https://docs.taler.net/manpages/taler-exchange-offline.1.html *)
|
||||
|
|
@ -11,26 +10,15 @@ let download ~base_url ~output =
|
|||
let uri =
|
||||
Uri.with_path (Uri.of_string base_url) "/management/keys/" |> Uri.to_string
|
||||
in
|
||||
let wget = Cmd.(v "wget" % "-O" % output % uri) in
|
||||
OS.Cmd.run wget
|
||||
OS.Cmd.run Cmd.(v "hurl" % "--output" % output % uri)
|
||||
|
||||
let upload ~base_url ~input =
|
||||
let open Bos in
|
||||
let uri =
|
||||
Uri.with_path (Uri.of_string base_url) "/management/keys/" |> Uri.to_string
|
||||
in
|
||||
let wget =
|
||||
Cmd.(
|
||||
v "wget"
|
||||
% "--method=POST"
|
||||
% "--header='Content-Type: application/json'"
|
||||
% "--body-file"
|
||||
% input
|
||||
% "-O"
|
||||
% "/dev/null"
|
||||
% uri)
|
||||
in
|
||||
OS.Cmd.run wget
|
||||
OS.Cmd.run
|
||||
Cmd.(v "hurl" % "--method" % "POST" % "--json-input" % ("@=" ^ input) % uri)
|
||||
|
||||
let setup ~output =
|
||||
let output = Fpath.v output in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue