TOR bridge + TOR Proxy + migration config_file_version (#617)

* tor bridge config and args

* migration `config_file_version=2`

* small fixes typo, comment etc..

* support: snowflake, meek_lite, obsf4 and tor proxy

* remove useless serde

* improve migrate function

* few fixes

* add bridge flags to pay and receive + few fixes

* some improvements
This commit is contained in:
deevope
2022-02-03 15:33:41 +00:00
committed by GitHub
parent f5dbed2014
commit c424a0ed10
18 changed files with 1338 additions and 41 deletions
+20
View File
@@ -88,6 +88,11 @@ subcommands:
short: n
long: no_tor
takes_value: false
- bridge:
help: Enable bridge relay with TOR listener
short: g
long: bridge
takes_value: true
- owner_api:
about: Runs the wallet's local web API
args:
@@ -167,6 +172,11 @@ subcommands:
short: u
long: outfile
takes_value: true
- bridge:
help: Enable tor bridge relay when sending via Slatepack workflow
short: g
long: bridge
takes_value: true
- unpack:
about: Unpack and display an armored Slatepack Message, decrypting if possible
args:
@@ -192,6 +202,11 @@ subcommands:
short: u
long: outfile
takes_value: true
- bridge:
help: Enable tor bridge relay when receiving via Slatepack workflow
short: g
long: bridge
takes_value: true
- finalize:
about: Processes a Slatepack Message to finalize a transfer.
args:
@@ -275,6 +290,11 @@ subcommands:
short: u
long: outfile
takes_value: true
- bridge:
help: Enable tor bridge relay when paying invoice.
short: g
long: bridge
takes_value: true
- outputs:
about: Raw wallet output info (list of outputs)
- txs:
+18
View File
@@ -394,6 +394,9 @@ pub fn parse_listen_args(
if let Some(port) = args.value_of("port") {
config.api_listen_port = port.parse().unwrap();
}
if let Some(bridge) = args.value_of("bridge") {
tor_config.bridge.bridge_line = Some(bridge.into());
}
if args.is_present("no_tor") {
tor_config.use_tor_listener = false;
}
@@ -512,6 +515,11 @@ pub fn parse_send_args(args: &ArgMatches) -> Result<command::SendArgs, ParseErro
let outfile = parse_optional(args, "outfile")?;
let bridge = match args.value_of("bridge") {
Some(b) => Some(b.to_string()),
None => None,
};
Ok(command::SendArgs {
amount: amount,
minimum_confirmations: min_c,
@@ -527,6 +535,7 @@ pub fn parse_send_args(args: &ArgMatches) -> Result<command::SendArgs, ParseErro
target_slate_version: target_slate_version,
outfile,
skip_tor: args.is_present("manual"),
bridge: bridge,
})
}
@@ -552,11 +561,14 @@ pub fn parse_receive_args(args: &ArgMatches) -> Result<command::ReceiveArgs, Par
let outfile = parse_optional(args, "outfile")?;
let bridge = parse_optional(args, "bridge")?;
Ok(command::ReceiveArgs {
input_file,
input_slatepack_message,
skip_tor: args.is_present("manual"),
outfile,
bridge,
})
}
@@ -582,11 +594,14 @@ pub fn parse_unpack_args(args: &ArgMatches) -> Result<command::ReceiveArgs, Pars
let outfile = parse_optional(args, "outfile")?;
let bridge = parse_optional(args, "bridge")?;
Ok(command::ReceiveArgs {
input_file,
input_slatepack_message,
skip_tor: args.is_present("manual"),
outfile,
bridge,
})
}
@@ -741,6 +756,8 @@ pub fn parse_process_invoice_args(
let outfile = parse_optional(args, "outfile")?;
let bridge = parse_optional(args, "bridge")?;
Ok(command::ProcessInvoiceArgs {
minimum_confirmations: min_c,
selection_strategy: selection_strategy.to_owned(),
@@ -751,6 +768,7 @@ pub fn parse_process_invoice_args(
ttl_blocks,
skip_tor: args.is_present("manual"),
outfile,
bridge,
})
}