2.1 KiB
2.1 KiB
PloughGres Usage Guide
Quick Start
-
Start the PostgreSQL container:
./start.sh
-
Connect to the database:
./connect.sh
-
Stop the container:
docker-compose down
Common Operations
Database Management
- View container status:
docker ps
- View container logs:
docker logs ploughgres-db
- Access PostgreSQL shell:
./connect.sh
- Restart container:
docker-compose restart
SSL Connection Testing
The setup uses TLSv1.3 with 256-bit encryption. Connection details:
- Host: localhost
- Port: 5432
- Database: ploughgres
- User: ploughgres_user
- SSL Mode: verify-full (certificate verification enabled)
Data Persistence
- Database data is stored in
./data/
directory - SSL certificates are in
./secrets/
directory - All data remains in the project directory (userspace)
Security Features
- ✅ SSL/TLS encryption (TLSv1.3)
- ✅ Certificate verification
- ✅ SCRAM-SHA-256 authentication
- ✅ Row-level security enabled
- ✅ Audit logging
- ✅ Encryption functions (pgcrypto)
Troubleshooting
Container Issues
- Container won't start: Check
docker logs ploughgres-db
- Port conflicts: Ensure port 5432 is available
- Permission issues: Check file permissions in
secrets/
directory
SSL Connection Issues
- Certificate errors: Verify certificates exist in
secrets/
- Connection refused: Ensure container is running and healthy
- Authentication failed: Check password in
secrets/postgres_password.txt
Development
Making Changes
- Stop the container:
docker-compose down
- Make your changes
- Rebuild and restart:
./start.sh
Viewing SSL Status
Connect to the database and run:
SELECT ssl, version, cipher, bits FROM pg_stat_ssl WHERE pid = pg_backend_pid();
Files Overview
docker-compose.yml
- Container configurationstart.sh
- Initialization and startup scriptconnect.sh
- SSL connection test scriptDockerfile
- Container image definitionsecrets/
- SSL certificates and passwordsdata/
- PostgreSQL data directory