monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.77k stars 2.18k forks source link

Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm. #6449

Open mrpmohiburrahman opened 1 year ago

mrpmohiburrahman commented 1 year ago

Hello, monicahq team,

I've deployed monicahq to heroku using "deploy to heroku" button. APP_KEY, APP_URL, MAIL_FROM_ADDRESS, MAIL_NAME just as mentioned as in this page https://github.com/monicahq/monica/blob/main/docs/installation/providers/heroku.md.

After deploying it, when I open the app it shows me the following error.

Whoops! Something went wrong.

Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm.

Screenshots Unsupported cipher

Additional context I am very new to this kind of stuff. And never work with laravel.

Please, suggest me, how to solve this.

santiago-mooser commented 1 year ago

See https://github.com/orgs/firefly-iii/discussions/5163#discussioncomment-1452330

You're likely not giving the right APP_KEY and/or HASH_SALT. I think you have to add base64: to the front of it like this:

[...]

# The encryption key. This is the most important part of the application. Keep
# this secure otherwise, everyone will be able to access your application.
# Must be 32 characters long exactly.
# Use `php artisan key:generate` or `echo -n 'base64:'; openssl rand -base64 32` to generate a ra>
APP_KEY=base64:<32 char base64 string here>

# Prevent information leakage by referring to IDs with hashIds instead of
# the actual IDs used in the database.
HASH_SALT=base64:<20 char base 64 key here>
HASH_LENGTH=18

[...]