Skip to content

Commit

Permalink
chore: add missing env variables to the readme (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
icehaunter authored Nov 25, 2022
1 parent 2a36799 commit e1c0e2e
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,31 @@ make stop_dev_env

The Electric application is configured using environment variables. Everything that doesn't have a default is required to run.

| Variable | Default | Description |
|-------------------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `VAXINE_HOST` | | Host of Vaxine instance to connect to |
| `VAXINE_API_PORT` | `8087` | Port for the regular DB API on Vaxine instance |
| `VAXINE_REPLICATION_PORT` | `8088` | Port for the replication API on Vaxine instance |
| `VAXINE_CONNECTION_TIMEOUT` | `5000` | (ms) Timeout waiting while connecting to a Vaxine instance |
| | | |
| `ELECTRIC_HOST` | | Host of this electric instance for the reverse connection from Postgres. It has to be accessible from postgres instances listed in the `CONNECTORS` |
| `CONNECTORS` | `""` | Semicolon-separated list of Postgres connection strings for PG instances that will be part of the cluster |
| | | |
| `POSTGRES_REPLICATION_PORT` | `5433` | Port for connections from PG instances as replication followers |
| `STATUS_PORT` | `5050` | Port to expose health and status API endpoint |
| `WEBSOCKET_PORT` | `5133` | Port to expose the `/ws` path for the replication over the websocket |
| | | |
| `OFFSET_STORAGE_FILE` | `./offset_storage_data.dat` | Path to the file storing the mapping between connected instances and offsets in Vaxine WAL. Should be persisted between Electric restarts. |
| | | |
| `MIGRATIONS_DIR` | | Directory to read the migration SQL files from (see below) |
| `MIGRATIONS_FILE_NAME_SUFFIX` | `/postgres.sql` | Suffix that is appended to the migration name when looking for the migration file |
| | | |
| `SATELLITE_AUTH_SIGNING_KEY` | `""` | Authentication token signing/validation secret key. See below. |
| `SATELLITE_AUTH_SIGNING_ISS` | `""` | Cluster ID which acts as the issuer for the authentication JWT. See below. |
| Variable | Default | Description |
| ----------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `VAXINE_HOST` | | Host of Vaxine instance to connect to |
| `VAXINE_API_PORT` | `8087` | Port for the regular DB API on Vaxine instance |
| `VAXINE_REPLICATION_PORT` | `8088` | Port for the replication API on Vaxine instance |
| `VAXINE_CONNECTION_TIMEOUT` | `5000` | (ms) Timeout waiting while connecting to a Vaxine instance |
| | | |
| `ELECTRIC_HOST` | | Host of this electric instance for the reverse connection from Postgres. It has to be accessible from postgres instances listed in the `CONNECTORS` |
| `CONNECTORS` | `""` | Semicolon-separated list of Postgres connection strings for PG instances that will be part of the cluster |
| | | |
| `POSTGRES_REPLICATION_PORT` | `5433` | Port for connections from PG instances as replication followers |
| `STATUS_PORT` | `5050` | Port to expose health and status API endpoint |
| `WEBSOCKET_PORT` | `5133` | Port to expose the `/ws` path for the replication over the websocket |
| | | |
| `OFFSET_STORAGE_FILE` | `./offset_storage_data.dat` | Path to the file storing the mapping between connected instances and offsets in Vaxine WAL. Should be persisted between Electric restarts. |
| | | |
| `MIGRATIONS_DIR` | | Directory to read the migration SQL files from (see below) |
| `MIGRATIONS_FILE_NAME_SUFFIX` | `/postgres.sql` | Suffix that is appended to the migration name when looking for the migration file |
| | | |
| `SATELLITE_AUTH_SIGNING_KEY` | `""` | Authentication token signing/validation secret key. See below. |
| `SATELLITE_AUTH_SIGNING_ISS` | `""` | Cluster ID which acts as the issuer for the authentication JWT. See below. |
| | | |
| `GLOBAL_CLUSTER_ID` | | Identifier of the cluster within the Electric cloud. When running locally, you can use any string |
| `ELECTRIC_INSTANCE_ID` | | Unique identifier of this Electric instance when running in the cluster. When running locally, you can use any string |
| `ELECTRIC_REGIONAL_ID` | | Shared identifier for multiple Electric instance that connect to the same Vaxine DC when running in the cluster. When running locally, you can use any string |

**Authentication**

Expand All @@ -108,12 +112,12 @@ production, set the following environment variables:
- `SATELLITE_AUTH_SIGNING_KEY` - Some random string used as the HMAC signing
key. Must be at least 32 bytes long.

- `SATELLITE_AUTH_SIGNING_ISS` - The JWT issuer (the `iss` field in the JWT).
- `SATELLITE_AUTH_SIGNING_ISS` - The JWT issuer (the `iss` field in the JWT).

You can generate a valid token using these configuration values by running `mix electric.gen.token`, e.g:

``` shell
$ export SATELLITE_AUTH_SIGNING_KEY=00000000000000000000000000000000
```shell
$ export SATELLITE_AUTH_SIGNING_KEY=00000000000000000000000000000000
$ export SATELLITE_AUTH_SIGNING_ISS=my.electric.server
$ mix electric.gen.token my_user my_other_user
```
Expand Down

0 comments on commit e1c0e2e

Please sign in to comment.