chown web-server files during installation

Review Request #7784 - Created Nov. 30, 2015 and updated

Stephen Gallagher
Review Board
master
4033
a8305cb...
reviewboard

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.
  • 1
  • 0
  • 4
  • 1
  • 6
Description From Last Updated
This looks to be basically the same code. Can we iterate over itertools.chain(dirs, files)? Christian Hammond Christian Hammond
Review Bot
  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. 
      
Christian Hammond
  1. 
      
  2. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
     

    Blank line between these.

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

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

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

    Sentence casing. Here and below.

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

    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)
     
     
     

    Blank line between these.

    Also, I'd prefer joined_path.

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

    Blank line between these.

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

  8. 
      
Stephen Gallagher
Review Bot
  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. 
      
Stephen Gallagher
Review request changed

Change Summary:

Rebased this patch atop current master branch

Branch:

-release-2.5.x
+master

Commit:

+a8305cb9f773f103bc534fc21dba48f82ebbfe22

Diff:

Revision 3 (+85 -10)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...