Skip to content

Commit

Permalink
config: replace jami.net servers by sfl.io
Browse files Browse the repository at this point in the history
We was using jami.net tun server and bootstrap node in docs, config and
even source code as default. To split concerns, DHTNet now have it's
own turn.sfl.io and bootstrap.sfl.io services for demonstration and
public testing purpose. They are still not intended for production use.

Also change default conf to allow anonymous by default.
This is not a security concern as by default we only allow SSH access,
which is secure and restricted by key / password.

Change-Id: Ibcd3607dcd7f46ed21c0ac396fde0459edc2c92e
  • Loading branch information
loulou123546 committed Oct 9, 2024
1 parent 503d364 commit f6b2962
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/connectionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ createConfig(std::shared_ptr<ConnectionManager::Config> config_)
};
config_->dht = std::make_shared<dht::DhtRunner>();
config_->dht->run(dhtConfig, std::move(dhtContext));
config_->dht->bootstrap("bootstrap.jami.net");
config_->dht->bootstrap("bootstrap.sfl.io");
}
if (!config_->factory){
config_->factory = std::make_shared<IceTransportFactory>(config_->logger);
Expand Down
2 changes: 1 addition & 1 deletion tests/connectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ConnectionManagerTest : public CppUnit::TestFixture
std::shared_ptr<IceTransportFactory> factory;

private:
std::unique_ptr<ConnectionHandler> setupHandler(const dht::crypto::Identity& id, const std::string& bootstrap = "bootstrap.jami.net");
std::unique_ptr<ConnectionHandler> setupHandler(const dht::crypto::Identity& id, const std::string& bootstrap = "bootstrap.sfl.io");
std::filesystem::path testDir_;

void testConnectDevice();
Expand Down
28 changes: 14 additions & 14 deletions tests/ice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ IceTest::setUp()
};

dht_->run(0, config, std::move(context));
dht_->bootstrap("bootstrap.jami.net:4222");
dht_->bootstrap("bootstrap.sfl.io:4222");
// Wait for the DHT's public address to be available, otherwise the assertion that
// `addr4.size() != 0` at the beginning of several of the tests will fail.
cv.wait_for(lk, std::chrono::seconds(5), [&] {
return dht_->getPublicAddress().size() != 0;
});
}
if (!turnV4_) {
turnV4_ = std::make_unique<dhtnet::IpAddr>("turn.jami.net", AF_INET);
turnV4_ = std::make_unique<dhtnet::IpAddr>("turn.sfl.io", AF_INET);
}
if (!upnpContext) {
if (!ioContext) {
Expand Down Expand Up @@ -293,9 +293,9 @@ IceTest::testTurnMasterIceConnection()
ice_config.accountLocalAddr = dhtnet::ip_utils::getLocalAddr(AF_INET);
ice_config.turnServers.emplace_back(dhtnet::TurnServerInfo()
.setUri(turnV4_->toString(true))
.setUsername("ring")
.setPassword("ring")
.setRealm("ring"));
.setUsername("sfl")
.setPassword("sfl")
.setRealm("sfl"));
ice_config.master = true;
ice_config.streamsCount = 1;
ice_config.compCountPerStream = 1;
Expand Down Expand Up @@ -476,9 +476,9 @@ IceTest::testTurnSlaveIceConnection()
};
ice_config.turnServers.emplace_back(dhtnet::TurnServerInfo()
.setUri(turnV4_->toString(true))
.setUsername("ring")
.setPassword("ring")
.setRealm("ring"));
.setUsername("sfl")
.setPassword("sfl")
.setRealm("sfl"));
ice_config.master = false;
ice_config.streamsCount = 1;
ice_config.compCountPerStream = 1;
Expand Down Expand Up @@ -545,9 +545,9 @@ IceTest::testReceiveTooManyCandidates()
ice_config.accountLocalAddr = dhtnet::ip_utils::getLocalAddr(AF_INET);
ice_config.turnServers.emplace_back(dhtnet::TurnServerInfo()
.setUri(turnV4_->toString(true))
.setUsername("ring")
.setPassword("ring")
.setRealm("ring"));
.setUsername("sfl")
.setPassword("sfl")
.setRealm("sfl"));
ice_config.master = true;
ice_config.streamsCount = 1;
ice_config.compCountPerStream = 1;
Expand Down Expand Up @@ -716,9 +716,9 @@ IceTest::testCompleteOnFailure()
};
ice_config.turnServers.emplace_back(dhtnet::TurnServerInfo()
.setUri(turnV4_->toString(true))
.setUsername("ring")
.setPassword("ring")
.setRealm("ring"));
.setUsername("sfl")
.setPassword("sfl")
.setRealm("sfl"));
ice_config.master = false;
ice_config.streamsCount = 1;
ice_config.compCountPerStream = 1;
Expand Down
16 changes: 8 additions & 8 deletions tests/turnCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ TurnCacheTest::testTurnResolution()
auto cachePath = testDir_ / "cache";

