Git Product home page Git Product logo

docker's Introduction

Monica's docker image

Docker Pulls Monica's docker

amd64 build status badge arm32v5 build status badge arm32v6 build status badge arm32v7 build status badge arm64v8 build status badge i386 build status badge mips64le build status badge ppc64le build status badge s390x build status badge

MonicaHQ

Monica can run with Docker images.

Prerequisites

You can use Docker and docker-compose to pull or build and run a Monica image, complete with a self-contained MySQL database. This has the nice properties that you don't have to install lots of software directly onto your system, and you can be up and running quickly with a known working environment.

For any help about how to install Docker, see their documentation

Use Monica docker image

There are two versions of the image you may choose from.

The apache tag contains a full Monica installation with an apache webserver. This points to the default latest tag too.

The fpm tag contains a fastCGI-Process that serves the web pages. This image should be combined with a webserver used as a proxy, like apache or nginx.

Using the apache image

This image contains a webserver that exposes port 80. Run the container with:

docker run -d -p 8080:80 monica

Using the fpm image

This image serves a fastCGI server that exposes port 9000. You may need an additional web server that can proxy requests to the fpm port 9000 of the container. Run this container with:

docker run -d -p 9000:9000 monica:fpm

Persistent data storage

To have a persistent storage for your datas, you may want to create volumes for your db, and for monica you will have to save the /var/www/html/storage directory.

Run a container with this named volume:

docker run -d 
-v monica_data:/var/www/html/storage
monica

Connect to a mysql database

Monica needs a database connection, and currently supports mysql/mariadb only. Run these to have a running environment:

mysqlCid="$(docker run -d \
 -e MYSQL_RANDOM_ROOT_PASSWORD=true \
 -e MYSQL_DATABASE=monica \
 -e MYSQL_USER=homestead \
 -e MYSQL_PASSWORD=secret \
 "mariadb:11")"
docker run -d \
 --link "$mysqlCid":mysql \
 -e DB_HOST=mysql \
 -p 8080:80 \
 monica

If you want to use a mysql installation that already exists, you can pass the database environment variables directly into the docker run command, with DB_HOST indicating the IP address of the MySQL database. Ensure all permissions are granted to the user specified in the enviornment variable DB_USERNAME.

docker run -d \
 -e DB_PORT=3306 \
 -e DB_DATABASE=monica \
 -e DB_USERNAME=homestead \
 -e DB_PASSWORD=secret \
 -e DB_HOST=0.0.0.0 \
 -p 8080:80 \
 monica

Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.

Run commands inside the container

Like every Laravel application, the php artisan command is very usefull for Monica. To run a command inside the container, run

docker exec CONTAINER_ID php artisan COMMAND

or for docker-compose

docker-compose exec monica php artisan COMMAND

where monica is the name of the service in your docker-compose.yml file.

Running the image with docker-compose

See some examples of docker-compose possibilities in the example section.


Apache version

This version will use the apache image and add a mysql container. The volumes are set to keep your data persistent. This setup provides no ssl encryption and is intended to run behind a proxy.

Make sure to pass in values for APP_KEY variable before you run this setup.

Set APP_KEY to a random 32-character string. You can for instance copy and paste the output of echo -n 'base64:'; openssl rand -base64 32.

  1. Create a docker-compose.yml file
version: "3.4"

services:
  app:
    image: monica
    depends_on:
      - db
    ports:
      - 8080:80
    environment:
      - APP_KEY=
      - DB_HOST=db
      - DB_USERNAME=usermonica
      - DB_PASSWORD=secret
    volumes:
      - data:/var/www/html/storage
    restart: always

  db:
    image: mariadb:11
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=usermonica
      - MYSQL_PASSWORD=secret
    volumes:
      - mysql:/var/lib/mysql
    restart: always

volumes:
  data:
    name: data
  mysql:
    name: mysql
  1. Set a value for APP_KEY variable before you run this setup. You can for instance copy and paste the output of

    echo -n 'base64:'; openssl rand -base64 32
  2. Run

    docker-compose up -d

    Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.

  3. Run this command once:

    docker-compose exec app php artisan setup:production

FPM version

When using FPM image, you will need another container with a webserver to proxy http requests. In this example we use nginx with a basic container to do this.

  1. Download nginx.conf and Dockerfile file for nginx image. An example can be found on the example section
    mkdir web
    curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/nginx.conf -o web/nginx.conf
    curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/Dockerfile -o web/Dockerfile

The web container image should be pre-build before each deploy with: docker-compose build

  1. Create a docker-compose.yml file
version: "3.4"

services:
  app:
    image: monica:fpm
    depends_on:
      - db
    environment:
      - APP_KEY=
      - DB_HOST=db
      - DB_USERNAME=usermonica
      - DB_PASSWORD=secret
    volumes:
      - data:/var/www/html/storage
    restart: always
  
  web:
    build: ./web
    ports:
      - 8080:80
    depends_on:
      - app
    volumes:
      - data:/var/www/html/storage:ro
    restart: always

  db:
    image: mariadb:11
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=usermonica
      - MYSQL_PASSWORD=secret
    volumes:
      - mysql:/var/lib/mysql
    restart: always

volumes:
  data:
    name: data
  mysql:
    name: mysql
  1. Set a value for APP_KEY variable before you run this setup. You can for instance copy and paste the output of

    echo -n 'base64:'; openssl rand -base64 32
  2. Run

    docker-compose up -d

    Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.

  3. Run this command once:

    docker-compose exec app php artisan setup:production

Make Monica available from the internet

To expose your Monica instance for the internet, it's important to set APP_ENV=production in your .env file or environment variables. In this case https scheme will be mandatory.

Using a proxy webserver on the host

One way to expose your Monica instance is to use a proxy webserver from your host with SSL capabilities. This is possible with a reverse proxy.

Using a proxy webserver container

See some examples of docker-compose possibilities in the example section to show how to a proxy webserver with ssl capabilities.

docker's People

Contributors

akrly avatar asbiin avatar dennisgaida avatar iloveitaly avatar lcx avatar mcsj120 avatar miladiir avatar mohammed90 avatar monicabot avatar tknobi avatar ymage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Use php.ini-production by default

Since #19 all the examples use php.ini-production.

I think it would make sense to move this step inside the monica container:

  • it removes boilerplates
  • it makes default install more secure
  • powerusers may still customize the config using $PHP_INI_DIR/conf.d/

I can make a PR if you agree.

Docker image failing

The docker container is failing when the deployment steps are followed. It exits with fatal error (Exit code 1). I've tried the docker-compose method and it doesn't work either. The container restarts every few seconds, again error code 1.

