Disable origin check by default

This commit is contained in:
Adrian Kumpf
2019-10-21 15:11:53 +02:00
parent dd5c2d7934
commit c32d53aeb1
2 changed files with 20 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ config :teslamate, TeslaMateWeb.Endpoint,
url: [host: System.get_env("VIRTUAL_HOST", "localhost"), port: 80],
secret_key_base: System.get_env("SECRET_KEY_BASE", Util.random_encoded_bytes()),
live_view: [signing_salt: System.get_env("SIGNING_SALT", Util.random_encoded_bytes())],
check_origin: System.get_env("CHECK_ORIGIN", "true") |> Util.parse_check_origin!()
check_origin: System.get_env("CHECK_ORIGIN", "false") |> Util.parse_check_origin!()
if System.get_env("DISABLE_MQTT") != "true" do
config :teslamate, :mqtt,

View File

@@ -2,22 +2,22 @@
TeslaMate accepts the following environment variables for runtime configuration:
| Variable Name | Description | Default Value |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| DATABASE_USER | Username (**required**) | / |
| DATABASE_PASS | User password (**required**) | / |
| DATABASE_NAME | The database to connect to (**required**) | / |
| DATABASE_HOST | Hostname of the database server (**required**) | / |
| DATABASE_PORT | Port of the database server | 5432 |
| DATABASE_POOL_SIZE | Size of the database connection pool | 5 |
| VIRTUAL_HOST | Host part used for generating URLs throughout the app | localhost |
| CHECK_ORIGIN | Configures whether to check the origin header or not. May be `true` (default), `false` or a comma-separated list of hosts that are allowed (e.g. `https://example.com,//another.com:888`). Hosts also support wildcards. It defaults to true and, in such case, it will check against the host value in `VIRTUAL_HOST`. | true |
| PORT | Port where the web interface is exposed | 4000 |
| DISABLE_MQTT | Disables the MQTT feature if `true` | false |
| MQTT_HOST | Hostname of the broker (**required** unless DISABLE_MQTT is `true`) | / |
| MQTT_USERNAME | Username _(optional)_ | / |
| MQTT_PASSWORD | Password _(optional)_ | / |
| MQTT_TLS | Enables TLS if `true` _(optional)_ | false |
| MQTT_TLS_ACCEPT_INVALID_CERTS | Accepts invalid certificates if `true` _(optional)_ | false |
| LOCALE | The default locale for the web interface and addresses. Currently available: `en` (default) and `de` | en |
| TZ | Used to establish the local time zone. See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | / |
| Variable Name | Description | Default Value |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| DATABASE_USER | Username (**required**) | / |
| DATABASE_PASS | User password (**required**) | / |
| DATABASE_NAME | The database to connect to (**required**) | / |
| DATABASE_HOST | Hostname of the database server (**required**) | / |
| DATABASE_PORT | Port of the database server | 5432 |
| DATABASE_POOL_SIZE | Size of the database connection pool | 5 |
| VIRTUAL_HOST | Host part used for generating URLs throughout the app | localhost |
| CHECK_ORIGIN | Configures whether to check the origin header or not. May be `true` (**recommended**), `false` (_default_) or a comma-separated list of hosts that are allowed (e.g. `https://example.com,//another.com:888`). Hosts also support wildcards. It defaults to true and, in such case, it will check against the host value in `VIRTUAL_HOST`. | false |
| PORT | Port where the web interface is exposed | 4000 |
| DISABLE_MQTT | Disables the MQTT feature if `true` | false |
| MQTT_HOST | Hostname of the broker (**required** unless DISABLE_MQTT is `true`) | / |
| MQTT_USERNAME | Username _(optional)_ | / |
| MQTT_PASSWORD | Password _(optional)_ | / |
| MQTT_TLS | Enables TLS if `true` _(optional)_ | false |
| MQTT_TLS_ACCEPT_INVALID_CERTS | Accepts invalid certificates if `true` _(optional)_ | false |
| LOCALE | The default locale for the web interface and addresses. Currently available: `en` (default) and `de` | en |
| TZ | Used to establish the local time zone. See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | / |