Skip to content

Commit

Permalink
Merge pull request #1732 from subspace/make-private-ips-disabled-by-d…
Browse files Browse the repository at this point in the history
…efault

networking: Disable private IPs by default.
  • Loading branch information
shamil-gadelshin authored Aug 1, 2023
2 parents 33cb540 + d7da18c commit 7944f1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(super) fn configure_dsn(
bootstrap_nodes,
piece_cache_size,
provided_keys_limit,
disable_private_ips,
enable_private_ips,
reserved_peers,
in_connections,
out_connections,
Expand Down Expand Up @@ -145,7 +145,7 @@ pub(super) fn configure_dsn(
let config = Config {
reserved_peers,
listen_on,
allow_non_global_addresses_in_dht: !disable_private_ips,
allow_non_global_addresses_in_dht: enable_private_ips,
networking_parameters_registry: Some(networking_parameters_registry),
request_response_protocols: vec![
PieceByHashRequestHandler::create(
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-farmer/src/bin/subspace-farmer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct DsnArgs {
provided_keys_limit: NonZeroUsize,
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in Kademlia DHT.
#[arg(long, default_value_t = false)]
disable_private_ips: bool,
enable_private_ips: bool,
/// Multiaddrs of reserved nodes to maintain a connection to, multiple are supported
#[arg(long)]
reserved_peers: Vec<Multiaddr>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum Command {
pending_out_peers: u32,
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in Kademlia DHT.
#[arg(long, default_value_t = false)]
disable_private_ips: bool,
enable_private_ips: bool,
/// Defines path for the provider record storage DB (optional).
#[arg(long, value_hint = ValueHint::FilePath)]
db_path: Option<PathBuf>,
Expand Down Expand Up @@ -122,7 +122,7 @@ async fn main() -> anyhow::Result<()> {
out_peers,
pending_in_peers,
pending_out_peers,
disable_private_ips,
enable_private_ips,
db_path,
piece_providers_cache_size,
protocol_version,
Expand Down Expand Up @@ -168,7 +168,7 @@ async fn main() -> anyhow::Result<()> {
let config = Config {
networking_parameters_registry,
listen_on,
allow_non_global_addresses_in_dht: !disable_private_ips,
allow_non_global_addresses_in_dht: enable_private_ips,
reserved_peers,
max_established_incoming_connections: in_peers,
max_established_outgoing_connections: out_peers,
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-node/src/bin/subspace-node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ fn main() -> Result<(), Error> {
listen_on: cli.dsn_listen_on,
bootstrap_nodes: dsn_bootstrap_nodes,
reserved_peers: cli.dsn_reserved_peers,
allow_non_global_addresses_in_dht: !cli.dsn_disable_private_ips,
allow_non_global_addresses_in_dht: cli.dsn_enable_private_ips,
max_in_connections: cli.dsn_in_connections,
max_out_connections: cli.dsn_out_connections,
max_pending_in_connections: cli.dsn_pending_in_connections,
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub struct Cli {
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses
/// in Kademlia DHT for the DSN.
#[arg(long, default_value_t = false)]
pub dsn_disable_private_ips: bool,
pub dsn_enable_private_ips: bool,

/// Enables DSN-sync on startup.
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
Expand Down

0 comments on commit 7944f1a

Please sign in to comment.