gitweb: Set correct access rights after enabling application

- after enabling application, do not enable Apache auth configuration
  if a public repository exist.

Closes #1669

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa authored and Sunil Mohan Adapa committed 2019-10-22 11:44:49 -07:00
1 parent d05facfe04
commit 7c5837a13a
1 file changed
+6
+6
View File
@@ -147,6 +147,12 @@ class GitwebWebserverAuth(Webserver):
repos = app.get_repo_list()
return have_public_repos(repos) or super().is_enabled()
def enable(self):
"""Enable apache configuration only if no public repository exists."""
repos = app.get_repo_list()
if not have_public_repos(repos):
super().enable()
def init():
"""Initialize the module."""