mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
Encrypt API tokens (#2360)
Store API tokens encrypted in the database. During the database migration a randomly generated key will be used encrypt the tokens if no ENCRYPTION_KEY environment variable was provided. If the application is started without the presence of an ENCRYPTION_KEY (or if the key failed to decrypt the existing tokens), the UI will display a warning with further instructions.
This commit is contained in:
@@ -35,6 +35,7 @@ services:
|
||||
image: teslamate/teslamate:latest
|
||||
restart: always
|
||||
environment:
|
||||
- ENCRYPTION_KEY=${TM_ENCRYPTION_KEY}
|
||||
- DATABASE_USER=${TM_DB_USER}
|
||||
- DATABASE_PASS=${TM_DB_PASS}
|
||||
- DATABASE_NAME=${TM_DB_NAME}
|
||||
@@ -101,6 +102,7 @@ volumes:
|
||||
This file should reside in the same folder as the docker-compose.yml file.
|
||||
|
||||
```plaintext title=".env"
|
||||
TM_ENCRYPTION_KEY= #your secure key to encrypt your Tesla API tokens
|
||||
TM_DB_USER=teslamate
|
||||
TM_DB_PASS= #your secure password!
|
||||
TM_DB_NAME=teslamate
|
||||
|
||||
Reference in New Issue
Block a user