summaryrefslogtreecommitdiff
path: root/src/leap/soledad/server/server.tac
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-28 21:01:49 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:08:47 -0300
commit508fa68d7a2a7d7ef68a39df33b4c57e2260dfe6 (patch)
tree5ed0b0c487d93c9318351e66d60d84e559271e4b /src/leap/soledad/server/server.tac
parent75a1e40517329c3f460431ead2d67fd9cf7732dc (diff)
[bug] check for conflicting ports + systemd fixes
-- Related: #8867
Diffstat (limited to 'src/leap/soledad/server/server.tac')
-rw-r--r--src/leap/soledad/server/server.tac8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/leap/soledad/server/server.tac b/src/leap/soledad/server/server.tac
index 1bc3dc69..b443e632 100644
--- a/src/leap/soledad/server/server.tac
+++ b/src/leap/soledad/server/server.tac
@@ -1,14 +1,17 @@
+import sys
import os
from twisted.application import service, strports
from twisted.web import server
+from twisted.python import log
from leap.soledad.server import entrypoint
application = service.Application('soledad-server')
# local entrypoint
-local_description = 'tcp:2323:interface=127.0.0.1'
+local_port = os.getenv('LOCAL_SERVICES_PORT', 2323)
+local_description = 'tcp:%s:interface=127.0.0.1' % local_port
local_site = server.Site(entrypoint.LocalServicesEntrypoint())
local_server = strports.service(local_description, local_site)
@@ -16,6 +19,9 @@ local_server.setServiceParent(application)
# public entrypoint
port = os.getenv('HTTPS_PORT', None)
+if port == local_port:
+ log.err("LOCAL_SERVICES_PORT and HTTPS_PORT can't be the same!")
+ sys.exit(20)
if port:
privateKey = os.getenv('PRIVKEY_PATH', '/etc/soledad/soledad-server.key')
certKey = os.getenv('CERT_PATH', '/etc/soledad/soledad-server.pem')