将 GitLab 同步到 Azure DevOps Git,无需更新凭据和/或通过 SSH

发布于 2025-01-15 18:08:57 字数 862 浏览 3 评论 0原文

我们目前正在使用我们的管理员帐户之一上的 DevOps 生成的 Git 凭据,通过 https 将本地 GitLab 存储库镜像到 DevOps,因此我们可以对所有项目使用一个凭据,而无需将用户添加到所有项目。不幸的是,这些凭证只能持续一年,然后需要在我们正在镜像的所有项目上进行更新,目前大约有 40 个项目,并且还在不断增加。此外,这也不是最安全的方法。

我们想创建一个用户只是为了镜像目的,我想知道我们是否可以使用经典的用户身份验证和/或 SSH 密钥作为身份验证方法。所以我们不必再更新凭据了。我们再次想要设置从本地 GitLab 服务器到 Azure DevOps git 的镜像。我一直在寻找这个答案,但它总是相反。从 DevOps 到 GitLab。

当你想通过 SSH 镜像 GitLab 并输入 DevOps 存储库的地址时,如下所示: [email protected]:v3/tenant-name/project/repository

这需要将 ssh:// 添加到 gitlab 中地址的开头。单击“检测主机密钥”后,我遇到“无效 URL”错误。

我在 DevOps 中发现了一种名为“备用凭证”的东西,它完全符合我们的目的,问题是有一条警告消息,从 2020 年 3 月起将不再支持它。那是 2 年前的事了,但似乎仍在工作。

那么,是否有办法镜像存储库,而无需每年更新凭据,并且如果可能的话,通过 SSH 来使其更安全?我会很高兴有任何想法。

我们正在使用最新的 GitLab 14.8.4-ee

we are currently mirroring our local GitLab repositories to DevOps over https using the generated Git credentials from DevOps on one of our admin accounts, so we can use one credentials for all of the projects without adding the user to all projects. Unfortunately these credentials only last one year and then need to be updated on all of the project we are mirroring, currently around 40 and going up. Also this is not the most secure way to go about it.

We would like to create an user just for the mirroring purposes and I was wondering if we could use classic user authentication and/or SSH keys as an authentication method. So we don't have to update the credentials anymore. Once again we want to setup mirroring from local GitLab server to Azure DevOps git. I was looking for this answer, but its always the other way around. From DevOps to GitLab.

When you want to mirror form GitLab via SSH and input the address from DevOps repository like this one:
[email protected]:v3/tenant-name/project/repository

This requires adding the ssh:// to the start of the address in gitlab. Once I click "Detect host keys" I am met with "Invalid URL" error.

I have found something called "Alternate Credentials" in DevOps which would fit exactly our purpose, the problem is that there is a warning message it will no longer be supported from march of 2020. Which was 2 years ago, but appears to be still working.

So is there is way to mirror the repositories without the need to update the credentials every year and if possible, over SSH to make it but more secure? I will be glad for any ideas.

We are using latest GitLab 14.8.4-ee

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文