edit - apologies, I didn't follow the instructions correctly. Looks like the containers are working. Please delete this issue.

Examples don't use .env file + db user mismatch

I'm kinda new with docker but it seems that current examples instruct to download the .env file and define some proper settings in it, but the actual docker-compose.yml file doesn't use it (tested the simple)

I checked by running docker-compose config and all the env variables in the .env file are not used.

Checking compose docs I saw that we could use env_file to provide an external file for the vars.

After adding
env_file: - .env
in the compose file, and running docker-compose config, I get to see all variables defined (and the application pick it up).

---- edit

Also, the DB user in the example .env doesn't match the example db user in docker file

let me know if I can update the examples and submit a pr

Issue with documentation!

Hello! i am looking for the page at https://github.com/monicahq/docker/blob/main/docs/installation/mail.md which doesn't exist. all i need to know is for the environmental variables i can set in docker compose for monica for MAIL_* to set up a mail server, otherwise it's impossible to use this as it requires mail to invite and other things.

in short, i'm looking for a simple list of what different MAIL_* variables there are so i can set it up myself.

Rewrite or internal redirection cycle (monica:fpm)

Hello,
I really appreciate your work and I hope you can help with this issue.
I think "Photos" and "Documents" in the docker monica:fpm are broken.

Photos:

Photos are "empty":
screenshot

and I get errors like this:

app_1  | 172.24.0.4 -  21/Aug/2021:20:42:33 +0000 "GET /index.php" 200
web_1  | 2021/08/21 20:42:33 [error] 32#32: *91 rewrite or internal redirection cycle while internally redirecting to "/index.php/store/photos/WXG28Cm1XvswjH0IeNgfRdXzE4iUplkXddH5qAM2.jpg", client: 192.168.9.1, server: monica, request: "GET /store/photos/WXG28Cm1XvswjH0IeNgfRdXzE4iUplkXddH5qAM2.jpg HTTP/1.1", host: "m.mydomain.dk"

nginx.conf is not altered:

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 on;
        }

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

docker-compose.yml

version: "3.4"

services:
  app:
    image: monica:fpm
    depends_on:
      - db
    environment:
      - APP_ENV=production
      - APP_DEBUG=true
      - APP_KEY=38KOVH4VUMpATaIpyuQ1lMJaWY7lw6FM
      - HASH_SALT=7VOlCvzfDRvPhDC6NF+5HVA93Lk
      - HASH_LENGTH=18
      - APP_URL=https://m.mydomain.dk
      - APP_FORCE_URL=false
      - APP_TRUSTED_PROXIES=*
      - DB_HOST=db
      - DB_USERNAME=monica
      - DB_PASSWORD=secret
    volumes:
      - ./appdata:/var/www/html/storage
    restart: always

  web:
    build: ./web
    ports:
      - 8554:80
    depends_on:
      - app
    volumes:
      - ./webdata:/var/www/html/storage:ro
    restart: always

  db:
    image: mysql:5.7
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=secret
    volumes:
      - ./mysqldata:/var/lib/mysql
    restart: always

I've tried running the container behind reverse proxy and local, with and without https, with docker volumes and with binds like above. Nothing works with nginx/fpm - however it works fine with apache instead.
I've read that this endless loop can be fixed in nginx.conf, but that the real error resides in the app code(?)

Documents:

Documents works sometimes when uploading, but sometimes it fails saying: "There was an error uploading the document. Please try again below. " I get the same error with apache. Some files just wont upload no matter how many times you try (like "gifs_08 (1).gif") but I cant find a pattern regarding filenames or sizes.
Output from the container logs:

web_1  | 2021/08/21 20:51:56 [warn] 32#32: *178 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000015, client: 192.168.9.1, server: monica, request: "POST /people/h:5mME4pW0e2PNlDn9dv/documents HTTP/1.1", host: "m.mydomain.dk"
app_1  | 172.24.0.4 -  21/Aug/2021:20:51:56 +0000 "POST /index.php" 422
web_1  | 192.168.9.1 - - [21/Aug/2021:20:51:56 +0000] "POST /people/h:5mME4pW0e2PNlDn9dv/documents HTTP/1.1" 422 109 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.9.1"

I hope you can help me
Thank you in advance :)

Remove some unused packages from monica:fpm image

I see in the fpm/Dockerfile some effort is made to remove unused packages. But inspecting the resulting image, some packages seem questionable for a production image, for example autoconf, make, m4, curl (command-line tool), dpkg-dev, gcc. Those would be acceptable for an build-stage image where only required stuff would be installed/copied in the production-stage image. Furthermore, cleaning unused packages from a build-stage image would be pointless, so the apt-mark part would not be needed.

For reference:

% docker run --rm --entrypoint /bin/sh -it monica:fpm -c "apt-mark showmanual"
autoconf
bash
busybox-static
ca-certificates
curl
dpkg-dev
file
g++
gcc
libargon2-1
libbrotli1
libbz2-1.0
libc6
libc6-dev
libcom-err2
libcurl4
libffi7
libfreetype6
libgcc-s1
libgcrypt20
libgmp10
libgnutls30
libgpg-error0
libgssapi-krb5-2
libhogweed6
libicu67
libidn2-0
libjpeg62-turbo  
libk5crypto3
libkeyutils1
libkrb5-3
libkrb5support0  
libldap-2.4-2
liblzma5
libmemcached11   
libnettle8
libnghttp2-14
libonig5
libp11-kit0
libpng16-16
libpsl5
libreadline8
librtmp1
libsasl2-2
libsodium23
libsqlite3-0
libssh2-1
libssl1.1
libstdc++6
libtasn1-6
libtinfo6
libunistring2
libwebp6
libxml2
libzip4
make
pkg-config
re2c
xz-utils
zlib1g

Can't register a new user

