PSA/pgbouncer/README.md
Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

65 lines
1.8 KiB
Markdown

# PgBouncer Configuration
This directory contains the PgBouncer connection pooler configuration for the Alga PSA application.
## Components
- `Dockerfile`: Builds the PgBouncer container
- `entrypoint.sh`: Initializes PgBouncer with secrets and configuration
- `pgbouncer.ini.template`: PgBouncer configuration template
- `userlist.txt.template`: User authentication template
## Secrets Management
PgBouncer requires the following secrets to be present:
- `/run/secrets/postgres_password`: PostgreSQL superuser password
- `/run/secrets/db_password_server`: Application database user password
### Important: Secret File Format
Secret files must be properly formatted:
- Should contain the password as a single line
- Should have a trailing newline character
- Should not contain extra whitespace
### Troubleshooting
If PgBouncer container exits silently:
1. Check if secrets are mounted:
```bash
docker compose run --rm pgbouncer ls -la /run/secrets/
```
2. Validate secret files:
```bash
./scripts/validate-secrets.sh
```
3. Check container logs:
```bash
docker logs <container_name>
```
4. Test entrypoint directly:
```bash
docker run --rm \
-v $(pwd)/secrets/postgres_password:/run/secrets/postgres_password:ro \
-v $(pwd)/secrets/db_password_server:/run/secrets/db_password_server:ro \
--entrypoint /bin/sh \
alga-psa-pgbouncer -c "sh -x /entrypoint.sh"
```
## Known Issues
### Silent Failures with `read` Command
The shell `read` command fails silently if the input file doesn't end with a newline.
We use `$(cat file)` instead of `read < file` to handle files without trailing newlines.
## Configuration
PgBouncer is configured to:
- Listen on port 6432
- Use transaction pooling mode
- Support up to 1000 client connections
- Maintain a pool of 20 connections per database