Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ keywords: "Configure Tyk Enterprise Developer Portal, Tyk Enterprise Developer P
sidebarTitle: "Environment Variables and Configs"
---

import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

To configure the Tyk Enterprise Developer Portal, you can use either a config file or environment variables.
The table below provides a reference to all options available to you when configuring the portal.

<EnvTypeMapping/>

## Portal settings
This section explains the general portal settings, including which port it will be listening on, how often it should synchronize API Products and plans with the Tyk Dashboard, and so on.
Most of these settings are optional, except for the PORTAL_LICENSEKEY. If you don't specify these settings, the default values will be used.
Expand Down
16 changes: 16 additions & 0 deletions snippets/env-type-mapping.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Environment Variable Type Mapping

When configuring Tyk components using environment variables, it's important to understand how different data types are represented. The type of each variable is based on its definition in the Go source code. This section provides a guide on how to format values for common data types.

| Go Type | Environment Variable Format | Example |
| ----------------------- | ---------------------------------- | -------------------------------------------------------------------- |
| `string` | A regular string of text. | `TYK_GW_SECRET="mysecret"` |
| `int`, `int64` | A whole number. | `TYK_GW_LISTENPORT=8080` |
| `bool` | `true` or `false`. | `TYK_GW_USEDBAPPCONFIG=true` |
| `[]string` | A comma-separated list of strings. | `TYK_PMP_PUMPS_STDOUT_FILTERS_SKIPPEDAPIIDS="api1,api2,api3"` |
| `map[string]string` | A comma-separated list of key:value pairs. | `TYK_GW_GLOBALHEADERS="X-Tyk-Test:true,X-Tyk-Version:1.0"` |
| `map[string]interface{}` | A JSON string representing the object. | `TYK_GW_POLICIES_POLICYSOURCE_CONFIG='{"connection_string": "..."}'` |

<Note>
For complex types like `map[string]interface{}`, the value should be a valid JSON string. For `[]string` and `map[string]string`, ensure there are no spaces around the commas unless they are part of the value itself.
</Note>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ order: 3
sidebarTitle: "Tyk Identity Broker"
---

import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

The Tyk Identity Broker (TIB) is configured through two files: The configuration file `tib.conf` and the profiles file `profiles.json`. TIB can also be managed via the [TIB REST API](/tyk-identity-broker/tib-rest-api) for automated configurations.

#### The `tib.conf` file
### The `tib.conf` file

```{.copyWrapper}
{
Expand Down Expand Up @@ -56,6 +58,8 @@ From TIB v1.3.1, the environment variable `TYK_IB_OMITCONFIGFILE` is provided to
If set to TRUE, then TIB will ignore any provided configuration file and set its parameters according to environment variables. TIB will fall back to the default value for any parameters not set in an environment variable.
This is particularly useful when using Docker, as this option will ensure that TIB will load the configuration via env vars and not expect a configuration file.

<EnvTypeMapping/>

The various options for `tib.conf` file are:

### secret
Expand Down
3 changes: 3 additions & 0 deletions tyk-dashboard/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sidebarTitle: "Dashboard"
---

import DashboardConfig from '/snippets/dashboard-config.mdx';
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

You can use environment variables to override the config file for the Tyk Dashboard. The Dashboard configuration file can be found in the `tyk-dashboard` folder and by default is called `tyk_analytics.conf`, though it can be renamed and specified using the `--conf` flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
Expand All @@ -20,6 +21,8 @@ Please consult the [data storage configuration](/api-management/dashboard-config

All the Dashboard environment variables have the prefix `TYK_DB_`. The environment variables will take precedence over the values in the configuration file.

<EnvTypeMapping/>

Environment variables (env var) can be used to override the settings defined in the configuration file. Where an environment variable is specified, its value will take precedence over the value in the configuration file.

The file will look like the sample below, the various fields are explained in the following sections:
Expand Down
3 changes: 3 additions & 0 deletions tyk-multi-data-centre/mdcb-configuration-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sidebarTitle: "Multi Data Center Bridge"
---

import MdcbConfig from '/snippets/mdcb-config.mdx';
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

## Tyk MDCB Configuration

Expand All @@ -16,6 +17,8 @@ The Tyk MDCB server is configured primarily via the `tyk_sink.conf` file, this f

Environment variables (env var) can be used to override the settings defined in the configuration file. Where an environment variable is specified, its value will take precedence over the value in the configuration file.

<EnvTypeMapping/>

### Default Ports

| Application | Port |
Expand Down
3 changes: 3 additions & 0 deletions tyk-oss-gateway/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ sidebarTitle: "Gateway"
---

import GatewayConfig from '/snippets/gateway-config.mdx';
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

You can use environment variables to override the config file for the Tyk Gateway. The Gateway configuration file can be found in the `tyk-gateway` folder and by default is called `tyk.conf`, though it can be renamed and specified using the `--conf` flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).

All the Gateway environment variables have the prefix `TYK_GW_`. The environment variables will take precedence over the values in the configuration file.

<EnvTypeMapping/>

### tyk lint

In **v2.4** we have added a new `tyk lint` command which will validate your `tyk.conf` file and validate it for syntax correctness, misspelled attribute names or format of values. The Syntax can be:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ sidebarTitle: "Pump"
---

import PumpConfig from '/snippets/pump-config.mdx';
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';

You can use environment variables to override the config file for the Tyk Pump. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).

All the Pump environment variables have the prefix `TYK_PMP_`. The environment variables will take precedence over the values in the configuration file.

<EnvTypeMapping/>

<PumpConfig/>