Skip to content

Commit

Permalink
Fix: get back ssl with cnpg self signed certificates (#480)
Browse files Browse the repository at this point in the history
* fix: get back SSL with self signed cnpg cert

* fix
  • Loading branch information
achauve authored Aug 29, 2023
1 parent 89cde2d commit 997e3e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion back-strapi/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 997e3e5

Please sign in to comment.