Skip to content

Conversation

@kreusel
Copy link

@kreusel kreusel commented Jul 16, 2025

As for many (or just my) environments, you do not want to have passwords in configurations that may be stored in a git repository. So i wanted to have a way of configuring env var replacements inside the .toml file without changing to much.

Another possible solution would be to implement a more sophisticated config framework.

Example for config file (smtp_password will get replaced with value of $SMTP_PASSWORD):

[nodemailer]
smtp_server = "mail.example.com"
smtp_port = "587"
smtp_username = "noreply@example.com"
smtp_password = "$SMTP_PASSWORD"

Example for config file (smtp_password will get replaced with value of $SMTP_PASSWORD):
```
[nodemailer]
smtp_server = "mail.example.com"
smtp_port = "587"
smtp_username = "noreply@example.com"
smtp_password = "$SMTP_PASSWORD"
```
@lowercasename
Copy link
Owner

Ah, this is a lovely idea. I wonder if it would be a bit safer to parse the file as TOML first, and then replace the variables in the output JS object, knowing that they specifically start with a $ symbol. My worry here is what happens if I put a $ symbol in another variable, or in an API key, etc.

@kreusel
Copy link
Author

kreusel commented Jul 29, 2025

Fair point, had that idea too. Will have a look

halkeye added a commit to halkeye/gathio that referenced this pull request Nov 2, 2025
halkeye added a commit to halkeye/gathio that referenced this pull request Nov 14, 2025
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