]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/app/wordpress.py
Add detectVersionFromGit utility method
[wizard.git] / wizard / app / wordpress.py
index bd82ee1fa4a12a6595c593f91ab2c55d1ecc03c0..bdcf25d1c9fa5357e83aedcbff6dd44051f47059 100644 (file)
@@ -36,6 +36,7 @@ class Application(app.Application):
     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_blacklist = set(['put your unique phrase here'])
     def urlFromExtract(self, deployment):
         try:
             meta = sql.connect(deployment.dsn)
@@ -117,6 +118,16 @@ class Application(app.Application):
         pluggable_file.write(pluggable)
         pluggable_file.close()
 
+        # replace random variable stubs with real values
+        old_config = open('wp-config.php').read()
+        def replace_with_random(s):
+            return s.replace('put your unique phrase here', util.random_key(), 1)
+        config = replace_with_random(old_config)
+        while config != old_config:
+            old_config = config
+            config = replace_with_random(config)
+        open('wp-config.php', 'w').write(config)
+
         php.ini_replace_vars()
     def upgrade(self, d, version, options):
         result = d.fetch("wp-admin/upgrade.php?step=1")