📝 Update code example to limit the length of generated secret value by 40 bytes #1914
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.
In docs we instruct users to use
python -c "import secrets; print(secrets.token_urlsafe(32))"
to generate secrets for all parameters that have defaultchangethis
value (source).Since
token_urlsafe
uses Base64 encoding, the length of generated token is actually not always less than 40 characters (it's 32*1.3=41.6 in average, see docs).This leads to app failure on start due to violating the constraint of first user password (currently limited by 40, there is a PR #1447 to increase the limit).
I updated the code example to generate secret value in docs and in
copier.yml
(for the sake of consistency).Alternatively (IMO, even better) we can just merge #1447