MonicaHQ

MonicaHQ sohuld be a tool to note and organize your entire life. A bit like a CRM, but on a personal base. I tried to install it, but failed after one full day of attempts and the tickets i opened about that fell silent so far, so i gave up because i prefer something more actively supported and better documented.

As a short reminder:

useradd -d /data/daemons/monicahq -m monicahq
mkdir /data/monicahq
chown monicahq:users /data/monicahq -R
mkdir /data/monicahq/storage
mkdir /data/monicahq/mysql
chown monicahq:users /data/monicahq -R
su - monicahq

Then i created the following docker-composer.yml:

podman-compose.yml
version: "3.9"

services:
  app:
    image: monica:5.0-apache
    depends_on:
      - db
    ports:
      - 9980:80
    environment:
      - APP_ENV=local
      - APP_KEY=qHOBIml3zoCUNPbNfg9GaxXw7+6vh4MA
      - APP_URL=http://casa.gardiol.org/monicahq
      - APP_TRUSTED_PROXIES=*
      - DB_HOST=db
      - DB_DATABASE=monica
      - DB_USERNAME=monica
      - DB_PASSWORD=monica_secret
      - LOG_CHANNEL=stderr
      - CACHE_DRIVER=database
      - SESSION_DRIVER=database
      - QUEUE_DRIVER=sync
    volumes:
      - /deposito/monicahq/storage:/var/www/html/storage
    networks:
      - monicahq-net

  db:
    image: mariadb:latest
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=monica_secret
    volumes:
      - /deposito/monicahq/mysql:/var/lib/mysql
    networks:
      - monicahq-net

networks:
  monicahq-net: {}

I first tried with monica:apache image, then tried the monica:5.0-apache but got worse reuslts.

The NGINX configuration was:

monicahq.conf
location /monicahq/ {
    proxy_pass         http://127.0.0.1:9980/;
    proxy_redirect     off;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
}

Here i also tried all the combinations i could thing of.

At the end of the day, i managed to run the monica:apache image but only on port 9980, never trough the reverse proxy (it seems APP_URL is ignored or mis-managed, as well as the production/local setting forces HTTPS/HTTP in a weird way).