diff options
| author | 2019-03-13 16:52:51 +0000 | |
|---|---|---|
| committer | 2019-03-13 16:52:51 +0000 | |
| commit | 4058608bf2359a998857515030efda5035e93862 (patch) | |
| tree | d522a7b56f41b4d72aa5d546fb4040bca305a943 | |
| parent | move `code` in to the string format arg for log functions (diff) | |
| signature | ||
Add 'api-port' setting to bot.conf and use it in rest_api.py
| -rw-r--r-- | bot.conf.example | 1 | ||||
| -rw-r--r-- | modules/rest_api.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/bot.conf.example b/bot.conf.example index 6f0a493c..4335124b 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -9,6 +9,7 @@ tls-certificate = # key/cert used for REST API tls-api-key = tls-api-certificate = +api-port = # the default channel BitBot automatically joins bot-channel = diff --git a/modules/rest_api.py b/modules/rest_api.py index bd5aca40..4784aa60 100644 --- a/modules/rest_api.py +++ b/modules/rest_api.py @@ -126,7 +126,8 @@ class Module(ModuleManager.BaseModule): self.httpd = None if self.bot.get_setting("rest-api", False): - self.httpd = http.server.HTTPServer(("", 5000), Handler) + port = int(self.bot.config.get("api-port", "5000")) + self.httpd = http.server.HTTPServer(("", port), Handler) self.httpd.socket = utils.security.ssl_wrap(self.httpd.socket, cert=self.bot.config["tls-api-certificate"], |
