mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
ejabberd: Enable mod_http_upload
- Upgrade existing config. Tests: - Install ejabberd. Configuration is set as expected and ejabberd is running. - Upgrade from existing ejabberd install. Configuration is set as expected and ejabberd is running. - Send a file between two users in dino-im and Conversations app. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
ce1347b172
commit
39aac9228b
@ -50,7 +50,7 @@ class EjabberdApp(app_module.App):
|
||||
|
||||
app_id = 'ejabberd'
|
||||
|
||||
_version = 4
|
||||
_version = 5
|
||||
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
|
||||
@ -4,3 +4,11 @@ ProxyPassReverse /bosh/ http://localhost:5443/bosh/
|
||||
<Proxy http://localhost:5443/bosh/*>
|
||||
Require all granted
|
||||
</Proxy>
|
||||
|
||||
##
|
||||
## Proxy for XEP-0363 HTTP File Upload
|
||||
##
|
||||
<Location /upload/>
|
||||
ProxyPreserveHost On
|
||||
ProxyPass http://localhost:5443/upload/
|
||||
</Location>
|
||||
|
||||
@ -55,6 +55,28 @@ def setup(domainname: str):
|
||||
listen_port['tls'] = False
|
||||
if 'use_turn' in listen_port:
|
||||
conf['listen'].remove(listen_port) # Use coturn instead
|
||||
if listen_port['port'] == 5443:
|
||||
# Enable XEP-0363 HTTP File Upload
|
||||
listen_port['request_handlers']['/upload'] = 'mod_http_upload'
|
||||
|
||||
origin_key = scalarstring.DoubleQuotedScalarString(
|
||||
'Access-Control-Allow-Origin')
|
||||
origin_value = scalarstring.DoubleQuotedScalarString('https://@HOST@')
|
||||
methods_key = scalarstring.DoubleQuotedScalarString(
|
||||
'Access-Control-Allow-Methods')
|
||||
methods_value = scalarstring.DoubleQuotedScalarString(
|
||||
'GET,HEAD,PUT,OPTIONS')
|
||||
headers_key = scalarstring.DoubleQuotedScalarString(
|
||||
'Access-Control-Allow-Headers')
|
||||
headers_value = scalarstring.DoubleQuotedScalarString('Content-Type')
|
||||
conf['modules']['mod_http_upload'] = {
|
||||
'put_url': 'https://@HOST@/upload',
|
||||
'custom_headers': {
|
||||
origin_key: origin_value,
|
||||
methods_key: methods_value,
|
||||
headers_key: headers_value,
|
||||
},
|
||||
}
|
||||
|
||||
conf['auth_method'] = 'ldap'
|
||||
conf['ldap_servers'] = [scalarstring.DoubleQuotedScalarString('localhost')]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user