Matrix Synapse setup: using nginx proxy manage, coturn & cloudflare


Tweak91

Recommended Posts

  • Cloudflare & Nginx proxy manager Step one

https://www.cloudflare.com/ 

  • Create a A name record pointing at your external IP DNS only.

cloudf2.thumb.png.c269f1262bbb67c03ea775dee62a627e.png

  • Create an SRV record _matrix targeted at your subdomain

cloudf1.thumb.png.d1cdaec40e1c5c1add3a70e110671875.png

  • Create a C name for coturn turn.yoururl DNS only

 

  • Nginx proxy manager

npm1.thumb.png.01333abf6aba178ef9b5e6e0f472baea.png

custom location Tap add 3

npm2.png.7057777f274f866a140885b2cc82a87a.png

 

npm3.png.086a2ab8cf72ef49ca12a9daaea86ed6.png

npm4.png.f4e760d8ef5df7ef8fb2417c8f2e0e6f.png

 

 

 

  • Matrix-Synapse Step two 

Matrix-Synapse docker by matrixdotorg. 

Delete all ports except Client Port 8008

add Server Name: matrix.yoururl

 

ADVANCED VIEW  Post Arguments: add generate

install the docker

C111apture.thumb.PNG.66aca1a5b2ab42fe397baf27263e11b3.PNG

 

  • homeserver.yaml edit Step three 
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
server_name: "matrix.yoururl"
pid_file: /data/homeserver.pid
public_baseurl: https://matrix.yoururl
#web_client_location: https://matrix.yoururl
listeners:
  - port: 8008
    tls: false
    type: http
    x_forwarded: true
    bind_addresses: ['0.0.0.0']
    resources:
      - names: [client, federation]
        compress: false
database:
  name: sqlite3
  args:
    database: /data/homeserver.db

log_config: "/data/matrix.yoururl.log.config"
media_store_path: /data/media_store
registration_shared_secret: ""
report_stats: false
macaroon_secret_key: ""
form_secret: ""
signing_key_path: "/data/matrix.yoururl.signing.key"
trusted_key_servers:
  - server_name: "matrix.org"

# Enable registration for new users.
enable_registration: true
enable_registration_without_verification: true
registration_shared_secret: 
trusted_third_party_id_servers:
    - matrix.org
    - vector.im
    - riot.im
    - matrix.yoururl

allow_public_rooms_over_federation: true
allow_public_rooms_without_auth: false
enable_search: true
push:
include_content: true
group_unread_count_by_room: true


 ## TURN ##
# The public URIs of the TURN server to give to clients
turn_uris: ["turn:your turn url:3478?transport=udp"] 

# The shared secret used to compute passwords for the TURN server
turn_username: user
turn_password: pass



# vim:ft=yaml

change all matrix.yoururl to your url 

registration_shared_secret use key created on install homeserver.yaml

macaroon_secret_key use key created on install homeserver.yaml

form_secret use key created on install homeserver.yaml

 

  • coturn Step four

change Network Type: too br0 use a open server IP

Delete all ports install 

Capturaaae.thumb.PNG.e6831a5f89d5cc6f8bc4f33bcaf74c8b.PNG

 

coturn turnserver.conf 

listening-port=3478
tls-listening-port=5349
listening-ip=0.0.0.0
external-ip=Br0 server IP 
min-port=49152
max-port=65535

verbose
fingerprint
lt-cred-mech
user=user:pass

total-quota=100
stale-nonce=600

realm=turn.yoururl
server-name=turn.yoururl

#cert=/ssl/fullchain.pem
#pkey=/ssl/privkey.pem
#cipher-list="ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384"

syslog
pidfile="/var/run/turnserver.pid"

#no-tls
#no-udp
#no-tcp
#no-cli
#no-tlsv1
#no-tlsv1_1
#no-tlsv1_2

cli-password=passs

 

change turn.yoururl to your coturn url 

change user=user:pass add the same user:pass created to homeserver.yaml 

change cli password 

port forwarding 49152- 65535 UDP

 

!!!!!!!DONT FORGET!!!!!!!! !!!!before starting matrix docker remove generate from Post Arguments!!!!

you should now be up and running 

check https://federationtester.matrix.org/

full homeserver.yaml https://matrix-org.github.io/synapse/v1.37/usage/configuration/homeserver_sample_config.html

adding POSTGRES DB, and ELEMENT Web 

 

 

LDAP USERS

password_providers:
 - module: "ldap_auth_provider.LdapAuthProvider"
   config:
     enabled: true
     mode: "search"     
     uri: "ldap://domain:389"
     start_tls: false
     base: "OU=home,DC=example,dc=com"
     attributes:
        uid: "saMAccountName"
        mail: "mail"
        name: "givenName"
     bind_dn: "cn=ldap,cn=Users,dc=example,dc=com"
     bind_password: "password"
     #filter: "(objectClass=posixAccount)"

When you get up and running come say hi 

 

https://matrix.to/#/#sykocyberofficial:m.sykocyber.com

 

 

 

 

Edited by Tweak91
  • Like 1
Link to comment

Hey man I followed this to the T, but cannot get it to work. I can get the matrix page up and working on [localip]:8008, but my page times out on matrix.mydomain.com. Federation tester also doesn't work. Anything I'm missing? Were there any ports that needed to be forwarded or anything specific about your NGINX config I'm missing?

Link to comment
4 hours ago, Shadax said:

Hey man I followed this to the T, but cannot get it to work. I can get the matrix page up and working on [localip]:8008, but my page times out on matrix.mydomain.com. Federation tester also doesn't work. Anything I'm missing? Were there any ports that needed to be forwarded or anything specific about your NGINX config I'm missing?

DNS only??

Link to comment
1 minute ago, Tweak91 said:

DNS only??

 

1 minute ago, Tweak91 said:

DNS only??

 

4 hours ago, Shadax said:

Hey man I followed this to the T, but cannot get it to work. I can get the matrix page up and working on [localip]:8008, but my page times out on matrix.mydomain.com. Federation tester also doesn't work. Anything I'm missing? Were there any ports that needed to be forwarded or anything specific about your NGINX config I'm missing?

What dose your log say ??

Link to comment
5 hours ago, Shadax said:

Hey man I followed this to the T, but cannot get it to work. I can get the matrix page up and working on [localip]:8008, but my page times out on matrix.mydomain.com. Federation tester also doesn't work. Anything I'm missing? Were there any ports that needed to be forwarded or anything specific about your NGINX config I'm missing?

homeserver.yaml

Try this forget the coturn for now. 

Anywhere you see "URL" add your own

anywhere you see "KEY" add your key from the default catered homeserver.yaml

Test federation

After that step than you can try turn. 

I'll give you my full homeserver.yaml tonight

Link to comment
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.