gitweb: Fix modifying git repositories when gitweb app is disabled

Fixes #2408.

- When app is disabled, continue to update the app shortcut's login required
property. Otherwise, the value is current after the app is re-enabled.

- When public access is enabled, the gitweb-freedombox-auth.conf configuration
must be disabled. This can be done even if the configuration is already disabled
or does not exist. So, continue doing this.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Perform enable public access even if app is disabled]
[sunil: Perform shortcut update in all cases even if app is disabled]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa authored and Sunil Mohan Adapa committed 2024-02-27 15:06:27 -08:00
1 parent c217fdb5c6
commit 1268898176
2 files changed
+29 -16

No files matched your search

+2 -2
View File
@@ -98,7 +98,7 @@ class GitwebApp(app_module.App):
def post_init(self):
"""Perform post initialization operations."""
if not self.needs_setup() and self.is_enabled():
if not self.needs_setup():
self.update_service_access()
def set_shortcut_login_required(self, login_required):
@@ -122,7 +122,7 @@ class GitwebApp(app_module.App):
def _disable_public_access(self):
"""Allow Gitweb app to be accessed by logged-in users only."""
if not self.auth_webserver.is_conf_enabled():
if self.is_enabled() and not self.auth_webserver.is_conf_enabled():
self.auth_webserver.enable()
self.set_shortcut_login_required(True)