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

Allow generating the config file through CLI params #880

Open
anujmore-grabtaxi opened this issue Aug 23, 2023 · 2 comments
Open

Allow generating the config file through CLI params #880

anujmore-grabtaxi opened this issue Aug 23, 2023 · 2 comments

Comments

@anujmore-grabtaxi
Copy link

Hi, thanks for this awesome tool.

I have a recommendation that I would also be willing to take a stab at. Before that, I just want to pass this idea by for opinions:

In the fresh start section, it mentions a prompt based generation of lab.toml file. Do you think it is worth it to have something like:

lab config --host ... --token ... --user ...

Currently I have a template that I plug the values in for headless installation, but including the config command would make such configurations easier.

@prarit
Copy link
Collaborator

prarit commented Aug 23, 2023

That's an interesting idea. My concern is however, that I don't like passing passwords in clear text (whether it be via command line, webUI, or an app). But I'm not everyone ;) and I can see how others would find that functionality useful.

Perhaps using the LAB_CORE_HOST, LAB_CORE_TOKEN, adding a LAB_CORE_USER variable, and then adding a --save-config option would be better than adding 3 separate parameters? What do you think?

That way a user could do

LAB_CORE_HOST=http://gitlab.com LAB_CORE_TOKEN=1234abcd LAB_CORE_USER=prarit lab --save-config

and just have the information saved?

@anujmore-grabtaxi
Copy link
Author

anujmore-grabtaxi commented Aug 23, 2023

Oh, in my case too I have the token in a shell variable, but we can't control how people use it, because there is not way to tell shell replacements and direct strings apart AFAIK.

For 3 params (config with options) vs single --save-config, I think the usage for --save-config is difficult to explain, and it feels like a all-or-nothing case.

Also, if there's a need to only change the host token, maybe we can extend the proposed feature to change the token through:

lab config --token $LAB_CORE_TOKEN

And it goes and updates only the token value, and retains the other values.

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