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

Synapse behind HAProxy on pfSense firewall

Open JCSynthTux opened this issue 3 years ago • 0 comments

Hello, I am currently trying to deploy a Synapse instance behind pfSense with HAProxy. Synapse itself works fine, but the federation part of Synapse is not working at all. Response from federationtester.matrix.org:

{
  "WellKnownResult": {
    "m.server": "",
    "result": "Get \"https://matrix.domain.tld/.well-known/matrix/server\": dial tcp MYIP:443: i/o timeout",
    "CacheExpiresAt": 0
  },
  "DNSResult": {
    "SRVSkipped": false,
    "SRVCName": "",
    "SRVRecords": null,
    "SRVError": {
      "Message": "lookup _matrix._tcp.matrix.domain.tld on 8.8.8.8:53: no such host"
    },
    "Hosts": {
      "matrix.domain.tld": {
        "CName": "mycname.",
        "Addrs": [
          "MYIP"
        ],
        "Error": null
      }
    },
    "Addrs": [
      "MYIP:8448"
    ]
  },
  "ConnectionReports": {},
  "ConnectionErrors": {
    "MYIP8448": {
      "Message": "Get \"https://MYIP:8448/_matrix/key/v2/server\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
    }
  },
  "Version": {
    "error": "Get \"matrix://matrix.domain.tld/_matrix/federation/v1/version\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
  },
  "FederationOK": false
}

I also tried multiple different configurations for the federation HAProxy part and I tried both chaining the nginx proxy of this playbook and without the nginx at all, like listed in the HAProxy example (I setup the nginx mentioned there for .well-known).

I am hoping someone here did setup Synapse behind HAProxy on pfSense and can help me out here.

######################################################################
#
# matrix-global
#
######################################################################
matrix_domain: doamin.tld
matrix_ssl_retrieval_method: none # https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-own-webserver.md#preparation

######################################################################
#
# matrix-postgres
#
######################################################################
matrix_postgres_connection_password: ''


######################################################################
#
# matrix-client-element
#
######################################################################
matrix_client_element_enabled: false #Disables WebUI - dont really see the use case for a WebUI here

######################################################################
#
# matrix-ma1sd
#
######################################################################
matrix_ma1sd_enabled: false #Disables Identity Server - dont really see the use case - might be more of headache considering firewall


######################################################################
#
# matrix-mailer
#
######################################################################
matrix_mailer_sender_address: ""
matrix_mailer_relay_use: true
matrix_mailer_relay_host_name: ""
matrix_mailer_relay_host_port: 587
matrix_mailer_relay_auth: true
matrix_mailer_relay_auth_username: ""
matrix_mailer_relay_auth_password: ""

######################################################################
#
# matrix-jitsi
#
######################################################################
matrix_jitsi_enabled: false # Disables since we are using an external jitsi instance

######################################################################
#
# matrix-nginx-proxy
#
######################################################################
matrix_nginx_proxy_enabled: false # https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-own-webserver.md#preparation
matrix_nginx_proxy_base_domain_homepage_enabled: false #Since haProxy will be used we dont need nginx

######################################################################
#
# matrix-registration
#
######################################################################
matrix_registration_enabled: false
matrix_registration_admin_secret: ""
matrix_registration_container_http_host_bind_port: '0.0.0.0:8767' #Exposes port of registration on host instead of loopback

######################################################################
#
# matrix-coturn
#
######################################################################
matrix_coturn_turn_static_auth_secret: '' 

######################################################################
#
# matrix-synapse
#
######################################################################
matrix_synapse_federation_enabled: true # Enables Federation
matrix_synapse_federation_port_enabled: true
matrix_synapse_enable_registration: false #Use this to enable or disable serverwide registration
matrix_synapse_container_client_api_host_bind_port: '0.0.0.0:8008' #Exposes main matrix port on host - without this port would be exposed on loopback
matrix_synapse_container_federation_api_plain_host_bind_port: '0.0.0.0:8048' #Exposes main federation port on host - without this port would be exposed on loopback
matrix_synapse_macaroon_secret_key: ''

######################################################################
#
# matrix-synapse-admin
#
######################################################################
matrix_synapse_admin_enabled: true
matrix_synapse_admin_container_http_host_bind_port: '0.0.0.0:8766' #Exposes port of admin panel on host instead of loopback

JCSynthTux avatar Dec 29 '21 12:12 JCSynthTux