Repository navigation
fix(fri): let startserver run without FLASK_SECRET_KEY set - #643
Open
Siddhanthguptaa wants to merge 1 commit into
Open
Siddhanthguptaa wants to merge 1 commit into
Siddhanthguptaa wants to merge 1 commit into
Conversation
main.py refuses to start without FLASK_SECRET_KEY unless FLASK_ENV is development, and the launchers set neither, so startserver failed on a fresh checkout and pointed users at pip. Set a throwaway key for the run when none is set, fix the error hint and the README sentence, and make startserver executable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #642
Since #414 the server refuses to start without
FLASK_SECRET_KEY(unlessFLASK_ENV=development), butstartserverandstartserver.batset neither, so they fail on a fresh checkout and then suggest reinstalling packages.FLASK_SECRET_KEYfor that run, only when it isn't already set (bash: from /dev/urandom, bat: Pythonsecrets).main.pyis unchanged, so the check still applies to any other way of starting the server.startserveris now executable (it was 100644).Why not set
FLASK_ENV=developmentin the launchers: Flask is unpinned infri/requirements.txtand older Flask versions also switch on debug mode from that variable; a random per-run key avoids that.Testing (Windows 11, Python 3.11, both variables unset)
RuntimeError: FLASK_SECRET_KEY environment variable must be set in production.startserver.bat(cmd) andstartserver(Git Bash) both start the server on :5000.