Month: May 2019

Mattermost Server Docker Installation Tutorial

Introduction

This tutorial covers how to setup mattermost, an open-source and free slack alternative with docker on a domain or subdomain with SSL. The deployment, which results from this tutorial is production ready.

Background: Why Mattermost?

DriveTrust started as a small team, back then slack has been a good solution. However, we grew and with 10 people we have reached our 10K message limit for slack quiet quick. Now paying 7,50€ / user / month seemed to expensive for a comparably simple chat application, so we started looking for better alternatives.

Mattermost Pros & Cons

Pros:

1. free & self hosted.

2. A close to 1:1 clone of Slack, it has its own Android & iOS application

3. Has an export feauture from Slack, so the migration is quiet simple

Cons:

1. Currently no guest user feature support

2. During migration private messages are not exported, as well we have not managed to export all the files

Requirements

From DriveTrust’s side there have been a few requirements:

1. Integration with our existing applications on the server

2. Running on the subdomain chat.drivetrust.eu

3. SSL

4. Running within docker

5. Being a capable production deployment

Implementation

Prerequisites

1. Docker & Docker Compose

2. DNS A record pointing to domain/subdomain. (In our case chat.drivetrust.eu ) and server with a dedicated IP

3. jwilder nginx proxy and jwilder letsencrypt nginx proxy companion
Both are needed to reverse proxy the domain https://chat.drivetrust.eu to a docker container which is located on a different port. Because we don’t want to have some URL like chat.drivetrust.eu:9097 for production.
The second container automatically generates free SSL certificates for each subdomain you run with the nginx proxy.

0. Setup reverse proxy and SSL

This part refers to the above-mentioned containers. Once docker has installed the running of the containers is straight forward. This is straight from the official tutorial from Github
with one minor modification.

Before getting started with the servers and the reverse proxy we need to create a docker network to which will attach the nginx-proxy, the letsencrypt proxy ssl and the mattermost containers. Once the network is created we run the following two commands:

Now you should have the reverse proxy setup!

Mattermost installation

The official mattermost tutorial deploys mattermost as a docker service. This has not been suitable for us since we were looking to integrate with our existing Nginx Proxy Server. That’s why took apart the docker-compose.yml and rebuild everything from scratch. In total we will have three different docker containers, one for database, one for the app and one for the web application.

Step 1: create the local volume directories where the data will be stored:

Step 2: get the official mattermost git repo:

Step 3: a )Build the database container.

That should build the database container.

b) Run the container

Replace YOUR_DATABASE_PASSWORD with a proper database password. Please note that we add the container to nginx-net network to integrate with the reverse proxy.

Step 4: a) Build the mattermost app container

Here we need to add –build-arg edition=team to build the team edition of mattermost.

b) Run the container

Replace YOUR_DATABASE_PASSWORD with the database password.
Replace MM_SERVICESETTINGS_SITEURL with your URL
Note that the container has as well been added to the nginx-net network
Note that –-env DB_HOST actually requires an IP address of the database. However, since our database is as the app on the nginx-net network we can just pass the database container name (mattermost-docker_db_1) as host and docker does the domain name resolution automatically

Step 5: a) Build the web container

b) Run the container:

Replace VIRTUAL_HOST, LETSENCRYPT_EMAIL, LETSENCRYPT_HOST with your domain. The APP_HOST is the containername of the mattermost app build in 4. It’s the same principle of DNS as with the mattermost database and mattermost app.

That’s it. Now you should be able to see the login screen on the domain of your choice!

Introduction to dash cams and dash cam types

A dash cam is a high-definition wide-angle camera embedded in a car. This camera is connected to the latter via a cord that will fit into the cigarette lighter. It is fixed on the dashboard or windscreen inside the passenger compartment. There are several types of attachment, depending on the user’s preference, double-sided tape to stick to the window was from our experience the best one because it does not fall off. It is used to film and record everything that happens during a driver’s journey.

You can purchase it on Amazon -> https://www.amazon.fr/TOGUARD-Embarqu%C3%A9e-Objectif-Enregistreur-Enregistrement/dp/B01M9DG2A0

The digital archive can be used as evidence in the event of incidents. The dashcam is really an ideal witness in all circumstances. However, you should be aware of which country you use it in and how the local regulations are. In Germany, for about one year now it is accepted to use dash cam footage as proof as long as it is compliant with data protection laws, for example only recording a limited period of time and auto-deleting footage. In Austria, till this day it is forbidden to use dash cameras and you can even get fined with up to 10.000€ dependant on the case. In France, currently there is lobbying to allow that, however, the current state is unclear. However, in countries like Russia where insurance fraud is a common problem, it will hard to get an insurance contract without a dash camera.

