Skip to content

[Backend] DB pool has no SSL enforcement and no statement_timeout #9

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

src/db/connection.ts creates the Pool with only connectionString and sizing (lines 19-24). There is no ssl option, so TLS/cert validation depends entirely on the DATABASE_URL string, and there is no statement_timeout, so a slow or stuck query can hold a connection indefinitely and exhaust the pool.

Acceptance criteria

  • Add configurable SSL (with rejectUnauthorized in production) driven by env
  • Set a per-connection statement_timeout (env-configurable, sane default) and/or query_timeout
  • Document the new env vars in .env.example
  • Add a test or startup check that the timeout is applied

Files to touch

  • src/db/connection.ts
  • .env.example

Out of scope

  • Switching connection pooler (pgbouncer)
  • Read-replica routing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or requesthardAdvanced / high-difficulty issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions