Rollsecretkey
In v3.12.33
a new feature has been added. You can now roll your secret key.
This is useful if you think your secret key has been compromised.
It is introduced because there was a security issue with the secret key. If you are using a version below v3.12.33, please update your Coolify instance.
Technical details: The secret key was generated with the installation date used as a random seed. This means that if someone knows the installation date, they can generate the secret key. This is not a problem if you are using a recent version of Coolify, because the installation date is not used anymore since 2023.07.14.
How to roll the secret key
If you are upgrading form a version below v3.12.33
, you will be automatically rolled to a new secret key.
If you are just installing Coolify, you do not need to do anything.
Rollback to old secret key
(It also solve this issue related to secretOrPrivateKey must be an asymmetric key when using RS256 or Getting 500 error when accessing running services).
If you want to rollback to the old secret key, you need to do the followings:
- Login to your Coolify instance via SSH.
- Switch to root user (
sudo su -
) and locate your~/coolify/.env
file. - In
~/coolify/.env
file there should be aCOOLIFY_SECRET_KEY
environment variable. - Create a
COOLIFY_SECRET_KEY_BETTER
with the same value asCOOLIFY_SECRET_KEY
. - Check your database files with
docker exec coolify ls -l /app/db
command. - There should be at least on with the name of
prod.db
and a few withprod.db_<date>
. - Locate the oldest one. For example:
- Make a copy of your
prod.db
file:docker exec coolify cp /app/db/prod.db /app/db/prod.db_$(date +"%Y%m%d%H%M%S")
- Overwrite
prod.db
with the old database file:docker exec coolify cp /app/db/prod.db_1689674942980 /app/db/prod.db
app/db/prod.db_1689674942980
will be different in your case
- Reinstall Coolify with:
cd ~ && wget -q https://get.coollabs.io/coolify/install.sh -O install.sh; sudo bash ./install.sh -f
If you have any questions, please contact us.
Force roll secret key
- Login to your Coolify instance via SSH.
- Run the following command:
docker exec -ti coolify bash
. Now you are in the Coolify container. - You will work in the
/app/.env
file. You can edit it withvi .env
. - Delete
COOLIFY_SECRET_KEY_BETTER
. - Login to your Coolify instance on the web interface.
- Go to
Settings
and fill theRollback
input field with3.12.33
(or the latest version - you can check it here) and click onRollback
.
If you have any questions, please contact us.