Skip to content

Implement #4 - fix password via CLI#5

Merged
kylecarbs merged 1 commit into
coder:masterfrom
icebob:master
Mar 6, 2019
Merged

Implement #4 - fix password via CLI#5
kylecarbs merged 1 commit into
coder:masterfrom
icebob:master

Conversation

@icebob

@icebob icebob commented Mar 5, 2019

Copy link
Copy Markdown
Contributor

Add --password=123456 CLI argument to use fix password instead of random.

@kylecarbs Currently I'm on Windows so I can't test it but I hope the code is correct. Maybe could you try it?

version: flags.version({ char: "v" }),
"no-auth": flags.boolean({ default: false }),
"allow-http": flags.boolean({ default: false }),
password: flags.string(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could generate the password here and add it as a default. What do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylecarbs for non interactive env's a flag should be provided I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylecarbs Maybe, but in this case, code-server --help will print always a random password as a default value for --password argument, won't it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thats correct. I agree.

@andreimc andreimc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for this I was thinking of adding it, it’s needed

chars.push(possible[Math.floor(Math.random() * possible.length)]);
let password = flags["password"];
if (!password) {
// Generate a random password

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated issue but this needs to be changed. The password should generated from a CPRNG.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is only related to adding a static password feature, not changing original password generation method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those reading this thread, aforementioned issue is located at #26

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.

5 participants