mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
xmpp: Enable jwchat apache conf after install.
This commit is contained in:
parent
eca896a2e8
commit
128aa42873
10
actions/xmpp
10
actions/xmpp
@ -47,6 +47,9 @@ def parse_arguments():
|
|||||||
'--domainname',
|
'--domainname',
|
||||||
help='The domain name that will be used by the XMPP service.')
|
help='The domain name that will be used by the XMPP service.')
|
||||||
|
|
||||||
|
# Setup jwchat apache conf
|
||||||
|
subparsers.add_parser('setup', help='Setup jwchat apache conf')
|
||||||
|
|
||||||
# Prepare ejabberd for hostname change
|
# Prepare ejabberd for hostname change
|
||||||
pre_hostname_change = subparsers.add_parser(
|
pre_hostname_change = subparsers.add_parser(
|
||||||
'pre-change-hostname',
|
'pre-change-hostname',
|
||||||
@ -103,6 +106,13 @@ def subcommand_pre_install(arguments):
|
|||||||
input=b'jwchat jwchat/ApacheServerName string ' + domainname.encode())
|
input=b'jwchat jwchat/ApacheServerName string ' + domainname.encode())
|
||||||
|
|
||||||
|
|
||||||
|
def subcommand_setup(_):
|
||||||
|
"""Setup jwchat apache conf"""
|
||||||
|
subprocess.call(['a2dissite', 'jwchat'])
|
||||||
|
subprocess.call(['a2enconf', 'jwchat-plinth'])
|
||||||
|
subprocess.call(['service', 'apache2', 'reload'])
|
||||||
|
|
||||||
|
|
||||||
def subcommand_pre_change_hostname(arguments):
|
def subcommand_pre_change_hostname(arguments):
|
||||||
"""Prepare ejabberd for hostname change"""
|
"""Prepare ejabberd for hostname change"""
|
||||||
old_hostname = arguments.old_hostname
|
old_hostname = arguments.old_hostname
|
||||||
|
|||||||
12
data/etc/apache2/conf-available/jwchat-plinth.conf
Normal file
12
data/etc/apache2/conf-available/jwchat-plinth.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Alias /jwchat /usr/share/jwchat/www
|
||||||
|
|
||||||
|
<Directory /usr/share/jwchat/www>
|
||||||
|
Options +Indexes +Multiviews +FollowSymLinks
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
# proxy for BOSH server
|
||||||
|
ProxyPass /http-bind/ http://localhost:5280/http-bind/
|
||||||
|
ProxyPassReverse /http-bind/ http://localhost:5280/http-bind/
|
||||||
|
<Proxy http://localhost:5280/http-bind/*>
|
||||||
|
Allow from all
|
||||||
|
</Proxy>
|
||||||
@ -70,9 +70,15 @@ def before_install():
|
|||||||
actions.superuser_run('xmpp', ['pre-install', '--domainname', domainname])
|
actions.superuser_run('xmpp', ['pre-install', '--domainname', domainname])
|
||||||
|
|
||||||
|
|
||||||
|
def on_install():
|
||||||
|
"""Setup jwchat apache conf"""
|
||||||
|
actions.superuser_run('xmpp', ['setup'])
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@package.required(['jwchat', 'ejabberd'],
|
@package.required(['jwchat', 'ejabberd'],
|
||||||
before_install=before_install)
|
before_install=before_install,
|
||||||
|
on_install=on_install)
|
||||||
def index(request):
|
def index(request):
|
||||||
"""Serve XMPP page"""
|
"""Serve XMPP page"""
|
||||||
return TemplateResponse(request, 'xmpp.html',
|
return TemplateResponse(request, 'xmpp.html',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user