Skip to content

Commit

Permalink
chore(config): move env var details to top of overview
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Nov 14, 2023
1 parent 112f13f commit 118b61c
Showing 1 changed file with 45 additions and 47 deletions.
92 changes: 45 additions & 47 deletions configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,52 @@ The server will check in a few different locations for server configuration (in
You can edit any of these properties to your liking, and on restart Flipt will
pick up the new changes.

These properties are as follows:
## Environment Variables

All options in the configuration file can be overridden using environment
variables using the syntax:

```yaml
FLIPT_<SectionName>_<KeyName>
```

### General
Environment variables **MUST** have `FLIPT_` prefix and be in `UPPER_SNAKE_CASE` format.

<Note>
Using environment variables to override defaults is especially helpful when
running with Docker as described in the [Installation](/installation)
documentation.
</Note>

Keys should be uppercase and `.` should be replaced by `_`. For example,
given these configuration settings:

```yaml
server:
grpc_port: 9000

db:
url: file:/var/opt/flipt/flipt.db
```
You can override them using:
```console
export FLIPT_SERVER_GRPC_PORT=9001
export FLIPT_DB_URL="postgres://postgres@localhost:5432/flipt?sslmode=disable"
```

### Multiple Values

Some configuration options can have a list of values. For example, the `cors.allowed_origins` option can have multiple origins.

In this case, you can use a space separated list of values for the environment variable override:

```console
export FLIPT_CORS_ALLOWED_ORIGINS="http://localhost:3000 http://localhost:3001"
```

## Configuration Parameters

| Property | Description | Default | Since |
| ----------------------------- | ------------------------------------------------------------- | ------------------- | ------- |
Expand Down Expand Up @@ -301,48 +344,3 @@ be logged in the Flipt logs when a deprecated configuration option is used.

All deprecated options are listed in the [DEPRECATIONS](https://github.com/flipt-io/flipt/blob/main/DEPRECATIONS.md) file
in the Flipt repository as well as the [CHANGELOG](https://github.com/flipt-io/flipt/blob/main/CHANGELOG.md).

## Environment Variables

All options in the configuration file can be overridden using environment
variables using the syntax:

```yaml
FLIPT_<SectionName>_<KeyName>
```

Environment variables **MUST** have `FLIPT_` prefix and be in `UPPER_SNAKE_CASE` format.

<Note>
Using environment variables to override defaults is especially helpful when
running with Docker as described in the [Installation](/installation)
documentation.
</Note>

Keys should be uppercase and `.` should be replaced by `_`. For example,
given these configuration settings:

```yaml
server:
grpc_port: 9000

db:
url: file:/var/opt/flipt/flipt.db
```
You can override them using:
```console
export FLIPT_SERVER_GRPC_PORT=9001
export FLIPT_DB_URL="postgres://postgres@localhost:5432/flipt?sslmode=disable"
```

### Multiple Values

Some configuration options can have a list of values. For example, the `cors.allowed_origins` option can have multiple origins.

In this case, you can use a space separated list of values for the environment variable override:

```console
export FLIPT_CORS_ALLOWED_ORIGINS="http://localhost:3000 http://localhost:3001"
```

0 comments on commit 118b61c

Please sign in to comment.