This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tech:devops:git [2019/04/21 03:45] rk4n3 |
tech:devops:git [2019/06/08 13:19] (current) rk4n3 |
||
---|---|---|---|
Line 97: | Line 97: | ||
Then, create auth file with something like: ''htpasswd -c /var/www/git/.htpasswd git'' //... prompted for password// | Then, create auth file with something like: ''htpasswd -c /var/www/git/.htpasswd git'' //... prompted for password// | ||
- | For anonymous read/write, in ''/etc/httpd/conf.d/git.conf'':<code> | + | === For anonymous read/write ... === |
+ | In ''/etc/httpd/conf.d/git.conf'':<code> | ||
# Git-smart HTTP/HTTPS back-end | # Git-smart HTTP/HTTPS back-end | ||
SetEnv GIT_PROJECT_ROOT /var/www/git | SetEnv GIT_PROJECT_ROOT /var/www/git | ||
Line 115: | Line 116: | ||
- | For anonymous read and authenticated write, in ''/etc/httpd/conf.d/git.conf'':<code> | + | === ... or, for anonymous read and authenticated write ... === |
+ | In ''/etc/httpd/conf.d/git.conf'':<code> | ||
# Git-smart HTTP/HTTPS back-end | # Git-smart HTTP/HTTPS back-end | ||
SetEnv GIT_PROJECT_ROOT /var/www/git | SetEnv GIT_PROJECT_ROOT /var/www/git | ||
Line 137: | Line 139: | ||
- | For authenticated read/write, in ''/etc/httpd/conf.d/git.conf'':<code> | + | === ... or, for authenticated read/write ... === |
+ | In ''/etc/httpd/conf.d/git.conf'':<code> | ||
# Git-smart HTTP/HTTPS back-end | # Git-smart HTTP/HTTPS back-end | ||
SetEnv GIT_PROJECT_ROOT /var/www/git | SetEnv GIT_PROJECT_ROOT /var/www/git | ||
Line 153: | Line 156: | ||
</code> | </code> | ||
- | === ... or, for LDAP authentication: === | + | === ... or, for LDAP authentication ... === |
+ | Ensure ''mod_ldap'' is installed, then in ''/etc/httpd/conf.d/git.conf'': | ||
<code> | <code> | ||
<Directory "/usr/libexec/git-core"> | <Directory "/usr/libexec/git-core"> | ||
Line 162: | Line 166: | ||
AuthBasicProvider ldap | AuthBasicProvider ldap | ||
AuthLDAPURL "ldap://cosmos.samudio.net/dc=samudio,dc=net?uid?sub?" | AuthLDAPURL "ldap://cosmos.samudio.net/dc=samudio,dc=net?uid?sub?" | ||
- | AuthName "GIT -- Bluejay" | ||
Require valid-user | Require valid-user | ||
</Directory> | </Directory> | ||
+ | </code> | ||
+ | |||
+ | === ... Active Directory AuthLDAPURL ... === | ||
+ | <code>AuthLDAPURL "ldap://ad-ldap-prod.uhc.com/dc=ms,dc=ds,dc=uhc,dc=com?sAMAccountName?sub?(objectCategory=person)(objectClass=user)"</code> | ||
+ | |||
+ | === ... add specific location auth ... === | ||
+ | <code> | ||
+ | <LocationMatch "^/git/yourrepo.*"> | ||
+ | ... add same LDAP constructs, except for ... | ||
+ | Require ldap-attribute sAMAccountName="yourlogin" | ||
+ | </LocationMatch> | ||
</code> | </code> | ||