Last active
August 19, 2016 18:47
-
-
Save jorben/fe40a4da945c11c4acf7d3b6741b3955 to your computer and use it in GitHub Desktop.
subversion明文密码转apache支持的webpasswd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# write by jorbenzhu, 2016-08-19 | |
use warnings; | |
use strict; | |
open (FILE, "passwd") or die ("Can't open the passwd file!"); | |
open (OUT_FILE, ">webpasswd") or die ("Can't open the webpasswd file!"); | |
close (OUT_FILE); | |
foreach (<FILE>) { | |
if ( $_ =~ m/^[^#].*=/ ) { | |
$_ =~ s/=//; | |
# print $_; | |
print "\n"; | |
`htpasswd -b webpasswd $_`; | |
} | |
} | |
############################################ | |
以下是注释 都是注释 | |
<Location /svn/> | |
DAV svn | |
SVNListParentPath on | |
SVNParentPath /data/svnrep/ | |
SVNIndexXSLT "/svnindex.xsl" | |
# Limit write permission to list of valid users. | |
#<LimitExcept GET PROPFIND OPTIONS REPORT> | |
# Require SSL connection for password protection. | |
# SSLRequireSSL | |
AuthType Basic | |
AuthName "Authorization Repository" | |
AuthBasicProvider file | |
#AuthUserFile /tmp/svn-auth.htpasswd | |
AuthUserFile /data/webpasswd | |
#AuthzSVNAccessFile /data/authz | |
AuthzSVNAccessFile /tmp/authz | |
#Satisfy Any | |
Require valid-user | |
#</LimitExcept> | |
</Location> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment