[PR #1256] [MERGED] Allow the use of SSL connections to the postgres database. #8973

Closed
opened 2026-02-05 13:56:18 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1256
Author: @monotok
Created: 1/5/2023
Status: Merged
Merged: 1/20/2023
Merged by: @alextran1502

Base: mainHead: ssl


📝 Commits (10+)

  • 58f704f Allow the use of SSL connections to the postgres database.
  • f14e804 Add default SSL false when no env set
  • 6d189ff Add commented out example of DB_SSL env
  • 3aea7c8 Refactor add SSL option into PostgresConnectionOptions
  • 62f5323 Refactor the database connection to optionally use a URL string instead of the env variables
  • 8f51276 Refactor the database connection based on feedback
  • a5925e0 Add dynamic validation around the DB envs
  • 4c041c4 Remove DB_URL from example
  • bab8aa1 Fix rebase
  • d6da901 Add back the optional database port in the example

📊 Changes

2 files changed (+24 additions, -9 deletions)

View changed files

📝 server/libs/common/src/config/app.config.ts (+10 -3)
📝 server/libs/infra/src/db/config/database.config.ts (+14 -6)

📄 Description

Hello,

fixes #902

Just throwing it out there, I have never coded in typescript before so wasn't exactly sure what I was doing as I code mainly in python/C.

I tweaked the code slightly so allow untrusted SSL connections or no SSL. I tested it with the docker-compose-dev deployment and also changing the environment parameters to point to my crunchydata postgres instance within K8s (which requires SSL). It all seemed to work.

I have made this a draft as I am not sure if this is a good way of doing it and I haven't changed/written any tests for it.

PS. I haven't tested immich yet as I am migrating stuff to K8s and want to deploy it there but it looks very promising; exactly what I have been looking for! Thank you for creating this.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1256 **Author:** [@monotok](https://github.com/monotok) **Created:** 1/5/2023 **Status:** ✅ Merged **Merged:** 1/20/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `ssl` --- ### 📝 Commits (10+) - [`58f704f`](https://github.com/immich-app/immich/commit/58f704f6e9e21fe77387f0c1260acd646e22ee9f) Allow the use of SSL connections to the postgres database. - [`f14e804`](https://github.com/immich-app/immich/commit/f14e8047a3060a1f287ea1021949e88ac5658ef2) Add default SSL false when no env set - [`6d189ff`](https://github.com/immich-app/immich/commit/6d189ff01480bc349178128d1654c1f78d096620) Add commented out example of DB_SSL env - [`3aea7c8`](https://github.com/immich-app/immich/commit/3aea7c82243c8a4b8abb5d4a2915243ef55f129f) Refactor add SSL option into PostgresConnectionOptions - [`62f5323`](https://github.com/immich-app/immich/commit/62f53235d5df15b36734519e8e7cbef8423820ab) Refactor the database connection to optionally use a URL string instead of the env variables - [`8f51276`](https://github.com/immich-app/immich/commit/8f51276d6991083f547fdf09ffd8b3534e74adea) Refactor the database connection based on feedback - [`a5925e0`](https://github.com/immich-app/immich/commit/a5925e088aa0c04801b1a7fc722f5770f1e104e0) Add dynamic validation around the DB envs - [`4c041c4`](https://github.com/immich-app/immich/commit/4c041c4343f88a308de0a8b52a402eca2c8742d1) Remove DB_URL from example - [`bab8aa1`](https://github.com/immich-app/immich/commit/bab8aa1c85bc3a37bf497d60b7fb430bd45dc247) Fix rebase - [`d6da901`](https://github.com/immich-app/immich/commit/d6da90162363d4b6787a15a084dcf302fdf08fac) Add back the optional database port in the example ### 📊 Changes **2 files changed** (+24 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `server/libs/common/src/config/app.config.ts` (+10 -3) 📝 `server/libs/infra/src/db/config/database.config.ts` (+14 -6) </details> ### 📄 Description Hello, fixes #902 Just throwing it out there, I have never coded in typescript before so wasn't exactly sure what I was doing as I code mainly in python/C. I tweaked the code slightly so allow untrusted SSL connections or no SSL. I tested it with the docker-compose-dev deployment and also changing the environment parameters to point to my crunchydata postgres instance within K8s (which requires SSL). It all seemed to work. I have made this a draft as I am not sure if this is a good way of doing it and I haven't changed/written any tests for it. PS. I haven't tested immich yet as I am migrating stuff to K8s and want to deploy it there but it looks very promising; exactly what I have been looking for! Thank you for creating this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:56:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8973