This commit is contained in:
parent
9994385179
commit
1bc7756d7a
2 changed files with 43 additions and 35 deletions
|
|
@ -1,23 +1,5 @@
|
||||||
# comment 1
|
|
||||||
# foo
|
|
||||||
# barr
|
|
||||||
[currency-EUR]
|
[currency-EUR]
|
||||||
enabled = NO
|
enabled= YES
|
||||||
# comment 2
|
|
||||||
code= "EUR"
|
|
||||||
name =euro
|
|
||||||
fractional_input_digits = 2
|
|
||||||
fractional_normal_digits =2
|
|
||||||
fractional_trailing_zero_digits= 2
|
|
||||||
% comment 3
|
|
||||||
alt_unit_names = "{"0":"€","3":"k€"}"
|
|
||||||
% comment 4
|
|
||||||
|
|
||||||
[dummy-section]
|
|
||||||
dummy = "blah"
|
|
||||||
|
|
||||||
[currency-EUR]
|
|
||||||
enabled= NO
|
|
||||||
code= EUR
|
code= EUR
|
||||||
name= euro
|
name= euro
|
||||||
fractional_input_digits= 2
|
fractional_input_digits= 2
|
||||||
|
|
@ -43,6 +25,8 @@ wirewatch_idle_sleep_interval = "1 hour"
|
||||||
signkey_legal_duration = "1 year"
|
signkey_legal_duration = "1 year"
|
||||||
max_keys_caching = "4 weeks"
|
max_keys_caching = "4 weeks"
|
||||||
enable_kyc = NO
|
enable_kyc = NO
|
||||||
|
terms_etag = "0"
|
||||||
|
privacy_etag = "0"
|
||||||
|
|
||||||
[exchangedb]
|
[exchangedb]
|
||||||
idle_reserve_expiration_time = "1 year 2 weeks 3 hours 4 minutes 5 seconds"
|
idle_reserve_expiration_time = "1 year 2 weeks 3 hours 4 minutes 5 seconds"
|
||||||
|
|
@ -54,6 +38,14 @@ default_purse_limit = 9999
|
||||||
[exchangedb-postgres]
|
[exchangedb-postgres]
|
||||||
config = "pgx://mte:hunter2@localhost:5432/taler-exchange"
|
config = "pgx://mte:hunter2@localhost:5432/taler-exchange"
|
||||||
|
|
||||||
|
[taler-exchange-secmod-rsa]
|
||||||
|
lookahead_sign = "1 year"
|
||||||
|
overlap_duration = "1 year"
|
||||||
|
|
||||||
|
[taler-exchange-secmod-eddsa]
|
||||||
|
lookahead_sign = "1 year"
|
||||||
|
overlap_duration = "1 year"
|
||||||
|
|
||||||
[coin_kudo_1]
|
[coin_kudo_1]
|
||||||
value= EUR:0.01
|
value= EUR:0.01
|
||||||
duration_withdraw= "1 year"
|
duration_withdraw= "1 year"
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@
|
||||||
|
|
||||||
do not support "$"-path expansion*)
|
do not support "$"-path expansion*)
|
||||||
|
|
||||||
(* TODO
|
|
||||||
- do all config section
|
|
||||||
- parse alt_unit_names json pair
|
|
||||||
*)
|
|
||||||
|
|
||||||
open Angstrom
|
open Angstrom
|
||||||
|
|
||||||
type item = {
|
type item = {
|
||||||
|
|
@ -287,7 +282,7 @@ module Config = struct
|
||||||
let read_file file = In_channel.with_open_bin file In_channel.input_all in
|
let read_file file = In_channel.with_open_bin file In_channel.input_all in
|
||||||
let content = read_file "default.config" in
|
let content = read_file "default.config" in
|
||||||
let v = Parse_file.parse_content content in
|
let v = Parse_file.parse_content content in
|
||||||
(*Fmt.pr "config file:@\n%a@." Pp_debug.pp_config v;*)
|
(*Fmt.epr "config file:@\n%a@." Pp_debug.pp_config v;*)
|
||||||
v
|
v
|
||||||
|
|
||||||
module Exchange = struct
|
module Exchange = struct
|
||||||
|
|
@ -321,6 +316,8 @@ module Config = struct
|
||||||
let signkey_legal_duration = get "signkey_legal_duration" |> duration
|
let signkey_legal_duration = get "signkey_legal_duration" |> duration
|
||||||
let max_keys_caching = get "max_keys_caching" |> duration
|
let max_keys_caching = get "max_keys_caching" |> duration
|
||||||
let enable_kyc = get "enable_kyc" |> yes_no
|
let enable_kyc = get "enable_kyc" |> yes_no
|
||||||
|
let terms_etag = get "terms_etag"
|
||||||
|
let privacy_etag = get "privacy_etag"
|
||||||
|
|
||||||
(* optional:
|
(* optional:
|
||||||
tiny_amount
|
tiny_amount
|
||||||
|
|
@ -337,9 +334,7 @@ module Config = struct
|
||||||
unixpath
|
unixpath
|
||||||
unixpath_mode
|
unixpath_mode
|
||||||
terms_dir
|
terms_dir
|
||||||
terms_etag
|
privacy_dir *)
|
||||||
privacy_dir
|
|
||||||
privacy_etag *)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Exchangedb = struct
|
module Exchangedb = struct
|
||||||
|
|
@ -404,13 +399,6 @@ module Config = struct
|
||||||
"section `[currency-%s]` not found, currency `%s` is not defined"
|
"section `[currency-%s]` not found, currency `%s` is not defined"
|
||||||
Exchange.currency Exchange.currency)
|
Exchange.currency Exchange.currency)
|
||||||
| Some v -> v
|
| Some v -> v
|
||||||
|
|
||||||
(*
|
|
||||||
let () =
|
|
||||||
let pp_pair ppf (k, v) = Fmt.pf ppf "k: %d - v: %s" k v in
|
|
||||||
Fmt.epr "alt unit names:@\n%a@." (Fmt.list pp_pair) v.alt_unit_names;
|
|
||||||
()
|
|
||||||
*)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Coin = struct
|
module Coin = struct
|
||||||
|
|
@ -472,4 +460,32 @@ module Config = struct
|
||||||
let kudo_1 = get_coin "kudo_1"
|
let kudo_1 = get_coin "kudo_1"
|
||||||
let kudo_2 = get_coin "kudo_2"
|
let kudo_2 = get_coin "kudo_2"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Make_exchange_secmod (M : sig
|
||||||
|
val kind : string
|
||||||
|
end) : sig
|
||||||
|
val lookahead_sign : Ptime.Span.t
|
||||||
|
val overlap_duration : Ptime.Span.t
|
||||||
|
end = struct
|
||||||
|
let get field =
|
||||||
|
let section = "taler-exchange-secmod-" ^ M.kind in
|
||||||
|
get config ~section ~field
|
||||||
|
|
||||||
|
let lookahead_sign = get "lookahead_sign" |> duration
|
||||||
|
let overlap_duration = get "overlap_duration" |> duration
|
||||||
|
(* not relevant:
|
||||||
|
sm_priv_key
|
||||||
|
key_dir
|
||||||
|
unixpath *)
|
||||||
|
end
|
||||||
|
|
||||||
|
module Exchange_secmod_rsa = Make_exchange_secmod (struct
|
||||||
|
let kind = "rsa"
|
||||||
|
end)
|
||||||
|
|
||||||
|
module Exchange_secmod_eddsa = Make_exchange_secmod (struct
|
||||||
|
let kind = "eddsa"
|
||||||
|
end)
|
||||||
|
|
||||||
|
(* not implemented: module Exchange_secmod_cs *)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue