# HG changeset patch # User Paul Boddie # Date 1357858759 -3600 # Node ID c15b2e850ee683af848e8f48f8f940bf7c33c41b # Parent abc9177c54356a23cac23e393fc8e580f9dcc708 Introduced stricter file permissions and plugin compilation upon deployment. Updated the copyright details and release notes. diff -r abc9177c5435 -r c15b2e850ee6 README.txt --- a/README.txt Thu Jan 10 22:07:27 2013 +0100 +++ b/README.txt Thu Jan 10 23:59:19 2013 +0100 @@ -319,6 +319,8 @@ * Added web_user and web_group settings. * Added support for making hierarchical page packages. * Introduced detection of setup.py files when installing plugins. + * Introduced compilation of plugins upon deployment and more restrictive + permissions on files in the plugins directory. New in moinsetup 0.3 (Changes since moinsetup 0.2) -------------------------------------------------- diff -r abc9177c5435 -r c15b2e850ee6 docs/COPYING.txt --- a/docs/COPYING.txt Thu Jan 10 22:07:27 2013 +0100 +++ b/docs/COPYING.txt Thu Jan 10 23:59:19 2013 +0100 @@ -1,7 +1,7 @@ Licence Agreement for moinsetup ------------------------------- -Copyright (C) 2010, 2011 Paul Boddie +Copyright (C) 2010, 2011, 2012, 2013 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff -r abc9177c5435 -r c15b2e850ee6 moinsetup.py --- a/moinsetup.py Thu Jan 10 22:07:27 2013 +0100 +++ b/moinsetup.py Thu Jan 10 23:59:19 2013 +0100 @@ -3,7 +3,7 @@ """ A setup and configuration script for MoinMoin. -Copyright (C) 2010, 2011, 2012 Paul Boddie +Copyright (C) 2010, 2011, 2012, 2013 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -25,9 +25,10 @@ from glob import glob from zipfile import ZipFile import os -import sys +import py_compile +import re import shutil -import re +import sys import tempfile __version__ = "0.4" @@ -92,6 +93,8 @@ find '%(common_dir)s/data' -type f | xargs setfacl -m u:%(web_user)s:rw find '%(common_dir)s/data' -type d | xargs setfacl -m u:%(web_user)s:rwx +find '%(common_dir)s/data/plugin' -type f | xargs setfacl -m u:%(web_user)s:r +find '%(common_dir)s/data/plugin' -type d | xargs setfacl -m u:%(web_user)s:rx find '%(common_dir)s/underlay' -type f | xargs setfacl -m u:%(web_user)s:rw find '%(common_dir)s/underlay' -type d | xargs setfacl -m u:%(web_user)s:rwx if [ -e "%(common_dir)s/wikiconfig.py" ]; then @@ -115,11 +118,15 @@ chown -R %(this_user)s.%(web_group)s '%(common_dir)s/data' chown -R %(this_user)s.%(web_group)s '%(common_dir)s/underlay' -chmod -R g+w '%(common_dir)s/data' -chmod -R g+w '%(common_dir)s/underlay' +find '%(common_dir)s/data' -type f | xargs chmod g=rw +find '%(common_dir)s/data' -type d | xargs chmod g=rwx +find '%(common_dir)s/data/plugin' -type f | chmod g=r +find '%(common_dir)s/data/plugin' -type d | chmod g=rx +find '%(common_dir)s/underlay' -type f | xargs chmod g=rw +find '%(common_dir)s/underlay' -type d | xargs chmod g=rwx if [ -e "%(common_dir)s/wikiconfig.py" ]; then chown %(this_user)s.%(web_group)s '%(common_dir)s/wikiconfig.py' - chmod g+r '%(common_dir)s/wikiconfig.py' + chmod g=r '%(common_dir)s/wikiconfig.py' fi """ @@ -1361,6 +1368,11 @@ for module in glob(join(plugins_dir, "*%spy" % extsep)): shutil.copy(module, plugin_target_dir) + # Compile the plugin. + + plugin = join(plugins_dir, split(module)[-1]) + py_compile.compile(plugin) + def install_actions(self, actions_dir): "Install Wiki actions provided in the given 'actions_dir'."