moinsetup

Changeset

63:3ede22b8cbfe
2012-07-13 Paul Boddie raw files shortlog changelog graph Added Web user and group settings. Fixed the log-related setfacl command to use the Web user.
README.txt (file) moinsetup.py (file)
     1.1 --- a/README.txt	Fri Jul 13 21:39:20 2012 +0200
     1.2 +++ b/README.txt	Fri Jul 13 21:52:07 2012 +0200
     1.3 @@ -117,6 +117,21 @@
     1.4                      unspecified, a limited hosting environment will be
     1.5                      assumed.
     1.6  
     1.7 +The following Web server settings are optional, but they should probably be
     1.8 +investigated and specified:
     1.9 +
    1.10 +web_user            The user operating the Web server, typically www-user or
    1.11 +                    apache. This setting is typically used where the
    1.12 +                    filesystem supports ACLs and the setfacl program can be
    1.13 +                    run.
    1.14 +
    1.15 +web_group           The group of the user operating the Web server, typically
    1.16 +                    the same as the user. This setting is typically used where
    1.17 +                    the ownership of files has to be modified in order to
    1.18 +                    allow the Web server to access the Wiki programs and
    1.19 +                    files, thus preserving the original ownership of the
    1.20 +                    installed files.
    1.21 +
    1.22  Except for the common_dir setting, site settings are generally only relevant
    1.23  when configuring and installing a Wiki:
    1.24  
    1.25 @@ -295,12 +310,13 @@
    1.26  New in moinsetup 0.4 (Changes since moinsetup 0.3)
    1.27  --------------------------------------------------
    1.28  
    1.29 -  * Added edit and event log permissions/ownership commands to the postinstall
    1.30 -    scripts.
    1.31 +  * Added wikiconfig.py, edit-log and event-log permissions/ownership commands
    1.32 +    to the postinstall scripts.
    1.33    * Fixed the .htaccess file location for limited hosting environments, using
    1.34      the static resources directory in preference to the application directory.
    1.35    * Added support for separate static URL paths enforced by limited hosting
    1.36      environments.
    1.37 +  * Added web_user and web_group settings.
    1.38  
    1.39  New in moinsetup 0.3 (Changes since moinsetup 0.2)
    1.40  --------------------------------------------------
     2.1 --- a/moinsetup.py	Fri Jul 13 21:39:20 2012 +0200
     2.2 +++ b/moinsetup.py	Fri Jul 13 21:52:07 2012 +0200
     2.3 @@ -106,7 +106,7 @@
     2.4  
     2.5  postsetup_setfacl_logs = """
     2.6  if [ -e "%(common_dir)s/data/*-log" ]; then
     2.7 -    setfacl -m g:%(web_group)s:rw %(common_dir)s/data/*-log
     2.8 +    setfacl -m u:%(web_user)s:rw %(common_dir)s/data/*-log
     2.9  fi
    2.10  """
    2.11  
    2.12 @@ -368,10 +368,10 @@
    2.13          "url_path", "static_url_path"
    2.14          )
    2.15  
    2.16 -    # NOTE: Need to detect Web server user.
    2.17 +    # NOTE: Potentially detect Web server credentials.
    2.18  
    2.19 -    web_user = "www-data"
    2.20 -    web_group = "www-data"
    2.21 +    web_user_default = "www-data"
    2.22 +    web_group_default = "www-data"
    2.23  
    2.24      # MoinMoin resources.
    2.25  
    2.26 @@ -382,6 +382,7 @@
    2.27          moin_distribution=None,
    2.28          prefix=None, site_packages=None,
    2.29          web_app_dir=None, web_static_dir=None, web_site_dir=None,
    2.30 +        web_user=None, web_group=None,
    2.31          common_dir=None, farm_config=None, site_config=None,
    2.32          url_path=None, static_url_path=None,
    2.33          superuser=None, site_name=None, site_identifier=None, front_page_name=None,
    2.34 @@ -404,6 +405,8 @@
    2.35            * web_site_dir      - optional: the directory where Web site
    2.36                                  definitions reside (such as
    2.37                                  /etc/apache2/sites-available)
    2.38 +          * web_user          - optional: the user operating the Web server
    2.39 +          * web_group         - optional: the group of the Web server user
    2.40  
    2.41          The following site settings are also applicable:
    2.42  
    2.43 @@ -438,6 +441,9 @@
    2.44          self.site_config = site_config
    2.45          self.theme_default = theme_default
    2.46  
    2.47 +        self.web_user = web_user or self.web_user_default
    2.48 +        self.web_group = web_group or self.web_group_default
    2.49 +
    2.50          # NOTE: Support the detection of the Apache sites directory.
    2.51  
    2.52          self.prefix, self.site_packages, self.web_app_dir, self.web_site_dir, self.web_static_dir, self.common_dir = \