mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
matrixsynapse: Fix issues with showing certificate warning
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
3961ccf415
commit
781ac3d5dd
@ -29,7 +29,6 @@ from ruamel.yaml.util import load_yaml_guess_indent
|
||||
from plinth import service as service_module
|
||||
from plinth import action_utils, actions, frontpage
|
||||
from plinth.menu import main_menu
|
||||
from plinth.utils import YAMLFile
|
||||
|
||||
from .manifest import backup, clients
|
||||
|
||||
@ -164,12 +163,11 @@ def get_public_registration_status():
|
||||
|
||||
|
||||
def has_valid_certificate():
|
||||
"""Return whether the configured domain name has a valid
|
||||
Let's Encrypt certificate."""
|
||||
"""Return whether the configured domain name has a valid certificate."""
|
||||
domain_name = get_configured_domain_name()
|
||||
status = actions.superuser_run('letsencrypt', ['get-status'])
|
||||
status = json.loads(status)
|
||||
if domain_name in status['domains']:
|
||||
return status['domains'][domain_name][
|
||||
'certificate_available'] == "true"
|
||||
return status['domains'][domain_name]['certificate_available']
|
||||
|
||||
return False
|
||||
|
||||
@ -80,6 +80,7 @@ class MatrixSynapseServiceView(ServiceView):
|
||||
context['domain_name'] = matrixsynapse.get_configured_domain_name()
|
||||
context['clients'] = matrixsynapse.clients
|
||||
context['manual_page'] = matrixsynapse.manual_page
|
||||
context['has_valid_certificate'] = has_valid_certificate()
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
@ -87,7 +88,6 @@ class MatrixSynapseServiceView(ServiceView):
|
||||
initial = super().get_initial()
|
||||
initial.update({
|
||||
'enable_public_registration': get_public_registration_status(),
|
||||
'has_valid_certificate': has_valid_certificate(),
|
||||
})
|
||||
return initial
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user