Change default ports and add clearer default to gamedir template, as per #1365.

This commit is contained in:
Griatch 2017-07-21 13:40:48 +02:00
parent 6c8101355d
commit 8cad0dc02e
7 changed files with 67 additions and 44 deletions

View file

@ -5,7 +5,7 @@
# on DockerHub, which can be used as the basis for creating # on DockerHub, which can be used as the basis for creating
# an Evennia game within a container. This base image can be # an Evennia game within a container. This base image can be
# found in DockerHub at https://hub.docker.com/r/evennia/evennia/ # found in DockerHub at https://hub.docker.com/r/evennia/evennia/
# #
# For more information on using it to build a container to run your game, see # For more information on using it to build a container to run your game, see
# #
# https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker # https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker
@ -26,7 +26,7 @@ RUN pip install -e /usr/src/evennia
ONBUILD ADD . /usr/src/game ONBUILD ADD . /usr/src/game
# make the game source hierarchy persistent with a named volume. # make the game source hierarchy persistent with a named volume.
# during development this is typically superceded by directives in # during development this is typically superceded by directives in
# docker-compose.yml or the CLI to mount a local directory. # docker-compose.yml or the CLI to mount a local directory.
VOLUME /usr/src/game VOLUME /usr/src/game
@ -36,5 +36,5 @@ WORKDIR /usr/src/game
# startup command # startup command
CMD ["evennia", "-i", "start"] CMD ["evennia", "-i", "start"]
# expose the default ports # expose the telnet, webserver and websocket client ports
EXPOSE 8000 8001 4000 EXPOSE 4000 4001 4005

View file

