From 35ece0ef387d5a9026b60cbb8ca6b5ec295aa797 Mon Sep 17 00:00:00 2001 From: David Rubin Date: Mon, 18 Jan 2010 22:36:02 +0200 Subject: [PATCH] Moved default user settings to config.ini --- development.ini | 4 ++++ scribeengine/websetup.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/development.ini b/development.ini index db85be5..4b90136 100644 --- a/development.ini +++ b/development.ini @@ -38,6 +38,10 @@ paths.images = %(here)s/images # Themes directory paths.themes = %(here)s/themes +default.user.password = p4ssw0rd +default.user.email = admin@scribeengine.org +default.user.nick = Admin + # Security settings security.salt = secretsalt diff --git a/scribeengine/websetup.py b/scribeengine/websetup.py index cc90443..5e9bd66 100644 --- a/scribeengine/websetup.py +++ b/scribeengine/websetup.py @@ -57,10 +57,10 @@ def setup_app(command, conf, vars): role_admin = Role(name=u'Administrator') role_admin.permissions.extend([perm_addposts, perm_editmyposts, perm_delmyposts]) - password = unicode(hmac.new(conf[u'security.salt'], u'password', + password = unicode(hmac.new(conf[u'security.salt'], conf[u'default.user.password'], hashlib.sha256).hexdigest(), u'utf-8') - user = User(email=u'admin@scribeengine.org', - password=password, nick=u'admin') + user = User(email=conf[u'default.user.email'], + password=password, nick=conf[u'default.user.nick']) user.roles.append(role_admin) Session.add_all([blog_title, blog_slogan, user])