65 Commits

Author SHA1 Message Date
b1c1l1
97cfb79493 feat: Add URL_PATH environment variable for reverse proxy deployments (#3771)
* 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
2024-03-25 09:21:34 +01:00
Brian May
2b5cdbdffd Add nix flake (#3485)
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.
2024-03-19 09:37:17 +01:00
PhracturedBlue
3cc0102090 Support listening on unix domain socket (#3328)
* Support connection on unix domain socket

* Better support for unix domain sockets

* Document Unix Domain sockets

* Fix typos caught by review
2024-01-29 13:43:45 +01:00
Simon Shi
7329b2bf3a Support server_name_indication for ssl (#3497)
* Support server_name_indication for ssl

* update format
2023-11-26 11:04:38 +01:00
Adrian Kumpf
56a6aa3e7f Support self-signed certificates
Related to #3243
2023-06-13 13:55:47 +02:00
Brian May
4a11ef8421 If no geofence is found map then use default value (#2564)
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
2022-07-15 10:59:46 +02:00
Adrian Kumpf
0d6e288c70 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.
2022-02-18 17:03:13 +01:00
Adrian Kumpf
796d0c8ef4 Update phoenix to 1.6.0 2021-09-24 22:39:26 +02:00
Adrian Kumpf
70468ea762 Migrate from webpack to esbuild 2021-09-22 22:07:14 +02:00
Adrian Kumpf
8909719c60 Don't purge debug log statements
Related to #1289
2021-02-08 18:58:38 +01:00
Adrian Kumpf
a2129b1457 Hide sign-out button in import mode 2021-02-06 21:39:52 +01:00
Adrian Kumpf
294bb28034 Point out more clearly when starting into import mode 2021-02-06 20:53:36 +01:00
Adrian Kumpf
ab7556e8af Allow to use non-standard MQTT ports 2021-01-03 22:40:07 +01:00
Adrian Kumpf
37a60829ab Allow to connect to MQTT broker via IPv6
Addresses #1000
2020-12-01 18:09:24 +01:00
Adrian Kumpf
e0b3d3d6b5 Allow to connect to Postgres via IPv6 (#1006) 2020-11-05 12:20:09 +01:00
Adrian Kumpf
1aa86332da Bump webpack to 5.0 2020-10-11 19:19:08 +02:00
Adrian Kumpf
6b43e509c6 Log the date as well 2020-10-11 18:43:44 +02:00
Adrian Kumpf
4b23c8604e Upgrade to Elixir v1.11 2020-10-08 22:17:56 +02:00
Adrian Kumpf
60631907ef Replace mojito with finch 2020-05-14 14:11:20 +02:00
dyxyl
2765ae81f3 Add option HTTP_BINDING_ADDRESS to control the bound IP address (#665)
* Add option HTTP_BINDING_ADDRESS to control the IP address where the web interface is exposed.

* Fix doc typo.

* Keep mix format quiet with some empty lines.
2020-05-02 12:34:52 +02:00
Adrian Kumpf
155a135d51 Upgrade to phoenix 1.5 2020-04-23 12:51:15 +02:00
Adrian Kumpf
6e2247b7fe Handle ambiguous dates when importing data
Fixes #549
2020-04-14 14:24:25 +02:00
Adrian Kumpf
70c16045e5 Use default transport options 2020-04-11 14:55:25 +02:00
Adrian Kumpf
86aab4c523 Add option DATABASE_SSL
Closes #447
2020-02-14 11:28:53 +01:00
Adrian Kumpf
803438206e Bump phoenix_live_view to 0.7.1 2020-02-14 10:43:48 +01:00
Adrian Kumpf
d013eb0858 List dashboards as external resources 2020-02-07 13:21:05 +01:00
Adrian Kumpf
f61315cb10 Implement TeslaFi import
Closes #316
2020-02-07 13:21:05 +01:00
Adrian Kumpf
0edc49944e Disable token refresh during development 2020-01-24 16:18:39 +01:00
Adrian Kumpf
dbff8327bf Add language setting 2020-01-21 14:27:11 +01:00
Adrian Kumpf
120e82cb18 Add option use custom namespace for MQTT topics 2020-01-17 14:13:04 +01:00
Adrian Kumpf
91ea9a2c1e Log version at startup 2019-12-22 14:49:22 +01:00
Adrian Kumpf
1eec12cec5 Double queue target and increase pool size
Fixes #298
2019-12-15 21:11:32 +01:00
Adrian Kumpf
c32d53aeb1 Disable origin check by default 2019-10-21 15:54:54 +02:00
Adrian Kumpf
7ac8d56812 Make :check_origin configurable via env variable
Resolved #194
2019-10-06 13:58:12 +02:00
Adrian Kumpf
7889c803c4 Remove tesla auth config 2019-09-28 20:59:41 +02:00
Adrian Kumpf
ba0ee998c0 Add option to accept invalid certificates 2019-09-08 14:05:30 +02:00
virtualm2000
b1ffa97e16 Add support for MQTT SSL (#140)
* Add support for MQTT SSL

* Fixed format
2019-09-08 13:58:43 +02:00
Adrian Kumpf
d0cec8435d Set default LOCALE 2019-09-02 11:10:31 +02:00
Adrian Kumpf
adc35410f3 Remove LoggerTelegramBackend 2019-09-01 21:19:48 +02:00
Adrian Kumpf
3cd0af570d Create cache directory 2019-08-28 12:49:27 +02:00
Adrian Kumpf
9bd859dadf Keep mapping provider responsive all the time 2019-08-28 12:49:27 +02:00
Adrian Kumpf
a4fa480b94 Test Mapping 2019-08-28 12:49:27 +02:00
Adrian Kumpf
93033ee0ff Add mapping provider 2019-08-28 12:48:05 +02:00
Adrian Kumpf
b6fd6d0d32 Persist API tokens 2019-07-31 17:40:15 +02:00
Adrian Kumpf
dddb1e8499 Fix generation of secret_key_base 2019-07-31 15:33:32 +02:00
Adrian Kumpf
9cab49a3cc Log :car_id 2019-07-30 12:07:26 +02:00
Marcus Vaal
9bb1b446ea Support custom database port through environment DATABASE_PORT env var
Based on example from https://github.com/elixir-ecto/ecto
2019-07-27 10:42:08 +02:00
Adrian Kumpf
f9462b4c12 Reduce default pool size to 5 2019-07-26 18:47:08 +02:00
Adrian Kumpf
3489aeb3ea Add default values to some config parameters 2019-07-23 19:41:00 +02:00
Adrian Kumpf
ee82b4f734 Add feature flags for MQTT and Logging 2019-07-21 17:06:57 +02:00