X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/db245eaf61b357b35c8d6e743e737fd2a7a8444e..a504eefd8719a52b14217c2a1152db151504f99a:/wizard/app/wordpress.py diff --git a/wizard/app/wordpress.py b/wizard/app/wordpress.py index add10ff..7999089 100644 --- a/wizard/app/wordpress.py +++ b/wizard/app/wordpress.py @@ -2,6 +2,7 @@ import os import re import logging import distutils +import distutils.version import urlparse import hashlib import sqlalchemy.exc @@ -24,6 +25,10 @@ seed = util.dictmap(make_filename_regex_define, { 'WIZARD_SECURE_AUTH_KEY': 'SECURE_AUTH_KEY', 'WIZARD_LOGGED_IN_KEY': 'LOGGED_IN_KEY', 'WIZARD_NONCE_KEY': 'NONCE_KEY', + 'WIZARD_AUTH_SALT': 'AUTH_SALT', + 'WIZARD_SECURE_AUTH_SALT': 'SECURE_AUTH_SALT', + 'WIZARD_LOGGED_IN_SALT': 'LOGGED_IN_SALT', + 'WIZARD_NONCE_SALT': 'NONCE_SALT', }) class Application(app.Application): @@ -35,12 +40,25 @@ class Application(app.Application): substitutions.update(php.substitutions) install_schema = install.ArgSchema("db", "admin", "email", "title") deprecated_keys = set(['WIZARD_SECRETKEY']) - random_keys = set(['WIZARD_SECRETKEY', 'WIZARD_AUTH_KEY', 'WIZARD_SECURE_AUTH_KEY', 'WIZARD_LOGGED_IN_KEY', 'WIZARD_NONCE_KEY']) + random_keys = set([ + 'WIZARD_SECRETKEY', + 'WIZARD_AUTH_KEY', + 'WIZARD_SECURE_AUTH_KEY', + 'WIZARD_LOGGED_IN_KEY', + 'WIZARD_NONCE_KEY', + 'WIZARD_AUTH_SALT', + 'WIZARD_SECURE_AUTH_SALT', + 'WIZARD_LOGGED_IN_SALT', + 'WIZARD_NONCE_SALT', + ]) random_blacklist = set(['put your unique phrase here']) def urlFromExtract(self, deployment): try: meta = sql.connect(deployment.dsn) - wp_options = meta.tables["wp_options"] + try: + wp_options = meta.tables["wp_options"] + except KeyError: + return None query = wp_options.select(wp_options.c.option_name == 'home') return query.execute().fetchone()['option_value'] except sqlalchemy.exc.OperationalError: @@ -52,7 +70,7 @@ class Application(app.Application): def checkWeb(self, deployment): return self.checkWebPage(deployment, "", outputs=["