Ruthalas Posted October 31, 2018 Share Posted October 31, 2018 I recently cam across this Hacker News thread detailing a self-hosted CRM for relationships called Monica. It would allow you to track various details of interpersonal relationships, from birthdays to gifts to debts. I'd like to get it running, but the docker instructions include a lot of details about setting up an .env file. I am not well versed in Docker, but I have managed to get one or two template-less dockers up and running. None had this much extra configuration though. Is this sort of setup feasible in the unRAID docker environment, and if so, how complex is getting that set up? Quote Link to comment
tjb_altf4 Posted October 31, 2018 Share Posted October 31, 2018 (edited) Search via CA in unRAID and extend search to docker hub. The GitHub repository linked is for those wanting to build the image from scratch. It looks like "monicahq" is the official docker hub repository for Monica CRM. https://hub.docker.com/u/monicahq/ Edited October 31, 2018 by tjb_altf4 Quote Link to comment
Ruthalas Posted October 31, 2018 Author Share Posted October 31, 2018 (edited) 7 hours ago, tjb_altf4 said: Search via CA in unRAID and extend search to docker hub. The GitHub repository linked is for those wanting to build the image from scratch. It looks like "monicahq" is the official docker hub repository for Monica CRM. https://hub.docker.com/u/monicahq/ Thanks for the response. The portion I am struggling with is how to implement the .env file portion of the quickstart guide: Quickstart Download a copy of MonicaHQ's example configuration file: $ curl https://raw.githubusercontent.com/monicahq/monica/master/.env.example > .env Edit it: Set APP_KEY to a random 32-character string. For example, if you have the pwgen utility installed, you could copy and paste the output of pwgen -s 32 1. Edit the MAIL_* settings to point to your own mailserver. Set DB_* settings to point to your database configuration. If you don't want to set a db prefix, be careful to set DB_PREFIX= and not DB_PREFIX='' as docker will not expand this as an empty string. Run this image: $ docker run --env-file .env -p 80:80 monicahq/monicahq I can fetch the file and prepare it, but I'm not sure how to incporate the .env file into the creation of the docker in unRAID. Where would I place the .env file such that the (as yet not created) docker can access it? How do I replicate that final 'docker run' command in my unRAID docker interface? Edited October 31, 2018 by Ruthalas Code block had incorrect syntax highlighting. 1 Quote Link to comment
tjb_altf4 Posted November 3, 2018 Share Posted November 3, 2018 @Ruthalas After looking further into this package I got interested and wanted it working too haha. One method I knew would work was to add all variables to the docker template... no thanks 😛 Though some google-fu and trial and error, I eventually worked out how to pass the .env file and got monica running. If you manually create the monicahq folder in appdata directory and add the .env file there, you can point to it in the Extra Parameters section of the docker template (advanced setting enabled) with this: --env-file=/mnt/user/appdata/monicahq/.env Other than adding port and the appdata path (probably needed later on) this is all that is needed to get the service going, but be warned it may need some further tweaking. I've also setup monica's db in mariadb, if anyone is interested in how to set that up I'm happy to share. 1 Quote Link to comment
Ruthalas Posted November 4, 2018 Author Share Posted November 4, 2018 Oh! Nice work! I'd love to hear about how you configured your mariahdb. Quote Link to comment
tjb_altf4 Posted November 4, 2018 Share Posted November 4, 2018 Assuming MariaDB is already up and running, bash into the docker container (or select console on the mariadb docker context window). In the console enter the following command, if there's no password set on mariadb, press enter on password prompt. mysql -u root -p Once logged in run the following commands, modifying password and username fields as you require. CREATE USER 'monicaUser' IDENTIFIED by 'monicaPassword'; CREATE DATABASE IF NOT EXISTS monicahq CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci; GRANT ALL PRIVILEGES ON monicahq.* TO 'monicaUser' IDENTIFIED BY 'monicaPassword'; Note the created values, these will need to be added to the database connection details in the .env file I've also set up the collation (in the statement above) to allow for emoji data to be stored, we turn this setting on in Monica in the docker .env file by setting emoji usage to true # Use utf8mb4 database charset format to support emoji characters # ⚠ be sure your DBMS supports utf8mb4 format DB_USE_UTF8MB4=true 1 Quote Link to comment
Ruthalas Posted November 8, 2018 Author Share Posted November 8, 2018 @tjb_altf4 Thank you for your help! I will try to get this set up soon, and report back if I have any questions. Quote Link to comment
Ruthalas Posted November 8, 2018 Author Share Posted November 8, 2018 Ok! Question for you. I spun up the database, made monicahq database, and spun up the docker. When I launch the web interface I get the following error: Whoops! Something went wrong. The stream or file "/var/www/monica/storage/logs/laravel-2018-11-08.log" could not be opened: failed to open stream: Permission denied Back to homepage My docker config looks like this: And the Access Mode for the container path remap is "Read/Write". (I tried RW/Slave as well.) (I figured manually creating the folder might be skewing the permissions, so I tried letting the unRAID docker setup create the directory, then placing the env file in, but that didn't change anything.) Any guidance? Quote Link to comment
tjb_altf4 Posted November 8, 2018 Share Posted November 8, 2018 2 things to try: Create the folder in midnight commander (unraid main console, then mc), navigate to the appdata folder and create folder via mkdir (F7) File should be .env not env.ini, what you've done is probably ok, but mine is named simply .env 1 Quote Link to comment
ninjaneer68 Posted April 14 Share Posted April 14 should this work using postgressql ? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.