diff --git a/docs/dev_services.md b/docs/dev_services.md --- a/docs/dev_services.md +++ b/docs/dev_services.md @@ -39,11 +39,11 @@ You'll need to create a Tunnelbroker-specific configuration file. ``` -mkdir -p $HOME/tunnelbroker -vim $HOME/tunnelbroker/tunnelbroker.ini +mkdir -p $HOME/.config +vim $HOME/.config/tunnelbroker.ini ``` -Provide a unique ID for each running instance of Tunnelbroker and a RabbitMQ URI in accordance with this [specification](https://www.rabbitmq.com/uri-spec.html). +Provide a unique ID for each running instance of Tunnelbroker and a RabbitMQ URI in accordance with this [specification](https://www.rabbitmq.com/uri-spec.html): ``` [tunnelbroker] @@ -56,6 +56,8 @@ uri = amqp://guest:guest@0.0.0.0/vhost ``` +There is a configuration file template at `services/tunnelbroker/tunnelbroker.ini`. + # Building and running `services/package.json` provides useful scripts to build and run services. The `run` scripts will automatically build the services if necessary and run them. @@ -76,7 +78,7 @@ ### Configuration changes in the sandbox -In your sandbox, services will connect to a local cloud stack, ignoring the `~/.aws` connection settings. The `-test` suffix is applied for all DynamoDB table names in this mode. Tunnelbroker will use the `services/tunnelbroker/tunnelbroker-dev.ini` configuration file and connect to a local instance of the RabbitMQ server. +In your sandbox, services will connect to a local cloud stack, ignoring the `~/.aws` connection settings. The `-test` suffix is applied for all DynamoDB table names in this mode. The log level in this mode is increased from ERROR to INFO. diff --git a/services/tunnelbroker/src/libcpp/src/Constants.h b/services/tunnelbroker/src/libcpp/src/Constants.h --- a/services/tunnelbroker/src/libcpp/src/Constants.h +++ b/services/tunnelbroker/src/libcpp/src/Constants.h @@ -59,9 +59,8 @@ const std::string CONFIG_FILE_DIRECTORY_ENV_VARIABLE = "TUNNELBROKER_CONFIG_FILE_DIRECTORY"; const std::string DEFAULT_CONFIG_FILE_DIRECTORY = - std::string(std::getenv("HOME")) + "/tunnelbroker"; + std::string(std::getenv("HOME")) + "/.config"; const std::string CONFIG_FILE_NAME = "tunnelbroker.ini"; -const std::string SANDBOX_CONFIG_FILE_NAME = "tunnelbroker-sandbox.ini"; // DeliveryBroker const size_t DELIVERY_BROKER_MAX_QUEUE_SIZE = 100; diff --git a/services/tunnelbroker/src/libcpp/src/Tools/ConfigManager.cpp b/services/tunnelbroker/src/libcpp/src/Tools/ConfigManager.cpp --- a/services/tunnelbroker/src/libcpp/src/Tools/ConfigManager.cpp +++ b/services/tunnelbroker/src/libcpp/src/Tools/ConfigManager.cpp @@ -45,11 +45,7 @@ if (configFileDirectoryFromEnvironment != nullptr) { configFilePath = std::string{configFileDirectoryFromEnvironment}; } - if (comm::network::tools::isSandbox()) { - loadConfigFile(configFilePath + "/" + SANDBOX_CONFIG_FILE_NAME); - } else { - loadConfigFile(configFilePath + "/" + CONFIG_FILE_NAME); - } + loadConfigFile(configFilePath + "/" + CONFIG_FILE_NAME); } void ConfigManager::loadConfigFile(const std::string configFilePath) { diff --git a/services/tunnelbroker/tunnelbroker-sandbox.ini b/services/tunnelbroker/tunnelbroker.ini rename from services/tunnelbroker/tunnelbroker-sandbox.ini rename to services/tunnelbroker/tunnelbroker.ini