使用 gitlab-ce-12.x,Geo 需要散列存储路径( https://docs.gitlab.com/ee/administration/repository_storage_types.html )
因此,对于给定的存储库,数据将存储在:
"@hashed/#{hash[0..1]}/#{hash[2..3]}/#{hash}.git"
从实际的角度来看,假设我有一个存储库,其 URL 是
如何找出服务器上存储的路径?
即我如何找到的值(value)
#{hash[0..1]}/#{hash[2..3]}/#{hash}
谢谢
最佳答案
我找到了我的问题的答案。
为了获取项目的哈希存储位置,您首先需要获取项目存储库的项目 id。
获得该项目 ID 后,假设您的项目 ID 为 1,
你这样得到哈希:
说 project.id 是 1
echo -n 1 | sha256sum
=> 你得到了 HASH
6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b
因此,服务器上存储库的散列存储位置将是:
server/@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git
这已被 gitlab 开发人员讨论过
https://gitlab.com/gitlab-org/gitlab-ce/issues/63250
关于gitlab-ce 12.X : how do I find the hashed storage path of a repository on the server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57242592/