Monitor Contacts Relation with Monica CRM and Raspberry PI (Self Hosted)

Constructing a powerful buddy and buyer relationship is a key issue to create belief and getting higher life and job outcomes. When you could have a number of contacts, it's actually onerous to recollect all of their information. Monica CRM and Raspberry PI enable creating an affordable resolution to make all these knowledge safe (self hosted) and nicely organized

On this tutorial, I’m going to point out you how one can set up Monica CRM on Raspberry PI with docker.

Monica is an open supply CRM that helps in organizing social interactions. It's constructed to handle household/pals relations. However, in my trustworthy opinion, it has nice potential with managing relations with clients on the subject of creating a powerful relationship and belief.

Major Monica options embrace:

  • an entire contact sheet, with important information like relations / dad and mom names, addresses, telephones, relations frequency (to recollect to name it again in future), vital dates and in addition present supplied in previous. This, beside an area for common notes
  • a robust dashboard, permitting to seek the advice of favorite notes about your contacts and an inventory of deliberate occasions or reminders about your contacts.
  • a journal, permitting to take monitor of your every day log

Essential factor, Monica is a web-based resolution. So, as soon as put in in your Raspberry PI you need to use it from any gadget with a standard browser with out the necessity for consumer software program.

For this tutorial, I’m going to make use of a Raspberry PI 3 mannequin B+, however this tutorial ought to work with any Raspberry PI laptop board (not for Raspberry PI Pico, as it is a microcontroller).

What We Want

Raspberry PI 4 model B image

As normal, I counsel including from now to your favorite e-commerce purchasing cart all wanted {hardware}, in order that on the finish it is possible for you to to guage total prices and determine if persevering with with the venture or eradicating them from the purchasing cart. So, {hardware} shall be solely:

Verify {hardware} costs with the next hyperlinks:

Amazon raspberry pi boards box
Amazon Micro SD box
Amazon Raspberry PI Power Supply box

Step-by-Step Process

Put together Working System

Begin getting ready your OS. Set up Raspberry PI OS Lite for a quick, headless OS and to get one of the best performances out of your board. You may as well use Raspberry PI OS Desktop, on this case working from its inside terminal.

Make certain your OS is updated. Out of your terminal, use the next command:

sudo apt replace -y && sudo apt improve -y

Now you can use my tutorial to put in docker and docker-compose in your Raspberry PI.

Put together Docker Information

We're going to use docker-compose to be able to simplify set up. As soon as all information from this tutorial shall be out there in your board, it is possible for you to to have Monica up with a single terminal command!

As MariaDB can’t run straight from Docker hub, we’ll construct it from a Debian picture, including all of the instructions required to accurately go up in a Dockerfile.

Earlier than getting information, please create a devoted folder to your Monica set up. From terminal:

mkdir monicaCRM
cd monicaCRM

We’ll organize 3 information for this listing, getting the next construction on the finish:

pi@raspberrypi:~/monicaCRM $ ls -la
complete 20
drwxr-xr-x 2 pi pi 4096 Oct  3 16:25 .
drwxr-xr-x 5 pi pi 4096 Oct  3 15:07 ..
-rw-r--r-- 1 pi pi  426 Oct  3 16:11 docker-compose.yml
-rw-r--r-- 1 pi pi  374 Oct  3 15:20 Dockerfile
-rw-r--r-- 1 pi pi  135 Oct  3 15:21 mySqlScript.sql

Dockerfile:

The Dockerfile is required to create the MariaDB container from a Debian picture. It contains all of the instructions to create a customized picture working on Raspberry PI.

Create a brand new “Dockerfile” file and enter enhancing with the nano editor.

nano Dockerfile

Copy and paste the next content material in your Dockerfile:

FROM debian
RUN apt replace -y && apt set up mariadb-server -y
RUN sed -i 's/bind-address/bind-address = 0.0.0.0 #/i' /and so on/mysql/mariadb.conf.d/50-server.cnf
RUN mkdir /mysql_scripts
COPY mySqlScript.sql /mysql_scripts/
RUN /and so on/init.d/mariadb begin && mysql -uroot --password="" -e "supply /mysql_scripts/mySqlScript.sql"
CMD /and so on/init.d/mariadb begin && tail -f /dev/null

Shut and save the file.

All of those traces are nicely defined in my Create a Custom MariaDB Container with Raspberry PI and Docker tutorial.

mySqlScript.sql

Additionally, mySqlScript.sql is required to initialize the MariaDB database for Monica CRM. This script shall be executed solely on the very first run of MariaDB container and can create a consumer in a position to handle the database (once more, as defined in my Create a Custom MariaDB Container with Raspberry PI and Docker).

Create this as a brand new file with the nano editor, utilizing the next terminal command:

nano mySqlScript.sql

Copy and paste the next content material:

create consumer monicaDbUser@'%' recognized by 'monicaDbPassword';
grant all privileges on *.* to monicaDbUser@'%';
flush privileges;
stop

Change “monicaDbUser” and “monicaDbPassword” together with your favorite ones. Then shut and save the file.

docker-compose.yml

Earlier than creating the docker-compose file, we’ll want a random encryption key to get the app working. We don’t want and particular password and the app key will be self-generated on Raspberry PI with the already out there openssl, through the use of the next command:

openssl enc -aes-128-cbc -k secret -P -iter 1 | grep key

This may give a outcome just like the next:

key=013A6D029FDFEE2661FA0CE8E32DE73F

The important thing to make use of is all of the row content material excluding the preliminary ” key=” chars. Preserve it on a notepad, as we have to copy it within the subsequent file.

Now, create a brand new “docker-compose.yml” file with nano:

nano docker-compose.yml

Copy and paste the next content material:

model: "3.4"

providers:
 app:
  picture: monica
  depends_on:
    - db
  ports:
    - 8080:80
  surroundings:
    - APP_KEY=013A6D029FDFEE2661FA0CE8E32DE73F
    - DB_HOST=db
    - DB_USERNAME=monicaDbUser
    - DB_PASSWORD=monicaDbPassword
  volumes:
    - knowledge:/var/www/html/storage
  restart: at all times

 db:
  construct: .
  volumes:
    - mysql:/var/lib/mysql
  restart: at all times

volumes:
 knowledge:
  identify: knowledge
 mysql:
  identify: mysql

Change the APP_KEY together with your openssl key and the DB_USERNAME and DB_PASSWORD parameters together with your ones saved in your mySqlScript.sql file. Save and shut.

As you possibly can see from this file, we use 2 important sections. The primary one units Monica as from the official set up process and parameters. The second permits the constructing of our database (as a substitute of default MySQL). Ultimate volumes mapping create persistent knowledge folders in your Raspberry PI in order that even after a container cease/deletion you can see all information saved outdoors the container. These volumes can be found from “/var/lib/docker/volumes” folder and are seen solely from a root consumer (or with sudo).

Execute Docker-Compose

With all of the work ready in earlier information, container creation turns into so simple as launching from the identical listing the place information are saved following command:

docker-compose up -d

You will note docker downloading Debian picture (if not out there domestically), updating aptitude repositories, putting in and configuring your MariaDB container, earlier than getting MonicaCRM picture.

On the finish you must see one thing like the next:

pi@raspberrypi:~/monicaCRM $ docker-compose up -d
Creating community "monicacrm_default" with the default driver
Creating quantity "knowledge" with default driver
Creating quantity "mysql" with default driver
Creating monicacrm_db_1 ... completed
Creating monicacrm_app_1 ... completed

Notice for “At the very least one invalid signature was encountered.” error

After some launch upgrades, a number of individuals encountered an error on “docker-compose up -d” command. This error studies one thing just like the next output:

Step 2/7 : RUN apt-get replace -y && apt-get set up mariadb-server -y
—> Working in 432c6c634d35
Get:1 http://safety.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:2 http://deb.debian.org/debian bullseye InRelease [113 kB]
Err:1 http://safety.debian.org/debian-security bullseye-security InRelease
At the very least one invalid signature was encountered.
Err:2 http://deb.debian.org/debian bullseye InRelease
At the very least one invalid signature was encountered.
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
At the very least one invalid signature was encountered.

With container not working in any respect.

The basis explanation for the issue appears to be in libseccomp model put in by default on Raspberry PI OS. The newer model of libseccomp fixes the issue, however it isn't but out there in Debian’s steady repos (from apt) and it's good to set up it manually. From terminal, obtain the deb package deal:

wget http://ftp.de.debian.org/debian/pool/important/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb

Then set up the package deal:

sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

This may resolve the “At the very least one invalid signature was encountered” error. Then you possibly can go on as for this tutorial with:

docker-compose up -d

Accessing Monica

As soon as run the docker-compose up command, even when the “completed” suggestions from terminal, about one minute will be wanted to get your set up working. At this level, our work on Raspberry PI has completed and we will begin utilizing Monica from exterior gadgets.

Out of your private laptop or another gadget, open your favorite browser and use your Raspberry PI’s IP tackle with the 8080 port as URL. As my RPI tackle is 192.168.1.238, my URL shall be “http://192.168.1.238:8080” and you can be redirected to the next display:

Raspberry PI Monica CRM new installation admin registration

Right here you possibly can select your favorite language on the highest half. Then, add your very first account to enter Monica by filling fields together with your e mail, identify, surname and password.

You will want to simply accept Privateness Coverage and Phrases of use, by selecting the associated flag after which you possibly can enter by urgent the “Register” button on the finish of the web page:

Raspberry PI Monica CRM dashboard

Including contacts and associated information, as utilizing the entire software program is kind of simple and doesn’t require advanced fields, in addition to utilizing the entire software program is actually intuitive. Nonetheless, I'd counsel the Monica workforce to create a extra full consumer handbook, because the GitHub User Docs for Monica is actually poor when it comes to how one can. In any case, this doesn’t change my opinion of this software program which has, for me, a really nice potential.

Take pleasure in!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *