Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
github_best_practices [2019/03/26 15:53] – Add [File Permissions]. Traumflug | github_best_practices [2019/10/05 14:00] (current) – [File Permissions] Clarify link. Traumflug | ||
---|---|---|---|
Line 188: | Line 188: | ||
A typical problem of developer installations is trouble with file permissions. While the Git repository is owned by the developer, the web server runs as another user. Result: developer can't edit files created by the web server and vice versa. | A typical problem of developer installations is trouble with file permissions. While the Git repository is owned by the developer, the web server runs as another user. Result: developer can't edit files created by the web server and vice versa. | ||
- | Solution is to use extended file permissions: | + | Solution is to use extended file permissions. First, move //.git// aside: |
- | <code none> | + | |
- | cd <git repository> | + | $ mv <git repository> |
- | REPOSITORY=$(basename " | + | |
- | # Move .git aside: | + | Then follow instructions at [[Developer Installation#The User Privileges Issue|Developer Installation]]. |
- | mv .git /tmp | + | |
- | cd .. | + | That done, move //.git// back: |
- | # Set existing files: | + | |
- | setfacl -Rm u:mah:rwx " | + | $ mv /tmp/.git <git repository> |
- | setfacl -Rm u:www-data: | + | |
- | # Set the same as default for file created in the future: | + | |
- | setfacl -Rm d:u:mah:rwx "${REPOSITORY}" | + | |
- | setfacl -Rm d: | + | |
- | # Restore Git: | + | |
- | cd " | + | |
- | mv / | + | |
- | </code> | + | |
- | In the above, //mah// is the developer user, // | + | |
===== References ===== | ===== References ===== | ||
* [[https:// | * [[https:// | ||
github_best_practices.txt · Last modified: 2019/10/05 14:00 by Traumflug