[x]
):问题描述/错误信息
git-mirror
是机器的主机)。[lycheejs] (development)$ git push mirror development
Counting objects: 80, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (80/80), 15.28 KiB | 0 bytes/s, done.
Total 80 (delta 50), reused 0 (delta 0)
# XXX: Note this /home/alarm/gitea path, this is the outdated update hook path
remote: hooks/update: line 2: /home/alarm/gitea: Permission denied
remote: error: hook declined to update refs/heads/development
To git-mirror:Artificial-Engineering/lycheejs.git
! [remote rejected] development -> development (hook declined)
error: failed to push some refs to 'git@git-mirror:Artificial-Engineering/lycheejs.git'
重现步骤
/home/alarm
以进行试验,启动并配置它。git
用户帐户。/opt/gitea
,因为我在那里有一个外部硬盘安装(在Raspberry Pi 2上运行)。custom/conf/app.ini
中的所有内容都是可配置和可修改的其他人的快速修复
我做了一个小脚本,假设./gitea-repositories
文件夹与 gitea 二进制文件在同一个文件夹中,并且一旦运行就修复了所有更新挂钩。 就我而言,它位于/opt/gitea/fix_repos.js
中,其中 repos 位于/opt/gitea/gitea-repositories
中。 链接到fix_repos.js 脚本。
引起的问题
我在上游 gogs 中看到了一些问题,人们遇到了同样的问题。 完全不清楚您不能在 gitea 周围移动,因为我假设二进制文件可以与其配置文件一起复制/粘贴,并且它应该在该文件夹中隔离工作。
建议
也许有一个启动例程在启动 gitea Web 服务时对所有更新挂钩进行健全性检查是有意义的。 这样它就可以确保所有路径都是最新的并指向正确的二进制文件。
在 UI 上进入 Gitea 管理面板,运行 Rewrite '.ssh/authorized_keys' 文件(注意:非 Gitea 密钥将丢失)和 Rewrite all update hook of repositories(更改自定义配置路径时需要)。
由于数据是静态部分,因此必须在管理 ui 中重写。
首先,我尝试推送 git 但收到此错误。
[remote denied] master -> master (pre-receive hook denied)
我运行Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)
但出现错误。
open C:\Windows\system32\config\systemprofile.ssh\authorized_keys.tmp:系统找不到指定的路径。
然后我运行Resynchronize pre-receive, update and post-receive hooks of all repositories.
我再次尝试推动,一切正常。
我不确定是否为此或更新.ssh/authorized_keys
工作,即使它显示错误或其他东西,但它工作! 我不知道为什么。
最有用的评论
在 UI 上进入 Gitea 管理面板,运行 Rewrite '.ssh/authorized_keys' 文件(注意:非 Gitea 密钥将丢失)和 Rewrite all update hook of repositories(更改自定义配置路径时需要)。