df.close()
anonfile = "%s/repos/%s/git-daemon-export-ok" % (self.conf.get("paths", "githome"), name)
+ htafile = "%s/repos/%s/.htaccess" % (self.conf.get("paths", "githome"), name)
if anon:
if not os.path.isfile(anonfile):
open(anonfile, "w").close()
+ if os.path.isfile(htafile):
+ os.remove(htafile)
else:
if os.path.isfile(anonfile):
os.remove(anonfile)
+ if not os.path.isfile(htafile):
+ hf = open(htafile, "w")
+ hf.write("order allow,deny\ndeny from all\noptions -indexes\n")
+ hf.close()
+
f.close()
os.chmod("%s.tmp" % self.conf.get("paths", "gitweblist"), 0644)
os.rename("%s.tmp" % self.conf.get("paths", "gitweblist"), self.conf.get("paths", "gitweblist"))