@ -2,7 +2,7 @@
# Evennia installation # Evennia installation
The latest and more detailed installation instructions can be found The latest and more detailed installation instructions can be found
[here](https://github.com/evennia/evennia/wiki/Getting-Started). [here](https://github.com/evennia/evennia/wiki/Getting-Started).
## Installing Python ## Installing Python
@ -37,7 +37,7 @@ virtualenv vienv
``` ```
A new folder `vienv` will be created (you could also name it something A new folder `vienv` will be created (you could also name it something
else if you prefer). Activate the virtual environment like this: else if you prefer). Activate the virtual environment like this:
``` ```
# for Linux/Unix/Mac: # for Linux/Unix/Mac:
@ -64,13 +64,13 @@ git clone https://github.com/evennia/evennia.git
If you have a github account and have [set up SSH If you have a github account and have [set up SSH
keys](https://help.github.com/articles/generating-ssh-keys/), you want keys](https://help.github.com/articles/generating-ssh-keys/), you want
to use this instead: to use this instead:
``` ```
git clone git@github.com:evennia/evennia.git git clone git@github.com:evennia/evennia.git
``` ```
In the future you just enter the new `evennia` folder and do In the future you just enter the new `evennia` folder and do
``` ```
git pull git pull
@ -78,7 +78,7 @@ git pull
to get the latest Evennia updates. to get the latest Evennia updates.
## Evennia package install ## Evennia package install
Stand at the root of your new `evennia` directory and run Stand at the root of your new `evennia` directory and run
@ -90,12 +90,12 @@ pip install -e .
current directory). This will install Evennia and all its dependencies current directory). This will install Evennia and all its dependencies
(into your virtualenv if you are using that) and make the `evennia` (into your virtualenv if you are using that) and make the `evennia`
command available on the command line. You can find Evennia's command available on the command line. You can find Evennia's
dependencies in `evennia/requirements.txt`. dependencies in `evennia/requirements.txt`.
## Creating your game project ## Creating your game project
To create your new game you need to initialize a new game project. To create your new game you need to initialize a new game project.
This should be done somewhere *outside* of your `evennia` folder. This should be done somewhere *outside* of your `evennia` folder.
``` ```
@ -118,10 +118,10 @@ evennia start
Follow the instructions to create your superuser account. A lot of Follow the instructions to create your superuser account. A lot of
information will scroll past as the database is created and the server information will scroll past as the database is created and the server
initializes. After this Evennia will be running. Use initializes. After this Evennia will be running. Use
``` ```
evennia -h evennia -h
``` ```
for help with starting, stopping and other operations. for help with starting, stopping and other operations.
@ -131,7 +131,7 @@ port *4000*. If you are just running locally the server name is
*localhost*. *localhost*.
Alternatively, you can find the web interface and webclient by Alternatively, you can find the web interface and webclient by
pointing your web browser to *http://localhost:8000*. pointing your web browser to *http://localhost:4001*.
Finally, login with the superuser account and password you provided Finally, login with the superuser account and password you provided
earlier. Welcome to Evennia! earlier. Welcome to Evennia!

View file

@ -25,16 +25,16 @@ To start the server, stand in this directory and run
This will start the server, logging output to the console. Make This will start the server, logging output to the console. Make
sure to create a superuser when asked. By default you can now connect sure to create a superuser when asked. By default you can now connect
to your new game using a MUD client on `localhost`, port `4000`. You can to your new game using a MUD client on `localhost`, port `4000`. You can
also log into the web client by pointing a browser to also log into the web client by pointing a browser to
`http://localhost:8000`. `http://localhost:4001`.
# Getting started # Getting started
From here on you might want to look at one of the beginner tutorials: From here on you might want to look at one of the beginner tutorials:
http://github.com/evennia/evennia/wiki/Tutorials. http://github.com/evennia/evennia/wiki/Tutorials.
Evennia's documentation is here: Evennia's documentation is here:
https://github.com/evennia/evennia/wiki. https://github.com/evennia/evennia/wiki.
Enjoy! Enjoy!

View file

@ -34,6 +34,27 @@ from evennia.settings_default import *
# This is the name of your game. Make it catchy! # This is the name of your game. Make it catchy!
SERVERNAME = {servername} SERVERNAME = {servername}
# Server ports. If enabled and marked as "visible", the port
# should be visible to the outside world on a production server.
# Note that there are many more options available beyond these.
# Telnet ports. Visible.
TELNET_ENABLED = True
TELNET_PORTS = [4000]
# (proxy, internal). Only proxy should be visible.
WEBSERVER_ENABLED = True
WEBSERVER_PORTS = [(4001, 4002)]
# Telnet+SSL ports, for supporting clients. Visible.
SSL_ENABLED = False
SSL_PORTS = [4003]
# SSH client ports. Requires crypto lib. Visible.
SSH_ENABLED = False
SSH_PORTS = [4004]
# Websocket-client port. Visible.
WEBSOCKET_CLIENT_ENABLED = True
WEBSOCKET_CLIENT_PORT = 4005
# Internal Server-Portal port. Not visible.
AMP_PORT = 4006
###################################################################### ######################################################################
# Settings given in secret_settings.py override those in this file. # Settings given in secret_settings.py override those in this file.

View file

@ -528,7 +528,7 @@ def create_settings_file(init=True, secret_settings=False):
settings_path = os.path.join(GAMEDIR, "server", "conf", "settings.py") settings_path = os.path.join(GAMEDIR, "server", "conf", "settings.py")
setting_dict = { setting_dict = {
"settings_default": os.path.join(EVENNIA_LIB, "settings_default.py"), "settings_default": os.path.join(EVENNIA_LIB, "settings_default.py"),
"servername": "\"%s\"" % GAMEDIR.rsplit(os.path.sep, 1)[1].capitalize(), "servername": "\"%s\"" % GAMEDIR.rsplit(os.path.sep, 1)[1],
"secret_key": "\'%s\'" % create_secret_key()} "secret_key": "\'%s\'" % create_secret_key()}
if not init: if not init:

View file

@ -4,8 +4,8 @@ AJAX/COMET fallback webclient
The AJAX/COMET web client consists of two components running on The AJAX/COMET web client consists of two components running on
twisted and django. They are both a part of the Evennia website url twisted and django. They are both a part of the Evennia website url
tree (so the testing website might be located on tree (so the testing website might be located on
http://localhost:8000/, whereas the webclient can be found on http://localhost:4001/, whereas the webclient can be found on
http://localhost:8000/webclient.) http://localhost:4001/webclient.)
/webclient - this url is handled through django's template /webclient - this url is handled through django's template
system and serves the html page for the client system and serves the html page for the client
@ -33,7 +33,7 @@ from evennia.server import session
_CLIENT_SESSIONS = utils.mod_import(settings.SESSION_ENGINE).SessionStore _CLIENT_SESSIONS = utils.mod_import(settings.SESSION_ENGINE).SessionStore
_RE_SCREENREADER_REGEX = re.compile(r"%s" % settings.SCREENREADER_REGEX_STRIP, re.DOTALL + re.MULTILINE) _RE_SCREENREADER_REGEX = re.compile(r"%s" % settings.SCREENREADER_REGEX_STRIP, re.DOTALL + re.MULTILINE)
_SERVERNAME = settings.SERVERNAME _SERVERNAME = settings.SERVERNAME
_KEEPALIVE = 30 # how often to check keepalive _KEEPALIVE = 30 # how often to check keepalive
# defining a simple json encoder for returning # defining a simple json encoder for returning
# django data to the client. Might need to # django data to the client. Might need to

View file

@ -32,6 +32,12 @@ TELNET_ENABLED = True
TELNET_PORTS = [4000] TELNET_PORTS = [4000]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6. # Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
TELNET_INTERFACES = ['0.0.0.0'] TELNET_INTERFACES = ['0.0.0.0']
# Activate Telnet+SSL protocol (SecureSocketLibrary) for supporting clients
SSL_ENABLED = False
# Ports to use for Telnet+SSL
SSL_PORTS = [4003]
# Telnet+SSL Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
SSL_INTERFACES = ['0.0.0.0']
# OOB (out-of-band) telnet communication allows Evennia to communicate # OOB (out-of-band) telnet communication allows Evennia to communicate
# special commands and data with enabled Telnet clients. This is used # special commands and data with enabled Telnet clients. This is used
# to create custom client interfaces over a telnet connection. To make # to create custom client interfaces over a telnet connection. To make
@ -39,6 +45,12 @@ TELNET_INTERFACES = ['0.0.0.0']
# server-side (see INPUT_FUNC_MODULES). TELNET_ENABLED is required for this # server-side (see INPUT_FUNC_MODULES). TELNET_ENABLED is required for this
# to work. # to work.
TELNET_OOB_ENABLED = False TELNET_OOB_ENABLED = False
# Activate SSH protocol communication (SecureShell)
SSH_ENABLED = False
# Ports to use for SSH
SSH_PORTS = [4004]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
SSH_INTERFACES = ['0.0.0.0']
# Start the evennia django+twisted webserver so you can # Start the evennia django+twisted webserver so you can
# browse the evennia website and the admin interface # browse the evennia website and the admin interface
# (Obs - further web configuration can be found below # (Obs - further web configuration can be found below
@ -53,7 +65,7 @@ ALLOWED_HOSTS = ["*"]
# the Portal proxy presents to the world. The serverports are # the Portal proxy presents to the world. The serverports are
# the internal ports the proxy uses to forward data to the Server-side # the internal ports the proxy uses to forward data to the Server-side
# webserver (these should not be publicly open) # webserver (these should not be publicly open)
WEBSERVER_PORTS = [(8000, 5001)] WEBSERVER_PORTS = [(4001, 4002)]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6. # Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
WEBSERVER_INTERFACES = ['0.0.0.0'] WEBSERVER_INTERFACES = ['0.0.0.0']
# IP addresses that may talk to the server in a reverse proxy configuration, # IP addresses that may talk to the server in a reverse proxy configuration,
@ -68,11 +80,11 @@ WEBSERVER_THREADPOOL_LIMITS = (1, 20)
# the websocket one. # the websocket one.
WEBCLIENT_ENABLED = True WEBCLIENT_ENABLED = True
# Activate Websocket support for modern browsers. If this is on, the # Activate Websocket support for modern browsers. If this is on, the
# default webclient will use this and only use the ajax version of the browser # default webclient will use this and only use the ajax version if the browser
# is too old to support websockets. Requires WEBCLIENT_ENABLED. # is too old to support websockets. Requires WEBCLIENT_ENABLED.
WEBSOCKET_CLIENT_ENABLED = True WEBSOCKET_CLIENT_ENABLED = True
# Server-side websocket port to open for the webclient. # Server-side websocket port to open for the webclient.
WEBSOCKET_CLIENT_PORT = 8001 WEBSOCKET_CLIENT_PORT = 4005
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6. # Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
WEBSOCKET_CLIENT_INTERFACE = '0.0.0.0' WEBSOCKET_CLIENT_INTERFACE = '0.0.0.0'
# Actual URL for webclient component to reach the websocket. You only need # Actual URL for webclient component to reach the websocket. You only need
@ -81,21 +93,19 @@ WEBSOCKET_CLIENT_INTERFACE = '0.0.0.0'
# be automatically appended). If left at None, the client will itself # be automatically appended). If left at None, the client will itself
# figure out this url based on the server's hostname. # figure out this url based on the server's hostname.
WEBSOCKET_CLIENT_URL = None WEBSOCKET_CLIENT_URL = None
# Activate SSH protocol communication (SecureShell)
SSH_ENABLED = False
# Ports to use for SSH
SSH_PORTS = [8022]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
SSH_INTERFACES = ['0.0.0.0']
# Activate SSL protocol (SecureSocketLibrary)
SSL_ENABLED = False
# Ports to use for SSL
SSL_PORTS = [4001]
# Interface addresses to listen to. If 0.0.0.0, listen to all. Use :: for IPv6.
SSL_INTERFACES = ['0.0.0.0']
# This determine's whether Evennia's custom admin page is used, or if the # This determine's whether Evennia's custom admin page is used, or if the
# standard Django admin is used. # standard Django admin is used.
EVENNIA_ADMIN = True EVENNIA_ADMIN = True
# The Server opens an AMP port so that the portal can
# communicate with it. This is an internal functionality of Evennia, usually
# operating between two processes on the same machine. You usually don't need to
# change this unless you cannot use the default AMP port/host for
# whatever reason.
AMP_HOST = 'localhost'
AMP_PORT = 4006
AMP_INTERFACE = '127.0.0.1'
# Path to the lib directory containing the bulk of the codebase's code. # Path to the lib directory containing the bulk of the codebase's code.
EVENNIA_DIR = os.path.dirname(os.path.abspath(__file__)) EVENNIA_DIR = os.path.dirname(os.path.abspath(__file__))
# Path to the game directory (containing the server/conf/settings.py file) # Path to the game directory (containing the server/conf/settings.py file)
@ -162,14 +172,6 @@ ENCODINGS = ["utf-8", "latin-1", "ISO-8859-1"]
# of users with screen readers. Note that ANSI/MXP doesn't need to # of users with screen readers. Note that ANSI/MXP doesn't need to
# be stripped this way, that is handled automatically. # be stripped this way, that is handled automatically.
SCREENREADER_REGEX_STRIP = r"\+-+|\+$|\+~|--+|~~+|==+" SCREENREADER_REGEX_STRIP = r"\+-+|\+$|\+~|--+|~~+|==+"
# The game server opens an AMP port so that the portal can
# communicate with it. This is an internal functionality of Evennia, usually
# operating between two processes on the same machine. You usually don't need to
# change this unless you cannot use the default AMP port/host for
# whatever reason.
AMP_HOST = 'localhost'
AMP_PORT = 5000
AMP_INTERFACE = '127.0.0.1'
# Database objects are cached in what is known as the idmapper. The idmapper # Database objects are cached in what is known as the idmapper. The idmapper
# caching results in a massive speedup of the server (since it dramatically # caching results in a massive speedup of the server (since it dramatically
# limits the number of database accesses needed) and also allows for # limits the number of database accesses needed) and also allows for