Hello,
Fresh docker install. Same issue with mysql or mariadb.
When I add the info in /register, I get an error about permissions issue. Once I fix this by giving the correct permissions to the laravel.log file I get another error stating that I can't register a new user :

Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'temperature_scale' in 'field list' (SQL: insert into users (account_id, first_name, last_name, email, password, locale, timezone, currency_id, temperature_scale, updated_at, created_at) values (1, First, Last, Redacted, $omething, fr, Europe/Paris, 4, celsius, 2022-08-29 12:50:03, 2022-08-29 12:50:03)) in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
Stack trace:
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback('insert into mo...', Array, Object(Closure)) /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(502): Illuminate\Database\Connection->run('insert into mo...', Array, Object(Closure))
2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(454): Illuminate\Database\Connection->statement('insert into mo...', Array) 3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into mo...', Array)
4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3028): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into `mo...', Array, 'id')
5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1655): Illuminate\Database\Query\Builder->insertGetId(Array, 'id')
6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1188): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array)
7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1153): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array)
8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(994): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder))
9 /var/www/html/app/Services/User/CreateUser.php(46): Illuminate\Database\Eloquent\Model->save()
10 /var/www/html/app/Models/Account/Account.php(664): App\Services\User\CreateUser->execute(Array)
11 /var/www/html/app/Http/Controllers/Auth/RegisterController.php(104): App\Models\Account\Account::createDefault('redacted', 'redacted', 'redacted', 'redacted', '172.18.0.1', 'fr')
12 /var/www/html/vendor/laravel/ui/auth-backend/RegistersUsers.php(34): App\Http\Controllers\Auth\RegisterController->create(Array)
13 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Auth\RegisterController->register(Object(Illuminate\Http\Request))
14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('register', Array)
15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Auth\RegisterController), 'register')
16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Route->run()
18 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
19 /var/www/html/app/Http/Middleware/RedirectIfAuthenticated.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
20 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\RedirectIfAuthenticated->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /var/www/html/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle(Object(Illuminate\Http\Request), Object(Closure))
23 /var/www/html/app/Http/Middleware/CheckCompliance.php(22): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckCompliance->handle(Object(Illuminate\Http\Request), Object(Closure))
25 /var/www/html/app/Http/Middleware/CheckVersion.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckVersion->handle(Object(Illuminate\Http\Request), Object(Closure))
27 /var/www/html/app/Http/Middleware/CheckLocale.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckLocale->handle(Object(Illuminate\Http\Request), Object(Closure))
29 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
31 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
33 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
35 /var/www/html/app/Http/Middleware/SentryContext.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SentryContext->handle(Object(Illuminate\Http\Request), Object(Closure))
37 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
39 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
40 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
41 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
42 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
43 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
45 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then(Object(Closure))
46 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
47 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
48 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
49 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
50 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
51 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
52 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
53 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
54 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
55 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
56 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
57 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
58 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
59 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
60 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
61 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
62 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
63 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
64 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))
65 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
66 /var/www/html/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
67 {main}

Any help would be appreciated as this was previously working and after a migration to another host it is not :(

Thanks in advance

running from portainer

Hi, if running this compose from portainer is there an alternate instruction set?

I've tried both with and without the final step "docker-compose exec app php artisan setup:production" but haven't been able to get it actually running, the closest I've gotten is creating a login profile on the local page at which point I get an error message

Forcing password characters is lame.

That is great that you want to force people to use a certain characters for passwords. I find this very annoying. At the very least make it optional.

APP_KEY and Docker secrets error: Unsupported cipher or incorrect key length

Docker secrets have recently been added to this project (#93), which is awesome, but I can't figure out how to get the variable APP_KEY to work.

version: "3.9"

services:
  app:
    container_name: monica-app
    depends_on:
      - db
    environment:
      - APP_ENV=production
      - APP_KEY=/run/secrets/monica-app-key
      - APP_TRUSTED_PROXIES=172.21.0.2
      - APP_URL=https://my-super-secret-domain.com
      - DB_HOST=db
      - DB_DATABASE=monica
      - DB_USERNAME=monica
      - DB_PASSWORD_FILE=/run/secrets/monica-mysql-password
      - LOG_CHANNEL=stderr
      - CACHE_DRIVER=database
      - SESSION_DRIVER=database
      - QUEUE_DRIVER=sync
      - TZ=Europe/Berlin
    image: monica:apache
    networks:
      - proxy
      - monica
    restart: always
    secrets:
      - monica-app-key
      - monica-mysql-password
    volumes:
      - data:/var/www/html/storage

  db:
    container_name: monica-db
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD_FILE=/run/secrets/monica-mysql-password
      - TZ=Europe/Berlin
    image: mysql:8.0
    networks:
      - monica
    restart: always
    secrets:
      - monica-mysql-password
    volumes:
      - mysql:/var/lib/mysql

secrets:
  monica-mysql-password:
     file: ./.secrets/mysql.txt
  monica-app-key:
     file: ./.secrets/appkey.txt

networks:
  proxy:
    external: true
  monica:

volumes:
  data:
  mysql:

My docker-compose.yml file works in general. However, when I access https://my-super-secret-domain.com it shows the following error:

monica-app  | [2023-02-12 21:08:40] production.ERROR: Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm. {"exception":"[object] (RuntimeException(code: 0): Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm. at /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:55)
monica-app  | [stacktrace]
monica-app  | #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\\Encryption\\Encrypter->__construct('/run/secrets/mo...', 'AES-256-CBC')
monica-app  | #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(889): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
monica-app  | #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(774): Illuminate\\Container\\Container->build(Object(Closure))
monica-app  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(860): Illuminate\\Container\\Container->resolve('encrypter', Array, true)
monica-app  | #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(710): Illuminate\\Foundation\\Application->resolve('encrypter', Array)
monica-app  | #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(845): Illuminate\\Container\\Container->make('encrypter', Array)
monica-app  | #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1047): Illuminate\\Foundation\\Application->make('encrypter')
monica-app  | #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(963): Illuminate\\Container\\Container->resolveClass(Object(ReflectionParameter))
monica-app  | #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(924): Illuminate\\Container\\Container->resolveDependencies(Array)
monica-app  | #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(774): Illuminate\\Container\\Container->build('App\\\\Http\\\\Middle...')
monica-app  | #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(860): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Middle...', Array, true)
monica-app  | #11 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(710): Illuminate\\Foundation\\Application->resolve('App\\\\Http\\\\Middle...', Array)
monica-app  | #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(845): Illuminate\\Container\\Container->make('App\\\\Http\\\\Middle...', Array)
monica-app  | #13 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(239): Illuminate\\Foundation\\Application->make('App\\\\Http\\\\Middle...')
monica-app  | #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(203): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response))
monica-app  | #15 /var/www/html/public/index.php(60): Illuminate\\Foundation\\Http\\Kernel->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response))
monica-app  | #16 {main}
monica-app  | "}

I checked several issues within this repository, as well as the main monica repo, and found similar issues like #6449. They suggest, as well as the documentation command for APP_KEY, that the 32 character string should be prefixed with base64:.

Quick side question: Why does openssl rand -base64 32 create a string with more than 32 characters?

Using APP_KEY directly in the docker-compose.yml file

docker-compose.yml

services:
  app:
    container_name: monica-app
    depends_on:
      - db
    environment:
      - APP_ENV=production
      - APP_KEY=base64:!-A-RANDOM-32-CHARACTER-STRING-!

This example works, but I don't want to have my environment variables available just like that.

Using APP_KEY in a env_file

docker-compose.yml

services:
  app:
    container_name: monica-app
    depends_on:
      - db
    env_file: .env
    environment:
      - APP_ENV=production

.env

APP_KEY=base64:!-A-RANDOM-32-CHARACTER-STRING-!

This example works as well, but I still don't want to have my environment variables available just like that.

Using Docker secrets

docker-compose.yml

services:
  app:
    container_name: monica-app
    depends_on:
      - db
    environment:
      - APP_ENV=production
      - APP_KEY=/run/secrets/monica-app-key
    secrets:
      - monica-app-key

secrets:
  monica-app-key:
     file: .secrets/appkey.txt

.secrets/appkey.txt

APP_KEY=base64:!-A-RANDOM-32-CHARACTER-STRING-!

It doesn't work with the same syntax as the .env file

.secrets/appkey.txt

APP_KEY=!-A-RANDOM-32-CHARACTER-STRING-!

It also won't work when I remove the prefix base64:.

Setting the path for the Docker secret to the env_file doesn't work either.

docker-compose.yml

secrets:
  monica-app-key:
     file: .env

  • Docker Secrets work for the MySQL Password.
  • The application also works when I omit the whole APP_KEY variable. However, I assume that I can't recover data in a recovery process without that key.

I am currently using the env_file as a workaround but would appreciate any input that you might have.

Docker Image Release Automation

It seems that the work needed to bump the version can be completely automated. We can set up an Action that fires on release in the main repo and have it request this repo's webhook to start another Action that replace the version label in Dockerfiles and create the corresponding pull request. This reduces some of the human effort and ensures that the Docker image version is as consistent as possible with the main repository.

Reminders not being sent out

Hi - I seem to be having some trouble getting reminders emailed to me.

I have Monica running in a docker container, using the following docker run command (some portions redacted for privacy)

docker run -d --name monica \
   -e DB_HOST=<REDACTED> \
   -e MAIL_MAILER=smtp \
   -e MAIL_HOST=<REDACTED> \
   -e MAIL_PORT=587 \
   -e MAIL_ENCRYPTION=tls \
   -e MAIL_USERNAME=<REDACTED> \
   -e MAIL_PASSWORD=<REDACTED> \
   -e MAIL_FROM_ADDRESS=<REDACTED> \
   -e MAIL_FROM_NAME=<REDACTED> \
   -e REQUIRES_SUBSCRIPTION=false \
   -p 7777:80 \
   --restart unless-stopped \
   monica

Emails appear to be working, both by using the artisan test email command (php artisan monica:test-email) as well as by testing using the "Forgot Password" functionality.

I am trying to get one time / weekly reminders working, but nothing comes to my inbox in these instances. Although, in the app I do see the next run date incrementing as expected - just no emails are being sent out.

The version I am currently running is Version: 2.19.1.

Any assistance is appreciated.

2016_09_10_164406_create_jobs_table FAIL on the first start

I'm trying to install Monica on my QNAP NAS using the "latest" docker version, but seems to be a problem with my MariaDB (the default and latest "10" version from QNAP, "10.5.8-MariaDB-log - MariaDB Server".

`In Connection.php line 760:

