References & Links:
Matrix.org
http://matrix.org
"Matrix is an open standard for interoperable, decentralised, real-time communication over IP. It can be used to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things communication - or anywhere you need a standard HTTP API for publishing and subscribing to data whilst tracking the conversation history."
Synapse
net/py-matrix-synapse
https://github.com/matrix-org/synapse
Riot.im (Mobile Client)
https://riot.im
My Thoughts
Matrix.org is brilliant! I work for a small IT company. We like to keep things in house so we chose to host our own communication services via XMPP (OpenFire) for internal chat and mobile messaging as well as IRC (UnrealIRCd + ZNC) just to have it. When I stumbled across Matrix.org I was excited to try this new project. Synapse is still in heavy beta however, after using it I'm even more excited for whats to come.
I've written this tutorial for those of you who want to give a Matrix.org HomeServer a try.
Lets Begin!
Assuming you have a clean installation of FreeBSD 11
Switch to root user or use sudo
Update FreeBSD
Install Ports Tree
Install ports-mgmt/portmaster
I use portmaster due to the number of dependencies, however you could just jump to the next step and use "make install clean"
Install net/py-matrix-synapse
Do note, you can also do an install via
Create directory for Synapse files. This can be done under your own account or you can create a synapse user. This is fine because Synapse does not require root/wheel permissions to run.
I created 3 scripts for the next three steps.
Script #1: synapse_config.sh
This will be used to configure synapse before starting the service.
For further details on this script, please visit Synapse on GitHub. For this tutorial, all you'll need to adjust is the domain. Save the script then run it to configure synapse. Which we'll do at this time.
Script #2: synapse_start.sh
This script will be used to start Synapse. It will also be added to cron so it'll run at boot.
Lets start Synapse then add this script to cron
The configuration should take a few seconds. Once done, you should see something similar to the text above.
Lets add this script to the cronjobs. Not as root.
Script #3: synapse_add_user.sh
This script will be used to add users to the Synapse database.
Lets run this script...
If everything goes well, you can point your browser to https://localhost:8448 and you’ll be presented with a login screen.
Use the account you just created to log into your Matrix.org Home Server and enjoy! Cheers!
~ Alex
Matrix.org
http://matrix.org
"Matrix is an open standard for interoperable, decentralised, real-time communication over IP. It can be used to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things communication - or anywhere you need a standard HTTP API for publishing and subscribing to data whilst tracking the conversation history."
Synapse
net/py-matrix-synapse
https://github.com/matrix-org/synapse
Riot.im (Mobile Client)
https://riot.im
My Thoughts
Matrix.org is brilliant! I work for a small IT company. We like to keep things in house so we chose to host our own communication services via XMPP (OpenFire) for internal chat and mobile messaging as well as IRC (UnrealIRCd + ZNC) just to have it. When I stumbled across Matrix.org I was excited to try this new project. Synapse is still in heavy beta however, after using it I'm even more excited for whats to come.
I've written this tutorial for those of you who want to give a Matrix.org HomeServer a try.
Lets Begin!
Assuming you have a clean installation of FreeBSD 11
Switch to root user or use sudo
su root
Update FreeBSD
freebsd-update fetch install
Install Ports Tree
portsnap fetch extract
Install ports-mgmt/portmaster
Code:
# cd /usr/ports/ports-mgmt/portmaster
# make install clean
I use portmaster due to the number of dependencies, however you could just jump to the next step and use "make install clean"
Install net/py-matrix-synapse
Code:
# cd /usr/ports/net/py-matrix-synapse
# portmaster
Do note, you can also do an install via
pkg install py27-matrix-synapse
with Synth pkg install synth
for keeping packages current... However, that's another tutorial.Create directory for Synapse files. This can be done under your own account or you can create a synapse user. This is fine because Synapse does not require root/wheel permissions to run.
mkdir ~/.synapse
I created 3 scripts for the next three steps.
Script #1: synapse_config.sh
This will be used to configure synapse before starting the service.
Code:
#!/bin/sh
# Synapse: Config Synapse
cd ~/.synapse
python2.7 -m synapse.app.homeserver \
--server-name MyDomain.com \ # *MyDomain.com* can be any internal or external domain
--config-path homeserver.yaml \
--generate-config \
--report-stats=no
For further details on this script, please visit Synapse on GitHub. For this tutorial, all you'll need to adjust is the domain. Save the script then run it to configure synapse. Which we'll do at this time.
Code:
# ~/synapse_config.sh
A config file has been generated in 'homeserver.yaml' for server name 'MyDomain.com' with corresponding SSL keys and self-signed certificates. Please review this file and customize it to your needs.
If this server name is incorrect, you will need to regenerate the SSL certificates
Script #2: synapse_start.sh
This script will be used to start Synapse. It will also be added to cron so it'll run at boot.
Code:
#!/bin/sh
# Synapse: Start Synapse
cd ~/.synapse
synctl start
Lets start Synapse then add this script to cron
Code:
# ~/synapse_start.sh
2017-02-21 22:06:39,476 - twisted - 131 - INFO - - SynapseSite starting on 8008
2017-02-21 22:06:39,477 - twisted - 131 - INFO - - Starting factory <synapse.http.site.SynapseSite instance at 0x80f17b680>
2017-02-21 22:06:39,477 - synapse.app.homeserver - 202 - INFO - - Synapse now listening on port 8008
started synapse.app.homeserver('homeserver.yaml')
The configuration should take a few seconds. Once done, you should see something similar to the text above.
Lets add this script to the cronjobs. Not as root.
Code:
# crontab -e
@reboot ~/synapse_start.sh
Script #3: synapse_add_user.sh
This script will be used to add users to the Synapse database.
Code:
#!/bin/sh
# Synapse: Add User
cd ~/.synapse
register_new_matrix_user -c homeserver.yaml https://localhost:8448
Lets run this script...
Code:
# ~/code/scripts/synapse_add_user.sh
New user localpart [tzuntzai]: tzuntzai
Password:
Confirm password:
Make admin [no]: yes
If everything goes well, you can point your browser to https://localhost:8448 and you’ll be presented with a login screen.
Use the account you just created to log into your Matrix.org Home Server and enjoy! Cheers!
~ Alex