# HG changeset patch # User Paul Boddie # Date 1342209127 -7200 # Node ID 3ede22b8cbfea0dd89bb350ed67e7fcc3bbb40fe # Parent d51fbd8f05ca60fa8828b6bee5c98132be5669cc Added Web user and group settings. Fixed the log-related setfacl command to use the Web user. diff -r d51fbd8f05ca -r 3ede22b8cbfe README.txt --- a/README.txt Fri Jul 13 21:39:20 2012 +0200 +++ b/README.txt Fri Jul 13 21:52:07 2012 +0200 @@ -117,6 +117,21 @@ unspecified, a limited hosting environment will be assumed. +The following Web server settings are optional, but they should probably be +investigated and specified: + +web_user The user operating the Web server, typically www-user or + apache. This setting is typically used where the + filesystem supports ACLs and the setfacl program can be + run. + +web_group The group of the user operating the Web server, typically + the same as the user. This setting is typically used where + the ownership of files has to be modified in order to + allow the Web server to access the Wiki programs and + files, thus preserving the original ownership of the + installed files. + Except for the common_dir setting, site settings are generally only relevant when configuring and installing a Wiki: @@ -295,12 +310,13 @@ New in moinsetup 0.4 (Changes since moinsetup 0.3) -------------------------------------------------- - * Added edit and event log permissions/ownership commands to the postinstall - scripts. + * Added wikiconfig.py, edit-log and event-log permissions/ownership commands + to the postinstall scripts. * Fixed the .htaccess file location for limited hosting environments, using the static resources directory in preference to the application directory. * Added support for separate static URL paths enforced by limited hosting environments. + * Added web_user and web_group settings. New in moinsetup 0.3 (Changes since moinsetup 0.2) -------------------------------------------------- diff -r d51fbd8f05ca -r 3ede22b8cbfe moinsetup.py --- a/moinsetup.py Fri Jul 13 21:39:20 2012 +0200 +++ b/moinsetup.py Fri Jul 13 21:52:07 2012 +0200 @@ -106,7 +106,7 @@ postsetup_setfacl_logs = """ if [ -e "%(common_dir)s/data/*-log" ]; then - setfacl -m g:%(web_group)s:rw %(common_dir)s/data/*-log + setfacl -m u:%(web_user)s:rw %(common_dir)s/data/*-log fi """ @@ -368,10 +368,10 @@ "url_path", "static_url_path" ) - # NOTE: Need to detect Web server user. + # NOTE: Potentially detect Web server credentials. - web_user = "www-data" - web_group = "www-data" + web_user_default = "www-data" + web_group_default = "www-data" # MoinMoin resources. @@ -382,6 +382,7 @@ moin_distribution=None, prefix=None, site_packages=None, web_app_dir=None, web_static_dir=None, web_site_dir=None, + web_user=None, web_group=None, common_dir=None, farm_config=None, site_config=None, url_path=None, static_url_path=None, superuser=None, site_name=None, site_identifier=None, front_page_name=None, @@ -404,6 +405,8 @@ * web_site_dir - optional: the directory where Web site definitions reside (such as /etc/apache2/sites-available) + * web_user - optional: the user operating the Web server + * web_group - optional: the group of the Web server user The following site settings are also applicable: @@ -438,6 +441,9 @@ self.site_config = site_config self.theme_default = theme_default + self.web_user = web_user or self.web_user_default + self.web_group = web_group or self.web_group_default + # NOTE: Support the detection of the Apache sites directory. self.prefix, self.site_packages, self.web_app_dir, self.web_site_dir, self.web_static_dir, self.common_dir = \