Skip to content

Commit 3deecae

Browse files
committed
docs: keep deployment integrations private
1 parent 7cd9da3 commit 3deecae

8 files changed

Lines changed: 23 additions & 95 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
integration coverage.
2020
- Default release containers to Alpine, add a stripped scratch control-plane
2121
image, add checksummed native packages for PostgreSQL 14 through 18, and add
22-
a CapRover one-click definition.
22+
an optional one-click deployment definition.
2323

2424
## 0.2.0 - 2026-08-12
2525

README.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,14 @@ HTTPS requests to BrasilAPI and turn the JSON response into PostgreSQL rows.
6060
```text
6161
browser ──> control plane ──SQL──> PostgreSQL + openapi_fdw
6262
63-
Metabase ─────────PostgreSQL──────────┤
63+
SQL clients ──────PostgreSQL──────────┤
6464
└──HTTPS──> external JSON APIs
6565
```
6666

6767
The control plane can be stopped after configuration. PostgreSQL keeps serving
6868
the foreign tables because the data plane has no dependency on the web app.
69-
Likewise, Metabase talks normal PostgreSQL; it does not need an OpenAPI plugin.
70-
71-
## Connect Metabase
72-
73-
Add the OpenAPI FDW PostgreSQL instance as a normal PostgreSQL database in
74-
Metabase. In Docker Compose, use `postgres:5432` from a container on the same
75-
network. In CapRover, use:
76-
77-
```text
78-
Host: srv-captain--openapi-fdw-db
79-
Port: 5432
80-
Database: openapi_fdw
81-
User: openapi_fdw
82-
Password: <the PostgreSQL password configured at deployment>
83-
```
84-
85-
The exact hostname changes if the CapRover app is given another name. No public
86-
database port is required when Metabase is in the same CapRover cluster.
87-
88-
Metabase schema synchronization sees the imported foreign tables and their
89-
typed columns. Native SQL questions work immediately. Path-based endpoints
90-
need an equality predicate for every placeholder, as in the CEP example above.
69+
Any PostgreSQL-compatible client can query the tables without an OpenAPI-aware
70+
driver or plugin.
9171

9272
## Use any compatible OpenAPI document
9373

@@ -291,7 +271,7 @@ reached 1,940 scans/s. Public network latency normally dominates; see
291271
## Documentation
292272

293273
- [Control plane and bundle format](docs/CONTROL_PLANE.md)
294-
- [Installation, containers, CapRover, and Metabase](docs/DEPLOYMENT.md)
274+
- [Installation and containers](docs/DEPLOYMENT.md)
295275
- [Architecture and trade-offs](docs/ARCHITECTURE.md)
296276
- [Original prototype audit](docs/AUDIT.md)
297277
- [Public API research](docs/API_RESEARCH.md)

control-plane/assets/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ async function copyConnectionSql(source) {
248248
const searchPath = schemas.length ? schemas.map(quoteIdentifier).join(", ") : "public";
249249
const firstSchema = schemas.length ? quoteIdentifier(schemas[0]) : "public";
250250
const firstTable = quoteIdentifier(source.tables[0]?.name || "table_name");
251-
const sql = `-- Run in Metabase after connecting this PostgreSQL database\nSET search_path TO ${searchPath}, public;\n\n-- Every SELECT below performs a live HTTP request\nSELECT * FROM ${firstSchema}.${firstTable} LIMIT 20;`;
251+
const sql = `-- Run in any PostgreSQL client\nSET search_path TO ${searchPath}, public;\n\n-- Every SELECT below performs a live HTTP request\nSELECT * FROM ${firstSchema}.${firstTable} LIMIT 20;`;
252252
await navigator.clipboard.writeText(sql);
253-
toast("Metabase starter SQL copied.");
253+
toast("Connection SQL copied.");
254254
}
255255

256256
async function removeSource(source) {

control-plane/src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn dashboard() -> String {
6161
p class="eyebrow" { "LIVE DATA PLANE" }
6262
h1 id="page-title" { "Turn an OpenAPI service into tables." }
6363
p class="lede" {
64-
"Discover operations, review the SQL, import a schema, then query the remote API from PostgreSQL or Metabase."
64+
"Discover operations, review the SQL, import a schema, then query the remote API from PostgreSQL."
6565
}
6666
}
6767
div class="metrics" aria-label="Control-plane summary" {

deploy/caprover/openapi-fdw.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ caproverOneClickApp:
4747
CapRover overlay network by default.
4848
end: |-
4949
Open https://$$cap_appname.$$cap_root_domain and sign in with the control-plane token.
50-
51-
Metabase running on this CapRover cluster can connect with:
52-
host: srv-captain--$$cap_appname-db
53-
port: 5432
54-
database: $$cap_pg_db
55-
username: $$cap_pg_user
56-
password: the PostgreSQL password entered above
5750
displayName: OpenAPI FDW
5851
isOfficial: false
5952
description: Query OpenAPI-described HTTP APIs as live PostgreSQL foreign tables.

docs/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ matters for local and low-latency services.
6565
browser --> stateless Rust control plane -- reviewed SQL --> PostgreSQL catalogs
6666
|
6767
v
68-
PostgreSQL planner/executor <---------------------- Metabase / SQL clients
68+
PostgreSQL planner/executor <---------------------- SQL clients
6969
|
7070
v
7171
supabase-wrappers native FDW callbacks

docs/CONTROL_PLANE.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ JavaScript. It does not proxy query traffic and it does not copy API data.
77
```text
88
administrator browser --> control plane --> PostgreSQL DDL/catalogs
99
|
10-
SQL clients and Metabase ---------------------+
10+
SQL clients ----------------------------------+
1111
|
1212
+--> external API on every scan
1313
```
@@ -26,10 +26,9 @@ its foreign tables.
2626
| `OPENAPI_FDW_POOL_SIZE` | no | `8` | PostgreSQL connection-pool size, 1 through 64 |
2727
| `RUST_LOG` | no | `openapi_fdw_control=info` | Rust tracing filter |
2828

29-
The current control-plane PostgreSQL connection uses `NoTls`. In Docker Compose
30-
or CapRover it should use a private container/overlay network and
31-
`sslmode=disable`. Do not expose that unencrypted connection across an
32-
untrusted network.
29+
The current control-plane PostgreSQL connection uses `NoTls`. In containers or
30+
an orchestrator it should use a private network and `sslmode=disable`. Do not
31+
expose that unencrypted connection across an untrusted network.
3332

3433
The login token is held in process memory. A successful login receives a
3534
derived, HTTP-only, same-site session cookie; the administrator token itself is

docs/DEPLOYMENT.md

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -78,68 +78,24 @@ Then connect and run `CREATE EXTENSION openapi_fdw;`. If an FDW option names a
7878
secret environment variable, pass that variable to this PostgreSQL container,
7979
not to the control-plane container.
8080

81-
## CapRover
81+
## Production operation
8282

83-
[`deploy/caprover/openapi-fdw.yml`](../deploy/caprover/openapi-fdw.yml) is a
84-
CapRover v4 one-click definition. It creates:
85-
86-
- `<app>`: the HTTPS control plane; and
87-
- `<app>-db`: private PostgreSQL 18 with a persistent volume mounted at
88-
`/var/lib/postgresql`.
89-
90-
In CapRover, choose **One-Click Apps/Databases**, use the template, provide an
91-
app name, keep separate long random PostgreSQL and administrator secrets, and
92-
deploy. Enable HTTPS and force HTTPS on the web app. PostgreSQL is deliberately
93-
not exposed as a web app and needs no public TCP mapping when its consumers are
94-
inside the same Swarm.
95-
96-
For an app named `openapi-fdw`, another CapRover app reaches PostgreSQL at:
97-
98-
```text
99-
srv-captain--openapi-fdw-db:5432
100-
```
101-
102-
Back up the persistent PostgreSQL volume using the same process used for other
103-
CapRover databases. The control plane is stateless; its only required state is
104-
its environment configuration and the metadata stored in PostgreSQL.
83+
Keep PostgreSQL on a private network unless direct client access is required,
84+
persist `/var/lib/postgresql`, and use independent random values for the
85+
database password and control-plane administrator token. Terminate HTTPS in
86+
front of the control plane and retain its secure-cookie default.
10587

10688
Upgrades should keep PostgreSQL on the same major unless a normal PostgreSQL
10789
major-version upgrade is performed. Updating a same-major image restarts the
10890
service with the existing volume and updated extension files. Run
10991
`ALTER EXTENSION openapi_fdw UPDATE;` when a future release introduces an
11092
extension upgrade script.
11193

112-
## Metabase
113-
114-
Add the deployment as a normal PostgreSQL database. For the CapRover example:
115-
116-
```text
117-
Display name: OpenAPI FDW / BrasilAPI
118-
Host: srv-captain--openapi-fdw-db
119-
Port: 5432
120-
Database: openapi_fdw
121-
Username: openapi_fdw
122-
Password: <deployment PostgreSQL password>
123-
SSL: off for the private CapRover overlay connection
124-
```
125-
126-
Grant Metabase a read-only role instead of reusing the owner in a multi-user
127-
installation:
128-
129-
```sql
130-
CREATE ROLE metabase_openapi LOGIN PASSWORD '<different random password>';
131-
GRANT CONNECT ON DATABASE openapi_fdw TO metabase_openapi;
132-
GRANT USAGE ON SCHEMA brasil TO metabase_openapi;
133-
GRANT SELECT ON ALL TABLES IN SCHEMA brasil TO metabase_openapi;
134-
ALTER DEFAULT PRIVILEGES IN SCHEMA brasil
135-
GRANT SELECT ON TABLES TO metabase_openapi;
136-
```
137-
138-
Metabase schema sync sees foreign tables and typed columns. Each question or
139-
native query that scans one performs live outbound API work, so dashboard
140-
refresh frequency and upstream rate limits still matter. For expensive or
141-
rate-limited datasets, explicitly materialize selected results in local tables
142-
on a schedule instead of treating the FDW as a cache.
94+
Any PostgreSQL-compatible client can connect with the standard host, port,
95+
database, user, and password fields. Prefer a dedicated read-only login and
96+
grant it only `CONNECT`, schema `USAGE`, foreign-server `USAGE`, and `SELECT`
97+
on the intended foreign tables. Each scan performs live outbound API work, so
98+
client refresh frequency and upstream rate limits still matter.
14399

144100
## Checksummed native installation
145101

0 commit comments

Comments
 (0)