diff --git a/game/manage.py b/game/manage.py index e93e3b76d2..c388cfb85e 100755 --- a/game/manage.py +++ b/game/manage.py @@ -29,6 +29,12 @@ if not os.path.exists('settings.py'): # If settings.py doesn't already exist, create it and populate it with some # basic stuff. + # make random secret_key. + import random, string + secret_key = list((string.letters + string.digits + string.punctuation).replace("'",'"')) + random.shuffle(secret_key) + secret_key = "".join(secret_key[:40]) + settings_file = open('settings.py', 'w') _CREATED_SETTINGS = True @@ -46,54 +52,63 @@ if not os.path.exists('settings.py'): from src.settings_default import * -################################################### +###################################################################### # Evennia base server config -################################################### +###################################################################### -################################################### +###################################################################### # Evennia Database config -################################################### +###################################################################### -################################################### +###################################################################### # Evennia pluggable modules -################################################### +###################################################################### -################################################### +###################################################################### # Default command sets -################################################### +###################################################################### -################################################### +###################################################################### # Typeclasses -################################################### +###################################################################### -################################################### +###################################################################### # Batch processors -################################################### +###################################################################### -################################################### +###################################################################### # Game Time setup -################################################### +###################################################################### -################################################### +###################################################################### # In-game access -################################################### +###################################################################### -################################################### +###################################################################### # In-game Channels created from server start -################################################### +###################################################################### -################################################### +###################################################################### # External Channel connections -################################################### +###################################################################### -################################################### +###################################################################### # Config for Django web features -################################################### +###################################################################### -################################################### +###################################################################### # Evennia components -################################################### -""" +###################################################################### + +###################################################################### +# SECRET_KEY was randomly seeded when settings.py was first created. +# Don't share this with anybody. Warning: if you edit SECRET_KEY +# *after* creating any accounts, your users won't be able to login, +# since SECRET_KEY is used to salt passwords. +###################################################################### +SECRET_KEY = '%s' + +""" % secret_key settings_file.write(string) settings_file.close() diff --git a/src/settings_default.py b/src/settings_default.py index bf04b32696..3eca481319 100644 --- a/src/settings_default.py +++ b/src/settings_default.py @@ -7,17 +7,17 @@ All settings changes should be done by copy-pasting the variable and its value to game/settings.py. An empty game/settings.py can be auto-generated by running game/manage.py without any arguments. -Hint: Don't copy&paste over more from this file than you actually want to -change. Anything you don't copy&paste will thus retain its default +Hint: Don't copy&paste over more from this file than you actually want +to change. Anything you don't copy&paste will thus retain its default value - which may change as Evennia is developed. This way you can always be sure of what you have changed and what is default behaviour. """ import os -################################################### +###################################################################### # Evennia base server config -################################################### +###################################################################### # This is the name of your game. Make it catchy! SERVERNAME = "Evennia" @@ -58,10 +58,6 @@ SSL_INTERFACES = ['0.0.0.0'] # If false, only one session is allowed, all other are logged off # when a new connects. ALLOW_MULTISESSION = True -# Make this unique, and don't share it with anybody. -# NOTE: If you change this after creating any accounts, your users won't be -# able to login, as the SECRET_KEY is used to salt passwords. -SECRET_KEY = 'changeme!(*#&*($&*(#*(&SDFKJJKLS*(@#KJAS' # The path that contains this settings.py file (no trailing slash). BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Path to the src directory containing the bulk of the codebase's code. @@ -108,9 +104,9 @@ ENCODINGS = ["utf-8", "latin-1", "ISO-8859-1"] AMP_HOST = 'localhost' AMP_PORT = 5000 -################################################### +###################################################################### # Evennia Database config -################################################### +###################################################################### # Database config syntax for Django 1.2+. You can add several # database engines in the dictionary (untested). @@ -141,9 +137,9 @@ DATABASE_PASSWORD = '' DATABASE_HOST = '' DATABASE_PORT = '' -################################################### +###################################################################### # Evennia pluggable modules -################################################### +###################################################################### # An alternate command parser module to use COMMAND_PARSER = "src.commands.cmdparser.cmdparser" @@ -166,14 +162,15 @@ AT_INITIAL_SETUP_HOOK_MODULE = "" # Module holding at_server_start(), at_server_reload() and # at_server_stop() methods. These methods will be called every time # the server starts, reloads and resets/stops. -AT_SERVER_STARTSTOP_MODULE = ""# Module holding server-side functions for out-of-band protocols to call. +AT_SERVER_STARTSTOP_MODULE = "" +# Module holding server-side functions for out-of-band protocols to call. OOB_FUNC_MODULE = "" # Module holding MSSP meta data MSSP_META_MODULE = "" -################################################### +###################################################################### # Default command sets -################################################### +###################################################################### # Note that with the exception of the unloggedin set (which is not # stored anywhere), changing these paths will only affect NEW created # characters, not those already in play. So if you plan to change @@ -188,9 +185,9 @@ CMDSET_DEFAULT = "src.commands.default.cmdset_default.DefaultCmdSet" # Command set for players without a character (ooc) CMDSET_OOC = "src.commands.default.cmdset_ooc.OOCCmdSet" -################################################### +###################################################################### # Typeclasses -################################################### +###################################################################### # Base paths for typeclassed object classes. These paths must be # defined relative evennia's root directory. They will be searched in @@ -217,17 +214,17 @@ BASE_SCRIPT_TYPECLASS = "src.scripts.scripts.DoNothing" # src/commands/default/unloggedin.py and customize. CHARACTER_DEFAULT_HOME = "2" -################################################### +###################################################################### # Batch processors -################################################### +###################################################################### # Python path to a directory to be searched for batch scripts # for the batch processors (.ev and/or .py files). BASE_BATCHPROCESS_PATHS = ['game.gamesrc.world', 'contrib'] -################################################### +###################################################################### # Game Time setup -################################################### +###################################################################### # You don't actually have to use this, but it affects the routines in # src.utils.gametime.py and allows for a convenient measure to @@ -247,9 +244,9 @@ TIME_WEEK_PER_MONTH = 4 TIME_MONTH_PER_YEAR = 12 -################################################### +###################################################################### # In-Game access -################################################### +###################################################################### # The access hiearchy, in climbing order. A higher permission in the # hierarchy includes access of all levels below it. @@ -261,9 +258,9 @@ PERMISSION_PLAYER_DEFAULT = "Players" LOCK_FUNC_MODULES = ("src.locks.lockfuncs",) -################################################### +###################################################################### # In-game Channels created from server start -################################################### +###################################################################### # Defines a dict with one key for each from-start # channel. Each key points to a tuple containing @@ -280,9 +277,9 @@ CHANNEL_MUDINFO = ("MUDinfo", '', 'Informative messages', CHANNEL_CONNECTINFO = ("MUDconnections", '', 'Connection log', "control:perm(Immortals);listen:perm(Wizards);send:false()") -################################################### +###################################################################### # External Channel connections -################################################### +###################################################################### # Note: You do *not* have to make your MUD open to # the public to use the external connections, they @@ -321,9 +318,9 @@ IMC2_SERVER_PWD = "" RSS_ENABLED=False RSS_UPDATE_INTERVAL = 60*10 # 10 minutes -################################################### +###################################################################### # Config for Django web features -################################################### +###################################################################### # While DEBUG is False, show a regular server error page on the web # stuff, email the traceback to the people in the ADMINS tuple @@ -417,9 +414,9 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.debug', 'src.web.utils.general_context.general_context',) -################################################### +###################################################################### # Evennia components -################################################### +###################################################################### # Global and Evennia-specific apps. This ties everything together so we can # refer to app models and perform DB syncs. @@ -445,9 +442,9 @@ AUTH_PROFILE_MODULE = "players.PlayerDB" # Use a custom test runner that just tests Evennia-specific apps. TEST_RUNNER = 'src.utils.test_utils.EvenniaTestSuiteRunner' -################################################### +###################################################################### # Django extensions -################################################### +###################################################################### # Django extesions are useful third-party tools that are not # always included in the default django distro. @@ -456,9 +453,19 @@ try: INSTALLED_APPS = INSTALLED_APPS + ('django_extensions',) except ImportError: pass -# South handles automatic database scheme migrations when evennia updates +# South handles automatic database scheme migrations when evennia +# updates try: import south INSTALLED_APPS = INSTALLED_APPS + ('south',) except ImportError: pass + +####################################################################### +# SECRET_KEY +####################################################################### +# This is the salt for account passwords. It is a fallback for the +# SECRET_KEY setting in settings.py, which is randomly seeded when +# settings.py is first created. If copying from here, make sure to +# change it! +SECRET_KEY = 'changeme!(*#&*($&*(#*(&SDFKJJKLS*(@#KJAS'