[Illuminate\Database\QueryException (42000)]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 1000 bytes (SQL: alter table monicajobs add in
dex monicajobs_queue_reserved_at_index(queue, reserved_at))

Exception trace:
at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
Illuminate\Database\Connection->runQueryCallback() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720
Illuminate\Database\Connection->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:546
Illuminate\Database\Connection->statement() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:109
Illuminate\Database\Schema\Blueprint->build() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:439
Illuminate\Database\Schema\Builder->build() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:285
Illuminate\Database\Schema\Builder->create() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338
Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/database/migrations/2016_09_10_164406_create_jobs_table.php:25
CreateJobsTable->up() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:481
Illuminate\Database\Migrations\Migrator->runMethod() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:399
Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:408
Illuminate\Database\Migrations\Migrator->runMigration() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:209
Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:36
Illuminate\Console\View\Components\Task->render() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:738
Illuminate\Database\Migrations\Migrator->write() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:209
Illuminate\Database\Migrations\Migrator->runUp() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:174
Illuminate\Database\Migrations\Migrator->runPending() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:117
Illuminate\Database\Migrations\Migrator->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:90
Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:615
Illuminate\Database\Migrations\Migrator->usingConnection() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:102
Illuminate\Database\Console\Migrations\MigrateCommand->handle() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
Illuminate\Container\Util::unwrapIfClosure() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
Illuminate\Container\BoundMethod::call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:663
Illuminate\Container\Container->call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:182
Illuminate\Console\Command->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:312
Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:152
Illuminate\Console\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1022
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:314
Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:168
Symfony\Component\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:102
Illuminate\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:155
Illuminate\Foundation\Console\Kernel->handle() at /var/www/html/artisan:37`

And Laravel documentation seems to be clear on that on how to fix:
https://laravel.com/docs/9.x/migrations#index-lengths-mysql-mariadb

Can you please check and advice?

Waiting for database to settle... MySQL Connection Error: (1045) Access denied for user

Hello I'm currently trying to get monica CRM to run using docker but every time I do I get this error

Waiting for database to settle...

Fatal error: Uncaught Error: mysqli object is already closed in Standard input code:40
�
Stack trace:

#0 Standard input code(40): mysqli->close()
�

}

  thrown in Standard input code on line 40

Waiting for database to settle...

MySQL Connection Error: (1045) Access denied for user 'homestead'@'ipaddress' (using password: YES)


Unable to contact your database��APP_KEY already set


Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'homestead'@'ipaddress' (using password: YES) in Standard input code on line 34


MySQL Connection Error: (1045) Access denied for user 'homestead'@'ipaddress' (using password: YES)


Waiting for database to settle...

where it says ipaddress I removed mine but it was saying the correct one.

this keeps happening not matter what I do

Need relative links, as opposed to absolute.

I've been having a hell of a time getting this to work with docker and having it exposed to the outside work behind a reverse proxy. While it loads, it seems the CSS isn't loading as nicely.

Digging around, it seems like the CSS style sheets are linked with a hard link as such:
<link rel="stylesheet" href="http://monica.xxxxx.com/css/app-ltr.css?id=xxxxxxxxxxxxxxxxxx">

When they should really be something like:
<link rel="stylesheet" href="https://monica.xxxxx.com/css/app-ltr.css?id=xxxxxxxxxxxxxxxxxx">

This makes me believe the code was written without using relative links, and more-so with hard links, specifically http as opposed to allowing for a check for https. Am I off here, or can this be looked into? Thanks!

Cant access monica server

hi
i have followed every instruction on the monica docker page and have successfully installed monica/mysql but when i access the monica server using localhost:8080 it just gives error. the only thing i change is the docker command
from
"docker run --name some-monica -d -p 8080:80 monica" to "docker run --name panda-monica -d -p 8080:80 monica"

monica access error

i am using debian bullseye
latest monica at this time
latest docker and docker-compose as of this time

Correct way to update with Docker Compose?

Hello, is there a special way to update monica with docker compose?

Normally I use WatchTower to do this automatically. However for monica I get the following error:

DEBU[0004] Trying to load authentication credentials.    container=/monica-app-1 image="monica-app:latest"
DEBU[0004] No credentials for monica-app:latest found    config_file=/config.json
DEBU[0004] Got image name: monica-app:latest
DEBU[0004] Checking if pull is needed                    container=/monica-app-1 image="monica-app:latest"
DEBU[0004] Building challenge URL                        URL="https://index.docker.io/v2/"
DEBU[0004] Got response to challenge request             header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
DEBU[0004] Checking challenge header content             realm="https://auth.docker.io/token" service=registry.docker.io
DEBU[0004] Setting scope for auth token                  image=monica-app scope="repository:library/monica-app:pull"
DEBU[0004] No credentials found.
DEBU[0005] Parsing image ref                             host=index.docker.io image=monica-app normalized="docker.io/library/monica-app:latest" tag=latest
DEBU[0005] Doing a HEAD request to fetch a digest        url="https://index.docker.io/v2/library/monica-app/manifests/latest"
WARN[0005] Could not do a head request for "monica-app:latest", falling back to regular pull.  container=/monica-app-1 image="monica-app:latest"
WARN[0005] Reason: registry responded to head request with "401 Unauthorized", auth: "Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/monica-app:pull\",error=\"insufficient_scope\""  container=/monica-app-1 image="monica-app:latest"
DEBU[0005] Pulling image                                 container=/monica-app-1 image="monica-app:latest"
DEBU[0006] Error pulling image monica-app:latest, Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
INFO[0006] Unable to update container "/monica-app-1": Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. Proceeding to next.
DEBU[0006] Trying to load authentication credentials.    container=/monica-db-1 image="mysql:5.7"
DEBU[0006] No credentials for mysql:5.7 found            config_file=/config.json
DEBU[0006] Got image name: mysql:5.7
DEBU[0006] Checking if pull is needed                    container=/monica-db-1 image="mysql:5.7"
DEBU[0006] Building challenge URL                        URL="https://index.docker.io/v2/"
DEBU[0006] Got response to challenge request             header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
DEBU[0006] Checking challenge header content             realm="https://auth.docker.io/token" service=registry.docker.io
DEBU[0006] Setting scope for auth token                  image=mysql scope="repository:library/mysql:pull"
DEBU[0006] No credentials found.
DEBU[0007] Parsing image ref                             host=index.docker.io image=mysql normalized="docker.io/library/mysql:5.7" tag=5.7
DEBU[0007] Doing a HEAD request to fetch a digest        url="https://index.docker.io/v2/library/mysql/manifests/5.7"
DEBU[0007] Found a remote digest to compare with         remote="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945"
DEBU[0007] Comparing                                     local="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945" remote="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945"
DEBU[0007] Found a match
DEBU[0007] No pull needed. Skipping image.
DEBU[0007] No new images found for /monica-db-```

