{"id":19594547,"url":"https://github.com/toggle-corp/pg-bouncer-template","last_synced_at":"2026-06-18T09:32:23.242Z","repository":{"id":238714318,"uuid":"797155688","full_name":"toggle-corp/pg-bouncer-template","owner":"toggle-corp","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-02T16:50:14.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-03T04:49:26.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toggle-corp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T09:52:06.000Z","updated_at":"2026-04-02T16:50:20.000Z","dependencies_parsed_at":"2024-11-11T08:44:06.407Z","dependency_job_id":"77234f6f-9e43-4600-ba09-667ea3923ea0","html_url":"https://github.com/toggle-corp/pg-bouncer-template","commit_stats":null,"previous_names":["toggle-corp/pg-bouncer-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toggle-corp/pg-bouncer-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toggle-corp%2Fpg-bouncer-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toggle-corp%2Fpg-bouncer-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toggle-corp%2Fpg-bouncer-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toggle-corp%2Fpg-bouncer-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toggle-corp","download_url":"https://codeload.github.com/toggle-corp/pg-bouncer-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toggle-corp%2Fpg-bouncer-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34485163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T08:43:55.021Z","updated_at":"2026-06-18T09:32:23.099Z","avatar_url":"https://github.com/toggle-corp.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DB proxy using pgbouncer\n\u003e https://hub.docker.com/r/bitnami/pgbouncer/\n\nUpdate .env with DB credentials\n\n## Generate certificates\n```bash\n./generate-certs.sh\n```\n\n## Source DB certificates\n### AWS\n\u003e https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html\n\n```bash\ncurl -sS \"https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem\" \u003e certs/source-cert.pem\n```\n\n## Create users\n\nCreate user in database\n\n```sql\n-- Create a group\nCREATE ROLE full_readaccess;\n\n-- Grant access to existing tables\nGRANT USAGE ON SCHEMA public TO full_readaccess;\nGRANT SELECT ON ALL TABLES IN SCHEMA public TO full_readaccess;\n\n-- Grant access to future tables\nALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO full_readaccess;\n\n-- Create a final user with password\nCREATE USER user_name WITH PASSWORD 'random_password';\n-- ALTER USER user_name WITH PASSWORD 'random_password';\nGRANT full_readaccess TO user_name;\n```\n\n---\n\nAllow new user in proxy using **userlist.txt**\n```bash\necho -n 'md5'; echo -n \"passworduser\" | md5sum | awk '{print $1}'\n# Then add the output as \"user\" \"md5.....\" to userlist.txt\n```\n\n---\n\nGenerate client certificate\n```bash\nopenssl req -x509 -keyout client-key.pem -out client-cert.pem -days 365 -nodes -subj '/CN=localhost'\n```\n\nAdd `client-cert.pem` to `certs/clients-cert.pem`\n\u003e NOTE: We can add verbose information outside `-----BEGIN FOO----- and -----END FOO-----`\n\nUse `client-key.pem` when connecting to database using SQL client\n\n\n## Connect to database\n\n```config\nEnable SSL: True\n# Server Certificates\nCA Cert: proxy-cert.pem\n# User certificates\nCertificate: client-cert.pem\nKey File: client-key.pem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoggle-corp%2Fpg-bouncer-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoggle-corp%2Fpg-bouncer-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoggle-corp%2Fpg-bouncer-template/lists"}