Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The dotenv-vault UI sometimes replaces escaped newline characters with actual newline characters, breaking the config #853

Open
oconnorjoseph opened this issue Jan 17, 2025 · 1 comment

Comments

@oconnorjoseph
Copy link

We've run into trouble when using https://vault.dotenv.org/ui/ to edit our environmental variables. Many of our environmental variables contain escaped newline characters (\n). Our environmental variable values are sometimes wrapped in quotes (""s), like NEXT_PUBLIC_FIREBASE_PROJECT_ID="blumint-development" and sometimes they are not, like FB_SERVICE_ACCOUNT_KEY={ "type": "service_account", ....

  1. Sometimes editing a value via the UI will cause the entire environmental configuration file to replace all escped newline characters with actual newline characters. I cannot tell you the exact steps to replicate the issue.

    • This can cause dotenv-vault to create new environmental variables by accident. For example:
      GOOGLE_SHEETS_SERVICE_ACCOUNT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIgEvgIBADANagkqhkiG440BAQEFAASCBKgc`
      
      turns into:
      GOOGLE_SHEETS_SERVICE_ACCOUNT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
      MIgEvgIBADANagkqhkiG440BAQEFAASCBKgc
      
      which turns into something like:
      GOOGLE_SHEETS_SERVICE_ACCOUNT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
      MIgEvgIBADANagkqhkiG440BAQEFAASCBKgc=""
      
  2. Sometimes editing a value via the UI will cause escaped newline characters to be replace with literal 'n' characters. Again, I cannot tell you the exact steps to replicate the issue.

@motdotla
Copy link
Owner

motdotla commented Jan 17, 2025

Hi @oconnorjoseph. I'll investigate.

Also, have you seen dotenvx ?

My current overarching timeline for things is:

  1. Recommend dotenvx going forward (active)
  2. Release dotenvx pro (coming soon)
  3. Merge dotenv-vault into dotenvx pro (end of 2025)

We learned a lot with dotenv-vault and it is a great tool, but dotenvx with dotenvx pro unlocks a lot more for the community while still maintaining a source of revenue for us and team features for small and medium businesses.

Basically everything currently in dotenv-vault will make its way into dotenvx pro - except that we are deprecating the .env.vault format. The underlying format will become the encrypted .env format.

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

No branches or pull requests

2 participants