For security, some users like to place the gitlab HTTPS port behind a CDN such as cloudflare or akamai. CDNs sometimes have file size limits on uploads or downloads (CF is 100MB on their Pro plan). Uploading a large lfs object exceeds this pretty easily, so if you use lfs you're pretty much forced to not use a CDN on HTTPS (unless there's a workaround I haven't thought of).
If ssh was possible with lfs, that would allow a separate secure channel for git / git-lfs to upload through (by specifying gitlab_ssh_host in the config) while still allowing for HTTPS to be behind a CDN.
I just wanted to throw this out there as a use case for git-lfs ssh support in case it hadn't been considered.
thanks @ajohnsn, I didn't consider that. We fully intend to support it (personally I'd have it rather yesterday than today), but we want to make sure it's stable and works well before adding further complexity (see @marin's comment above).
SSH support won't change anything in the way Git LFS works, object will still have to go through HTTP(S). Basically the only change here will be in how internally we handle the request but the upload or download will always have to go through HTTP(S).
If you do require large objects to actually be pushed through SSH then git-annex is the only option (for now).
I have LFS-enabled repos for which non-LFS on ssh and LFS over https used to work fine without any effort. Now it doesn't on the very same repos. I think the most likely explanation is that the client upgrade from 1.1.0 to 1.1.1 made something bork. True on a 8.2.3 (I know - haven't had time to upgrade) and 8.4.4 testing instance.
Switching remote to https URIs solves everything. Could the fix below, combined with the lack of a git-lfs-authenticate command, have caused this problem?
It is clear in the logs that the git-lfs-authenticate command is being run:
I, [2016-02-12T16:23:32.110604 #60488] INFO -- : gitlab-shell: executing git command <git-lfs-authenticate /var/opt/gitlab/git-data/repositories/thomas-downes/lfs-test.git> for user with key key-173.
@DouweM 8.5 is already expired. Can you reschedule and make sure this gets implemented for the scheduled milestone? A lot of customers are asking about SSH support for LFS.
git-lfs 1.1.1 isn't compatible with GitLabs LFS server anymore. This is probably due to this bug because the upload fails right after the attempted execution of git-lfs-authenticate. It is tracked on GitHub's side here.
@lorenz the milestone is set to 8.6, but @DouweM could tell you with more certainty whether this will get done by 8.6 or postponed due to lack of development resources.
You can use some kind of credential cacher. That's about it. We would like to use LFS in our build-bots but we have/choose to make them public-over-https to do so.
The idea is to update gitlab-shell to return response to the LFS client which will contain the necessary data that LFS client requires to know where it can send/receive files from.
Client needs to get the correct hypermedia links, this can be seen in response.rb and router.rb.
One of the necessary headers is HTTP_X_GITLAB_LFS_TMP which gitlab-workhorse will use to know where to store temporary files on upload.
GitLab-workhorse will also need to authorise with gitlab-rails so some thoughts will need to go into how to supply workhorse with the correct auth.
I finally had a look at the code last week and while I figured out how the general implementation would look like, the authentication will need some special treatment as LFS is not working with username/password but with tokens. I don't know enough about the structure of GitLab and Ruby/Rails in general to implement that.
I'd be grateful if you could implement it in 8.8.
As someone who trial-ed LFS in game development and wasn't able to use due to this bug, I saddened that this has been pushed back. I hope it can be scheduled soon.
Just wanted to add another justification/use case for this future. We use one-time-passwords, therefore it is not possible to use LFS. This feature would allow us to use LFS.
@JobV I have another customer that can't use LFS because of this, too. Since this has been scheduled for 8.6 and then 8.8, can we please schedule it for 8.10 or 8.11? cc/ @DouweM
So by way of #19091 (closed) it seems that it's only being looked at for 8.11 and is out for 8.10 :(
You mention a capacity issue -- is this a thing where the only person/people experienced with LFS are constantly tied up fixing show-stopping bugs 100% of their time? If so, totally understood on the capacity issue.
If that's not the case, with all due respect that seems like more of a prioritization issue than a capacity one. Speaking for myself, I would have preferred this LFS issue be addressed above many of the features that have gone into 8.5, 8.6, 8.7, 8.8, and 8.9, (and probably) 8.10. When all these features are chosen before LFS, it makes LFS support feel a bit like a second-class citizen in gitlab. If there's some important API change to git-lfs in the future, I'm now left wondering how long it will take gitlab to catch up to it. It's quite possible that it's just me that feels this way, and people are way more psyched all the stuff that has gone into 8.5 - 8.10, but there may be others like me!
Even as I say all of this, I'm a huge fan of what you've done with gitlab!
There is some confusion for users at the moment, if a repo has LFS assets and they clone over SSH, then the git LFS commands all fail. Is there a way to add a notice to the Gitlab interface if a repo has LFS enabled and let users know they should use the HTTPS url instead?
Clone via SSH should work fine, although retrieving actual LFS objects will happen over HTTPS. If you're getting an error, such as with lfs-authenticate then you may need to downgrade your client to 1.0.2. We don't yet support lfs-authenticate.
The LFS objects will still be downloaded over HTTPS, but it’ll work even if you’re using an SSH remote. And you’re not stuck using an old version of the LFS client - this works in 1.1.x and 1.2.x.
The downside is this might not work so well for forks, since it references the URL of the main repo.
@DouweM I got a nice suggestion from @marin to put someone on this else than himself or Jacob V, so that we have more people with knowledge about this. Considering this is heavily requested (and a really nice feature), do you think we could do this for 8.12 or 8.13? Any ideas about who?
As of now, Git-LFS is the main driver for our projects to adopt GitLab and lack of SSH authentication with Git-LFS is the main impediment to using LFS with GitLab in our organization. HTTPS authentication is okay for regular developers but it does not work well for automated processes run with Jenkins or cron. On our systems we are not allowed to store username/passwords in plain text files like with:
so we can't set up any automated testing for our projects with git repos that use Git-LFS pulling from GitHub repos. That makes Git-LFS with GitLab a non-starter.
As soon as this is done and released, it will be a great day!
@JobV We've been putting this off for months, so I agree we should just put someone on it and see how far we get. I propose @patricio, and I think starting with 8.12 is a good idea. If we make it within a month, great. If it turns out to be harder than expected, we'll get it with 8.13, and we'll have another LFS expert in @patricio :)
I am unable to use Unity Cloud Build (a CI solution) as it goes through SSH for git lfs, so the build always fails. It would be nice to be able to use this.
@kristian.d.skistad this feature is almost done (currently under review & testing). But I do urge you to keep in mind that LFS objects will not be sent via SSH. This feature has not been implemented in Git LFS. All LFS objects have to be transported via HTTP.
The merge requests I'm currently working on add support for authentication via SSH, so you don't have to enter credentials every time you need to clone or push LFS objects.
If you'd like to see support added to Git LFS to allow the transport of objects via SSH, please ask the project maintainers for it here: https://github.com/github/git-lfs/issues
If you absolutely need to push binary objects via SSH and don't want to use plain Git, please have a look at git-annex.
@patricio actually there's been a recent improvement to LFS called "transfer adapters", which can be used to provide alternative transports. However, nobody's written an SSH one as far as I can tell. See here for the details.
Still, I'll be pretty happy with SSH authentication already. My users keep complaining about having to re-type their password too often :) Even with a credential cache...
@patricio I spoke with someone on the Unity Cloud Build team, and it looks like they just need it to authenticate through SSH to function properly, so this should work fine.