Make internal/external ports clearer in wake of port changes

This commit is contained in:
Griatch 2017-09-23 13:55:01 +02:00
parent 8f9cbfd97d
commit 6f56ba71ce
2 changed files with 14 additions and 16 deletions

View file

@ -192,7 +192,7 @@ if AMP_ENABLED:
from evennia.server import amp from evennia.server import amp
print(' amp (to Server): %s' % AMP_PORT) print(' amp (to Server): %s (internal)' % AMP_PORT)
factory = amp.AmpClientFactory(PORTAL) factory = amp.AmpClientFactory(PORTAL)
amp_client = internet.TCPClient(AMP_HOST, AMP_PORT, factory) amp_client = internet.TCPClient(AMP_HOST, AMP_PORT, factory)
@ -223,7 +223,7 @@ if TELNET_ENABLED:
telnet_service.setName('EvenniaTelnet%s' % pstring) telnet_service.setName('EvenniaTelnet%s' % pstring)
PORTAL.services.addService(telnet_service) PORTAL.services.addService(telnet_service)
print(' telnet%s: %s' % (ifacestr, port)) print(' telnet%s: %s (external)' % (ifacestr, port))
if SSL_ENABLED: if SSL_ENABLED:
@ -249,7 +249,7 @@ if SSL_ENABLED:
ssl_service.setName('EvenniaSSL%s' % pstring) ssl_service.setName('EvenniaSSL%s' % pstring)
PORTAL.services.addService(ssl_service) PORTAL.services.addService(ssl_service)
print(" ssl%s: %s" % (ifacestr, port)) print(" ssl%s: %s (external)" % (ifacestr, port))
if SSH_ENABLED: if SSH_ENABLED:
@ -273,7 +273,7 @@ if SSH_ENABLED:
ssh_service.setName('EvenniaSSH%s' % pstring) ssh_service.setName('EvenniaSSH%s' % pstring)
PORTAL.services.addService(ssh_service) PORTAL.services.addService(ssh_service)
print(" ssh%s: %s" % (ifacestr, port)) print(" ssh%s: %s (external)" % (ifacestr, port))
if WEBSERVER_ENABLED: if WEBSERVER_ENABLED:
@ -287,7 +287,6 @@ if WEBSERVER_ENABLED:
if interface not in ('0.0.0.0', '::') or len(WEBSERVER_INTERFACES) > 1: if interface not in ('0.0.0.0', '::') or len(WEBSERVER_INTERFACES) > 1:
ifacestr = "-%s" % interface ifacestr = "-%s" % interface
for proxyport, serverport in WEBSERVER_PORTS: for proxyport, serverport in WEBSERVER_PORTS:
pstring = "%s:%s<->%s" % (ifacestr, proxyport, serverport)
web_root = EvenniaReverseProxyResource('127.0.0.1', serverport, '') web_root = EvenniaReverseProxyResource('127.0.0.1', serverport, '')
webclientstr = "" webclientstr = ""
if WEBCLIENT_ENABLED: if WEBCLIENT_ENABLED:
@ -305,21 +304,20 @@ if WEBSERVER_ENABLED:
from evennia.server.portal import webclient from evennia.server.portal import webclient
from evennia.utils.txws import WebSocketFactory from evennia.utils.txws import WebSocketFactory
interface = WEBSOCKET_CLIENT_INTERFACE w_interface = WEBSOCKET_CLIENT_INTERFACE
w_ifacestr = ''
if w_interface not in ('0.0.0.0', '::') or len(WEBSERVER_INTERFACES) > 1:
w_ifacestr = "-%s" % interface
port = WEBSOCKET_CLIENT_PORT port = WEBSOCKET_CLIENT_PORT
ifacestr = ""
if interface not in ('0.0.0.0', '::'):
ifacestr = "-%s" % interface
pstring = "%s:%s" % (ifacestr, port)
factory = protocol.ServerFactory() factory = protocol.ServerFactory()
factory.noisy = False factory.noisy = False
factory.protocol = webclient.WebSocketClient factory.protocol = webclient.WebSocketClient
factory.sessionhandler = PORTAL_SESSIONS factory.sessionhandler = PORTAL_SESSIONS
websocket_service = internet.TCPServer(port, WebSocketFactory(factory), interface=interface) websocket_service = internet.TCPServer(port, WebSocketFactory(factory), interface=w_interface)
websocket_service.setName('EvenniaWebSocket%s' % pstring) websocket_service.setName('EvenniaWebSocket%s:%s' % (w_ifacestr, proxyport))
PORTAL.services.addService(websocket_service) PORTAL.services.addService(websocket_service)
websocket_started = True websocket_started = True
webclientstr = "\n + webclient%s" % pstring webclientstr = "\n + webclient-websocket%s: %s (external)" % (w_ifacestr, proxyport)
web_root = Website(web_root, logPath=settings.HTTP_LOG_FILE) web_root = Website(web_root, logPath=settings.HTTP_LOG_FILE)
proxy_service = internet.TCPServer(proxyport, proxy_service = internet.TCPServer(proxyport,
@ -327,7 +325,7 @@ if WEBSERVER_ENABLED:
interface=interface) interface=interface)
proxy_service.setName('EvenniaWebProxy%s' % pstring) proxy_service.setName('EvenniaWebProxy%s' % pstring)
PORTAL.services.addService(proxy_service) PORTAL.services.addService(proxy_service)
print(" webproxy%s:%s (<-> %s)%s" % (ifacestr, proxyport, serverport, webclientstr)) print(" website-proxy%s: %s (external) %s" % (ifacestr, proxyport, webclientstr))
for plugin_module in PORTAL_SERVICES_PLUGIN_MODULES: for plugin_module in PORTAL_SERVICES_PLUGIN_MODULES:

View file

@ -546,7 +546,7 @@ if AMP_ENABLED:
ifacestr = "" ifacestr = ""
if AMP_INTERFACE != '127.0.0.1': if AMP_INTERFACE != '127.0.0.1':
ifacestr = "-%s" % AMP_INTERFACE ifacestr = "-%s" % AMP_INTERFACE
print(' amp (to Portal)%s: %s' % (ifacestr, AMP_PORT)) print(' amp (to Portal)%s: %s (internal)' % (ifacestr, AMP_PORT))
from evennia.server import amp from evennia.server import amp
@ -586,7 +586,7 @@ if WEBSERVER_ENABLED:
webserver.setName('EvenniaWebServer%s' % serverport) webserver.setName('EvenniaWebServer%s' % serverport)
EVENNIA.services.addService(webserver) EVENNIA.services.addService(webserver)
print(" webserver: %s" % serverport) print(" webserver: %s (internal)" % serverport)
ENABLED = [] ENABLED = []
if IRC_ENABLED: if IRC_ENABLED: