Monica - Take Three, Part Five

Monica - Take Three, Part Five
Photo by Antenna / Unsplash

Coming back to play with Monica some more today. I enable MFA since that's probably a good idea if this is going to be web facing. I then dive into configuring email.
Steps taken from MONICA-01

  • nano /var/www/monica/.env

and I configure the following options:

MAIL_MAILER=
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
APP_EMAIL_NEW_USERS_NOTIFICATION=

Once I save I try and test email functionality. It fails, it looks like it is still trying to use the original settings. The fix is to run the following command:

  • php artisan monica:update --force

Next I should try and make sure I can back this up before I lose my work. There is a backup option in the GUI but it fails. I'd rather not have to constantly log into the GUI to produce a backup anyway, so can I do this from CLI so that it can be scripted?

  • mysqldump -u monica -p monica > /var/backups/monica_test_backup.sql

My command fails because I do not have the proper permission.

  • mysql -uroot
    • GRANT PROCESS ON . TO monica@localhost;
    • exit
  • mysqldump -u monica -p monica > /var/backups/monica_test_backup.sql

Success! Backups through the GUI are still failing though. Oh I see my problem, I was looking at the wrong command. Reading more I learn the .env settings are cached so if all you are doing is making a change to .env I can just run the php artisan config:cache command.

  • php artisan config:cache
    • Configuration cache cleared!
    • Configuration cached successfully!

Testing again, sending an email fails. This time due to a wrong password. At least I'm making good progress.

  • nano .env

I correct the password and save.

  • php artisan config:cache
    • Configuration cache cleared!
    • Configuration cached successfully!

Testing again is successful and the email came through to my inbox. Awesome! I at least have a basic backup now in case I mess anything up and need to recover.

Documentation is super important so I go back through my notes and update them where I need to. I make a copy of the .env file as well as a copy of my .conf file. I also documented the steps that need to be taken to update Monica.