Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Fleet API users to change client_id #3984

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
JakobLichterfeld marked this conversation as resolved.
Show resolved Hide resolved
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
Loading