From 6ac89dad83b58526fd34972e50349bfe27df1f2c Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Mon, 11 Dec 2023 12:20:12 +0200 Subject: [PATCH] Mention the special `http` value for PG_PROXY_PORT in README --- components/electric/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/electric/README.md b/components/electric/README.md index 04b64cee14..fa751c07f2 100644 --- a/components/electric/README.md +++ b/components/electric/README.md @@ -90,7 +90,7 @@ The Electric application is configured using environment variables. Everything t | `LOGICAL_PUBLISHER_PORT` | `5433` | Port number to use for reverse connections from Postgres. | | `HTTP_PORT` | `5133` | Port for HTTP connections. Includes client websocket connections on `/ws`, and other functions on `/api`. | | | | | -| `PG_PROXY_PORT` | `65432` | Port number for connections to the [Postgres migration proxy](https://electric-sql.com/docs/usage/data-modelling/migrations). | +| `PG_PROXY_PORT` | `65432` |

Port number for connections to the [Postgres migrations proxy][1].

Setting this variable to the special value `http` enables the migrations proxy to accept connections from the proxy tunnel (`npx electric-sql proxy-tunnel`) when Electric is running behind a restrictive firewall that only allows HTTP/HTTPS connections. | | `PG_PROXY_PASSWORD` | | Password to use when connecting to the Postgres proxy via `psql` or any other Postgres client. | | | | | | `AUTH_MODE` | `"secure"` | Authentication mode to use to authenticate Satellite clients. See below. | @@ -102,6 +102,8 @@ The Electric application is configured using environment variables. Everything t | | | | | `ELECTRIC_INSTANCE_ID` | `electric` | Unique identifier of this Electric instance when running in a cluster (not yet supported). When running locally, you can use any string | + [1]: https://electric-sql.com/docs/usage/data-modelling/migrations + **Authentication** By default, Electric uses JWT-based authentication. At a minimum, the signature algorithm and an appropriate key must be @@ -153,14 +155,16 @@ Note that this procedure **MUST** be called within the same transaction as the m Note that if, when running on OSX, you get errors like: ``` + could not connect to the publisher: connection to server at \"host.docker.internal\" (192.168.65.2), port 5433 failed -``` + +```` You may need to adjust your docker networking or run Electric within docker. To run within Docker, you can build the docker image locally: ```sh make docker-build -``` +```` And then run with the right env vars, e.g.: