* Add URL_PATH environment variable for reverse proxy deployments
For example, this can be used to run TeslaMate behind a reverse proxy, using a
URL path such as "/teslamate".
* gettext: update pot and po files
Generated using:
mix gettext.extract --merge
* web: run mix format
* gettext: update pot and po files
Re-generating gettext files after running mix format.
Generated using:
mix gettext.extract --merge
This will add support for nix flakes. Which really helps with my
development on nixos. This has two basic parts:
1. DEVELOPMENT
After this you can use the following commands on computer with nix and a
patched version of direnv:
direnv allow
devenv up
And it will automatically start and instance of postgresql and mosquitto
for development.
And the environment variables are already configured for teslamate.
So then can start teslamate with:
npm install --prefix ./assets && npm run deploy --prefix ./assets
iex -S mix phx.server
This part is all working as designed. And pretty simple and straight
forward.
2. NIX PACKAGE OF TESLA
This is 99% complete, but some pain points I haven't addressed yet.
Because I don't yet know of good solutions.
* There are two checksums in flake.nix that needs to be updated whenever
mix.lock or package-lock.json changes.
This is required because the default value is "" which tells the mqtt
server to delete the retained value.
This in turn means that applications that care about when the car is in
a unknown location will not get the retained value.
This is a bit different from all of the other values in
`@always_published`. For them "" is only published if the value is
unknown or an error occurred. So it makes sense to delete the retained
value.
In this case however, a value of "" generally means "the car is outside
any known geofence" which is a valid condition it itself, and it should
be retained.
There was speculation this might affect the shift_state, but
unfortunately this was not followed up with any evidence or details. #1912
There are any number of solutions that could be deployed here. The
advantage of this solution however is it is not going to break anything
unless you specifically define the TESLAMATE_DEFAULT_GEOFENCE variable.
Fixes: #1336
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.