xmpp: Enable jwchat apache conf after install.

This commit is contained in:
James Valleroy 2015-05-20 22:12:22 -04:00 committed by Sunil Mohan Adapa
parent eca896a2e8
commit 128aa42873
3 changed files with 29 additions and 1 deletions

View File

@ -47,6 +47,9 @@ def parse_arguments():
'--domainname',
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
pre_hostname_change = subparsers.add_parser(
'pre-change-hostname',
@ -103,6 +106,13 @@ def subcommand_pre_install(arguments):
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):
"""Prepare ejabberd for hostname change"""
old_hostname = arguments.old_hostname

View 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>

View File

@ -70,9 +70,15 @@ def before_install():
actions.superuser_run('xmpp', ['pre-install', '--domainname', domainname])
def on_install():
"""Setup jwchat apache conf"""
actions.superuser_run('xmpp', ['setup'])
@login_required
@package.required(['jwchat', 'ejabberd'],
before_install=before_install)
before_install=before_install,
on_install=on_install)
def index(request):
"""Serve XMPP page"""
return TemplateResponse(request, 'xmpp.html',