Skip to content

Adding Support for Infisical Password Vault#1609

Draft
Zachary-Squires wants to merge 28 commits into
OpenEnergyDashboard:developmentfrom
Zachary-Squires:password-vault
Draft

Adding Support for Infisical Password Vault#1609
Zachary-Squires wants to merge 28 commits into
OpenEnergyDashboard:developmentfrom
Zachary-Squires:password-vault

Conversation

@Zachary-Squires
Copy link
Copy Markdown
Contributor

Description

This PR adds optional support for Infisical, an open source free secrets manager that can be self hosted. This PR allows the POSTGRES_PASSWORD and OED_DB_PASSWORD variables to be stored inside the Infisical password vault instead of the .env for increased security. I've created a tutorial as to how to do this which is here: https://gist.github.com/Zachary-Squires/b7d673922d251ec4d0edc5aa752ec06f

Fixes Security Issue 5

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

Currently Infisical can only host the passwords for the database, in future this could be expanded to also host user passwords.

Zachary-Squires and others added 25 commits November 11, 2025 13:24
Accidentally pushed with OED_PRODUCTION set to yes
Added:
1. Banners for the make sure to change this value notifications, also added a notification for the token secret.
2. Fixed spelling error.
3. Added spaces to comments.
4. A variable that checks what the installation type is at the start and is used for all checks.
Added comments in docker-compose.yml to alert users as to the fact passwords are only drawn from this file once. Added something to the .env file to show the code that the password has already been generated. Changed a redundant if statement to an else.
Changes to address feedback on 1/19, added/edited comments, changed changePass.js to changePostgresPass.js
This reverts commit ab538b9, reversing
changes made to f11c826.
@huss
Copy link
Copy Markdown
Member

huss commented Apr 20, 2026

@Zachary-Squires Thanks for working on this. I realize it is a work in progress but I had two thoughts from only looking at this a little:

  1. Normally OED keeps all the related documents in the DesignDocs repository. Is there a reason not to move your documentation there via a PR to that repo?
  2. There are a number of files that are changed in ways that seem unrelated to this work. Some seem related to open PRs and some from recent work. I have not looked carefully at why. I did see you did a merge from a development branch but maybe it wasn't from the OED repo. Is there a way to clean this up?

Please let me know if anything is not clear or your have thoughts.

@huss
Copy link
Copy Markdown
Member

huss commented Apr 21, 2026

I'm noting this PR contains code from PR #1554 as it is necessary. That PR will should be merged first so all those changes go away before this PR merged.

Copy link
Copy Markdown
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @Zachary-Squires for looking into this, adding the code and the documentation. Overall, this seems good. I have not yet tried it because it is a draft and I wanted to get my first thoughts back to you. I made a few comments to consider. I also put in a comment on the docs on your GitHub account. Please let me know if anything is not clear or you have any thoughts/questions.

Comment thread src/server/util/loadInfisicalSecrets.js Outdated
Comment thread src/server/util/loadInfisicalSecrets.js Outdated
Comment thread src/server/util/loadInfisicalSecrets.js Outdated
Comment thread src/server/util/loadInfisicalSecretsChild.js Outdated
Comment thread docker-compose.yml
- OED_MAIL_FROM=mydomain@example.com # The email address that the email will come from
- OED_MAIL_TO=someone@example.com # Set the destination address here for where to send emails
- OED_MAIL_ORG=My Organization Name # Org name for mail that is included in the subject
- PASSWORD_VAULT=no # Set to yes to load DB passwords from Infisical
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the design doc is in place for OED, it might be nice to put a link to it here so people can easily find the directions for enabling the vault.

Copy link
Copy Markdown
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zachary-Squires Thank you for the update addressing most of the comments. The one step left is to put in a pull request to the OED dev docs and then add the link in the one file (per other comment). After that someone else can finalize the work for general usage in OED and test the system. Please let me know if you need anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants