chown web-server files during installation

Review Request #7784 — Created Nov. 30, 2015 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

If the user specifies --web-server-user on the `rb-site install`
CLI or a distribution packager has set a default web server user
in rb_platform.py, `rb-site install` will attempt to chown the
necessary web-facing directories and their contents to that user.

If it succeeds in chowning all such directories, `rb-site install`
will now suppress the summary lines telling the user what
directories need to be manually owned.

If it fails on one or more ownership changes (or if no ownership
change is attempted due to a lack of a user or running on Windows),
then the original notice of directories to update is displayed at
the end of installation.

I deployed several Review Board sites as root against a PostgreSQL database:

  • DEFAULT_WEB_SERVER_USER="" in rb_platform.py, --web-server-user=apache on the CLI
    *- All appropriate directories were owned by apache:apache at the end of deployment. All other directories were owned by root.
  • DEFAULT_WEB_SERVER_USER="" in rb_platform.py, --web-server-user not on the CLI
    *- All directories were owned by root at the end of deployment
  • DEFAULT_WEB_SERVER_USER="apache" in rb_platform.py, --web-server-user not on the CLI
    *- All appropriate directories were owned by apache:apache at the end of deployment. All other directories were owned by root.