From 8b1a9625049e52f3e8433296ed95ea56c1cc8c29 Mon Sep 17 00:00:00 2001 From: pankajsoni22 <39917736+pankajsoni22@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:28:33 +0530 Subject: [PATCH] docs(contributing): Safely rotate secret key Explained how to change/create secret key. --- docs/docs/installation/configuring-superset.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/docs/installation/configuring-superset.mdx b/docs/docs/installation/configuring-superset.mdx index 916c28b49522d..7f80cc1b7e608 100644 --- a/docs/docs/installation/configuring-superset.mdx +++ b/docs/docs/installation/configuring-superset.mdx @@ -285,7 +285,11 @@ If you want to rotate the SECRET_KEY(change the existing secret key), follow the Add the new SECRET_KEY and PREVIOUS_SECRET_KEY to `superset_config.py`: ```python -PREVIOUS_SECRET_KEY = 'CURRENT_SECRET_KEY' # The default SECRET_KEY for deployment is '21thisismyscretkey12eyyh' -SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY' +PREVIOUS_SECRET_KEY = 'CURRENT_SECRET_KEY' +# To find out 'CURRENT_SECRET_KEY' follow these steps +# 1. Got to superset shell : $ superset shell +# 2. Run the command : >>> from flask import current_app; print(current_app.config["SECRET_KEY"]) + +SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY' # Generate a secure SECRET_KEY usng "openssl rand -base64 42" ``` Then run `superset re-encrypt-secrets`