X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/32a088acc77f804c4862362061a1a9f7838b88b6..d2221e2bb2203f73d633d0aeccabf2b0002a4e8a:/wizard/app/wordpress.py diff --git a/wizard/app/wordpress.py b/wizard/app/wordpress.py index 9bc112f..742881b 100644 --- a/wizard/app/wordpress.py +++ b/wizard/app/wordpress.py @@ -1,23 +1,27 @@ import os import re import logging +import distutils +import urlparse from wizard import app, install, resolve, sql, util from wizard.app import php -# XXX: We probably want to separate out the re.compile() line def make_filename_regex_define(var): - return 'wp-config.php', re.compile('^(define\(\'' + app.expand_re(var) + r''''\s*,\s*)(.*)(\);)''', re.M) + return 'wp-config.php', php.re_define(var) seed = util.dictmap(make_filename_regex_define, { + # these funny names are due to convention set by MediaWiki 'WIZARD_DBSERVER': 'DB_HOST', 'WIZARD_DBNAME': 'DB_NAME', 'WIZARD_DBUSER': 'DB_USER', 'WIZARD_DBPASSWORD': 'DB_PASSWORD', + 'WIZARD_SECRETKEY': 'SECRET_KEY', + 'WIZARD_AUTH_KEY': 'AUTH_KEY', + 'WIZARD_SECURE_AUTH_KEY': 'SECURE_AUTH_KEY', + 'WIZARD_LOGGED_IN_KEY': 'LOGGED_IN_KEY', + 'WIZARD_NONCE_KEY': 'NONCE_KEY', }) -# XXX: I have omitted an implementation for table prefix, on grounds that we -# do not permit it to be configured. If we do end up growing support for -# arbitrary table prefixes this should be added. class Application(app.Application): parametrized_files = ['wp-config.php'] + php.parametrized_files @@ -26,24 +30,23 @@ class Application(app.Application): substitutions = app.make_substitutions(seed) substitutions.update(php.substitutions) install_schema = install.ArgSchema("mysql", "email", "title") + deprecated_keys = set(['WIZARD_SECRETKEY']) def download(self, version): return "http://wordpress.org/wordpress-%s.tar.gz" % version def checkConfig(self, deployment): return os.path.isfile("wp-config.php") + def checkWeb(self, deployment): + # XXX: this sucks pretty hard + return self.checkWebPage(deployment, "", "