FS#62606 - [gitlab-shell] ignores `auth_file` config

Attached to Project: Community Packages
Opened by Vlad (ejiek) - Saturday, 11 May 2019, 17:31 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 15 June 2019, 17:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Ignores `auth_file` field in config file.

While adding new or deleting old ssh key gitlab-shell should modify given `authorized_keys` by adding new key with corresponding command or substituting old one with # symbols.

I have this file configured to default location for archlinux install: /var/lib/gitlab/.ssh/authorized_keys

After adding new key I can see failed background job (ssh key info removed):

Queue: gitlab_shell
Job: GitlabShellWorker
Arguments: "add_key", "key-x", "ssh-x xxx"
Error: Errno::EACCES: Permission denied @ rb_sysopen - /home/git/.ssh/authorized_keys.lock

Looks like its attempting to access file by some hardcoded path because even user is wrong (it should be gitlab)

PS. Background jobs: Admin Area -> Monitoring -> Background Jobs

Additional info:
* 2:9.0.0-1
* `/etc/webapps/gitlab-shell/config.yml` differs from default with
* gitlab_url: "http+unix://%2Fvar%2Flib%2Fgitlab%2Fsockets%2Fgitlab.socket"
* migration:
enabled: true
wich means that `auth_file` is set to "/var/lib/gitlab/.ssh/authorized_keys"

Steps to reproduce:
* Add new ssh key to / Remove old from _ your user
* Check that it's not in configured `authorized_keys` file.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 15 June 2019, 17:51 GMT
Reason for closing:  No response
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 13 May 2019, 17:25 GMT
What's the numerical uid/gid of that file and what's the numerical uid/gid of the gitlab user from passwd?
Comment by Vlad (ejiek) - Tuesday, 14 May 2019, 05:23 GMT
gitlab 105:105
git 996:996
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 15 May 2019, 21:46 GMT
Is there any chance you have a pretty old Gitlab installation from AUR times or shortly thereafter (roughly 2 years)? I'm trying to figure out whether there's a chance it's a problem with your system.
Comment by Vlad (ejiek) - Saturday, 18 May 2019, 07:55 GMT
There is a chance.

I'll try to reproduce on a new install.
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 24 May 2019, 03:45 GMT
Any news?

Loading...