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 2019-10-22 14:31:46 +03:00 committed by Sunil Mohan Adapa
parent d05facfe04
commit 7c5837a13a
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

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."""