mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
diaspora: Don't enable service until domain name is set
- This avoids an issue where it would try to enable the apache conf possibly before it is generated. - Added an explicit enable statement since it was missing. Reviewed-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
This commit is contained in:
parent
78df88ca85
commit
9fabb7b903
@ -62,7 +62,6 @@ def subcommand_setup(arguments):
|
|||||||
dnf.write(domain_name)
|
dnf.write(domain_name)
|
||||||
set_domain_name(domain_name)
|
set_domain_name(domain_name)
|
||||||
uncomment_user_registrations()
|
uncomment_user_registrations()
|
||||||
action_utils.service_start('diaspora')
|
|
||||||
action_utils.webserver_enable('diaspora-plinth')
|
action_utils.webserver_enable('diaspora-plinth')
|
||||||
|
|
||||||
|
|
||||||
@ -86,9 +85,10 @@ def set_domain_name(domain_name):
|
|||||||
'http://{}:3000'.format(domain_name))
|
'http://{}:3000'.format(domain_name))
|
||||||
aug.save()
|
aug.save()
|
||||||
|
|
||||||
diaspora.generate_apache_configuration('/etc/apache2/conf-available/diaspora-plinth.conf',
|
diaspora.generate_apache_configuration(
|
||||||
domain_name)
|
'/etc/apache2/conf-available/diaspora-plinth.conf', domain_name)
|
||||||
|
|
||||||
|
action_utils.service_enable('diaspora')
|
||||||
action_utils.service_start('diaspora')
|
action_utils.service_start('diaspora')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,11 @@ def setup(helper, old_version=None):
|
|||||||
helper.install(managed_packages)
|
helper.install(managed_packages)
|
||||||
helper.call('custom_config', actions.superuser_run, 'diaspora',
|
helper.call('custom_config', actions.superuser_run, 'diaspora',
|
||||||
['disable-ssl'])
|
['disable-ssl'])
|
||||||
helper.call('post', actions.superuser_run, 'diaspora', ['enable'])
|
|
||||||
|
|
||||||
|
def setup_domain_name(domain_name):
|
||||||
|
actions.superuser_run('diaspora',
|
||||||
|
['setup', '--domain-name', domain_name])
|
||||||
global service
|
global service
|
||||||
if service is None:
|
if service is None:
|
||||||
service = service_module.Service(
|
service = service_module.Service(
|
||||||
@ -108,8 +112,8 @@ def setup(helper, old_version=None):
|
|||||||
is_enabled=is_enabled,
|
is_enabled=is_enabled,
|
||||||
enable=enable,
|
enable=enable,
|
||||||
disable=disable)
|
disable=disable)
|
||||||
helper.call('post', service.notify_enabled, None, True)
|
service.notify_enabled(None, True)
|
||||||
helper.call('post', add_shortcut)
|
add_shortcut()
|
||||||
|
|
||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
|
|||||||
@ -24,7 +24,6 @@ from django.urls import reverse_lazy
|
|||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.views.generic import FormView
|
from django.views.generic import FormView
|
||||||
|
|
||||||
from plinth import actions
|
|
||||||
from plinth.forms import DomainSelectionForm
|
from plinth.forms import DomainSelectionForm
|
||||||
from plinth.modules import diaspora
|
from plinth.modules import diaspora
|
||||||
from plinth.utils import get_domain_names
|
from plinth.utils import get_domain_names
|
||||||
@ -43,9 +42,7 @@ class DiasporaSetupView(FormView):
|
|||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
domain_name = form.cleaned_data['domain_name']
|
domain_name = form.cleaned_data['domain_name']
|
||||||
actions.superuser_run('diaspora',
|
diaspora.setup_domain_name(domain_name)
|
||||||
['setup', '--domain-name', domain_name])
|
|
||||||
diaspora.add_shortcut()
|
|
||||||
|
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user