Enabled profile, change default websocket port

This commit is contained in:
Griatch 2018-01-18 21:55:06 +01:00
parent 03472e0d09
commit 4233298345
3 changed files with 14 additions and 12 deletions

View file

@ -428,16 +428,16 @@ PORTAL_INFO = \
{webserver_proxy}
{webclient}
internal_ports (to Server):
{amp}
{webserver_internal}
{amp}
"""
SERVER_INFO = \
"""{servername} Server {version}
internal ports (to Portal):
{amp}
{webserver}
{amp}
{irc_rss}
{info}
{errors}"""
@ -637,11 +637,11 @@ def _get_twistd_cmdline(pprofiler, sprofiler):
if pprofiler:
portal_cmd.extend(["--savestats",
"--profiler=cprofiler",
"--profiler=cprofile",
"--profile={}".format(PPROFILER_LOGFILE)])
if sprofiler:
server_cmd.extend(["--savestats",
"--profiler=cprofiler",
"--profiler=cprofile",
"--profile={}".format(SPROFILER_LOGFILE)])
return portal_cmd, server_cmd
@ -770,6 +770,8 @@ def start_evennia(pprofiler=False, sprofiler=False):
reactor.stop()
def _portal_started(*args):
print("... Portal started.\nServer starting {} ...".format(
"(under cProfile)" if sprofiler else ""))
wait_for_status_reply(_server_started)
send_instruction(SSTART, server_cmd)
@ -780,11 +782,11 @@ def start_evennia(pprofiler=False, sprofiler=False):
print("Server is already running as process {pid}. Not restarted.".format(pid=spid))
reactor.stop()
else:
print("Server starting {}...".format("(under cProfile)" if pprofiler else ""))
print("Server starting {}...".format("(under cProfile)" if sprofiler else ""))
send_instruction(SSTART, server_cmd, _server_started, _fail)
def _portal_not_running(fail):
print("Portal starting {}...".format("(under cProfile)" if sprofiler else ""))
print("Portal starting {}...".format("(under cProfile)" if pprofiler else ""))
try:
Popen(portal_cmd, env=getenv(), bufsize=-1)
except Exception as e:
@ -1687,7 +1689,7 @@ def main():
elif option == "info":
query_info()
elif option == "start":
start_evennia(False, args.profiler)
start_evennia(args.profiler, args.profiler)
elif option == 'reload':
reload_evennia(args.profiler)
elif option == 'reset':

View file

@ -196,7 +196,7 @@ if AMP_ENABLED:
from evennia.server.portal import amp_server
INFO_DICT["amp"] = 'amp: %s)' % AMP_PORT
INFO_DICT["amp"] = 'amp: %s' % AMP_PORT
factory = amp_server.AMPServerFactory(PORTAL)
amp_service = internet.TCPServer(AMP_PORT, factory, interface=AMP_INTERFACE)
@ -330,7 +330,7 @@ if WEBSERVER_ENABLED:
interface=interface)
proxy_service.setName('EvenniaWebProxy%s' % pstring)
PORTAL.services.addService(proxy_service)
INFO_DICT["webserver_proxy"].append("website%s: %s" % (ifacestr, proxyport))
INFO_DICT["webserver_proxy"].append("webserver-proxy%s: %s" % (ifacestr, proxyport))
INFO_DICT["webserver_internal"].append("webserver: %s" % serverport)

View file

@ -65,7 +65,7 @@ ALLOWED_HOSTS = ["*"]
# the Portal proxy presents to the world. The serverports are
# the internal ports the proxy uses to forward data to the Server-side
# webserver (these should not be publicly open)
WEBSERVER_PORTS = [(4001, 4002)]
WEBSERVER_PORTS = [(4001, 4005)]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
WEBSERVER_INTERFACES = ['0.0.0.0']
# IP addresses that may talk to the server in a reverse proxy configuration,
@ -89,12 +89,12 @@ WEBSOCKET_CLIENT_ENABLED = True
# working through a proxy or docker port-remapping, the environment variable
# WEBCLIENT_CLIENT_PROXY_PORT can be used to override this port only for the
# front-facing client's sake.
WEBSOCKET_CLIENT_PORT = 4005
WEBSOCKET_CLIENT_PORT = 4002
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
WEBSOCKET_CLIENT_INTERFACE = '0.0.0.0'
# Actual URL for webclient component to reach the websocket. You only need
# to set this if you know you need it, like using some sort of proxy setup.
# If given it must be on the form "ws[s]://hostname[:port]". If left at None,
# If given it must be on the form "ws[s]://hostname[:port]". If left at None,
# the client will itself figure out this url based on the server's hostname.
# e.g. ws://external.example.com or wss://external.example.com:443
WEBSOCKET_CLIENT_URL = None