mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
Diaspora: Update domain name in Apache config
This commit is contained in:
parent
276dac2df2
commit
b109507e0a
@ -21,6 +21,7 @@ Configuration helper for diaspora* pod.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import augeas
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from plinth import action_utils
|
from plinth import action_utils
|
||||||
@ -62,7 +63,6 @@ def set_domain_name(domain_name):
|
|||||||
# This did not set the domain_name
|
# This did not set the domain_name
|
||||||
# action_utils.dpkg_reconfigure('diaspora-common',
|
# action_utils.dpkg_reconfigure('diaspora-common',
|
||||||
# {'url': domain_name})
|
# {'url': domain_name})
|
||||||
|
|
||||||
# Manually changing the domain name in the conf files.
|
# Manually changing the domain name in the conf files.
|
||||||
conf_file = '/etc/diaspora.conf'
|
conf_file = '/etc/diaspora.conf'
|
||||||
with open(conf_file, 'r') as conf:
|
with open(conf_file, 'r') as conf:
|
||||||
@ -78,6 +78,17 @@ def set_domain_name(domain_name):
|
|||||||
with open(conf_file, 'w') as conf:
|
with open(conf_file, 'w') as conf:
|
||||||
conf.write("\n".join(env_vars))
|
conf.write("\n".join(env_vars))
|
||||||
|
|
||||||
|
aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +
|
||||||
|
augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||||
|
aug.set('/augeas/load/Httpd/lens', 'Httpd.lns')
|
||||||
|
aug.set('/augeas/load/Httpd/incl[last() + 1]',
|
||||||
|
'/etc/apache2/conf-available/*')
|
||||||
|
aug.load()
|
||||||
|
|
||||||
|
aug.set('/files/etc/apache2/conf-available/diaspora-plinth.conf/VirtualHost/arg', domain_name)
|
||||||
|
aug.set("/files/etc/apache2/conf-available/diaspora-plinth.conf/VirtualHost/directive[1]/arg", domain_name)
|
||||||
|
aug.save()
|
||||||
|
|
||||||
action_utils.service_start('diaspora')
|
action_utils.service_start('diaspora')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user