Source :https://www.which.co.uk/news/2018/08/using-your-dash-cam-abroad-what-you-need-to-know-about-driving-in-europe/

DriveTrust’s connected dash cam is integrated to work with all types of regulations. Thanks to our GPS and cloud integration in can automatically disable based on location

How does it privacy compliant deletion work?

It films continuously in a sequence of 10 minutes (duration adjustable according to the cameras). The first 10 minutes are automatically recorded. During the first recording, if there is nothing to report, it is the turn of the next 10 minutes to be recorded. This first backup is then deleted and replaced by the next one, and so on. The larger the memory card, the more sequences are recorded. In this case, the recorded videos will be deleted as space runs out on the card.

DriveTrust’s smart dash camera supports additional modes. For example, based on the acceleration we can detect events or with our object detection, we can detect tailgating and other events and automatically save and record the video if some kind of issue during driving has been detected.

As well we provide a bluetooth button integration, which after pressing the dash camera automatically knows that it is supposed to save the last minutes and the next recordings.

USE OF THE DASH CAM

The dashcam was invented to monitor and save in a video file all incidents that may occur on the road.On the market, there are so-called “single lens” Dashcams but also dual lens Dashcams that can be used to film the front and rear of the vehicle. DriveTrust’s camera offers two versions, one just outward facing and one with two camera, recording the cockpit and for example driver distraction and the events on the road.

The classical dash cam use cases are:

Drivers, in the case of a dispute with another driver you can prove your good faith by providing video proof of the contested accident.

Internet drivers, who use this real “black box” for cars to film unusual scenes and publish many videos on the Internet and on YouTube and Dailymotion.

Professional drivers, such as truckers, taxi and VTC drivers, but also police officers, firefighters, ambulance drivers, ambulance drivers, driving school instructors, who can film their movements on video and keep an almost ” unremarkable ” record of their actions.

How to deal with aggressive drivers on the road ?

Aggressive driving is a serious concern and a real threat to the safety of all road users. In some extreme cases, this can lead to road rage, which is a violent criminal act involving the intent to cause physical harm. Any dangerous, intentional and malicious driving, or driving without consideration for safety, can be considered as aggressive driving.

Aggressiveness occurs when drivers put pressure on themselves because they want to reach their destination as quickly as possible or because they feel provoked by other road users. Frustrations at work or in everyday life can also lead to aggressive behaviour on the road.

What are the types of aggressive behaviors?

  • Headlight calls/blinkers/horns
  • Tighten the vehicle in front, follow it far too closely
  • Deliberately refusing priority to cyclists or pedestrians
  • Brake unnecessarily or block the passing lane
  • Making obscene gestures, insulting

How to avoid aggressiveness?

  • Be aware that by driving aggressively, you will not reach your destination faster, but will become a danger to yourself and others.
  • Don’t put yourself under pressure
  • Only drive if you are in good physical condition (tiredness, thirst, hunger or stress are also factors that can lead to aggressive behaviour.)
  • Be tolerant of yourself and others: we all make mistakes, including you.

By your tolerance, you improve the atmosphere on the roads and contribute to reducing the number of accidents.

How to deal with the aggressive drivers?

  • Stay calm. Put yourself in the position of the “aggressive” driver, there may just be a misunderstanding.
  • Make way and let the other aggressive driver pass
  • Do not tailgate.
  • Always be polite, even if the other person is not.

Preventing distractions while driving

Driving is a serious responsibility that requires skills of perception, analysis, movement, reaction as well as your full attention. Distractions can occur at anytime, anywhere and everywhere.

A distraction is something that takes your mind away from driving. There are four sources of distraction that are potentially disturbing to the driver:

auditive distraction: attention is turned away by what you hear

visual distraction: attention is drawn away by what you see



physical distraction: attention is focused on what you do


Source : Giphy)

cognitive distraction: attention is distracted by thoughts

How to avoid distractions while driving?

  • Place your GPS as close as possible to your field of vision (without obstructing your visibility on the road). Enter your itinerary information before you leave. Learning on how to just use the navigate by listening to the voice of the navigation rather than looking may as well help you to not get distracted
  • Avoid talking or sending text messages on your mobile phone while driving. If you really have a need for sending texts or talking on the phone while driving, there are quite a few ways how you can integrate speech recognition/voice control into your existing car.
  • Do not read while driving. When you need to read or use a map, leave the road.
  • Avoid taking your coat or changing clothes while driving.
  • Make-up, comb hair and/or beard before leaving home or at the office. These things should never be done while driving.
  • Avoid eating or drinking while driving.
  • Listen to music at a reasonable volume. And to reasonable music. Listening to Rammstein’s “Feuer Frei” will more likely make you speed rather than Bob Marley’s “Could you be loved” Listening to music too loud or using headphones or earplugs while driving can be disruptive and can affect your ability to hear emergency vehicles sharing the road with you.
  • Do not light or extinguish cigarettes or deal with ashes that fall while you are driving.

