Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Mattermost Server Binary"

From Funtoo
Jump to navigation Jump to search
m
m
Line 33: Line 33:
}}
}}


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:
Create the storage directory 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=
{{console|body=
###i## mkdir -p /var/mattermost/data
###i## mkdir -p /var/mattermost/data
}}
}}
Edit the main configuration file to point to the right directory for storing files:
{{file|name=/opt/mattermost/config/config.json|desc=main configuration file file|body=
    "FileSettings": {
        "MaxFileSize": 52428800,
        "DriverName": "local",
        "Directory": "/var/mattermost/data/",
        "EnablePublicLink": false,
}}


Create a system user and group called mattermost to run the service:
Create a system user and group called mattermost to run the service:
Line 45: Line 55:
###i## sudo chown -R mattermost:mattermost /var/mattermost/data
###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}}
{{warning|Failing to set the correct permissions on the data folder will cause file uploads to fail, as well as forgetting to edit config.json to point to the right folder.}}


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.
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.
Line 52: Line 62:


Create the start script:
Create the start script:
{{file|name=/usr/sbin/start-mattermost|desc=My foo.conf file|body=
{{file|name=/usr/sbin/start-mattermost|desc=start script file|body=
#!/bin/sh
#!/bin/sh
echo "starting mattermost"
echo "starting mattermost"
Line 61: Line 71:
{{console|body=
{{console|body=
###i## chmod +x /usr/sbin/start-mattermost
###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:
Create the stop script:
{{file|name=/usr/sbin/start-mattermost|desc=My foo.conf file|body=
{{file|name=/usr/sbin/start-mattermost|desc=stop script file|body=
#!/bin/sh
#!/bin/sh
echo "stopping mattermost"
echo "stopping mattermost"
Line 78: Line 84:
###i## chmod +x /usr/sbin/stop-mattermost
###i## chmod +x /usr/sbin/stop-mattermost
}}
}}
{{note|
These scripts have the disadvantage of mattermost being listed as "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.
}}


==Configuring MySQL==
==Configuring MySQL==
{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 22:33, 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 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

Edit the main configuration file to point to the right directory for storing files:

   /opt/mattermost/config/config.json - main configuration file file
"FileSettings": {
        "MaxFileSize": 52428800,
        "DriverName": "local",
        "Directory": "/var/mattermost/data/",
        "EnablePublicLink": false,


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, as well as forgetting to edit config.json to point to the right folder.

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 - start script 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

Create the stop script:

   /usr/sbin/start-mattermost - stop script 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
   Note

These scripts have the disadvantage of mattermost being listed as "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.


Configuring MySQL