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

About dst_token and dst_key #18

Closed
yfdoor opened this issue Mar 14, 2020 · 5 comments
Closed

About dst_token and dst_key #18

yfdoor opened this issue Mar 14, 2020 · 5 comments
Labels
question Further information is requested

Comments

@yfdoor
Copy link

yfdoor commented Mar 14, 2020

目前这个项目是只支持账户间的同步吗,有计划做成支持账户下某个repo 的同步吗?
还有就是关于 dst_token 和dst_key 的问题,还是需要请教下:
我看demo 中的示例只需要填写目的端 gitee 的 token 和 key

token:我可以在 gitee 生成一个私人令牌 https://gitee.com/profile/personal_access_tokens ,然后需要把他添加到gihub 的哪里呢? 不会是某个 repo setting 中的Secrets 下吧,难道要在所有的 repo setting 里都添加?
ssh key:我了解这个是用来让 github 连接 gitee 的 ,可是如何生成 gitee 的 公钥呢, 这里https://gitee.com/profile/sshkeys 只能添加外部连接 gitee 的 ssh key,可是如何生成 gitee 自己的 key 添加到 gihub 里呢?
不好意思,可能问题有些太基础了,可是还是不太了解,谢谢

@Yikun
Copy link
Owner

Yikun commented Mar 14, 2020

目前这个项目是只支持账户间的同步吗,有计划做成支持账户下某个repo 的同步吗?

是的,目前只支持账户或者组织间的repo同步。

账户下某个repo同步这个需求感觉没那么强烈,导入可以通过import去做,然后,如果要是同步的话,可以给那个仓库add remote,每次push一把,就全同步了。

所以,可能只是周期同步这个点比较有用?

还有就是关于 dst_token 和dst_key 的问题,还是需要请教下

我解释下目的端token和ssh key的作用,

  • token,这个是用来在目的端创建仓库用的。
  • ssh key,这个是在action的机器中,往目的端push code用的,是私钥。

Token和key都是加到某一个repo的security里面,然后利用这个repo的workflow触发整个账户的同步,不需要在每个repo添加。

ssh key:我了解这个是用来让 github 连接 gitee 的 ,可是如何生成 gitee 的 公钥呢, 这里https://gitee.com/profile/sshkeys 只能添加外部连接 gitee 的 ssh key,可是如何生成 gitee 自己的 key 添加到 gihub 里呢?

确切的说,这个key是用来连接目的端的ssh key,通过这个ssh key,让这个action有权限去push代码。所以,你需要做的是

  1. 为目的端增加ssh key,把private key的内容先添加到目的端的sshkey中。
  2. 把这个key添加到触发repo的security。

不好意思,可能问题有些太基础了,可是还是不太了解,谢谢

感谢你的issue,文档确实还没整理的非常完善,也欢迎你贡献,或者提一些希望补充的点。

@Yikun
Copy link
Owner

Yikun commented Mar 17, 2020

目前这个项目是只支持账户间的同步吗,有计划做成支持账户下某个repo 的同步吗?

突然有个想法,可以给这个加个“白名单”的功能,比如,如果仅需要同步某一个库,可以在白名单里面指定。

steps:
- name: Mirror the Github organization repos to Gitee.
  uses: Yikun/hub-mirror-action@master
  with:
    src: github/kunpengcompute
    dst: gitee/kunpengcompute
    dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
    dst_token:  ${{ secrets.GITEE_TOKEN }}
    # 仅同步repo1和repo2
    white_list: "repo1,repo2"

这样做可能比较更具通用性。

@Yikun Yikun added the question Further information is requested label Mar 17, 2020
@Yikun
Copy link
Owner

Yikun commented Mar 17, 2020

See #19

Yikun added a commit that referenced this issue Mar 20, 2020
This patch adds the black and white list support for hub
mirror action.

The back list has **high priority**, that mean if the repo
in the back list will never mirror, even the repo is also
in the white list.

And the white list can be used as single repo mirror, you
can set white_list as specific repo to only sync this single
repo.

Closes: #19, #14
Related: #18
Yikun added a commit that referenced this issue Mar 20, 2020
This patch adds the black and white list support for hub
mirror action.

The back list has **high priority**, that mean if the repo
in the back list will never mirror, even the repo is also
in the white list.

And the white list can be used as single repo mirror, you
can set white_list as specific repo to only sync this single
repo.

Closes: #19, #14
Related: #18
@Yikun
Copy link
Owner

Yikun commented Mar 20, 2020

@Yikun
Copy link
Owner

Yikun commented Mar 26, 2020

除此之外,还可以使用https://github.com/wearerequired/git-mirror-action 这个插件做单repo同步。

@Yikun Yikun closed this as completed Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants