OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Allow more PostgreSQL database options
Oliver Günthera20c7c5e849c
diff --git a/config/database.production.yml b/config/database.production.ymlindex d122a496977..b4a6ee5f56a 100644--- a/config/database.production.yml+++ b/config/database.production.yml@@ -34,6 +34,7 @@ DATABASE_OPTIONS = %w[poolusernamepassword+ passfilesslmodesslcompressionsslcert@@ -41,8 +42,18 @@ DATABASE_OPTIONS = %w[sslpasswordsslrootcertsslcrl+ ssl_min_protocol_versionapplication_namestatement_timeout+ channel_binding+ connect_timeout+ client_encoding+ keepalives+ keepalives_idle+ keepalives_interval+ keepalives_count+ gssencmode+ replication].freezeDATABASE_VARIABLES = %w[diff --git a/docs/installation-and-operations/configuration/database/README.md b/docs/installation-and-operations/configuration/database/README.mdindex f16d5c012c1..bbf743f82a1 100644--- a/docs/installation-and-operations/configuration/database/README.md+++ b/docs/installation-and-operations/configuration/database/README.md@@ -44,15 +44,35 @@ In both cases the seeder will be run when you (re)launch OpenProject to make surOpenProject will merge the settings from `DATABASE_URL` with manually specified environment options. Here are the supported options:-| Environment variable | Default | Description | Documentation |-|------------------------------------|-------------|-----------------------------------------------------------------------|------------------------------------------------------------------------------------------|-| DATABASE_URL<br>OPENPROJECT_DB_URL | *none* | URL style passing of database options | https://guides.rubyonrails.org/configuring.html#configuring-a-database |-| OPENPROJECT_DB_ENCODING | unicode | Encoding of the database | Should be left at unicode unless you really know what you're doing. |-| OPENPROJECT_DB_POOL | *none* | Connection pool count | https://guides.rubyonrails.org/configuring.html#database-pooling |-| OPENPROJECT_DB_USERNAME | *none* | Database username, if not presented in URL above | https://guides.rubyonrails.org/configuring.html#configuring-a-database |-| OPENPROJECT_DB_PASSWORD | *none* | Database password, if not presented in URL above | https://guides.rubyonrails.org/configuring.html#configuring-a-database |-| OPENPROJECT_DB_APPLICATION_NAME | openproject | PostgreSQL application name option | https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-APPLICATION-NAME |-| OPENPROJECT_DB_STATEMENT_TIMEOUT | 90s | Default statement timeout before connection statements are terminated | https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STATEMENT-TIMEOUT |+| Environment variable | Default | Description | Documentation |+| --------------------------------------- | ------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |+| DATABASE_URL<br>OPENPROJECT_DB_URL | | URL style passing of database options | https://guides.rubyonrails.org/configuring.html#configuring-a-database |+| OPENPROJECT_DB_ENCODING | unicode | Encoding of the database | Should be left at unicode unless you really know what you're doing. |+| OPENPROJECT_DB_POOL | | Connection pool count | https://guides.rubyonrails.org/configuring.html#database-pooling |+| OPENPROJECT_DB_USERNAME | | Database username, if not presented in URL above | https://guides.rubyonrails.org/configuring.html#configuring-a-database |+| OPENPROJECT_DB_PASSWORD | | Database password, if not presented in URL above | https://guides.rubyonrails.org/configuring.html#configuring-a-database |+| OPENPROJECT_DB_APPLICATION_NAME | openproject | PostgreSQL application name option | https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-APPLICATION-NAME |+| OPENPROJECT_DB_STATEMENT_TIMEOUT | 90s | Default statement timeout before connection statements are terminated | https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STATEMENT-TIMEOUT |+| OPENPROJECT_DB_REQUIRE_AUTH | Uses libpq default | Specifies the authentication method that the client requires from the server. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-REQUIRE-AUTH |+| OPENPROJECT_DB_CHANNEL_BINDING | Uses libpq default | This option controls the client's use of channel binding. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CHANNEL-BINDING |+| OPENPROJECT_DB_CONNECT_TIMEOUT | Uses libpq default | Maximum time to wait while connecting, in seconds (write as a decimal integer, e.g., `10`). | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT |+| OPENPROJECT_DB_CLIENT_ENCODING | Uses libpq default | This sets the `client_encoding` configuration parameter for this connection. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CLIENT-ENCODING |+| OPENPROJECT_DB_KEEPALIVES | Uses libpq default | Controls whether client-side TCP keepalives are used. The default value is 1, meaning on, but you can change this to 0, meaning off, if keepalives are not wanted. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-KEEPALIVES |+| OPENPROJECT_DB_KEEPALIVES_IDLE | Uses libpq default | Controls the number of seconds of inactivity after which TCP should send a keepalive message to the server. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-KEEPALIVES-IDLE |+| OPENPROJECT_DB_KEEPALIVES_INTERVAL | Uses libpq default | Controls the number of seconds after which a TCP keepalive message that is not acknowledged by the server should be retransmitted. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-KEEPALIVES-INTERVAL |+| OPENPROJECT_DB_KEEPALIVES_COUNT | Uses libpq default | Controls the number of TCP keepalives that can be lost before the client's connection to the server is considered dead. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-KEEPALIVES-COUNT |+| OPENPROJECT_DB_REPLICATION | Uses libpq default | This option determines whether the connection should use the replication protocol instead of the normal protocol. | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-REPLICATION |+| OPENPROJECT_DB_GSSENCMODE | Uses libpq default | This option determines whether or with what priority a secure GSS TCP/IP connection will be negotiated with the server. (prefer) | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE |+| OPENPROJECT_DB_SSLMODE | Uses libpq default | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLMODE | |+| OPENPROJECT_DB_SSLCOMPRESSION | Uses libpq default | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLCOMPRESSION | |+| OPENPROJECT_DB_SSL_MIN_PROTOCOL_VERSION | Uses libpq default | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSL-MIN-PROTOCOL-VERSION | |+| | | | |+| | | | |+| | | | |+| | | | |+| | | | |++## Using SSL/TLS with a PostgreSQL database@@ -66,15 +86,16 @@ DATABASE_URL=postgres://user:pass@host:port/dbname?sslmode=require-full&sslcert=Alternatively, for better readability, you can set these parameters with separate environment variables:-| Environment variable | Default | Description | PostgreSQL documentation |-| ----------------------------- | ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |-| OPENPROJECT_DB_SSLMODE | prefer | connection mode for SSL. See | [sslmode](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLMODE) |-| OPENPROJECT_DB_SSLCOMPRESSION | 0 | If set to 1, data sent over SSL connections will be compressed | [sslcompression](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCOMPRESSION) |-| OPENPROJECT_DB_SSLCERT | ~/.postgresql/postgresql.crt | Path to certificate | [sslcert](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCERT) |-| OPENPROJECT_DB_SSLKEY | ~/.postgresql/postgresql.key | Path to certificate key | [sslkey](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLKEY) |-| OPENPROJECT_DB_SSLPASSWORD | | Password to certificate key | [sslpassword](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLPASSWORD) |-| OPENPROJECT_DB_SSLROOTCERT | ~/.postgresql/root.crt | Path to CA | [sslrootcert](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT) |-| OPENPROJECT_DB_SSLCRL | ~/.postgresql/root.crl | Path to revocation list | [sslcrl](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCRL) |+| Environment variable | Default | Description | PostgreSQL documentation |+| --------------------------------------- | ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |+| OPENPROJECT_DB_SSLMODE | prefer | connection mode for SSL. See | [sslmode](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLMODE) |+| OPENPROJECT_DB_SSLCOMPRESSION | 0 | If set to 1, data sent over SSL connections will be compressed | [sslcompression](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCOMPRESSION) |+| OPENPROJECT_DB_SSLCERT | ~/.postgresql/postgresql.crt | Path to certificate | [sslcert](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCERT) |+| OPENPROJECT_DB_SSLKEY | ~/.postgresql/postgresql.key | Path to certificate key | [sslkey](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLKEY) |+| OPENPROJECT_DB_SSLPASSWORD | | Password to certificate key | [sslpassword](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLPASSWORD) |+| OPENPROJECT_DB_SSLROOTCERT | ~/.postgresql/root.crt | Path to CA | [sslrootcert](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT) |+| OPENPROJECT_DB_SSLCRL | ~/.postgresql/root.crl | Path to revocation list | [sslcrl](https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNECT-SSLCRL) |+| OPENPROJECT_DB_SSL_MIN_PROTOCOL_VERSION | Uses libpq default | https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSL-MIN-PROTOCOL-VERSION | |```text="prefer" # disable, allow, prefer, require, verify-ca, verify-full