我正在Windows服务器上运行Gitblit,并且正在尝试将数据从网络上的另一台机器推送到存储库.我使用过SSL证书(不是自签名的,但我认为我公司签了?不确定它是如何工作的,但Chrome,IE等看到它已经过身份验证).
运行Gitblit的服务器已命名itscm,在开发人员的桌面上我使用此URL通过TortoiseGit推送数据:
git.exe push --progress "https://itscm:8234/git/TestRepo.git" master
Run Code Online (Sandbox Code Playgroud)
但是,我收到此错误:
致命:无法访问' https:// itscm:8234/git/TestRepo.git / ':SSL证书问题:证书链中的自签名证书
当我在chrome中转到该地址时,我在页面上得到404,但我可以看到URL栏中的挂锁是绿色的.当我点击挂锁时,我看到身份已经过验证.我不明白我的浏览器如何将此证书视为有效,但当我尝试通过Git将数据推送到它时,它失败了.
我在gitblit中有一个post commit hook(一个groovy脚本)来调用REST端点.在这个脚本中,我正在执行curl命令.但似乎失败了.从命令行执行时,curl命令工作正常.
以下是我的groovy脚本.
#!/usr/bin/env groovy
def repoUrl= "https://gitblit.myhost.com/git/" + repository + ".git"
json='{"repository":{"url":"'+repoUrl+'"}}'
def response = "curl -v -k -X POST -H \"Content-Type: application/json\" -d '${json}' https://username:password@anotherhost.com:9443/restendpoint".execute().text
println response
Run Code Online (Sandbox Code Playgroud)
存储库由gitblit传递给这个脚本,我已经验证了它.
有人可以帮我这个.
We are running continuous Jenkins builds of a Git project hosted at Assembla. Jenkins is running on Tomcat 6 under its own user and generally works fine.
However every once in a while (say once in every 10 builds), the checkout operation at the beginning of the build job simply hangs. At other times the Git tag operation at the end of the build also hangs. I believe this did not ever happen in command-line operation (on the same host with …
尝试在 tomcat 9 上运行 gitblit,偶尔使用 JDK 11 会导致此堆栈跟踪:
gitblit | 07-May-2020 04:30:39.247 SEVERE [https-jsse-nio-8443-exec-10] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun Error running socket processor
gitblit | java.lang.NullPointerException
gitblit | at java.base/sun.security.ssl.HKDF.extract(HKDF.java:93)
gitblit | at java.base/sun.security.ssl.HKDF.extract(HKDF.java:119)
gitblit | at java.base/sun.security.ssl.ServerHello.setUpPskKD(ServerHello.java:1167)
gitblit | at java.base/sun.security.ssl.ServerHello$T13ServerHelloProducer.produce(ServerHello.java:545)
gitblit | at java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:436)
gitblit | at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1234)
gitblit | at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1170)
gitblit | at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:852)
gitblit | at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:813)
gitblit | at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
gitblit | at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
gitblit | at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061)
gitblit | at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1048)
gitblit | at java.base/java.security.AccessController.doPrivileged(Native Method)
gitblit …Run Code Online (Sandbox Code Playgroud) 在我的Mac OS X 10.8上安装gitlbit,但仍然无法推送!
在Gitblit Web界面中,我创建了一个名为empty的空存储库,并通过以下命令将其克隆到本地存储:
git clone https://localhost:8443/git/test/empty.git
Run Code Online (Sandbox Code Playgroud)
我添加了一个文件并提交更改并添加了一个遥控器
git remote add gitblit https://localhost:8443/git/test/empty.git
Run Code Online (Sandbox Code Playgroud)
然后我尝试推动:
git push -v gitblit master
Run Code Online (Sandbox Code Playgroud)
并且错误显示:
Pushing to https://localhost:8443/git/test/empty.git
Counting objects: 3, done.
Writing objects: 100% (3/3), 215 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
POST git-receive-pack (351 bytes)
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
Run Code Online (Sandbox Code Playgroud)
我尝试了ssl和缓冲区设置,但没有帮助.
git config http.postBuffer 524288000
git config http.sslVerify …Run Code Online (Sandbox Code Playgroud) 我们目前面临一种奇怪的情况,即服务器上只有65MB的本地克隆存储库(GitBlit,但这无关紧要)12 GB的大小.我尝试了不同的想法,这里可能会出错,这里是列表:
git ls-tree -r -t -l --full-name HEAD > stats.txt服务器上的每个分支,并收集该信息.cut -c53-60 <filename> | grep -v '-' | awk '{ sum += $1 } END { print sum }'总结所有提交的所有文件大小.所以我们没有找到任何提交大文件的提交.
我的本地目录.git/objects/pack有一个目前为17MB的包文件(在GC之后,它是21MB之前).服务器上的包文件当前大小为12 GB.
我以正常方式克隆了存储库:git clone https://myserver.mycompancy.com/gitblit/r/projectID/projectID.git并获得了本地副本.可以肯定的是,我在git fetch --all没有改变的情况下完成了.
那么我们怎样才能找到服务器上的包文件更大的原因呢?GitBlit有一个自动GC运行,可以打包超过7天的松散物体.
更新:我git verify-pack -v在我的本地克隆和服务器上按照建议完成了命令,这里是结果(仅作为统计信息):
因此,服务器上的包文件的幅度(~270倍)更长,这就解释了包中的差异.下一步要找到更多线路的原因应该是什么?统计的某些方面更有趣吗?
我希望经过身份验证的用户只能:
基本上我想要阻止用户,甚至是经过身份验证的用户,推送到这个git repo.但对于同一个GitBlit的其他git回购,我可能希望认证用户也推送到那些回购.
先感谢您
tl;dr:使用 sshj 发送 exec 命令时如何获取 I/O?或者,还有哪些其他 Java SSH 库提供了类似的抽象级别,但可能更适合我的用例?
\n\n除了不为我工作之外,我真的很喜欢 sshj\xe2\x80\x99s 的抽象级别,大多数其他 Java/SSH 库的级别要低得多,我的用例既不想也不需要这个。
\n\n细节:
\n\n作为开发人员入门工具的一部分,我\xe2\x80\x99m 尝试在 gitblit 服务器上安装 ssh\n公钥,其模式为\n https://github.com/hierynomus/sshj/blob/master/examples/ src/main/java/net/schmizz/sshj/examples/Exec.java。
\n\nI\xe2\x80\x99m 使用 sshj:
\n\ncompile \'com.hierynomus:sshj:0.21.1\'\nRun Code Online (Sandbox Code Playgroud)\n\n平台:Koltin 1.1.3-2(JRE 1.8.0_131-b11、Mac 10.12 上的 Azul Zulu)
\n\n不幸的是,我似乎无法\xe2\x80\x99t 读取或写入流。
\n\n我在 Repl 中将其缩减为这样,现在只是想获取 gitblits 帮助消息:
\n\nimport org.slf4j.Logger\nimport org.slf4j.LoggerFactory\nimport java.util.logging.Level\nimport java.util.logging.LogManager\n\nfun sshClientWithTrustingHostkeyVerifier(): SSHClient {\n return SSHClient(DefaultConfig()).also { client ->\n client.addHostKeyVerifier(object :\nOpenSSHKnownHosts(File(sshDir(), "known_hosts")) {\n override fun hostKeyUnverifiableAction(hostname: String?, key: PublicKey?): Boolean {\n super.write(SimpleEntry(null, hostname, KeyType.fromKey(key), key))\n …Run Code Online (Sandbox Code Playgroud) 我的问题不是这个问题。
在执行git clone我得到这个错误。我正在使用的命令是:
$ git clone "https://gdt.test.com/gitblit/log/?r=mytest.git&h=refs/heads/branch_development"
Run Code Online (Sandbox Code Playgroud)
在简单运行时:
$ git clone "https://gdt.test.com/gitblit/log/?r=mytest.git"
Run Code Online (Sandbox Code Playgroud)
我得到错误:
fatal: could not create work tree dir '?r=mytest'.: Invalid argument
Run Code Online (Sandbox Code Playgroud)
我想我需要将完整的URL以及r和h参数一起放入。因为这些参数指定了我的存储库的名称。
我做错了(复制和粘贴URL)。但是,即使使用URL:
gdt.test.com/gitblit/r/mytest.git/
Run Code Online (Sandbox Code Playgroud)
我收到错误消息:
'fatal: repository 'gdt.test.com/gitblit/r/mytest.git/'; not found.
Run Code Online (Sandbox Code Playgroud)
如何从gitblit摘要页面复制正确的URL?
我们正在尝试创建新组并修复错误,即Gitblit组中的组3与组3,并且已经尝试编辑该projects.conf文件但没有成功. 文档在线稀疏.
我们可以编辑哪些其他设置/配置文件来添加新项目组?
见下面的截图.
如果我在Eclipse或其他git客户端上添加拒绝推送的挂钩,则会显示拒绝消息.
但是,如果我使用intelij-idea,则不会显示拒绝原因.
这可以配置为在JIdea中显示吗?
我尝试在GitBlit中禁用SSH并将其隐藏在Repository-URL中,例如ssh:// user @ domain:29418/MyProj.git.我只需要http和https访问权限,例如https://user@domain/gitblit/MyProj.git
GitBlit在JBoss 4上运行.
谢谢你的帮助.
有没有办法配置 Jenkins 和 GitBlit,以便在将新代码推送到 git 时自动运行构建?
我听说过在 GitBlit 中使用 hook 和 post-jenknkins 脚本并在 Jenkins 中配置“Poll SCM”,但也许还有更复杂的配置?
非常感谢。