Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-525: Toggle for entry_dns #537

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions USER-INTERFACE-INTERFACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ be cleared.
* `db-password` - Password to unlock the sensitive values in the database.
* `dns-servers` - Comma-separated list of DNS servers to use.
* `earning-wallet` - Wallet into which earnings should be deposited.
* `entry-dns` - To start MASQ's local DNS server if HTTP proxying is unavailable.
* `gas-price` - The fee per unit of computational effort in blockchain transactions, measured in gwei.
* `ip` - The public IP address of the Node.
* `log-level` - The lowest level of logs that should be recorded. `off`, `error`, `warn`, `info`, `debug`, `trace`
Expand Down
19 changes: 19 additions & 0 deletions masq_lib/src/shared_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ pub const EARNING_WALLET_HELP: &str =
(case-insensitive). If you already have a derivation-path earning wallet, don't supply this. \
If you have supplied an earning wallet address before, either don't supply it again or be \
careful to supply exactly the same one you supplied before.";
pub const ENTRY_DNS_HELP: &str = "Specify whether to use entry DNS. If you can't use HTTP proxying \
to reroute your client's traffic through MASQ's Node, you can specify --entry-dns to start up \
MASQ's local DNS server; but you will also need to subvert your network stack's DNS traffic \
using dns_utility. This practice is not recommended but may be necessary in certain situations.";
pub const IP_ADDRESS_HELP: &str = "The public IP address of your MASQ Node: that is, the IPv4 \
address at which other Nodes can contact yours. If you're running your Node behind \
a router, this will be the IP address of the router. If this IP address starts with 192.168 or 10.0, \
Expand Down Expand Up @@ -408,6 +412,14 @@ pub fn shared_app(head: App<'static, 'static>) -> App<'static, 'static> {
EARNING_WALLET_HELP,
common_validators::validate_ethereum_address,
))
.arg(
Arg::with_name("entry-dns")
.long("entry-dns")
.value_name("ENTRY-DNS")
.required(false)
.takes_value(false)
.help(ENTRY_DNS_HELP),
)
.arg(
Arg::with_name("fake-public-key")
.long("fake-public-key")
Expand Down Expand Up @@ -741,6 +753,13 @@ mod tests {
If you have supplied an earning wallet address before, either don't supply it again or be \
careful to supply exactly the same one you supplied before."
);
assert_eq!(
ENTRY_DNS_HELP,
"Specify whether to use entry DNS. If you can't use HTTP proxying \
to reroute your client's traffic through MASQ's Node, you can specify --entry-dns to start up \
MASQ's local DNS server; but you will also need to subvert your network stack's DNS traffic \
using dns_utility. This practice is not recommended but may be necessary in certain situations."
);
assert_eq!(
IP_ADDRESS_HELP,
"The public IP address of your MASQ Node: that is, the IPv4 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait UnprivilegedParseArgsConfiguration {
unprivileged_config
.blockchain_bridge_config
.blockchain_service_url_opt =
if is_user_specified(multi_config, "blockchain-service-url") {
if has_user_specified(multi_config, "blockchain-service-url") {
value_m!(multi_config, "blockchain-service-url", String)
} else {
match persistent_config.blockchain_service_url() {
Expand All @@ -48,7 +48,7 @@ pub trait UnprivilegedParseArgsConfiguration {
};
unprivileged_config.clandestine_port_opt = value_m!(multi_config, "clandestine-port", u16);
unprivileged_config.blockchain_bridge_config.gas_price =
if is_user_specified(multi_config, "gas-price") {
if has_user_specified(multi_config, "gas-price") {
value_m!(multi_config, "gas-price", u64).expectv("gas price")
} else {
match persistent_config.gas_price() {
Expand Down Expand Up @@ -614,7 +614,7 @@ fn set_db_password_at_first_mention(
}
}

fn is_user_specified(multi_config: &MultiConfig, parameter: &str) -> bool {
pub fn has_user_specified(multi_config: &MultiConfig, parameter: &str) -> bool {
multi_config.occurrences_of(parameter) > 0
}

Expand Down
Loading
Loading