If I try manually with `docker compose pull` I get the following error:

~/monica$ docker compose pull
[+] Running 1/2
⠿ app Warning 1.5s
⠿ db Pulled 1.3s
WARNING: Some service image(s) must be built from source by running:
docker compose build app
1 error occurred:
* Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied


I can do `docker compose build app` but I am not sure if that is the correct way to update and it would be great if I could make it work with WatchTower?

Thanks!

version: "3.4"

services:
app:
build: ./app
image: monica-app
depends_on:
- db
env_file: .env
environment:
- DB_HOST=db
- DB_USERNAME=monica
- DB_PASSWORD=secret
ports:
- 8380:80
volumes:
- data:/var/www/html/storage
restart: always

db:
image: mysql:5.7
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD=secret
volumes:
- mysql:/var/lib/mysql
restart: always

volumes:
data:
mysql:

Define Database Port

Is it possible to define what port the db is to be accessed at. I'd like to run mariadb on a port besides 3306

Option to log the real IP if behind a reverse proxy?

I'm running a monica docker container behind a separate SSL proxy. I've set the proxy's IP in the APP_TRUSTED_PROXIES variable. When I look at my logs in docker, I get the IP of the proxy showing up and not my client's actual IP. Is there any way to fix that by setting some other environment variable or otherwise?

Upgrade PHP

The current PHP 7.3 looks outdated. Any plan to upgrade it to 7.4 or even 8?

SSL Termination causing issues fetching content

I have Monica running in a docker container with a Traefik container performing the SSL termination. Assume my domain is potato.com in the description below.

  1. I have configured Monica's container with the Traefik rule to use the hostname "monica.potato.com". Traefik will do HTTPs and then hit Monica's container on :80
  2. If I hit https://monica.potato.com I am redirected to the dashboard page, and am able to create the first user. However, the style's all broken and the form submission generates a browser warning saying it's unsafe
  3. Opening the browser console shows that a few resources (JS and CSS) have been blocked because they are trying to be fetched from http://monica.potato.com and indeed if I open the source of the dashboard page I see the below
 <link rel="stylesheet" href="http://monica.potato.com/css/app-ltr.css?id=523470c277b241ddce13">

Is there something else that needs to be configured in the container for this to work well? Maybe something that lets apache know that although what's reaching it is an http request it should use https URLs?
I don't think it makes sense to be doing body rewrites in Traefik to address this, but I'm very ignorant of PHP+Apache so I have no idea what I'd need to get this working.
Happy to provide more info if needed.

Database keeps crashing

Hello everyone.

This project seems awesome and I wanted to install it but I keep failing whatever I try. Even following the most basic instructions from your documentation leads me to constant fails.

Here is my last try (straight from your documentation, I only modified the host port for testing on localhost) :

# Run Monica with apache backend

version: "3.9"

services:
  app:
    image: monica:apache
    depends_on:
      - db
    ports:
      - 8080:80
    environment:
      - APP_ENV=production
      - DB_HOST=db
      - DB_DATABASE=monica
      - DB_USERNAME=monica
      - DB_PASSWORD=secret
      - LOG_CHANNEL=stderr
      - CACHE_DRIVER=database
      - SESSION_DRIVER=database
      - QUEUE_DRIVER=sync
    volumes:
      - data:/var/www/html/storage
    restart: always

  db:
    image: mysql:8.0
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=secret
    volumes:
      - mysql:/var/lib/mysql
    restart: always

volumes:
  data:
    name: data
  mysql:
    name: mysql

