Difference between revisions of "Package:Mattermost Server Binary"

From Funtoo
Jump to navigation Jump to search
(Added basics of using the Mattermost server binary)
 
m
Line 5: Line 5:
|Homepage=https://about.mattermost.com/download/
|Homepage=https://about.mattermost.com/download/
}}
}}
(ebuild currently not available)
{{warning|The ebuild is currently not available. The article will directly use the binaries provided on the Mattermost website}}


Mattermost is a messaging client that offers persistent storage of messages and file sharing. It also allows integration of audio, video, images, gifs, code snippets into messages as well. It also allows audio and video calls through WebRTC. If IRC was raw text, Mattermost would be its rich text counterpart. Mattermost also works with all major operating systems and is also available as a mobile app and as a webpage. Mattermost can also bridge to IRC, which is a separate topic. We'll cover the basic configuration of Mattermost with MySQL, postfix, NGINX and SSL certificates obtained with Letsencrypt.
Mattermost is a messaging client that offers persistent storage of messages and file sharing. It also allows integration of audio, video, images, gifs, code snippets into messages as well. It also allows audio and video calls through WebRTC. If IRC was raw text, Mattermost would be its rich text counterpart. Mattermost also works with all major operating systems and is also available as a mobile app and as a webpage. Mattermost can also bridge to IRC, which is a separate topic. We'll cover the basic configuration of Mattermost with MySQL, postfix, NGINX and SSL certificates obtained with Letsencrypt.
==Prerequisites==


Mattermost at the moment doesn't seem to support UNIX sockets. While configuring postfix (for user email verification) isn't required in preview mode, it's recommended if you're running Mattermost in production Please see http://www.funtoo.org/Package:Postfix on how to configure Postfix to use ports instead of UNIX sockets.
Mattermost at the moment doesn't seem to support UNIX sockets. While configuring postfix (for user email verification) isn't required in preview mode, it's recommended if you're running Mattermost in production Please see http://www.funtoo.org/Package:Postfix on how to configure Postfix to use ports instead of UNIX sockets.
Line 18: Line 20:
We'll also assume you correctly obtained the SSL certificates for your website with {{Package:app-crypt/certbot}} and configured NGINX to use them.
We'll also assume you correctly obtained the SSL certificates for your website with {{Package:app-crypt/certbot}} and configured NGINX to use them.


{{warning|this is a warning}}
Refer to the RHEL 6.6 guide to installing Mattermost. It'll be heavily referenced here. https://docs.mattermost.com/install/install-rhel-66.html
 
==Installing Mattermost binaries==
 
Let's get started. First, fetch the Mattermost binaries from the website and install them in /opt:
 
{{console|body=
###i## wget https://releases.mattermost.com/3.6.2/mattermost-3.6.2-linux-amd64.tar.gz
}}
{{console|body=
###i## tar -xvf mattermost-3.6.2-linux-amd64.tar.gz -C /opt
}}
 
