Created attachment 168382 [details] Fix gitlab-shell hook permissions In order for gitlab to work, the files in hooks/ need to be executable by git:git. Patch attached fixes this. Tested in poudriere and with a production Gitlab. Logs: http://pkg.fractalcells.com/logs/2016-03-19_11h34m50s/logs/gitlab-shell-2.6.10.log
Created attachment 168563 [details] Extended patch I propose extended patch, please test. Additional changes: - Fix misused targets - Scripts under %%DATADIR%%/bin should probably not be owned by git (they are executable anyway, and are not to be changes by git user, right?) - I assume logfile will be written to, yet it's included into package - this will lead to errors on package deinstallation/upgrade. Handle logfile via @sample instead (also I see no need for g+w) - @dir's are only needed for empty directories or directories with non-default permissions
(In reply to Dmitry Marakasov from comment #1) Please don't make the logfile a sample. It needs to be touched into existence with the right user, but a .sample file in /var/log is wrong in my opinion.
(In reply to Johannes Jost Meixner from comment #2) > Please don't make the logfile a sample. > > It needs to be touched into existence with the right user, but a .sample > file in /var/log is wrong in my opinion. You may not add a volatile file into a package either. Possible solutions: - Create a directory with right owner and point an application there, so it is able to create its logfile. The most correct solution IMO - Create rc.d script (doesn't seem suitable here, as this port does not install any daemons) - Create a file with @postexec and remove with @postunexec if it's empty
(In reply to Dmitry Marakasov from comment #3) > - Create a directory with right owner and point an application there, so it is able to create its logfile. The most correct solution IMO This sounds good if you can make gitlab-shell work with changed logfile-paths (I don't know enough > - Create a file with @postexec and remove with @postunexec if it's empty I was thinking about this too, and it sounds the best option actually. It's basically what is behind @sample anyway.
Created attachment 168706 [details] Extended patch + fixes logfile location Updated patch which uses dedicated log directory (writable by `git' user) for gitlab-shell.
(In reply to Dmitry Marakasov from comment #5) Thanks. This builds in poudriere, and works in Gitlab. To verify, I created a project. root@976f96ad-f45e-11e5-88b9-8b2395c19741:~ # cat /var/log/gitlab-shell/gitlab-shell.log # Logfile created on 2016-03-28 06:04:39 +0000 by logger.rb/44203 I, [2016-03-28T06:04:39.437248 #36087] INFO -- : Adding project xmj/asdf.git at </home/git/repositories/xmj/asdf.git>. I, [2016-03-28T06:04:39.476972 #36087] INFO -- : Moving existing hooks directory and symlinking global hooks directory for /home/git/repositories/xmj/asdf.git. root@976f96ad-f45e-11e5-88b9-8b2395c19741:~ #
Hello, i'm right back from vacation and will have a look at your patches! Thank you for your efforts! :)
Comment on attachment 168706 [details] Extended patch + fixes logfile location I approve the extended patch. This looks much better than my version and works fine also :) Thank you both for fixing this issue! :)
I set the approval flag to + but the change is not stored. Same for -. I don't know why :/
A commit references this bug: Author: amdmi3 Date: Wed Mar 30 19:30:07 UTC 2016 New revision: 412190 URL: https://svnweb.freebsd.org/changeset/ports/412190 Log: - Make hooks executable - Fix misused targets - Fix plist permissions and owners - Fix log file handling PR: 208135 Submitted by: xmj, amdmi3 Approved by: ports@toco-domains.de (maintainer) Changes: head/devel/gitlab-shell/Makefile head/devel/gitlab-shell/files/patch-config.yml.example head/devel/gitlab-shell/pkg-plist