Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Specify that you *need* to rename the executable #26240

Closed
yukijoou opened this issue Jul 30, 2023 · 8 comments
Closed

Documentation: Specify that you *need* to rename the executable #26240

yukijoou opened this issue Jul 30, 2023 · 8 comments
Labels

Comments

@yukijoou
Copy link

yukijoou commented Jul 30, 2023

Feature Description

Currently, on the documentation for installing the binary version of gitea, the "Copy the Gitea binary to a global location" doesn't indicate that it is strictly necessary to keep a consistent name for the gitea binary, otherwise commit hooks break, and you can't push code anymore…

I kept the original name of the gitea binary from when I downloaded it (gitea-1.19.3-linux-amd64), and when updating, I named the new binary gitea-1.20.1-linux-amd64. This broke all the commit hooks. The only solution I can think of to fix this now is to write a sed script that does it on every repo on the server. This is a pain. Please warn against it in the documentation! The current (lack of) explanation makes it seem like giving the binary this specific name is left as a choice to the user, it is not!

EDIT: In case this happens to someone else, I fixed it with this script

#!/bin/bash

for file in $(find /var/lib/gitea/ -type f -wholename '*.git/hooks/pre-receive.d/*' -or -wholename '*.git/hooks/post-receive.d/*' -or -wholename '*.git/hooks/update.d/*'); do
	sed -i 's/gitea-1.19.3-linux-amd64/gitea/g' $file;
done;

Make sure to change 'gitea-1.19.3-linux-amd64' in the sed command to whatever was the name of your gitea binary!

Screenshots

No response

@yukijoou yukijoou added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jul 30, 2023
@techknowlogick
Copy link
Member

Hi, there should be an automated startup task that rewrites those hooks. Also, if you need to rewrite the hooks there is an option to do so in the admin dashboard.
I'll leave this open as if your hooks aren't being rewritten then that could be a bug. Could you share how you've setup your install? I'm assuming systemd but are you also using the config provided in the documentation? Also, there is a system table in your database, could you share what the app path set in it is?

@techknowlogick techknowlogick added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jul 30, 2023
@yukijoou
Copy link
Author

seems like my email response didn't go through… aah, tonight is not a good time for me to use a computer apparently lol


Hi,

Thank you, and no, the hooks didn't get re-written automatically… Maybe because I started gitea once before having all the repositories in place (I'm doing server migration at the same time -- things got a bit messy)

I didn't think to check the admin dashboard for that task though, I half assumed this wouldn't exist because it's not mentionned in the version update documentation… As for the install, yes, I'm using systemd. It's pretty much the config from this repo, I just enabled the dependency on postgresql, as that's what I use, and that's pretty much it…

I don't know how to check the database though, can you give me more precise instructions?

Thank you very much for your time!

@techknowlogick
Copy link
Member

Ah, thanks for that clarification. I'm sorry if I missed this in your message above, but which DB are you using?

I suspect it's as you thought that since you were also migrating at the same time that the automated hook rewrite missed them. Either way I'll provide instructions to get the info requested above just to confirm.

@yukijoou
Copy link
Author

I'm using postgresql! And thank you so much for your help!

@GiteaBot
Copy link
Collaborator

GiteaBot commented Sep 8, 2023

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot GiteaBot closed this as completed Sep 8, 2023
@wxiaoguang wxiaoguang added type/bug and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Sep 8, 2023
@wxiaoguang
Copy link
Contributor

It should be a bug.

By design, Gitea should be able to update these paths automatically.

@wxiaoguang wxiaoguang reopened this Sep 8, 2023
@techknowlogick
Copy link
Member

@wxiaoguang as mentioned above, it didn't rewrite due to a migration happening at the same time, so the appPath saved in DB is the new one, and so when repos migrated with old path it wasn't updated.

@wxiaoguang
Copy link
Contributor

I just recalled there is another one : Push failed with "Unable to find configuration file" #25633

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants