matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Setup on local network results in "Can't connect to homeserver" with self-signed certs

Open ReggieMarr opened this issue 2 years ago • 0 comments

I'm trying to setup a matrix server that will run locally on a private network. My inventory/hosts file looks like this

[matrix_servers]
matrix.reggie.com ansible_host=192.182.138.209 ansible_ssh_user=rmarr ansible_python_interpreter=/usr/bin/python3.8 ansible_connection=local become=true become_user=rmarr

and my my vars are stored in inventory/host_vars/matrix.reggie.com.yml like so

# The bare domain name which represents your Matrix identity.
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
#
# Note: this playbook does not touch the server referenced here.
# Installation happens on another server ("matrix.<matrix-domain>").
#
# If you've deployed using the wrong domain, you'll have to run the Uninstalling step,
# because you can't change the Domain after deployment.
#
# Example value: example.com
matrix_domain: reggie.com

# The Matrix homeserver software to install.
# See:
#  - `roles/custom/matrix-base/defaults/main.yml` for valid options
# - the `docs/configuring-playbook-IMPLEMENTATION_NAME.md` documentation page, if one is available for your implementation choice
matrix_homeserver_implementation: synapse
matrix_synapse_admin_enabled: true

# A secret used as a base, for generating various other secrets.
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
matrix_homeserver_generic_secret_key: 'MY_FAKE_PASSWORD'

# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
#
# In case SSL renewal fails at some point, you'll also get an email notification there.
#
# If you decide to use another method for managing SSL certificates (different than the default Let's Encrypt),
# you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`).
#
# Example value: [email protected]
matrix_ssl_lets_encrypt_support_email: '[email protected]'

# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
#
# The playbook creates additional Postgres users and databases (one for each enabled service)
# using this superuser account.
matrix_postgres_connection_password: 'MY_FAKE_PASSWORD'

# google-docs but FLOSS
matrix_etherpad_enabled: true

# Because who needs zooom
matrix_jitsi_enabled: true

# Run `bash inventory/scripts/jitsi-generate-passwords.sh` to generate these passwords,
# or define your own strong passwords manually.
matrix_jitsi_jicofo_auth_password: generated_passwd
matrix_jitsi_jvb_auth_password: generated_passwd
matrix_jitsi_jibri_recorder_password: generated_passwd
matrix_jitsi_jibri_xmpp_password: generated_passwd


# configure jitsi as an indoor cat only
matrix_jitsi_jvb_container_extra_arguments:
- '--env "JVB_ADVERTISE_IPS=192.182.138.209"'

# This is all set so that we can run locally without a configured dns server
matrix_nginx_proxy_enabled: true
matrix_ssl_retrieval_method: self-signed
matrix_coturn_enabled: false
matrix_nginx_proxy_proxy_matrix_client_api_forwarded_location_synapse_admin_api_enabled: true

When I run the playbook with set-all, start things seem to be running but I've noticed a couple issues. First of all I can't get to element via matrix.reggie.com, I have to type in the ip_address:443 and when I get to the element page I notice this

matrix_screenshot

(I cut off the homeserver but that also says matrix.reggie.com)

I'm unable to get to any other services using the domain name and and I get this as the results of the self-check:

TASK [custom/matrix-synapse : Check Matrix Client API] *************************
fatal: [matrix.reggie.com -> 127.0.0.1]: FAILED! => changed=false
  elapsed: 0
  msg: 'Status code was -1 and not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>'
  redirected: false
  status: -1
  url: https://matrix.reggie.com/_matrix/client/versions
...ignoring

TASK [custom/matrix-synapse : Fail if Matrix Client API not working] ***********
fatal: [matrix.reggie.com -> 127.0.0.1]: FAILED! => changed=false
  msg: 'Failed checking Matrix Client API is up at `matrix.reggie.com` (checked endpoint: `https://matrix.reggie.com/_matrix/client/versions`). Is Synapse running? Is port 443 open in your firewall? Full error: {''redirected'': False, ''url'': ''https://matrix.reggie.com/_matrix/client/versions'', ''status'': -1, ''elapsed'': 0, ''changed'': False, ''failed'': True, ''msg'': ''Status code was -1 and not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>''}'

PLAY RECAP *********************************************************************
matrix.reggie.com   : ok=11   changed=0    unreachable=0    failed=1    skipped=159  rescued=0    ignored=1

Is there something wrong with my config or does this point to a firewall problem? I'm a bit new at setting up a local domain name, is there a way to check that that is correct?

Thanks

ReggieMarr avatar Nov 16 '22 16:11 ReggieMarr