Summary
Synapse possibility of separate domain from server domain.
Problem
When Synapse is installed, it allows to choose homeserver domain.
However, it only allows to choose the domain of the freedombox. But imagine I own example.com
and have freedombox in box.example.com
. In such case, Matrix supports having @user:example.com
instead of @user:box.example.com
. You can configure that by adding a SRV DNS record or adding a /.well-known/matrix/server
file that defines that.
Matrix would only require to have TLS on box.example.com
, but right now, in freedombox, if I configure it as example.com
(in system > configure) and then install synapse and set its domain as example.com
, installation fails with:
may 25 22:21:12 box /usr/bin/plinth[501]: Internal Server Error: /plinth/apps/matrixsynapse/setup/
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 183, in post
return self.form_valid(form)
File "/usr/lib/python3/dist-packages/plinth/modules/matrixsynapse/views.py", line 47, in form_valid
['setup', '--domain-name', domain_name])
File "/usr/lib/python3/dist-packages/plinth/actions.py", line 118, in superuser_run
log_error=log_error)
File "/usr/lib/python3/dist-packages/plinth/actions.py", line 208, in _run
raise ActionError(action, output, error)
plinth.errors.ActionError: ('matrixsynapse', '', 'Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nTraceback (most recent call last):\n File "/usr/share/plinth/actions/matrixsynapse", line 251, in <module>\n main()\n File "/usr/share/plinth/actions/matrixsynapse", line 247, in main\n sub_command_method(arguments)\n File "/usr/share/plinth/actions/matrixsynapse", line 169, in subcommand_setup\n _update_tls_certificate()\n File "/usr/share/plinth/actions/matrixsynapse", line 117, in _update_tls_certificate\n shutil.copyfile(source_certificate_path, dest_certificate_path)\n File "/usr/lib/python3.7/shutil.py", line 120, in copyfile\n with open(src, \'rb\') as fsrc:\nFileNotFoundError: [Errno 2] No such file or directory: \'/etc/letsencrypt/live/example.com/fullchain.pem\'\n')
Solution
Although the easiest solution is to just support @user:box.example.com
, the prettiest solution is to use @user:example.com
. It would be great if Freedombox supported those 2 separate settings. Maybe calling them “Server name” (example.com) and “Server location” (box.example.com). “Server name” would be an advanced setting, as it requires altering some DNS records or servers that may or may not be in the same server.
Alternatives
Just stick with @user:box.example.com
. Not elegant, but works.