Skip to content

Commit

Permalink
container enable sslmode for PostgreSQL (CO-2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoranda committed Jan 22, 2024
1 parent d791f82 commit d8bec8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions container/registry/base/comanage_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function comanage_utils::consume_injected_environment() {
COMANAGE_REGISTRY_DATABASE
COMANAGE_REGISTRY_DATABASE_HOST
COMANAGE_REGISTRY_DATABASE_PORT
COMANAGE_REGISTRY_DATABASE_POSTGRES_SSLMODE
COMANAGE_REGISTRY_DATABASE_USER
COMANAGE_REGISTRY_DATABASE_USER_PASSWORD
COMANAGE_REGISTRY_EMAIL_FROM
Expand Down Expand Up @@ -502,6 +503,11 @@ EOF
php_string+="'port' => ${COMANAGE_REGISTRY_DATABASE_PORT},"
fi

if [[ "${COMANAGE_REGISTRY_DATABASE_POSTGRES_SSLMODE}" =~ ^(disable|allow|prefer|require|verify-ca|verify-full)$ ]]; then
php_string+=$'\n '
php_string+="'sslmode' => '${COMANAGE_REGISTRY_DATABASE_POSTGRES_SSLMODE}',"
fi

php_string+=$'\n );\n}\n';

printf "%s" "$php_string" > $database_config
Expand Down

0 comments on commit d8bec8c

Please sign in to comment.