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

kratos new -r not support scp styled git url #2294

Closed
czyt opened this issue Aug 19, 2022 · 6 comments
Closed

kratos new -r not support scp styled git url #2294

czyt opened this issue Aug 19, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@czyt
Copy link
Contributor

czyt commented Aug 19, 2022

PS C:\Users\czyt> kratos new tinyApp -r git@gitee.com:czyt/kratos-layout.git
🚀 Creating service tinyApp, layout repo is git@gitee.com:czyt/kratos-layout.git, please wait a moment.

2022/08/19 10:44:41 mkdir C:\Users\czyt/.kratos/repo/git@gitee.com:czyt: The directory name is invalid.
PS C:\Users\czyt> kratos -v
kratos version v2.5.0

@czyt czyt added the bug Something isn't working label Aug 19, 2022
@daemon365
Copy link
Member

为什么不用 https://gitee.com/czyt/kratos-layout.git

@czyt
Copy link
Contributor Author

czyt commented Aug 19, 2022

为什么不用 https://gitee.com/czyt/kratos-layout.git

昨晚突然想试试ssh那种,结果就失败了。哈哈 @haiyux

@daemon365
Copy link
Member

好的 我看一下

@daemon365
Copy link
Member

git clone git@gitee.com:czyt/kratos-layout.git
Cloning into 'kratos-layout'...
The authenticity of host 'gitee.com (212.64.63.190)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
git@gitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists

在本地执行也是失败的 好像要配置秘钥啥的?

@czyt
Copy link
Contributor Author

czyt commented Aug 19, 2022

git clone git@gitee.com:czyt/kratos-layout.git
Cloning into 'kratos-layout'...
The authenticity of host 'gitee.com (212.64.63.190)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
git@gitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists

在本地执行也是失败的 好像要配置秘钥啥的?

嗯,一般这个是knownhosts或者ssh公钥的问题。knownhost需要 ssh-keyscan -T 域名获取下服务器的公钥,这部分逻辑感觉放在工具这边 还是不太好,只能提示。您这个情况应该是ssh公钥的配置问题,您可以自己换成一个可以正常拉取的ssh git连接,试下@haiyux
当然我这边自己也写了个库可以判断knownhosts的问题,但感觉有点太重了。😂

daemon365 pushed a commit that referenced this issue Aug 31, 2022
#2295)

* fix `kratos new -r` not support scp styled git url.issue #2294

* fix lint

* fix lint

* remove tail space and add  test case

Co-authored-by: czyt <czyt@w.cn>
Co-authored-by: czyt <x-gopher@qq.com>
@czyt
Copy link
Contributor Author

czyt commented Aug 31, 2022

pr merged

@czyt czyt closed this as completed Aug 31, 2022
Loner1024 pushed a commit to Loner1024/kratos that referenced this issue Sep 9, 2022
go-kratos#2295)

* fix `kratos new -r` not support scp styled git url.issue go-kratos#2294

* fix lint

* fix lint

* remove tail space and add  test case

Co-authored-by: czyt <czyt@w.cn>
Co-authored-by: czyt <x-gopher@qq.com>
xiongpan828 pushed a commit to xiongpan828/kratos that referenced this issue Jan 5, 2023
go-kratos#2295)

* fix `kratos new -r` not support scp styled git url.issue go-kratos#2294

* fix lint

* fix lint

* remove tail space and add  test case

Co-authored-by: czyt <czyt@w.cn>
Co-authored-by: czyt <x-gopher@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants