Bugfix in .env (DB_HOST, caused by renaming in compose.yml, see prev commits), explanation about keys and passwords

This commit is contained in:
DarkCat09 2023-03-24 20:12:27 +04:00
parent 4eb0203b2d
commit 58fac81dd9
4 changed files with 19 additions and 11 deletions

21
.env
View file

@ -1,17 +1,22 @@
APP_HOST=0.0.0.0 APP_HOST=0.0.0.0
APP_PORT=8000 APP_PORT=8000
# Generate a strong secret key # Generate 2 strong secret keys
# #
# On Linux: tr -dc A-Za-z0-9_- </dev/urandom | head -c 44 # In Linux terminal:
# With Python: import secrets; secrets.token_urlsafe(32) # tr -dc A-Za-z0-9_- </dev/urandom | head -c 44
# Or in Python:
# import secrets
# print(secrets.token_urlsafe(32))
# #
# If this variable is not set, # If these variables are not set,
# the key is generated automatically # the keys are generated automatically
#SECRET_KEY=secret #
#SESSION_KEY=secret
#CSRF_KEY=secret
DB_HOST=${REPO_NAME_SNAKE}_db DB_HOST=${REPO_NAME_KEBAB}-db
DB_PORT=3306 DB_PORT=3306
DB_USER=${REPO_NAME_SNAKE} DB_USER=${REPO_NAME_SNAKE}
DB_PASSWORD=password DB_PASSWORD=password # Generate a password using the same method
DB_DATABASE=${REPO_NAME_SNAKE} DB_DATABASE=${REPO_NAME_SNAKE}

View file

@ -1,5 +1,5 @@
MYSQL_PORT=3306 MYSQL_PORT=3306
MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_RANDOM_ROOT_PASSWORD=true
MYSQL_USER=${REPO_NAME_SNAKE} MYSQL_USER=${REPO_NAME_SNAKE}
MYSQL_PASSWORD=password MYSQL_PASSWORD=password # Must be the same as in .env
MYSQL_DATABASE=${REPO_NAME_SNAKE} MYSQL_DATABASE=${REPO_NAME_SNAKE}

View file

@ -1,5 +1,6 @@
DEBUG=true DEBUG=true
SECRET_KEY=debug SESSION_KEY=debug
CSRF_KEY=debug
APP_HOST=127.0.0.1 APP_HOST=127.0.0.1
APP_PORT=8000 APP_PORT=8000

View file

@ -35,7 +35,9 @@ corresponding to your database structure
as explained below ([Structure > Database](#database)) as explained below ([Structure > Database](#database))
7. Check if `Makefile`, `Dockerfile`, `docker-compose.yml` are correct 7. Check if `Makefile`, `Dockerfile`, `docker-compose.yml` are correct
8. Run the formatter and linters (`make format`, then `make check`) 8. Run the formatter and linters (`make format`, then `make check`)
9. Edit the `version_code` file if needed, 9. Open `.env` and `.env_db`, generate secret keys and the database password
as explained in the comment above `SESSION_KEY=`
10. Edit the `version_code` file if needed,
build a docker image and [publish](#publishing-app) it build a docker image and [publish](#publishing-app) it
### Makefile ### Makefile