You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* SSL for postgres
* Add entrypoint wrapper
* Add in init so we can test ssl+init path
* Remove unused fields from options
* Remove unused consts
* Separate entrypoint from ssl
* Use external cert generation
* Make entrypoint not-optional
* Add docstring
* Spaces to tab in entrypoint
* Add postgres ssl docs
* Remove WithEntrypoint
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Embed resources + Use custom conf automatically
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update docs/modules/postgres.md
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Manuel de la Peña <[email protected]>
* Revert to use passed in conf
* Update doc for required conf
* Error checking in the customizer
* Few formatting fix
* Use non-nil error when err is nil
* Update modules/postgres/postgres_test.go
Co-authored-by: Steven Hartland <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Steven Hartland <[email protected]>
* Update modules/postgres/postgres.go
Co-authored-by: Steven Hartland <[email protected]>
* Update modules/postgres/postgres.go
Co-authored-by: Steven Hartland <[email protected]>
* Update modules/postgres/postgres_test.go
Co-authored-by: Steven Hartland <[email protected]>
* Addresses review modulo cleanup
* Remove unused type
* Use ContainerCleanup
* Lint pass
* Add t.Helper and Linting
* Remove SSLSetting struct, use raw paths
* Use single command for chown key material
* docs: remove spaces
* fix: use non-deprecated APIs
* chore: rename variable
---------
Co-authored-by: bstrausser <[email protected]>
Co-authored-by: Manuel de la Peña <[email protected]>
Co-authored-by: Steven Hartland <[email protected]>
Co-authored-by: Manuel de la Peña <[email protected]>
Copy file name to clipboardExpand all lines: docs/modules/postgres.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,9 +74,35 @@ An example of a `*.sh` script that creates a user and database is shown below:
74
74
75
75
In the case you have a custom config file for Postgres, it's possible to copy that file into the container before it's started, using the `WithConfigFile(cfgPath string)` function.
76
76
77
+
This function can be used `WithSSLSettings` but requires your configuration correctly sets the SSL properties. See the below section for more information.
78
+
77
79
!!!tip
78
80
For information on what is available to configure, see the [PostgreSQL docs](https://www.postgresql.org/docs/14/runtime-config.html) for the specific version of PostgreSQL that you are running.
79
81
82
+
#### SSL Configuration
83
+
84
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
85
+
86
+
If you would like to use SSL with the container you can use the `WithSSLSettings`. This function accepts a `SSLSettings` which has the required secret material, namely the ca-certificate, server certificate and key. The container will copy this material to `/tmp/testcontainers-go/postgres/ca_cert.pem`, `/tmp/testcontainers-go/postgres/server.cert` and `/tmp/testcontainers-go/postgres/server.key`
87
+
88
+
This function requires a custom postgres configuration file that enables SSL and correctly sets the paths on the key material.
89
+
90
+
If you use this function by itself or in conjuction with `WithConfigFile` your custom conf must set the require ssl fields. The configuration must correctly align the key material provided via `SSLSettings` with the server configuration, namely the paths. Your configuration will need to contain the following:
This function assumes the postgres user in the container is `postgres`
101
+
102
+
There is no current support for mutual authentication.
103
+
104
+
The `SSLSettings` function will modify the container `entrypoint`. This is done so that key material copied over to the container is chowned by `postgres`. All other container arguments will be passed through to the original container entrypoint.
0 commit comments