diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 59951f99..a26ae5e0 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -26,7 +26,7 @@ backend: - name: DATABASE_PASSWORD value: "$(PGPASSWORD)" - name: DATABASE_SSL - ~tpl~value: '"{{ .Values.global.isProd | ternary "true" "false" }}"' + value: "true" envFrom: - secretRef: name: pg-user diff --git a/back-strapi/config/database.js b/back-strapi/config/database.js index 29754b54..126c6dba 100644 --- a/back-strapi/config/database.js +++ b/back-strapi/config/database.js @@ -10,9 +10,17 @@ module.exports = ({ env }) => ({ database: env("DATABASE_NAME", "tumeplay_dev"), username: env("DATABASE_USERNAME", "db_user"), password: env("DATABASE_PASSWORD", "Mjolnir64"), - ssl: env.bool("DATABASE_SSL", false), + ssl: getSslConfig(env) }, options: {}, }, }, }); + + +function getSslConfig(env) { + if (env.bool("DATABASE_SSL", false)) { + return {rejectUnauthorized: false} // For self-signed certificates + } + return false; +}