Skip to content

Commit

Permalink
chore(docs): Update the documentation of DATABASE_USE_IPv6 (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
alco authored May 7, 2024
1 parent 60d4407 commit e45e729
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/api/_DATABASE_USE_IPV6.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Set to `false` to stop Electric from trying to connect to the database over IPv6. By default, it will try to resolve the hostname from `DATABASE_URL` to an IPv6 address, falling back to IPv4 in case that fails.
Set to `true` to prioritise connecting to the database over IPv6. Electric will fall back to an IPv4 DNS lookup if the IPv6 lookup fails.
4 changes: 2 additions & 2 deletions docs/api/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Configure how Electric connects to Postgres and exposes its HTTP/WebSocket API.

<EnvVarConfig
name="DATABASE_USE_IPV6"
defaultValue="true"
example="false">
defaultValue="false"
example="true">
<DatabaseUseIpv6 />
</EnvVarConfig>

Expand Down
3 changes: 2 additions & 1 deletion docs/deployment/fly.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ Restarting machine 148ed127a03de8
Waiting for 148ed127a03de8 to become healthy (started, 1/3)
```

Now go back to [Configure your Fly app](#configure-your-fly-app) above and modify the contents of the `fly.toml` file shown there by changing the `DATABASE_URL` value to use your Fly Postgres instance's connection string and adding the `DATABASE_REQUIRE_SSL` environment variable:
Now go back to [Configure your Fly app](#configure-your-fly-app) above and modify the contents of the `fly.toml` file shown there by changing the `DATABASE_URL` value to use your Fly Postgres instance's connection string and adding `DATABASE_USE_IPV6` and `DATABASE_REQUIRE_SSL` environment variables:


```toml
[env]
DATABASE_URL = "postgres://postgres:...@<pg-app-name>.flycast:5432"
DATABASE_USE_IPV6 = "true"
DATABASE_REQUIRE_SSL = "false"
...the rest of the env vars
```
Expand Down
2 changes: 2 additions & 0 deletions docs/deployment/supabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Run your [Electric sync service](../api/service), either locally or [via one of
- set `AUTH_JWT_ALG` to `HS256` to enable secure auth mode with the right signing algorithm
- set `AUTH_JWT_KEY` to the "JWT Secret" value you retrieved in step 3 above
- set `DATABASE_URL` to the connection string you retrieved in step 2 above
- set `DATABASE_USE_IPV6` to `true` unless you've purchased the IPv4 add-on for Supabase
- set `ELECTRIC_WRITE_TO_PG_MODE` to `direct_writes`
- set `PG_PROXY_PASSWORD` to a secure password value and note it down

Expand All @@ -93,6 +94,7 @@ docker run \
-e "AUTH_JWT_ALG=HS256" \
-e "AUTH_JWT_KEY=..." \
-e "DATABASE_URL=..." \
-e "DATABASE_USE_IPV6=true" \
-e "ELECTRIC_WRITE_TO_PG_MODE=direct_writes" \
-e "PG_PROXY_PASSWORD=..." \
-e "PG_PROXY_PORT=65432" \
Expand Down

0 comments on commit e45e729

Please sign in to comment.