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

[feat] populate password for command output #156

Open
a1994sc opened this issue Jan 20, 2025 · 4 comments
Open

[feat] populate password for command output #156

a1994sc opened this issue Jan 20, 2025 · 4 comments

Comments

@a1994sc
Copy link

a1994sc commented Jan 20, 2025

I have a postgresql connection that I would like to look at, but it has a randomly generated password.

The config looks like this:

[[database]]
Name = 'cluster-coder'
Provider = 'postgres'
DBName = 'coder'
URL = 'postgres://postgres:<password>@localhost:${port}/coder?sslmode=disable'
Commands = [
  { Command = 'kubectl --context cluster port-forward -n coder svc/cluster-pooler ${port}:5432', WaitForPort = '${port}' }
]

It would be nice to be able to populate the <password> the same we do for ${port}.

Commands = [
  { Command = 'kubectl --context cluster get secrets blah | yq .data.password | base64 -d', <password identifier> },
  { Command = 'kubectl --context cluster port-forward -n coder svc/cluster-pooler ${port}:5432', WaitForPort = '${port}' }
]

I'm not sure what it should look like for <password identifier> to say I want the output of this command to be used as the password... this might be able to be extend to allow arbitrary variable substitution, but at least MVP for this issue would be able to populate the password dynamically.

@jorgerojas26
Copy link
Owner

@svanharmelen Hi mate, i hope you are doing well. You are the one who did the commands feature, would you mind to check this and maybe help with a PR?

@svanharmelen
Copy link
Contributor

Hi @jorgerojas26 I'm super busy at the moment, so don't really have time to look into this one...

@svanharmelen
Copy link
Contributor

@jorgerojas26 and @a1994sc I think I can come up with a solution, just not sure in what time frame as I'm a bit overloaded at the moment. But will keep this one in the back of my head to take a look at later when things have settled down again...

@a1994sc
Copy link
Author

a1994sc commented Feb 16, 2025

@svanharmelen please work at your own place, this is a nice to have not a requirement so take your time

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

3 participants