[x]
):Problem Description / Error Message
git-mirror
is the host for the machine).[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'
Steps to reproduce
/home/alarm
to experiment around, start it and configure it.git
user account./opt/gitea
because I have an external HDD mount there (running on a Raspberry Pi 2).custom/conf/app.ini
Quickfix for others
I made a little script that assumes the ./gitea-repositories
folder is in the same folder as the gitea binary and that fixes all update hooks once run. In my case it's located in /opt/gitea/fix_repos.js
where repos are in /opt/gitea/gitea-repositories
. Link to the fix_repos.js script.
Problems caused
I saw a couple issues in upstream gogs where people had the same problems. It is totally unclear that you cannot move around gitea because I would assume that a binary can be copy/pasted with its config files and it should work isolated in that folder.
Suggestion
Maybe it makes sense to have a bootup routine that does a sanity checks for all update hooks when the gitea web service is started. So that it just makes sure that all paths are up to date and point to the correct binary.
Enter Gitea admin panel on the UI, run Rewrite '.ssh/authorized_keys' file (caution: non-Gitea keys will be lost) and Rewrite all update hook of repositories (needed when custom config path is changed).
Since the data is a static part it must be rewritten within the admin ui.
First I try to push git but get this error.
[remote rejected] master -> master (pre-receive hook declined)
I run Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)
but got error.
open C:\Windows\system32\config\systemprofile.ssh\authorized_keys.tmp: The system cannot find the path specified.
Then I run Resynchronize pre-receive, update and post-receive hooks of all repositories.
And I try to push again and everything works fine.
I'm not sure is that for this or update .ssh/authorized_keys
work even it display error or something but it work! I don't know why.
Most helpful comment
Enter Gitea admin panel on the UI, run Rewrite '.ssh/authorized_keys' file (caution: non-Gitea keys will be lost) and Rewrite all update hook of repositories (needed when custom config path is changed).