I do a simple docker compose up -d in my console next to it. The database container is stuck in a crash loop (the app container seems to work but, of course, can not reach the database)

What the docker logs gives me on this mysql container :

2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-04-01T13:50:25.734209Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-04-01T13:50:25.735747Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-04-01T13:50:25.746842Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-01T13:50:25.849909Z 1 [ERROR] [MY-012526] [InnoDB] Upgrade is not supported after a crash or shutdown with innodb_fast_shutdown = 2. This redo log was created with MySQL 5.7.41, and it appears logically non empty. Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/upgrading.html
2023-04-01T13:50:25.849938Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2023-04-01T13:50:26.292553Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-04-01T13:50:26.293019Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-04-01T13:50:26.293073Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-04-01T13:50:26.294307Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32)  MySQL Community Server - GPL.

Am I doing something wrong ? Am I missing a step ? Do I need a .env file (I tried it too but with the same result)? Or is it a bug ?

Thank you for your wonderful work.

Can not Setup Normal Docker Container Container

I can not create a normal Monica hq Docker Container with the nomral Settings in my Docker docker-compose.yml.

Configuration

See my File Configuration:

version: "3.4"

services:
  app:
    image: monica
    depends_on:
      - db
    ports:
      - 8080:80
    environment:
      - APP_KEY=
      - DB_HOST=db
      - DB_USERNAME=usermonica
      - DB_PASSWORD=secret
    volumes:
      - data:/var/www/html/storage
    restart: always

  db:
    image: mysql:5.7
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=usermonica
      - MYSQL_PASSWORD=secret
    volumes:
      - mysql:/var/lib/mysql
    restart: always

volumes:
  data:
    name: data
  mysql:
    name: mysql

Error Message

Seems like a Database Conection Error:
Error Message:

thrown in Standard input code on line 56 Database ready.��APP_KEY already set Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'monicauser'@'%' to database 'monica' in Standard input code:56 � Stack trace: #0 Standard input code(56): mysqli->query('CREATE DATABASE...') � } thrown in Standard input code on line 56 Database ready.��APP_KEY already set Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'monicauser'@'%' to database 'monica' in Standard input code:56 � Stack trace: #0 Standard input code(56): mysqli->query('CREATE DATABASE...') � }

DB container replaces volume during watchtower update

Hi folks, it looks like whenever watchtower updates the mysql container for monica it's creating a new volume and to get the DB back up I'm manually reassigning the original volume, can I get advice on how to prevent that (besides disabling watch tower, or maybe I should look into excluding the mysql container in some way)

my compose:

services:
  monica:
    image: monica:3.0.1-apache
    depends_on:
      - monica-db
    container_name: monica_personal
    ports:
      - 8091:80
    environment:
      - APP_KEY=base64:klkdjflskdjfalskdflksdfjlaskojf?????0E=
      - DB_HOST=monica-db
      - DB_USERNAME=monica
      - DB_PASSWORD=passwordmatch
      - APP_TRUSTED_PROXIES="*"
      - APP_URL=https://monica.example.com
    # volumes:
    #   - data:/var/www/html/storage
    restart: unless-stopped


  monica-db:
    image: mysql:5.7
    container_name: monica-db
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=passwordmatch
    # volumes:
    #   - mysql:/var/lib/mysql
    restart: unless-stopped

Could not initialize random number generator

When i try to install monicahq in docker on my synology i get the next error:
Database ready.[Mon May 09 12:28:40.199417 2022] [:crit] [pid 1] (38)Function not implemented: AH00141: Could not initialize random number generator
Could someone please point me in a direction in how to solve this?

✓ Maintenance mode: on
'/usr/local/bin/php' 'artisan' down --retry="10"
Application is now in maintenance mode.
✓ Resetting application cache
'/usr/local/bin/php' 'artisan' cache:clear
Application cache cleared!
✓ Clear config cache
'/usr/local/bin/php' 'artisan' config:clear
Application key set successfully.
Configuration cache cleared!
✓ Clear route cache
'/usr/local/bin/php' 'artisan' route:clear
Route cache cleared!
✓ Clear view cache
'/usr/local/bin/php' 'artisan' view:clear
Compiled views cleared!
✓ Performing migrations
'/usr/local/bin/php' 'artisan' migrate --force
Nothing to migrate.
✓ Check for encryption keys
'/usr/local/bin/php' 'artisan' monica:passport --force
Checking encryption keys...
✓ Files storage/oauth-private.key and storage/oauth-public.key detected.
Checking Personal Access Client...
✓ Personal Access Client already created.
✓ Ping for new version
'/usr/local/bin/php' 'artisan' monica:ping --force
Call url: https://version.monicahq.com/ping
instance version: 3.7.0
current version: 3.7.0
✓ Maintenance mode: off
'/usr/local/bin/php' 'artisan' up
Application is now live.
Monica v3.7.0 is set up, enjoy.
Database ready.[Mon May 09 12:28:40.199417 2022] [:crit] [pid 1] (38)Function not implemented: AH00141: Could not initialize random number generator

http works fine but ran through HAproxy reverse proxy and I fonts/pics is disaster and cant register or login.

Hi,

Setup monicahq from dockerhub. The latest new monica image.
used the docker-comose file basically as standard.

Then pointed my HAproxy to the port as I have done on 20 other services without issues.
But this time on monica Im met with a registerpage that is basically broken.

But if I visit the site without the reverse proxy it works fine. I have had no other problems like this and run like a homelab with bunch of services and stuff all behind my HAproxy reverse proxy,

Any ideas?

Any plans for an "all-in-one" container?

Is there any plans for a single container that can run Monica without any other dependencies?

Reading the documentation, it seems that it could be easily constructed, simply by adding mysql in one of the existing containers.

Unable to use Docker Host

Not sure if something is missing from the instructions for docker, but when trying to run the docker image I have had 0 success getting the application to work properly. It always ends up trying to connect to resources using the private IP of the host instead of the configured hostname in apache2 and the container. Is there a step I missed?

docker-compose setup does not work: Access denied for user 'monica'@...

Hi, I followed this instructions to set up monica with docker-compose: https://github.com/monicahq/docker#apache-version

However, on start up, I get the error:

app_1  | In Connection.php line 671:
app_1  |                                                                                
app_1  |   [Illuminate\Database\QueryException (1045)]                                  
app_1  |   SQLSTATE[HY000] [1045] Access denied for user 'usermonica'@'172.21.0.3' (us  
app_1  |   ing password: YES) (SQL: select * from information_schema.tables where tabl  
app_1  |   e_schema = monica and table_name = cache and table_type = 'BASE TABLE')      
app_1  |                                                                                
app_1  | 
app_1  | Exception trace:
app_1  |   at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
app_1  |  Illuminate\Database\Connection->runQueryCallback() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:631
app_1  |  Illuminate\Database\Connection->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:339
app_1  |  Illuminate\Database\Connection->select() at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php:18
app_1  |  Illuminate\Database\Schema\MySqlBuilder->hasTable() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
app_1  |  Illuminate\Support\Facades\Facade::__callStatic() at /var/www/html/app/Console/Commands/Update.php:66
app_1  |  App\Console\Commands\Update->handle() at n/a:n/a
app_1  |  call_user_func_array() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
app_1  |  Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:37
app_1  |  Illuminate\Container\Util::unwrapIfClosure() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:95
app_1  |  Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:39
app_1  |  Illuminate\Container\BoundMethod::call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:596
app_1  |  Illuminate\Container\Container->call() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:134
app_1  |  Illuminate\Console\Command->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:258
app_1  |  Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:121
app_1  |  Illuminate\Console\Command->run() at /var/www/html/vendor/symfony/console/Application.php:916
app_1  |  Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:264
app_1  |  Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:140
app_1  |  Symfony\Component\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:93
app_1  |  Illuminate\Console\Application->run() at /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
app_1  |  Illuminate\Foundation\Console\Kernel->handle() at /var/www/html/artisan:37
app_1  | 

Monica does not send reminders or stay_in_touch mails

First and foremost thank you guys for creating Monica!

Currently I'm trying to run the Monica Supervisor Apache on my Synology DS418 Play.

php artisan monica:test-email works.
php artisan send:stay_in_touch and php artisan send:reminders do not.

My docker compose:

version: "3.4"

services:
  app:
    build: ./app
    image: monica-app
    depends_on:
      - db
    environment:
      - APP_KEY=**** 
      - DB_HOST=db
      - TZ=Amsterdam/Europe
      - MAIL_MAILER=smtp
      - MAIL_HOST=****
      - MAIL_PORT=****
      - MAIL_ENCRYPTION=****
      - MAIL_USERNAME=****
      - MAIL_PASSWORD=****
      - MAIL_FROM_ADDRESS=****
      - MAIL_FROM_NAME="Monica Personal CRM"
      - APP_URL=****
      - QUEUE_CONNECTION=database
      - PUID=1026
      - GUID=101
    ports:
      - 8080:80
    volumes:
      - ****:/var/www/html/storage
    restart: always

  db:
    image: mysql:5.7
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=homestead
      - MYSQL_PASSWORD=secret
    volumes:
      - ****:/var/lib/mysql
    restart: always

Screenshots from the log:
Screenshot 2021-04-23 at 19 27 19

How can I fix this issue?

Accidentially deleted Monica Container, how to re-connect to existing Mysql Container?

I accidentally deleted my Monica container, but the Mysql container is still there with my data.

I created a new Monica container, but I don't know how to link/connect it to my existing mysql container.

I can create a new set of containers using the command in the instructions:

mysqlCid="$(docker run -d \
 -e MYSQL_RANDOM_ROOT_PASSWORD=true \
 -e MYSQL_DATABASE=monica \
 -e MYSQL_USER=homestead \
 -e MYSQL_PASSWORD=secret \
 "mysql:5.7")"
docker run -d \
 --link "$mysqlCid":mysql \
 -e DB_HOST=mysql \
 -p 8080:80 \
 monica

But this creates a new mysql databse.

I've spent hours searching, and I appreicated any help.

Monica HQ MySQL "mysqlCid is not recognized as an internal or external command" error

I got to the step in setting up Monica HQ where I need to get the MySQL environment running (Connect to a mysql database) but when I enter

mysqlCid="$(docker run -d
-e MYSQL_RANDOM_ROOT_PASSWORD=true
-e MYSQL_DATABASE=monica
-e MYSQL_USER=homestead
-e MYSQL_PASSWORD=secret
"mysql:5.7")"

into CMD I get this error: "mysqlCid is not recognized as an internal or external command"

Can't get any of the example docker-compose images to work.

I've tried every example and cannot get any of them to work. The best I have been able to do is get 503 errors. The main problem seems to be that because I'm running another system on 8080 (everything seems to want to use 8080) I need to use a different port.

Any suggestions for what would be best one to run on a local machine, on a port like 7500, and what I need to change?

unable to use 'POST' method through API

when using 'latest' image I seem not to be able to use POST requests through API. I tested GET and PUT and it all works as expected. However, whenever I run a request with POST, for example to create activity or contact field, I get:

The server returned a "405 Method Not Allowed"

this is also happening on the live instance on https://app.monicahq.com/

this has not been happening for me on Heroku deployment but I assume it used different version of the app.

Can you point me in the direction how do I configure my docker image to accept POST?

Disabling chown function?

I have my Monica data on a NFS share (that runs on OmniOS with ZFS), and I'm having issues with the chown command that runs when starting Monica. The NFS share has all 777 permissions, so it should not be a problem, but the client is not allowed/able to chownfiles, hence Monica halts.

Is it possible to disable the chown command by setting an enviroment variable or something (i.e nochown=true)

Scheduled emails not sending, Test is OK (Docker Supervised)

Trying to get email working I know my configuration is correct.

From other tickets I have drawn that I need to copy some files from somewhere to somewhere else?

I tried send:reminders and no email is sent either, even though there are things for that month.

Docker-Compose
`version: "3.4"

services:
app:
container_name: prod_monica_monica
image: monica:apache
depends_on:
- db
ports:
- 8003:80
environment:
- DB_HOST=db
- DB_USERNAME=@@@@
- DB_PASSWORD=@@@@
- MAIL_MAILER=smtp
- MAIL_HOST=192.168.1.xxx
- MAIL_PORT=25
- MAIL_ENCRYPTION=
- MAIL_FROM_ADDRESS=[email protected]
- MAIL_FROM_NAME="Monica Reminder"
volumes:
- ./var/www/html/storage:/var/www/html/storage
restart: always

db:
container_name: prod_monica_db
image: mysql:5.7
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=@@@@@
- MYSQL_PASSWORD=@@@@@
volumes:
- ./var/lib/mysql:/var/lib/mysql
restart: always

volumes:
data:
name: data
mysql:
name: mysql`

APP_URL for reverse proxy subfolder

I'm attempting to load Monica at my.domain.com/subfolder and not having any luck the APP_URL or APP_FORCE_URL parameter in the Apache image.

