Coder Social home page Coder Social logo

monica's Introduction

Monica

Setup MySQL database

docker-compose up mysql

Restoring database

Download the backup file from your S3 bucket:

sh backup/download.sh

Copy the backup file to the MySQL container:

docker cp ./backup/monica.sql mysql:/

Access the container, create the database and the user, and,restore data:

docker exec -it mysql bash
mysql -u root -p"<password>"
CREATE DATABASE monica;
CREATE USER 'monica'@'%' IDENTIFIED BY 'monicapassword';
GRANT ALL PRIVILEGES ON monica.* TO 'monica'@'%';
FLUSH PRIVILEGES;
EXIT
mysql -u monica -p"monicapassword" monica < monica.sql

Add the following lines to the .env file:

MONICA_DB_DATABASE=monica
MONICA_DB_USERNAME=monica
MONICA_DB_PASSWORD=monicapassword

Remove 2FA from old users (reference):

mysql -u monica -p monicapassword
use monica;
SELECT id,first_name,google2fa_secret FROM users;
UPDATE users SET google2fa_secret=NULL WHERE id=USER_ID;

Setup Monica

We've followed the instructions on this example to make Monica supervisor works to send automatic notifications and reminders.

Environment variables

https://github.com/monicahq/monica/blob/main/.env.example

Monica Fallback

We've also created a fallback for Monica container to help us debug eventual issues. For example, if HTTPS Gateway Timeout occurs and Monica fallback is working, we can assume that the issue should be on Traefik.

Add MONICA_FALLBACK_PORT to the .env file. This way you can access Monica over HTTP on http://$MONICA_URL:$MONICA_FALLBACK_PORT. You'll see the website without styles because Monica environment is production and it redirects to HTTPS the network requests.

Don't forget to allow the fallback port on EC2 security group.

Setup Traefik

Configure Traefik dashboard secure adding the following commands to the .env file:

  • TRAEFIK_URL: The URL of the Traefik dashboard. You should configure it on your DNS provider.
  • TRAEFIK_BASIC_AUTH: Execute the command htpasswd -nb USER PASSWORD to generate the basic auth credentials (reference).

Create acme.json file to store the ACME credentials:

touch acme.json
chmod 600 acme.json

Start

Once you've configured the environment variables, you can start the containers:

./start.sh

Troubleshooting

"The Compose file './docker-compose.yml' is invalid because:"

Check if docker-compose replace all environment variables running the command docker-compose config.

monica's People

Contributors

arantespp avatar

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.