mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-25 23:45:55 +03:00
[PR #311] [MERGED] Add Support for Loading Environment Variables from .env Files #385
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Telmate/proxmox-api-go/pull/311
Author: @JamborJan
Created: 2/6/2024
Status: ✅ Merged
Merged: 2/15/2024
Merged by: @mleone87
Base:
master← Head:master📝 Commits (4)
1d58b92add possebility to read environment variables from .env files1783c3cadd example and enhance readmea8856fcfix handling of .env file and system environment variablesc1808ebfix unused error for staticcheck📊 Changes
6 files changed (+96 additions, -20 deletions)
View changed files
➕
.env.example(+5 -0)📝
.gitignore(+1 -0)📝
README.md(+18 -0)📝
go.mod(+1 -0)📝
go.sum(+2 -0)📝
main.go(+69 -20)📄 Description
Hello
Telmate/proxmox-api-gomaintainers,I am just starting to contribute to the Proxmox ecosystem. I want to see a nice and useful terraform provider and do my part to it. As I learned now the
Telmate/proxmox-api-gois the first crucial thing and I cloned the repo to play around with it to get started.My Motivation:
When it came to exporting environment variables to setup the configuration, I thought
.envfiles would be a nice thing to have. I usually have multiple small projects ongoing at the same time and always having to typeexport KEY=valueis error prone and as it is part of the bash history also insecure.Implementation:
To address this, I have integrated the
godotenvpackage, which allows the application to automatically load environment variables from a.envfile at runtime. This means users can now store their sensitive credentials safely in.envfiles, significantly reducing the risk of accidental exposure, mixing up things etc. I also added.envto the gitignore file, everybody should know that this is a sensitive file which must not be shared.Changes Made:
godotenvas a dependency ingo.mod..envfile loading logic in the main initialization section of the application..envfiles with the Proxmox API Go client.Thank you for considering my PR.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.