A sanitized docker-compose is here:

  monica:
    image: monica
    container_name: monica
    volumes:
      - /mnt/tank/appdata/monica/app:/var/www/html/storage
    labels:
      - traefik.enable=true
      - traefik.http.routers.monica.rule=(Host(`my.domain.com`) && PathPrefix(`/monica`))
      - traefik.http.routers.monica.entrypoints=websecure
      - traefik.http.routers.monica.tls.certresolver=cloudflare
      - traefik.http.services.monica.loadbalancer.server.port=80
    ports:
      - 8901:80
    environment:
      - APP_KEY=32char
      - APP_URL=monica
      - APP_FORCE_URL=true
      - DB_HOST=db
    depends_on:
      - db
    restart: unless-stopped
  db:
    image: mariadb
    container_name: db
    volumes:
      - /mnt/tank/appdata/monica/db:/var/lib/mysql
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_PASSWORD=secret
      - MYSQL_DATABASE=monica
      - MYSQL_USER=homestead
    restart: unless-stopped

image

The above image is error I get. It appears that this docker image doesn't use the specified URL to make paths available at the correct location. The app works fine at ip:port.

nc:bad address 'mysql:3306'

I'm having issues running the docker container of Monica.

output of sudo docker logs monicacrm ;

Waiting for mysql:3306...
nc: bad address 'mysql:3306'
Waiting for mysql:3306...
nc: bad address 'mysql:3306'
Waiting for mysql:3306...

The command I'm using is the same one from the guide @ https://hub.docker.com/_/monica?tab=description

docker run --name monicacrm -d -p 80:80 monica

Log files created with wrong permissions under some cases

(Note: you don't need to follow this template, nor to keep headlines or bold sentences - they are just there to guide you. Feel free to delete everything. We review every issue even if we don't immediately respond.)

Thanks for filing an issue and for your interest in the project.

Describe the bug
When running a command from the console (inside docker), if this command generates the first error of the day, a logfile will be created in logs/ with today's date. It's owned by root:www-admin but its permissions are -rw-r--r-- and so the apache process cannot write to the logfile.

Which version are you using:
I'm running monica 3.6.1 in the monica:apache docker image.

Steps to reproduce

  • Ensure that logs/ does not contain a file for today's date
  • Start bash inside your container
    • eg docker exec -it monica_app_1 /bin/bash
  • Run an invalid command like php artisan monica:help
  • Note the file permissions of logs/laravel_DATE
  • Do something which generates an error in monica
    • Note the error reported says cannot write to log file

Application does not use S3 storage defined through compose environment

Hey 👋

I've set up monica with an external database server and an S3 bucket (hosted by wasabi) through the following compose file:

version: "3.7"

services:
  app:
    image: monica:3.7.0-apache
    ports:
      - "9876:80"
    environment:
      - APP_DEBUG=true
      - APP_ENV=production
      - APP_KEY=REDACTED
      - APP_URL=REDACTED

      - DB_HOST=REDACTED
      - DB_USERNAME=REDACTED
      - DB_PASSWORD=REDACTED

      - MAIL_MAILER=smtp
      - MAIL_HOST=REDACTED
      - MAIL_PORT=REDACTED
      - MAIL_USERNAME=REDACTED
      - MAIL_PASSWORD=REDACTED
      - MAIL_FROM_ADDRESS=REDACTED
      - MAIL_FROM_NAME=Monica

      - FILESYSTEM_DISK=s3

      - AWS_KEY=REDACTED
      - AWS_SECRET=REDACTED
      - AWS_REGION=eu-central-2
      - AWS_BUCKET=REDACTED
      - AWS_SERVER=s3.eu-central-2.wasabisys.com
      - S3_PATH_STYLE=true

      - ENABLE_GEOLOCATION=true
      - LOCATION_IQ_API_KEY=REDACTED
    volumes:
      - ./data:/var/www/html/storage
    restart: unless-stopped

The database is picked up fine, but monica is still using the local storage. Neither the server nor the laravel log file contains any error messages.

I think I followed the documentation pretty closely, is there something I'm missing or is this an actual bug?

Thanks in advance!

Is the cron executed in the standard Docker image?

I recently noticed that Monica sends no reminders. After digging into the docs, all installation methods except Docker mention to run a cron which runs the php artisan schedule:run command. This issue was discussed in #34 but the issue is kinda old and I am not sure if the mentioned supervisor installation method is the recommended way to run the Monica Docker image.
So, is the cron executed in the standard Monica image (monica:latest) or do I have to manually set up a cron which runs the artisan command? 🤔
Unfortunately, there is no mention about the cron anywhere in the Docker documentation.

Hardcoded database password?

I don't see an easy way to change it, if you deviate from "secret" then it errors out. Took me a while to realize that.

Upgrading v3.5.0 to v3.7.0 error

I've tried upgrading from v3.5 to v3.6, and from v3.5 to v3.7, but both experiencing issues. Can someone help with this please?

Looks like the database format has changed and there are missing columns in the table. Without starting from scratch, is there a way to force Monica to add the extra columns?

I have gone into the container and ran php artisan monica:update --force after changing to a new version, but no luck.

From v3.5 to v3.6

Whoops! Something went wrong.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'contacts.deleted_at' in 'where clause' (SQL: select `accounts`.*, (select count(*) from `contacts` where `accounts`.`id` = `contacts`.`account_id` and `address_book_id` is null and `contacts`.`deleted_at` is null) as `contacts_count`, (select count(*) from `reminders` where `accounts`.`id` = `reminders`.`account_id`) as `reminders_count`, (select count(*) from `notes` where `accounts`.`id` = `notes`.`account_id`) as `notes_count`, (select count(*) from `activities` where `accounts`.`id` = `activities`.`account_id`) as `activities_count`, (select count(*) from `gifts` where `accounts`.`id` = `gifts`.`account_id`) as `gifts_count`, (select count(*) from `tasks` where `accounts`.`id` = `tasks`.`account_id`) as `tasks_count` from `accounts` where `accounts`.`id` = 1 limit 1)

From v3.5 to v3.7

Whoops! Something went wrong.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'contacts.deleted_at' in 'where clause' (SQL: select `accounts`.*, (select count(*) from `contacts` where `accounts`.`id` = `contacts`.`account_id` and `address_book_id` is null and `contacts`.`deleted_at` is null) as `contacts_count`, (select count(*) from `reminders` where `accounts`.`id` = `reminders`.`account_id`) as `reminders_count`, (select count(*) from `notes` where `accounts`.`id` = `notes`.`account_id`) as `notes_count`, (select count(*) from `activities` where `accounts`.`id` = `activities`.`account_id`) as `activities_count`, (select count(*) from `gifts` where `accounts`.`id` = `gifts`.`account_id`) as `gifts_count`, (select count(*) from `tasks` where `accounts`.`id` = `tasks`.`account_id`) as `tasks_count` from `accounts` where `accounts`.`id` = 1 limit 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.