-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
"Resynchronize pre-receive, update and post-receive hooks" should explicitly set executable bit #6319
Closed
2 tasks done
Labels
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
type/enhancement
An improvement of existing functionality
Comments
SagePtr
changed the title
"Resynchronize pre-receive, update and post-receive hooks" should explicitly set executable
"Resynchronize pre-receive, update and post-receive hooks" should explicitly set executable bit
Mar 13, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
lunny
added
the
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
label
May 19, 2019
So looking at: Lines 953 to 990 in 8de76b6
The gitea hooks should be being recreated with their executable bit set. |
zeripath
added a commit
that referenced
this issue
Apr 6, 2020
* Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix #10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath
added a commit
to zeripath/gitea
that referenced
this issue
Apr 6, 2020
Backport go-gitea#10943 * Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix go-gitea#9878) and ensure hooks are executable (Fix go-gitea#6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix go-gitea#10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick
pushed a commit
that referenced
this issue
Apr 6, 2020
…#10991) * Mulitple Gitea Doctor improvements (#10943) Backport #10943 * Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix #10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch to io.Writer instead of io.StringWriter Signed-off-by: Andrew Thornton <art27@cantab.net>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
type/enhancement
An improvement of existing functionality
[x]
):Description
If repositories directory is copied from Windows to Linux machine - hooks will lose executable permissions. It's also easy to forget this aspect when restoring from backup using Windows machine.
Function "Resynchronize pre-receive, update and post-receive hooks" are very handy when dealing with migration from one server to another, but the only problem is - it doesn't set executable bit explicitely if hook files already exist, it set it only for new files via WriteFile third parameter.
Would be nice if this function will also fix hook files permissions, not only overwrite hooks content with new path to gitea executable.
Or separate function "Fix executable permission on all hooks" which should recursively set +x on all files inside each repo hooks directory (hide this function from admin panel if os == 'windows')
The text was updated successfully, but these errors were encountered: