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

Detect if gitea binary's name changed. #11341

Closed
lunny opened this issue May 8, 2020 · 1 comment
Closed

Detect if gitea binary's name changed. #11341

lunny opened this issue May 8, 2020 · 1 comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lunny
Copy link
Member

lunny commented May 8, 2020

When starting, check and save the binary path to a file. If the path changed,

run

Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.) 

and

Resynchronize pre-receive, update and post-receive hooks of all repositories.

automatically.

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label May 8, 2020
@zeripath
Copy link
Contributor

zeripath commented May 8, 2020

We could just run a subset of doctor at the start

wxiaoguang added a commit that referenced this issue Oct 21, 2021
…17335)

Gitea writes its own AppPath into git hook scripts. If Gitea's AppPath changes, then the git push will fail.

This PR:

* Introduce an AppState module, it can persist app states into database
* During GlobalInit, Gitea will check if the current AppPath is the same as last one. If they don't match, Gitea will sync git hooks.
* Refactor some code to make them more clear.
* Also, "Detect if gitea binary's name changed" #11341 is related, we call models.RewriteAllPublicKeys to update ssh authorized_keys file
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
…o-gitea#17335)

Gitea writes its own AppPath into git hook scripts. If Gitea's AppPath changes, then the git push will fail.

This PR:

* Introduce an AppState module, it can persist app states into database
* During GlobalInit, Gitea will check if the current AppPath is the same as last one. If they don't match, Gitea will sync git hooks.
* Refactor some code to make them more clear.
* Also, "Detect if gitea binary's name changed" go-gitea#11341 is related, we call models.RewriteAllPublicKeys to update ssh authorized_keys file
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants