-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
📝 Add note about FIRST_SUPERUSER_PASSWORD
needing to be 40 characters or less
#1683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… that it should be <= 40 characters
FIRST_SUPERUSER_PASSWORD
needing to be 40 characters or lessFIRST_SUPERUSER_PASSWORD
needing to be 40 characters or less
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing it this way?
@@ -204,7 +204,7 @@ The input variables, with their default values (some auto generated) are: | |||
- `stack_name`: (default: `"fastapi-project"`) The name of the stack used for Docker Compose labels and project name (no spaces, no periods) (in .env). | |||
- `secret_key`: (default: `"changethis"`) The secret key for the project, used for security, stored in .env, you can generate one with the method above. | |||
- `first_superuser`: (default: `"[email protected]"`) The email of the first superuser (in .env). | |||
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env). | |||
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env). Must be 40 characters or less. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env). Must be 40 characters or less. | |
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env). Default length constraints: 8–40 characters. |
40
is default max size limit, but it can be configured.
Also, there is a min length limit (8
by default).
@@ -23,7 +23,7 @@ first_superuser: | |||
|
|||
first_superuser_password: | |||
type: str | |||
help: The password of the first superuser (in .env) | |||
help: The password of the first superuser (in .env), must be 40 characters or less |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help: The password of the first superuser (in .env), must be 40 characters or less | |
help: The password of the first superuser (in .env). Default length constraints: 8–40 characters. |
@@ -132,7 +132,7 @@ You can set several variables, like: | |||
* `BACKEND_CORS_ORIGINS`: A list of allowed CORS origins separated by commas. | |||
* `SECRET_KEY`: The secret key for the FastAPI project, used to sign tokens. | |||
* `FIRST_SUPERUSER`: The email of the first superuser, this superuser will be the one that can create new users. | |||
* `FIRST_SUPERUSER_PASSWORD`: The password of the first superuser. | |||
* `FIRST_SUPERUSER_PASSWORD`: The password of the first superuser. Must be 40 characters or less. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `FIRST_SUPERUSER_PASSWORD`: The password of the first superuser. Must be 40 characters or less. | |
* `FIRST_SUPERUSER_PASSWORD`: The password of the first superuser. Default length constraints: 8–40 characters. |
The value of the
FIRST_SUPERUSER_PASSWORD
environment variable needs to be <= 40 characters or else the prestart logic will fail with a "String should have at most 40 characters" error. See below prestart output when launching usingdocker compose up
and aFIRST_SUPERUSER_PASSWORD
that's > 40 characters:I ran into this after following the instructions in
deployment.md
to generate secret keys using this command:I know that
FIRST_SUPERUSER_PASSWORD
isn't technically a "key", but it does have a default value ofchangethis
in.env
, so it was assumed it should be safe to just go ahead and use the above command to generate a secure password for it.This PR adds notes about the
FIRST_SUPERUSER_PASSWORD
needing to be <= 40 characters to the documentation.Optionally, we could also update the above Python snippet to produce 40 character secrets by default, which would further help mitigate the issue:
Let me know if we also want to make that update.