superset icon indicating copy to clipboard operation
superset copied to clipboard

docs: Added instructions on configuring Superset SECRET_KEY

Open wanjoc opened this issue 2 years ago • 5 comments

SUMMARY

Added alternative instructions on setting SECRET_KEY via environment variables.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2023-10-14 at 1 33 20 PM Screen Shot 2023-10-17 at 6 48 03 PM

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [x] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

wanjoc avatar Oct 14 '23 18:10 wanjoc

Hello, thanks for the PR and showing the before/after screenshots. Can you please explain what the advantage to this is / what the improvement is here? It seems like another way of adding the value to superset_config.py, which is already covered, and I'm not sure this will persist through the machine restarting.

sfirke avatar Oct 16 '23 18:10 sfirke

@sfirke Hello, many users have encountered the error below(ex: https://github.com/apache/superset/discussions/23598). While the initial 'Configuring Superset' section does touch upon setting the SUPERSET_SECRET_KEY environment variable in the code example, I believe providing this explicit alternative would make the local setup process more straightforward for beginners. Additionally, I realize this documentation update doesn't directly address the issues some users face when running superset re-encrypt-secrets and the PREVIOUS_SECRET_KEY setting. However, I felt this change was a step towards simplifying the initial setup for new users. Screen Shot 2023-10-16 at 2 11 42 PM

wanjoc avatar Oct 16 '23 19:10 wanjoc

SUPERSET_SECRET_KEY environment variable is already supported https://github.com/apache/superset/blob/master/superset/config.py#L184

so those additional imports are not required. Just defining the environment variable is enough.

I think the following is enough to add to docs without confusing users.

Alternatively, you can set the secret key using the `SUPERSET_SECRET_KEY` environment variable.

On a Linux System, you can do so by running the following command in your terminal:

export SUPERSET_SECRET_KEY=$(openssl rand -base64 42)

mdeshmu avatar Oct 17 '23 16:10 mdeshmu

@mdeshmu Thank you for the feedback. I've made the suggested update. Tweaked it to include macOS

wanjoc avatar Oct 17 '23 23:10 wanjoc

@sfirke please review.

mdeshmu avatar Oct 18 '23 06:10 mdeshmu

Sorry this seems to have slipped through the cracks, but it's in need of a rebase. I'll mark it as draft mode for now while it awaits an update. Thanks!

rusackas avatar Apr 22 '25 21:04 rusackas