changeset 4051:63fbadea490e

partially reverted removal of backup action (without the problematic 'restore' code) - we'll keep this until the refactored storage code is merged
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 31 Aug 2008 01:21:26 +0200
parents 6f6eed3818ed
children 0cdc180a2932
files MoinMoin/config/multiconfig.py docs/CHANGES
diffstat 2 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sun Aug 31 01:14:34 2008 +0200
+++ b/MoinMoin/config/multiconfig.py	Sun Aug 31 01:21:26 2008 +0200
@@ -325,6 +325,11 @@
         # e.g u'%(page_front_page)s' % self
         self.navi_bar = [elem % self for elem in self.navi_bar]
 
+        # expand %(...)s placeholders, compile regex and cache it
+        self.cache.backup_exclude_regex = re.compile("|".join(
+                                              [elem % self for elem in self.backup_exclude]))
+        self.cache.backup_include = [elem % self for elem in self.backup_include]
+
         # check if python-xapian is installed
         if self.xapian_search:
             try:
@@ -1186,6 +1191,22 @@
       ('import_pagename_regex', r'\[\[([^\]]*)\]\]', "Regular expression used to search for target pagename specification."),
       ('import_wiki_addrs', [], "Target mail addresses to consider when importing mail"),
     )),
+
+    'backup': ('Backup settings',
+        'These settings control how the backup action works and who is allowed to use it.',
+    (
+      ('compression', 'gz', 'What compression to use for the backup ("gz" or "bz2").'),
+      ('users', [], 'List of trusted user names who are allowed to get a backup.'),
+      ('include', ['%(data_dir)s', ], 'List of pathes to backup.'),
+      ('exclude',
+       [
+        r"(.+\.py(c|o)$)",
+        r"%(cache_dir)s",
+        r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
+        r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
+       ],
+       'List of regular expressions matching files that should be excluded from the backup.'),
+    )),
 }
 
 def _add_options_to_defconfig(opts, addgroup=True):
--- a/docs/CHANGES	Sun Aug 31 01:14:34 2008 +0200
+++ b/docs/CHANGES	Sun Aug 31 01:21:26 2008 +0200
@@ -69,7 +69,12 @@
     * url_prefix setting
     * traceback_log_dir setting (we just use logging.exception)
     * editor_quickhelp setting (replaced by per-parser quickhelp)
-    * backup action and associated settings
+    * restoring backups with the backup action and related settings (while
+      creating backups is no big issue and should work OK, restoring them
+      had fundamental issues related to overwriting or not-overwriting of
+      existing files - thus we removed the "restore" part of the action and
+      recommend that you just contact the wiki server admin in case of trouble,
+      give him your wiki backup file and let him carefully restore it.)
 
   New Features:
     * New "modernized" theme.
@@ -87,6 +92,8 @@
     * user_autocreate setting was removed from wiki configuration and replaced
       by a autocreate=<boolean> parameter of the auth objects that support user
       profile auto creation.
+    * backup action: you can now use placeholders for backup_include setting
+      and this list now defaults to ['%(data_dir)s', ].
 
 
 Version 1.7.current: