Need some hosting advice

I'm working on a project which has it's front-end and backend hosted on CF Pages / Workers, and I also use the CF KV out of convenience. Sadly I can't use D1 for my project, so I'm forced to host some external postgres DB on a VPS and communicate to it from workers. What would be the most secure and reliable way to communicate between my CF Workers and my postgres DB? Using a simple username + password connection string seems simple, but that opens possibility for brute-force attacks. And I'm not sure what types of firewall rule's I'd need to apply because CloudFlare would probably request the database from several different IP addresses.
3 Replies
Idle
Idle4mo ago
as for whitelisting cloudflare IPs you can check their ranges https://www.cloudflare.com/ips/ and perhaps you can use something like cloudflared to expose your postgres database?
Chaika
Chaika4mo ago
https://developers.cloudflare.com/hyperdrive/ Cloudflare has hyperdrive, a service for connecting to Postgres DBs from Workers, which also has connection pooling and caching
Cloudflare Docs
Hyperdrive · Hyperdrive
Hyperdrive is a service that accelerates queries you make to existing databases, making it faster to access your data from across the globe, …
Chaika
Chaika4mo ago
Both Hyperdrive and TCP Connect don't use /ips/ and instead use CF WARP IPs (not documented anywhere) though
Want results from more Discord servers?
Add your server
More Posts
Hey guys, I work in a startup as aHey guys, I work in a startup as a backend developer, and we're not currently using the cloud to hosCan we provide Cloudflared a truststore for certificates ?Hello everyone, During initial connection to Cloudflare, I have the following error that I suspect Cannot set redirect from www to apexI tried a few things but nothin is working at all. It is redirecting https://www.example.com/<> to Missing support for CiphersContext: Building an SSO integration using Workers + Shopify Multipass. Need to get `createCipheriv`Rejections in execution context and dashboard error countIf a promise that's been passed to `ctx.waitUntil()` throws, will it be reflected as an error in WorAccess private networks which are behind zero trust using cloudflared cli daemon app?I'm trying to access my 10.X,X,X ip (postgres) using the below command ``` cloudflared access tcp --Why isn't Cloudflare Pages / Hosting throwing 404s?Hey, for example, one of my websites, I can go to any URL and in the browsers network tab it always Other TLDs like .com.auI'd like to consolidate all of my domains with Cloudflare as I have some registered with some very sHow do I redirect a path to a different domain?I am trying to send all traffic from mydomain.com/blog to mydomain.ghost.io using redirect rules butURGNET: Github -> Cloudflare link broken? Commits to main do not lead to new deployments...Hey, Since an hour ago, I cannot deploy as Cloudflare does not pick up on commits to main. This co