From e1c0e2ebb1b34a5b5e9f7373b3f6eb08740a5d9d Mon Sep 17 00:00:00 2001 From: Ilia Borovitinov Date: Fri, 25 Nov 2022 18:27:09 +0300 Subject: [PATCH] chore: add missing env variables to the readme (#69) --- README.md | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ed930fb4..a43f4505 100644 --- a/README.md +++ b/README.md @@ -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** @@ -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 ```