The most important to remember is never multi-tasking while driving!

How Do You Prepare Your Car for A Long Trip?

In Summer and Spring, especially Easter holidays are often a time for family holidays, trips of all kinds. While some people choose to travel by plane or train, most people prefer to travel by car. Before a car trip, it is essential to check 3 major details: the car, the route and the load.

Vehicle check-up before a long trip

Tire Pressure

Check the air pressure of the tires, including the spare tire.

  • If you go for a long trip with a heavy load it’s better to refill more air into the tires, especially it makes sense to put more air into the rear tires because they will have a higher load.
  • Usually, you can refill the air pressure at every petrol station for free, so it’s definitely worth doing
  • However, you should drive maximum 10km before refilling the air pressure, since the tire might get warm which will change the reading

Oil, brake, coolant and windshield washer levels

  • Check the brakes, steering, headlights and lights, battery and wiper blades.
  • Check the levels of oil, brake and coolant fluids, windshield washer…

Essentials to take with you

  • Make sure you have the following items on board: a warning triangle, a safety vest, a medicine kit, wheel change equipment and a flashlight.
  • In summer, think of sunshades and sunglasses. Take enough water and drinks with you.
  • In winter. Don’t forget the antifreeze liquid, a squeegee, gloves and special equipment (chains, snow tires, etc.) in case it is required.

How to properly load a car?

  • Distribute the weights over the entire vehicle. Place the heaviest luggage as low as possible.
  • Do not have any objects before the rear window, so you can see clearly through the rear mirror
  • If you use roof bars, roof box, a bicycle carrier or a trailer, comply with the legal loading rules (exceeding the length of the vehicle, signage, etc.)
    It’s very important to properly tighten and load the goods since those might become a danger to other people in case they fall from the car
  • Load your vehicle the day before departure, if possible.

Road Planning

  • Prepare your route by favouring highways or bigger roads.
  • Find out about traffic conditions and weather forecasts for the entire route. Use apps such as Waze.
  • It’s the holidays, no stress! So, take some time to rest. On the way, take a break as soon as the need is felt, don’t fight against sleep. As a rule of thumb a 30-minute break every two hours of driving
    Avoid leaving after a day’s work, opt instead for an early departure.
    Be aware that you are going away for long hours, remember to put on an outfit in which you feel comfortable to drive. Navigation Systems and Apps

If you don’t want to buy a navigation system, there is no need. If you have a smartphone, you don’t even need a mobile Internet or mobile network connection, GPS works for free without connectivity.
However, you would need to download the maps beforehand, so GoogleMaps is not always the best solution…

Our favourite navigation apps are:

  • Co-Pilot. Download of one map for one country for free
  • Offline Maps & Navigation on Google Play Store. Less quality then Co-Pilot, but completely for free

Pro Tip For Navigation

Learn how to navigate by just listening to the voice of the navigation system. Watching the map while driving is distracting and a potential cause for accidents. So try to just put the navigation system on the speaker and turn off the display.

Dont’s during navigating

If you realize in the last moment that you miss a turn, don’t make rush movements and try to catch it. It’s always better to have a small detour rather than taking a risk of an accident.

7 Tips on being the perfect car passenger !

Unlike what you might think, you don’t become a passenger in a car once you’re sitting inside, but as soon as you open the door to sit down. Even if the passenger is under the responsibility of the driver, he has duties to fulfill.

1. Make sure that all interactions with the driver are considerate and not distracting. 

2. Don’t talk too loudly or putting music on the radio too loud it can distract the driver and possibly cause an accident.

3. Be cautious – wear your seat belt.

Reminder: The non-wearing of the seat belt for a passenger is punishable by a penalty of 135 euros. If the offender is of legal age, he/she will have to pay the fine; for an underage person, the driver will pay (with no points deducted).

4. Don’t wait for the driver to tell you to put it on or refuse to put it on when asked.

5. Don’t stress the driver by starting arguments or giving advice on how to driver

6. Co-pilot with respect and consideration. Warn the driver when navigating on the road, however, make sure that you do not warn the driver about unnecessary things. Your warning might take away attention from actually more important events on the road.

7. The entry and exit of a passenger must be done in optimal safety conditions. The greatest care must, therefore, be taken when opening the door so as not to obstruct traffic on the road.

Even if the driver has the most responsibility, the passenger also has a part to play when it comes to safety in the car: making sure that the driver is in the best conditions for a safe and enjoyable journey!