Comments (3)
It's not explicitly stated, but we can use the PG_META_DB_URL
env variable to define the connection string, like we would with GOTRUE_DB_DATABASE_URL
or PGRST_DB_URI
. Example:
PG_META_DB_URL: postgres://${POSTGRES_USER_META}:${POSTGRES__PASSWORD}@${POSTGRES__HOST}:${POSTGRES__PORT}/${POSTGRES__DB}?sslmode=verify-ca&sslrootcert=/certs/example.crt&sslcert=/certs/example.crt&sslkey=/example-rest.key
However, there is a mistake in the configuration for "rejectUnauthorized" (See):
config.ssl.rejectUnauthorized = sslmode !== 'no-verify'
Should be:
config.ssl.rejectUnauthorized = sslmode === 'verify-full'
According to the official docs, only the "verify-full" mode should verify that the CN (or SAN) of the cert used by pg-meta corresponds to the Postgres node's hostname.
I am not sure exactly how the "pg" client should be configured, does it just use "rejectUnauthorized: true" for "verify-full" and "rejectUnauthorized: false" for "verify-ca" and adds additional checks for everything except CN?
One thing is sure, Postgrest and Gotrue got this right as the exact same certificate with a custom CN that doesn't correspond to the hostname is accepted when using "verify-ca", but not when using "verify-full". So there is definitely a misconfiguration in pg-meta.
from postgres-meta.
Hi, thanks for reporting this. The rejectUnauthorized
issue should be fixed in #709.
For PG_META_DB_SSL_ROOT_CERT
, it actually accepts the contents of the cert, not the path.
from postgres-meta.
Closing this for now, but feel free to create a new issue if it persists.
from postgres-meta.
Related Issues (20)
- v0.61.1 introduces bug in typescript generation for computed column HOT 3
- Unable to run postgres-meta development
- typescript generated type of pgvector/vector is string HOT 5
- Generate types for foreign tables HOT 5
- Generating types for a postgresql array results in Typescript unknown property HOT 4
- Feat: Indexes HOT 1
- supabase gen types generates duplicate identifiers HOT 3
- gentype producing wrong type for inner join HOT 1
- Typegen is not respecting unique table constraint HOT 3
- Permission denied error when generating types HOT 3
- Stopping the container is slow, resorting to SIGKILL
- How to get online postgre-meta version? HOT 1
- Generate types: "Json" type is incompatible with other types HOT 6
- Hardcoded metadata resulting in broken TypeScript type generation from the Supabase CLI HOT 1
- sslmode=require ignored on postgresql URL with gen types --db-url HOT 3
- Gen type throws an exception when table has no columns HOT 2
- Type generation script does not pick up correct type when a SQL function returns data from other table HOT 1
- Composite types can be null
- Generated DB types do not include function property in Table HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgres-meta.