|
|
@@ -703,6 +703,7 @@ RunnerServiceConfig RunnerService::loadConfig(const std::filesystem::path& path)
|
|
|
|
|
|
config.grpc_port = cfg.getOr<int>("grpc_port", 9003);
|
|
|
config.runner_id = cfg.getOr<std::string>("runner_id", "runner-1");
|
|
|
+ config.advertise_address = cfg.getOr<std::string>("advertise_address", "");
|
|
|
config.webserver_address = cfg.getOr<std::string>("webserver_address", "localhost:8080");
|
|
|
config.node_sync_address = cfg.getOr<std::string>("node_sync_address", "localhost:9002");
|
|
|
config.credential_service_address = cfg.getOr<std::string>("credential_service_address", "localhost:9003");
|
|
|
@@ -856,7 +857,11 @@ bool RunnerService::registerWithWebServer() {
|
|
|
// Use HTTP to register with webserver
|
|
|
nlohmann::json body;
|
|
|
body["id"] = config_.runner_id;
|
|
|
- body["address"] = "localhost:" + std::to_string(config_.grpc_port);
|
|
|
+ // localhost is only correct when the webserver shares this host. Where it
|
|
|
+ // does not, the webserver would dial its own machine and find nothing.
|
|
|
+ body["address"] = config_.advertise_address.empty()
|
|
|
+ ? "localhost:" + std::to_string(config_.grpc_port)
|
|
|
+ : config_.advertise_address;
|
|
|
|
|
|
nlohmann::json capabilities;
|
|
|
std::vector<std::string> node_types;
|