Skip to content
Snippets Groups Projects
Commit f81d36bd authored by Louis Maillard's avatar Louis Maillard Committed by Adrien Béraud
Browse files

doc: add comments in config files to help users

Adding comment in config file help users to edit it without having to
keep documentation opened on side.

Change-Id: If58dd43dd6c5ac5dbb4209881fb4c14bd0d88e78
parent 8838918d
Branches
Tags
No related merge requests found
...@@ -41,17 +41,35 @@ configure_yaml() { ...@@ -41,17 +41,35 @@ configure_yaml() {
sed -i 's/^#certificate:.*$/certificate: \"\/etc\/dhtnet\/id\/id-server.crt\"/' /etc/dhtnet/dnc.yaml sed -i 's/^#certificate:.*$/certificate: \"\/etc\/dhtnet\/id\/id-server.crt\"/' /etc/dhtnet/dnc.yaml
sed -i 's/^#privateKey:.*$/privateKey: \"\/etc\/dhtnet\/id\/id-server.pem\"/' /etc/dhtnet/dnc.yaml sed -i 's/^#privateKey:.*$/privateKey: \"\/etc\/dhtnet\/id\/id-server.pem\"/' /etc/dhtnet/dnc.yaml
else else
echo "bootstrap: \"bootstrap.jami.net\"" > /etc/dhtnet/dnc.yaml {
echo "turn_host: \"turn.jami.net\"" > /etc/dhtnet/dnc.yaml echo "# The bootstrap node serves as the entry point to the DHT network."
echo "turn_user: \"ring\"" > /etc/dhtnet/dnc.yaml echo "# By default, bootstrap.jami.net is configured for the public DHT network and should be used for personal use only."
echo "turn_pass: \"ring\"" > /etc/dhtnet/dnc.yaml echo "# For production environments, it is recommended to set up your own bootstrap node to establish your own DHT network."
echo "turn_realm: \"ring\"" > /etc/dhtnet/dnc.yaml echo "# Documentation: https://docs.jami.net/en_US/user/lan-only.html#boostraping"
echo "port: 22" > /etc/dhtnet/dnc.yaml echo "bootstrap: \"bootstrap.jami.net\""
echo "ip: \"127.0.0.1\"" > /etc/dhtnet/dnc.yaml echo ""
echo "certificate: \"/etc/dhtnet/id/id-server.crt\"" > /etc/dhtnet/dnc.yaml echo "# TURN server is used as a fallback for connections if the NAT block all possible connections."
echo "privateKey: \"/etc/dhtnet/id/id-server.pem\"" > /etc/dhtnet/dnc.yaml echo "# By default is turn.jami.net (which uses coturn) but can be any TURN."
echo "anonymous: false" > /etc/dhtnet/dnc.yaml echo "# Developer must set up their own TURN server."
echo "verbose: false" > /etc/dhtnet/dnc.yaml echo "# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html"
echo "turn_host: \"turn.jami.net\""
echo "turn_user: \"ring\""
echo "turn_pass: \"ring\""
echo "turn_realm: \"ring\""
echo ""
echo "# When verbose is set to true, the server logs all incoming connections"
echo "verbose: false"
echo ""
echo "# On server, identities are saved in /etc/dhtnet/id/"
echo "certificate: \"/etc/dhtnet/id/id-server.crt\""
echo "privateKey: \"/etc/dhtnet/id/id-server.pem\""
echo ""
echo "# When anonymous is set to true, the server accepts any connection without checking CA"
echo "# When anonymous is set to false, the server allows only connection which are issued by the same CA as the server"
echo "anonymous: false"
echo ""
echo ""
} > /etc/dhtnet/dnc.yaml
fi fi
} }
......
...@@ -118,23 +118,24 @@ int create_yaml_config(std::filesystem::path file, std::filesystem::path certifi ...@@ -118,23 +118,24 @@ int create_yaml_config(std::filesystem::path file, std::filesystem::path certifi
yaml_file << "turn_user: \"ring\"\n"; yaml_file << "turn_user: \"ring\"\n";
yaml_file << "turn_pass: \"ring\"\n"; yaml_file << "turn_pass: \"ring\"\n";
yaml_file << "turn_realm: \"ring\"\n"; yaml_file << "turn_realm: \"ring\"\n";
if (is_client) {
yaml_file << "\n# When dnc server receives connexions, it forwards them to service at specified IP:port requested by client\n"; yaml_file << "\n# When verbose is set to true, the server logs all incoming connections\n";
yaml_file << "# By default, it forwards them to SSH server running on localhost at port 22\n"; yaml_file << "verbose: false\n";
yaml_file << "ip: \"127.0.0.1\"\n";
yaml_file << "port: 22\n";
}
yaml_file << "\n# On server, identities are saved in /etc/dhtnet/id/\n"; yaml_file << "\n# On server, identities are saved in /etc/dhtnet/id/\n";
yaml_file << "# On client, they are generaly saved in ~/.dnc/\n"; yaml_file << "# On client, they are generaly saved in ~/.dnc/\n";
yaml_file << "certificate: " << certificate << "\n"; yaml_file << "certificate: " << certificate << "\n";
yaml_file << "privateKey: " << privateKey << "\n"; yaml_file << "privateKey: " << privateKey << "\n";
if (!is_client) { if (is_client) {
yaml_file << "\n# When dnc server receives connexions, it forwards them to service at specified IP:port requested by CLIENT\n";
yaml_file << "# By default, it forwards them to SSH server running on localhost at port 22\n";
yaml_file << "ip: \"127.0.0.1\"\n";
yaml_file << "port: 22\n";
} else {
yaml_file << "\n# When anonymous is set to true, the server accepts any connection without checking CA\n"; 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 << "# 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: false\n";
} }
yaml_file << "\n# When verbose is set to true, the server logs all incoming connections\n";
yaml_file << "verbose: false\n";
yaml_file.close(); yaml_file.close();
fmt::print("Configuration file created in {}\n", file); fmt::print("Configuration file created in {}\n", file);
} else { } else {
......
# 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.
# 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.jami.net"
# 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.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net" turn_host: "turn.jami.net"
turn_user: "ring" turn_user: "ring"
turn_pass: "ring" turn_pass: "ring"
turn_realm: "ring" turn_realm: "ring"
port: 22
# When verbose is set to true, the server logs all incoming connections
verbose: false
# On server, identities are saved in /etc/dhtnet/id/
# On client, identities are saved in ~/.dnc/
#certificate: "to/your/certificate.crt"
#privateKey: "to/your/privatekey.pem"
##########################
### For Client Use Only ##
##########################
# When dnc server receives connexions, it forwards them to service at specified IP:port requested by CLIENT.
# By default, it forwards them to SSH server running on localhost at port 22
ip: "127.0.0.1" ip: "127.0.0.1"
# certificate: "to/your/certificate.crt" port: 22
# privateKey: "to/your/privatekey.pem"
anonymous: true ##########################
verbose: false ### For Server Use Only ##
\ No newline at end of file ##########################
# 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
# 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.
# 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.jami.net"
# 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.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net" turn_host: "turn.jami.net"
turn_user: "ring" turn_user: "ring"
turn_pass: "ring" turn_pass: "ring"
turn_realm: "ring" turn_realm: "ring"
# On server, identities are saved in /etc/dhtnet/id/
# On client, they are generaly saved in ~/.dnc/
#certificate: "to/your/certificate.crt"
#privateKey: "to/your/privatekey.pem"
##########################
### For Client Use Only ##
##########################
# When dsh server receives connexions, it run the specified binary requested by client
binary: "bash" binary: "bash"
# certificate: "/path/to/ca"
# privateKey: "/path/to/privateKey"
##########################
### For Server Use Only ##
##########################
# 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: false
# 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.
# 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.jami.net"
# 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.
# Documentation: https://docs.jami.net/en_US/developer/going-further/setting-up-your-own-turn-server.html
turn_host: "turn.jami.net" turn_host: "turn.jami.net"
turn_user: "ring" turn_user: "ring"
turn_pass: "ring" turn_pass: "ring"
turn_realm: "ring" turn_realm: "ring"
# configuration_file: "HOME/dhtnet/tools/dvpn/dvpn.yaml" # Change this to the path of the dvpn.yaml file
# certificate: /path/to/certificate # On server, identities are saved in /etc/dhtnet/id/
# privateKey: /path/to/privateKey # On client, they are generaly saved in ~/.dnc/
#certificate: "to/your/certificate.crt"
#privateKey: "to/your/privatekey.pem"
##########################
### For Server Use Only ##
##########################
# 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: false
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment