From cd7b571da071a4af4afd978b920e1b8372c880a3 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 13 Feb 2017 15:55:38 -0800 Subject: [PATCH] Add a local.conf option to set the port. --- service/OneService.cpp | 1 + service/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/service/OneService.cpp b/service/OneService.cpp index d56333c09..aa90798fd 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -987,6 +987,7 @@ public: _interfacePrefixBlacklist.clear(); json &settings = _localConfig["settings"]; if (settings.is_object()) { + _primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff; _portMappingEnabled = OSUtils::jsonBool(settings["portMappingEnabled"],true); const std::string up(OSUtils::jsonString(settings["softwareUpdate"],ZT_SOFTWARE_UPDATE_DEFAULT)); diff --git a/service/README.md b/service/README.md index d3bc5338a..bdf713c1c 100644 --- a/service/README.md +++ b/service/README.md @@ -24,6 +24,7 @@ Settings available in `local.conf` (this is not valid JSON, and JSON does not al } }, "settings": { /* Other global settings */ + "primaryPort": 0-65535, /* If set, override default port of 9993 and any command line port */ "portMappingEnabled": true|false, /* If true (the default), try to use uPnP or NAT-PMP to map ports */ "softwareUpdate": "apply"|"download"|"disable", /* Automatically apply updates, just download, or disable built-in software updates */ "softwareUpdateDist": true|false, /* If true, distribute software updates (only really useful to ZeroTier, Inc. itself, default is false) */