chown web-server files during installation

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

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.
Description From Last Updated

Blank line between these.

chipx86chipx86

I'd say "Change ownership of ...", plus a trailing period.

chipx86chipx86

Sentence casing. Here and below.

chipx86chipx86

This looks to be basically the same code. Can we iterate over itertools.chain(dirs, files)?

chipx86chipx86

Blank line between these. Also, I'd prefer joined_path.

chipx86chipx86

Blank line between these.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
        reviewboard/rb_platform.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
        reviewboard/rb_platform.py
    
    
  2. 
      
chipx86
  1. 
      
  2. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
     
    Show all issues

    Blank line between these.

  3. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues

    I'd say "Change ownership of ...", plus a trailing period.

  4. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues

    Sentence casing. Here and below.

  5. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    This looks to be basically the same code. Can we iterate over itertools.chain(dirs, files)?

    1. Thanks, my python-foo is mediocre at best. Didn't know about that handy function.

  6. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
     
    Show all issues

    Blank line between these.

    Also, I'd prefer joined_path.

  7. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
     
    Show all issues

    Blank line between these.

    1. Dropped because this code was merged together with the earlier one.

  8. 
      
sgallagh
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
        reviewboard/rb_platform.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
        reviewboard/rb_platform.py
    
    
  2. 
      
sgallagh
david
Review request changed

Status: Discarded

Loading...