Herramientas de usuario

Herramientas del sitio


informatica:software:aplicaciones_web:monica

Monica

CRM para las relaciones humanas.

Características:

  • Gestión de contactos: información personal, registro de llamadas, recordatorios…
  • Diario: cómo ha ido el día, actividades automáticas con los contactos.

Instalación

Docker

docker-compose.yml:

version: "3.4"

services:
  app:
    image: monica:fpm-alpine
    environment:
      - APP_KEY=Q9Z90QMfFBMNxuMF1QfUjrE9rBBHhYCJ
      - APP_TRUST_PROXIES=*
      - APP_ENV=production
      - DB_HOST=servidor-bd
      - MYSQL_ROOT_PASSWORD=root-password
      - MYSQL_DATABASE=monica
      - MYSQL_USER=usuario_monica
      - MYSQL_PASSWORD=usuario_password
      - DB_DATABASE=monica # seem required from config/database.php
      - DB_PASSWORD=usuario_password # seem required from config/database.php
      - DB_USERNAME=usuario_monica # seem required from config/database.php
      - MAIL_DRIVER=smtp
      - MAIL_HOST=smtp.sendgrid.net # ex: smtp.sendgrid.net
      - MAIL_PORT=587 # is using tls, as you should
      - MAIL_USERNAME=apikey
      - MAIL_PASSWORD=SG.IwzFudsasdxcRjjQ.yuTDxpTh9nFasdfasdaxcx1Fa-uZZ9UMMXyy0wCgYHDDjfVq3EOYo
      - MAIL_ENCRYPTION=tls
      - MAIL_FROM_ADDRESS=info@monica.lan # ex: email you want the email to be FROM
      - MAIL_FROM_NAME=Monica # ex: name of the sender
    volumes:
      - ./data:/var/www/html/storage

  web:
    build: ./config/nginx
    depends_on:
      - app
    environment:
      - VIRTUAL_HOST=p.tempwin.net # obligatorio para nginx-proxy
      - LETSENCRYPT_HOST=p.tempwin.net # obligatorio para letsencrypt proxy
      - LETSENCRYPT_EMAIL=tempwin@gmail.com # obligatorio para letsencrypt proxy
    volumes:
      - ./data:/var/www/html/storage:ro

En la carpeta config/nginx tenemos dos ficheros:

  • nginx.conf: configuración del servidor web Nginx
  • Dockerfile: configuración de la imagen de Monica.

Fichero nginx.conf:

# nginx.conf

worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    set_real_ip_from  10.0.0.0/8;
    set_real_ip_from  172.16.0.0/12;
    set_real_ip_from  192.168.0.0/16;
    real_ip_header    X-Real-IP;

    # Connect to app service
    upstream php-handler {
        server app:9000;
    }

    server {
        listen 80;

        server_name monica;

        ## HSTS ##
        # Add the 'Strict-Transport-Security' headers to enable HSTS protocol.
        # WARNING: Only add the preload option once you read about the consequences: https://hstspreload.org/.
        # This form will add the domain to a hardcoded list that is shipped in all major browsers and getting
        # removed from this list could take several months.
        #
        #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always;

        add_header Referrer-Policy "no-referrer" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header X-Download-Options "noopen" always;
        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-Permitted-Cross-Domain-Policies "none" always;
        add_header X-Robots-Tag "none" always;
        add_header X-XSS-Protection "1; mode=block" always;

        # Remove X-Powered-By, which is an information leak
        fastcgi_hide_header X-Powered-By;

        root /var/www/html/public;

        index index.html index.htm index.php;

        charset utf-8;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ ^/(?:robots.txt|security.txt) {
            allow all;
            log_not_found off;
            access_log off;
        }

        error_page 404 500 502 503 504 /index.php;

        location ~ /\.well-known/(?:carddav|caldav) {
            return 301 $scheme://$host/dav;
        }
        location = /.well-known/security.txt {
            return 301 $scheme://$host/security.txt;
        }
        location ~ /\.(?!well-known).* {
            deny all;
        }

        # set max upload size
        client_max_body_size 10G;
        fastcgi_buffers 64 4K;

        # Enable gzip but do not remove ETag headers
        gzip on;
        gzip_vary on;
        gzip_comp_level 4;
        gzip_min_length 256;
        gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
        gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

        # Uncomment if your server is build with the ngx_pagespeed module
        # This module is currently not supported.
        #pagespeed off;

        location ~ \.php(/|$) {
            # regex to split $uri to $fastcgi_script_name and $fastcgi_path
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;

            # Check that the PHP script exists before passing it
            try_files $fastcgi_script_name =404;

            fastcgi_pass php-handler;
            fastcgi_index index.php;

            include fastcgi_params;

            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            # Bypass the fact that try_files resets $fastcgi_path_info
            # see: http://trac.nginx.org/nginx/ticket/321
            set $path_info $fastcgi_path_info;
            fastcgi_param PATH_INFO $path_info;
        }

        # Adding the cache control header for js and css files
        # Make sure it is BELOW the PHP block
        location ~ \.(?:css|js|woff2?|svg|gif|json)$ {
            try_files $uri /index.php$request_uri;
            add_header Cache-Control "public, max-age=15778463";

            ## HSTS ##
            # Add the 'Strict-Transport-Security' headers to enable HSTS protocol.
            # Note it is intended to have those duplicated to the ones above.
            # WARNING: Only add the preload option once you read about the consequences: https://hstspreload.org/.
            # This form will add the domain to a hardcoded list that is shipped in all major browsers and getting
            # removed from this list could take several months.
            #
            #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always;

            add_header Referrer-Policy "no-referrer" always;
            add_header X-Content-Type-Options "nosniff" always;
            add_header X-Download-Options "noopen" always;
            add_header X-Frame-Options "SAMEORIGIN" always;
            add_header X-Permitted-Cross-Domain-Policies "none" always;
            add_header X-Robots-Tag "none" always;
            add_header X-XSS-Protection "1; mode=block" always;

            # Optional: Don't log access to assets
            access_log off;
        }

        location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
            try_files $uri /index.php$request_uri;

            # Optional: Don't log access to assets
            access_log off;
        }

        # deny access to .htaccess files
        location ~ /\.ht {
            deny all;
        }
    }
}
      
# Dockerfile

FROM monica:fpm-alpine AS monica

FROM nginx:alpine

COPY nginx.conf /etc/nginx/nginx.conf

# Copy content of monica image
COPY --from=monica /var/www/html /var/www/html
RUN ln -sf /var/www/html/storage/app/public /var/www/html/public/storage

Administración

Para añadirse uno mismo como contacto, hay que crearlo y establecer que somos nosotros desde Opciones → Configuración de la cuenta → My contact.

Importar contactos

Se puden importar contactos de Google Contacts.

Enviar e-mail de prueba

Si quieremos confirmar la configuración del correo electrónico, podemos indicar a Monica que envíe un e-mail de prueba:

php artisan monica:test-email

Nos pedirá la dirección del destinatario del e-mail y tratará de enviárselo.

Si usásemos Docker Compose:

docker-compose exec app php artisan monica:test-email

Suponiendo que app es el nombre del servicio que corresponde a Monica.

Traducción

Para colaborar en la traducción de la aplicación, se utiliza Crowdin

informatica/software/aplicaciones_web/monica.txt · Última modificación: por tempwin