Create the storage directory (We'll later specify) where all the files and images that are uploaded to Mattermost are stored. We'll use /var/mattermost/data as the data folder:
{{console|body=
###i## mkdir -p /var/mattermost/data
}}
 
Create a system user and group called mattermost to run the service:
{{console|body=
###i## sudo useradd --system --user-group mattermost
###i## sudo chown -R mattermost:mattermost /opt/mattermost
###i## sudo chmod -R g+w /opt/mattermost
###i## sudo chown -R mattermost:mattermost /var/mattermost/data
}}
{{warning|Failing to set the correct permissions on the data folder will cause file uploads to fail}}
 
Mattermost is now correctly installed. The only file that needs to be edited is /opt/mattermost/config/config.json, which is the main configuration file.
{{warning|Mattermost currently exhibits strange behavior when launched through an init script. We'll use
simple shell scripts with the start-stop-daemon command to emulate openRC.}}
 
Create the start script:
{{file|name=/usr/sbin/start-mattermost|desc=My foo.conf file|body=
#!/bin/sh
echo "starting mattermost"
cd /opt/mattermost/bin/
start-stop-daemon --start --background --exec ./platform -u mattermost
}}
make sure to make the scripts executable:
{{console|body=
###i## chmod +x /usr/sbin/start-mattermost
}}
{{note|
This has the disadvantage of mattermost being listed under "platform" in programs like top and htop.
You can rename the binary /opt/mattermost/bin/platfrom to /opt/mattermost/bin/mattermost . Make sure to rename ./platform to ./mattermost in the above script.
}}
 
Create the stop script:
{{file|name=/usr/sbin/start-mattermost|desc=My foo.conf file|body=
#!/bin/sh
echo "stopping mattermost"
cd /opt/mattermost/bin/
start-stop-daemon --stop --exec ./platform -u mattermost
}}
make sure to make the scripts executable:
{{console|body=
###i## chmod +x /usr/sbin/stop-mattermost
}}
 
==Configuring MySQL==
{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 22:25, February 13, 2017

Mattermost Server Binary

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

   Warning

The ebuild is currently not available. The article will directly use the binaries provided on the Mattermost website

Mattermost is a messaging client that offers persistent storage of messages and file sharing. It also allows integration of audio, video, images, gifs, code snippets into messages as well. It also allows audio and video calls through WebRTC. If IRC was raw text, Mattermost would be its rich text counterpart. Mattermost also works with all major operating systems and is also available as a mobile app and as a webpage. Mattermost can also bridge to IRC, which is a separate topic. We'll cover the basic configuration of Mattermost with MySQL, postfix, NGINX and SSL certificates obtained with Letsencrypt.

Prerequisites

Mattermost at the moment doesn't seem to support UNIX sockets. While configuring postfix (for user email verification) isn't required in preview mode, it's recommended if you're running Mattermost in production Please see http://www.funtoo.org/Package:Postfix on how to configure Postfix to use ports instead of UNIX sockets.

Please also see the article on NGINX on how to install it http://www.funtoo.org/Package:Nginx and see the article on how to install mysql http://www.funtoo.org/Package:MySQL

We'll assume Mattermost, Postfix, NGINX and MySQL are running on the same server. A separate guide on configuring Mattermost to run on multiple servers will be written at a certain point in the future. We'll assume the domain for Mattermost is chat.example.com, and we're installing Mattermost in /opt/mattermost.

We'll also assume you correctly obtained the SSL certificates for your website with Package:App-crypt/certbot and configured NGINX to use them.

Refer to the RHEL 6.6 guide to installing Mattermost. It'll be heavily referenced here. https://docs.mattermost.com/install/install-rhel-66.html

Installing Mattermost binaries

Let's get started. First, fetch the Mattermost binaries from the website and install them in /opt:

root # wget https://releases.mattermost.com/3.6.2/mattermost-3.6.2-linux-amd64.tar.gz
root # tar -xvf mattermost-3.6.2-linux-amd64.tar.gz -C /opt

Create the storage directory (We'll later specify) where all the files and images that are uploaded to Mattermost are stored. We'll use /var/mattermost/data as the data folder:

root # mkdir -p /var/mattermost/data

Create a system user and group called mattermost to run the service:

root # sudo useradd --system --user-group mattermost
root # sudo chown -R mattermost:mattermost /opt/mattermost
root # sudo chmod -R g+w /opt/mattermost
root # sudo chown -R mattermost:mattermost /var/mattermost/data
   Warning

Failing to set the correct permissions on the data folder will cause file uploads to fail

Mattermost is now correctly installed. The only file that needs to be edited is /opt/mattermost/config/config.json, which is the main configuration file.

   Warning

Mattermost currently exhibits strange behavior when launched through an init script. We'll use simple shell scripts with the start-stop-daemon command to emulate openRC.

Create the start script:

   /usr/sbin/start-mattermost - My foo.conf file
#!/bin/sh
echo "starting mattermost"
cd /opt/mattermost/bin/
start-stop-daemon --start --background --exec ./platform -u mattermost

make sure to make the scripts executable:

root # chmod +x /usr/sbin/start-mattermost
   Note

This has the disadvantage of mattermost being listed under "platform" in programs like top and htop. You can rename the binary /opt/mattermost/bin/platfrom to /opt/mattermost/bin/mattermost . Make sure to rename ./platform to ./mattermost in the above script.

Create the stop script:

   /usr/sbin/start-mattermost - My foo.conf file
#!/bin/sh
echo "stopping mattermost"
cd /opt/mattermost/bin/
start-stop-daemon --stop --exec ./platform -u mattermost

make sure to make the scripts executable:

root # chmod +x /usr/sbin/stop-mattermost

Configuring MySQL