Browse Source

* rename tunnels.conf -> tunnels.conf, add detection of old config

pull/448/head
hagen 9 years ago
parent
commit
e6dbeda18e
  1. 9
      ClientContext.cpp
  2. 2
      Config.cpp
  3. 2
      debian/i2pd.links
  4. 4
      docs/configuration.md
  5. 4
      docs/i2pd.conf

9
ClientContext.cpp

@ -261,8 +261,15 @@ namespace client @@ -261,8 +261,15 @@ namespace client
{
boost::property_tree::ptree pt;
std::string tunConf; i2p::config::GetOption("tunconf", tunConf);
if (tunConf == "")
if (tunConf == "") {
// TODO: cleanup this in 2.8.0
tunConf = i2p::fs::DataDirPath ("tunnels.cfg");
if (i2p::fs::Exists(tunConf)) {
LogPrint(eLogWarning, "FS: please rename tunnels.cfg -> tunnels.conf here: ", tunConf);
} else {
tunConf = i2p::fs::DataDirPath ("tunnels.conf");
}
}
LogPrint(eLogDebug, "FS: tunnels config file: ", tunConf);
try
{

2
Config.cpp

@ -108,7 +108,7 @@ namespace config { @@ -108,7 +108,7 @@ namespace config {
general.add_options()
("help", "Show this message")
("conf", value<std::string>()->default_value(""), "Path to main i2pd config file (default: try ~/.i2pd/i2pd.conf or /var/lib/i2pd/i2pd.conf)")
("tunconf", value<std::string>()->default_value(""), "Path to config with tunnels list and options (default: try ~/.i2pd/tunnels.cfg or /var/lib/i2pd/tunnels.cfg)")
("tunconf", value<std::string>()->default_value(""), "Path to config with tunnels list and options (default: try ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf)")
("pidfile", value<std::string>()->default_value(""), "Path to pidfile (default: ~/i2pd/i2pd.pid or /var/lib/i2pd/i2pd.pid)")
("log", value<std::string>()->default_value(""), "Logs destination: stdout, file, syslog (stdout if not set)")
("logfile", value<std::string>()->default_value(""), "Path to logfile (stdout if not set, autodetect if daemon)")

2
debian/i2pd.links vendored

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
etc/i2pd/i2pd.conf var/lib/i2pd/i2pd.conf
etc/i2pd/tunnels.conf var/lib/i2pd/tunnels.cfg
etc/i2pd/tunnels.conf var/lib/i2pd/tunnels.conf
etc/i2pd/subscriptions.txt var/lib/i2pd/subscriptions.txt
usr/share/i2pd/certificates var/lib/i2pd/certificates

4
docs/configuration.md

@ -7,7 +7,7 @@ Command line options @@ -7,7 +7,7 @@ Command line options
* --conf= - Config file (default: ~/.i2pd/i2pd.conf or /var/lib/i2pd/i2pd.conf)
This parameter will be silently ignored if the specified config file does not exist.
Options specified on the command line take precedence over those in the config file.
* --tunconf= - Tunnels config file (default: ~/.i2pd/tunnels.cfg or /var/lib/i2pd/tunnels.cfg)
* --tunconf= - Tunnels config file (default: ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf)
* --pidfile= - Where to write pidfile (dont write by default)
* --log= - Logs destination: stdout, file (stdout if not set, file - otherwise, for compatibility)
* --logfile= - Path to logfile (default - autodetect)
@ -73,7 +73,7 @@ i2pd.conf: @@ -73,7 +73,7 @@ i2pd.conf:
[sam]
enabled = true
tunnels.cfg (filename of this config is subject of change):
tunnels.conf
# outgoing tunnel sample, to remote service
# mandatory parameters:

4
docs/i2pd.conf

@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
## by removing the "#" symbol.
## Tunnels config file
## Default: ~/.i2pd/tunnels.cfg or /var/lib/i2pd/tunnels.cfg
#tunconf = /var/lib/i2pd/tunnels.cfg
## Default: ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf
#tunconf = /var/lib/i2pd/tunnels.conf
## Where to write pidfile (don't write by default)
#pidfile = /var/run/i2pd.pid

Loading…
Cancel
Save