TurnTransportParams turnParams;
turnParams.domain = "turn.jami.net";
turnParams.realm = "ring";
turnParams.username = "ring";
turnParams.password = "ring";
turnParams.domain = "turn.sfl.io";
turnParams.realm = "sfl";
turnParams.username = "sfl";
turnParams.password = "sfl";

auto turnCache = std::make_shared<TurnCache>("dummyAccount",
cachePath.string(),
Expand Down Expand Up @@ -129,10 +129,10 @@ TurnCacheTest::testRefreshMultipleTimes()
bool enabled = true;

TurnTransportParams turnParams;
turnParams.domain = "turn.jami.net";
turnParams.realm = "ring";
turnParams.username = "ring";
turnParams.password = "ring";
turnParams.domain = "turn.sfl.io";
turnParams.realm = "sfl";
turnParams.username = "sfl";
turnParams.password = "sfl";

auto turnCache = std::make_shared<TurnCache>("dummyAccount",
cachePath.string(),
Expand Down
2 changes: 1 addition & 1 deletion tools/benchmark/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ setupHandler(const std::string& name,
h->dht = std::make_shared<dht::DhtRunner>();
h->dht->run(dhtConfig, std::move(dhtContext));
h->dht->bootstrap("127.0.0.1:36432");
//h->dht->bootstrap("bootstrap.jami.net");
//h->dht->bootstrap("bootstrap.sfl.io");

auto config = std::make_shared<ConnectionManager::Config>();
config->dht = h->dht;
Expand Down
16 changes: 8 additions & 8 deletions tools/dhtnet_crtmgr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ int create_yaml_config(std::filesystem::path file, std::filesystem::path certifi
std::ofstream yaml_file (file);
if (yaml_file.is_open()) {
yaml_file << "# The bootstrap node serves as the entry point to the DHT network.\n";
yaml_file << "# By default, bootstrap.jami.net is configured for the public DHT network and should be used for personal use only.\n";
yaml_file << "# By default, bootstrap.sfl.io is configured for the public DHT network and should be used for personal use only.\n";
yaml_file << "# For production environments, it is recommended to set up your own bootstrap node to establish your own DHT network.\n";
yaml_file << "# Documentation: https://docs.jami.net/en_US/user/lan-only.html#boostraping\n";
yaml_file << "bootstrap: \"bootstrap.jami.net\"\n";
yaml_file << "bootstrap: \"bootstrap.sfl.io\"\n";

yaml_file << "\n# TURN server is used as a fallback for connections if the NAT block all possible connections.\n";
yaml_file << "# By default is turn.jami.net (which uses coturn) but can be any TURN.\n";
yaml_file << "# By default is turn.sfl.io (which uses coturn) but can be any TURN.\n";
yaml_file << "# Developer must set up their own TURN server.\n";
yaml_file << "# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html\n";
yaml_file << "turn_host: \"turn.jami.net\"\n";
yaml_file << "turn_user: \"ring\"\n";
yaml_file << "turn_pass: \"ring\"\n";
yaml_file << "turn_realm: \"ring\"\n";
yaml_file << "turn_host: \"turn.sfl.io\"\n";
yaml_file << "turn_user: \"sfl\"\n";
yaml_file << "turn_pass: \"sfl\"\n";
yaml_file << "turn_realm: \"sfl\"\n";

yaml_file << "\n# When verbose is set to true, the server logs all incoming connections\n";
yaml_file << "verbose: false\n";
Expand All @@ -137,7 +137,7 @@ int create_yaml_config(std::filesystem::path file, std::filesystem::path certifi
} else {
yaml_file << "\n# When anonymous is set to true, the server accepts any connection without checking CA\n";
yaml_file << "# When anonymous is set to false, the server allows only connection which are issued by the same CA as the server\n";
yaml_file << "anonymous: false\n";
yaml_file << "anonymous: true\n";

yaml_file << "\n# List of authorized services\n";
yaml_file << "# Each service is defined by an IP and a port\n";
Expand Down
18 changes: 9 additions & 9 deletions tools/dnc/dnc.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# The bootstrap node serves as the entry point to the DHT network.
# By default, bootstrap.jami.net is configured for the public DHT network and should be used for personal use only.
# By default, bootstrap.sfl.io is configured for the public DHT network and should be used for personal use only.
# For production environments, it is recommended to set up your own bootstrap node to establish your own DHT network.
# Documentation: https://docs.jami.net/en_US/user/lan-only.html#boostraping
bootstrap: "bootstrap.jami.net"
bootstrap: "bootstrap.sfl.io"

# TURN server is used as a fallback for connections if the NAT block all possible connections.
# By default is turn.jami.net (which uses coturn) but can be any TURN.
# Developer must set up their own TURN server.
# By default is turn.sfl.io (which uses coturn) but can be any TURN.
# Developer must set up their own TURN server before going to production, as this one will not scale.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net"
turn_user: "ring"
turn_pass: "ring"
turn_realm: "ring"
turn_host: "turn.sfl.io"
turn_user: "sfl"
turn_pass: "sfl"
turn_realm: "sfl"

# When verbose is set to true, the server logs all incoming connections
verbose: false
Expand Down Expand Up @@ -40,7 +40,7 @@ port: 22

# When anonymous is set to true, the server accepts any connection without checking CA
# When anonymous is set to false, the server allows only connection which are issued by the same CA as the server
anonymous: false
anonymous: true

# List of authorized services
# Each service is defined by an IP and a port
Expand Down
16 changes: 8 additions & 8 deletions tools/dsh/dsh.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# The bootstrap node serves as the entry point to the DHT network.
# By default, bootstrap.jami.net is configured for the public DHT network and should be used for personal use only.
# By default, bootstrap.sfl.io is configured for the public DHT network and should be used for personal use only.
# For production environments, it is recommended to set up your own bootstrap node to establish your own DHT network.
# Documentation: https://docs.jami.net/en_US/user/lan-only.html#boostraping
bootstrap: "bootstrap.jami.net"
bootstrap: "bootstrap.sfl.io"

# TURN server is used as a fallback for connections if the NAT block all possible connections.
# By default is turn.jami.net (which uses coturn) but can be any TURN.
# By default is turn.sfl.io (which uses coturn) but can be any TURN.
# Developer must set up their own TURN server.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net"
turn_user: "ring"
turn_pass: "ring"
turn_realm: "ring"
turn_host: "turn.sfl.io"
turn_user: "sfl"
turn_pass: "sfl"
turn_realm: "sfl"

# On server, identities are saved in /etc/dhtnet/id/
# On client, they are generaly saved in ~/.dnc/
Expand All @@ -33,5 +33,5 @@ binary: "bash"

# When anonymous is set to true, the server accepts any connection without checking CA
# When anonymous is set to false, the server allows only connection which are issued by the same CA as the server
anonymous: false
anonymous: true

2 changes: 1 addition & 1 deletion tools/dvpn/dvpn.1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Run dvpn in listen mode, allowing the program to accept incoming VPN connections

.TP
.B \-b, \-\-bootstrap \fIADDRESS\fR
Specify the address of a bootstrap node to connect to an existing DHT network. Default is "bootstrap.jami.net" if not specified.
Specify the address of a bootstrap node to connect to an existing DHT network. Default is "bootstrap.sfl.io" if not specified.

.TP
.B \-t, \-\-turn_host \fIADDRESS\fR
Expand Down
16 changes: 8 additions & 8 deletions tools/dvpn/dvpn.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# The bootstrap node serves as the entry point to the DHT network.
# By default, bootstrap.jami.net is configured for the public DHT network and should be used for personal use only.
# By default, bootstrap.sfl.io is configured for the public DHT network and should be used for personal use only.
# For production environments, it is recommended to set up your own bootstrap node to establish your own DHT network.
# Documentation: https://docs.jami.net/en_US/user/lan-only.html#boostraping
bootstrap: "bootstrap.jami.net"
bootstrap: "bootstrap.sfl.io"

# TURN server is used as a fallback for connections if the NAT block all possible connections.
# By default is turn.jami.net (which uses coturn) but can be any TURN.
# By default is turn.sfl.io (which uses coturn) but can be any TURN.
# Developer must set up their own TURN server.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net"
turn_user: "ring"
turn_pass: "ring"
turn_realm: "ring"
turn_host: "turn.sfl.io"
turn_user: "sfl"
turn_pass: "sfl"
turn_realm: "sfl"

# On server, identities are saved in /etc/dhtnet/id/
# On client, they are generaly saved in ~/.dnc/
Expand All @@ -25,4 +25,4 @@ turn_realm: "ring"

# When anonymous is set to true, the server accepts any connection without checking CA
# When anonymous is set to false, the server allows only connection which are issued by the same CA as the server
anonymous: false
anonymous: true

0 comments on commit f6b2962

Please sign in to comment.