Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f3221f

Browse files
authored
fix: use more descriptive login flags (#4493)
1 parentc13e682 commit0f3221f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

‎cli/login.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ func login() *cobra.Command {
248248
returnnil
249249
},
250250
}
251-
cliflag.StringVarP(cmd.Flags(),&email,"email","e","CODER_EMAIL","","Specifies an email address toauthenticate with.")
252-
cliflag.StringVarP(cmd.Flags(),&username,"username","u","CODER_USERNAME","","Specifies a username toauthenticate with.")
253-
cliflag.StringVarP(cmd.Flags(),&password,"password","p","CODER_PASSWORD","","Specifies a password toauthenticate with.")
251+
cliflag.StringVarP(cmd.Flags(),&email,"first-user-email","","CODER_FIRST_USER_EMAIL","","Specifies an email address touse if creating the first user for the deployment.")
252+
cliflag.StringVarP(cmd.Flags(),&username,"first-user-username","","CODER_FIRST_USER_USERNAME","","Specifies a username touse if creating the first user for the deployment.")
253+
cliflag.StringVarP(cmd.Flags(),&password,"first-user-password","","CODER_FIRST_USER_PASSWORD","","Specifies a password touse if creating the first user for the deployment.")
254254
returncmd
255255
}
256256

‎cli/login_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestLogin(t *testing.T) {
7474
// accurately detect Windows ptys when they are not attached to a process:
7575
// https://github.com/mattn/go-isatty/issues/59
7676
doneChan:=make(chanstruct{})
77-
root,_:=clitest.New(t,"login",client.URL.String(),"--username","testuser","--email","user@coder.com","--password","password")
77+
root,_:=clitest.New(t,"login",client.URL.String(),"--first-user-username","testuser","--first-user-email","user@coder.com","--first-user-password","password")
7878
pty:=ptytest.New(t)
7979
root.SetIn(pty.Input())
8080
root.SetOut(pty.Output())

‎examples/lima/coder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ provision:
9595
# If we are already logged in, nothing to do
9696
coder templates list >/dev/null 2>&1 && exit 0
9797
# Set up initial user
98-
[ ! -e ~/.config/coderv2/session ] && coder login http://localhost:3000 --username admin --email admin@coder.com --password $(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8 | tee ${HOME}/.config/coderv2/password)
98+
[ ! -e ~/.config/coderv2/session ] && coder login http://localhost:3000 --first-user-username admin --first-user-email admin@coder.com --first-user-password $(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8 | tee ${HOME}/.config/coderv2/password)
9999
# Create an initial template
100100
temp_template_dir=$(mktemp -d)
101101
echo code-server | coder templates init "${temp_template_dir}"

‎scripts/develop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CODER_DEV_SHIM="${PROJECT_ROOT}/scripts/coder-dev.sh"
6666

6767
if [!-f"${PROJECT_ROOT}/.coderv2/developsh-did-first-setup" ];then
6868
# Try to create the initial admin user.
69-
"${CODER_DEV_SHIM}" login http://127.0.0.1:3000 --username=admin --email=admin@coder.com --password="${password}"||
69+
"${CODER_DEV_SHIM}" login http://127.0.0.1:3000 --first-user-username=admin --first-user-email=admin@coder.com --first-user-password="${password}"||
7070
echo'Failed to create admin user. To troubleshoot, try running this command manually.'
7171

7272
# Try to create a regular user.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp