Skip to content

Commit

Permalink
feat: allow Fleet API users to change client_id (#3984)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien <julien@citio.digital>
  • Loading branch information
jlestel and Julien committed Jun 26, 2024
1 parent 9df4e7c commit 2c4639e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tesla_api/auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule TeslaApi.Auth do
@web_client_id "ownerapi"
@redirect_uri "https://auth.tesla.com/void/callback"

def web_client_id, do: @web_client_id
def web_client_id, do: System.get_env("TESLA_AUTH_CLIENT_ID") || @web_client_id
def redirect_uri, do: @redirect_uri

@default_headers [
Expand Down
5 changes: 3 additions & 2 deletions website/docs/configuration/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_label: Environment Variables
TeslaMate accepts the following environment variables for runtime configuration:

| Variable Name | Description | Default Value |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **ENCRYPTION_KEY** | A key used to encrypt the Tesla API tokens (**required**) | |
| **DATABASE_USER** | Username (**required**) | |
| **DATABASE_PASS** | User password (**required**) | |
Expand Down Expand Up @@ -37,10 +37,11 @@ TeslaMate accepts the following environment variables for runtime configuration:
| **IMPORT_DIR** | The path of the directory for the import of data (e.g. TeslaFi) | ./import |
| **TZ** | Used to establish the local time zone, e.g. to use the local time in logs. See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | |
| **DEFAULT_GEOFENCE** | The default GEOFENCE to send via GEOFENCE if car not in geofence. Overrides the default of "" which will delete any retained value. | "" (no quotes) |
| **TESLAFI_IMPORT_VEHICLE_ID** | The default Vehicle ID used when importing from TeslaFi. If it is not defined and the import source does not contain the data, 1 is used.
| **TESLAFI_IMPORT_VEHICLE_ID** | The default Vehicle ID used when importing from TeslaFi. If it is not defined and the import source does not contain the data, 1 is used. | |
| **TESLA_API_HOST** | Hostname of the Tesla API | https://owner-api.teslamotors.com (or for chinese: https://owner-api.vn.cloud.tesla.cn) |
| **TESLA_AUTH_HOST** | Hostname of the Tesla authentication API | https://auth.tesla.com |
| **TESLA_AUTH_PATH** | The Tesla authentication path | /oauth2/v3 |
| **TESLA_AUTH_CLIENT_ID** | Client ID of the application registered on [developer.tesla.com](https://developer.tesla.com) | ownerapi |
| **TESLA_WSS_HOST** | Hostname of the Tesla streaming | wss://streaming.vn.teslamotors.com (or for chinese: wss://streaming.vn.cloud.tesla.cn) |
| **TESLA_WSS_TLS_ACCEPT_INVALID_CERTS** | Accepts invalid certificates on TESLA_WSS_HOST if `true` | |
| **TESLA_WSS_USE_VIN** | Use the `vin` field instead of `vid` to connect stream if `true` | |
Expand Down

0 comments on commit 2c4639e

Please sign in to comment.