mssun / passforios

Pass for iOS - an iOS client compatible with Pass command line application.
https://mssun.github.io/passforios
MIT License
1.52k stars 103 forks source link

Unable to clone from a server that specifies a custom ssh port #95

Closed samdmarshall closed 7 years ago

samdmarshall commented 7 years ago

I am running a git server on my NAS that hosts a copy of my passwords repo. My NAS uses a custom port for ssh (2200) and i cannot seem to get the repo to be cloned in the app. I've tried specifying the port in the URL (ssh://my-nas.local:2200/git/passwords.git) and this fails as well. Since the instructions and error message i'm presented with (failed to clone repo) are not very much help; is there any information about this on setup?

mssun commented 7 years ago

Hi, I just tested my repo. It's OK.

Did you forget to include username in the url?

I mean like this: ssh://username@my-nas.local:2200/git/passwords.git

samdmarshall commented 7 years ago

yeah I have tried that as well, still fails for the same reason.

As a note, I'm able to clone from other devices; just not through this app for whatever reason

mssun commented 7 years ago

@samdmarshall Can you try the latest TestFlight build? Since we fixed some clone issues, I don't know if it was related to yours. Thanks.

samdmarshall commented 7 years ago

sure, how would i get that?

mssun commented 7 years ago

Did you join in our TestFlight beta test? If yes, update in the TestFlight app. If not, I can put you in the list.

samdmarshall commented 7 years ago

I'm not a part of that yet, i would appreciate being able to test out if that new build fixes my problem; I'd be able to test it on iOS 10 and 11 if it makes a difference.

mssun commented 7 years ago

Done, a invitation link have been sent to you.

samdmarshall commented 7 years ago

img_0005

I'm still getting the same error on the testflight build. Is there any way that more info could be provided so i could debug this?

yishilin14 commented 7 years ago

Sadly, the error message returned by ObjectiveGit(or libgit2 used by it) usually does not contain any useful information.

We use ObjectiveGit to clone repositories, and ObjectiveGit provides bindings to the libgit2 library. I am thinking about using libgit2 directly to clone a repository like this and see what will happen first. You mentioned previously that you have other devices that could successfully clone the repository, do you know whether they use libgit2?

samdmarshall commented 7 years ago

I was using command line git 2.13.1, passing the same url to it as i have shown here and it connects and prompts for a password. when i provide that password it will checkout the repo successfully.

mssun commented 7 years ago

@samdmarshall Hi, I'm wondering if your iPad can resolve the "tardis.local" domain in your local network? Can you somehow test if your iPad can connect to the server?

samdmarshall commented 7 years ago

Yup, with an SSH client i am able to connect to tardis.local on port 2200 and login; both as git and another user. Maybe this is a clue: when i login as git over ssh, it prints a message:

fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.

then exits the shell. This doesn't seem to impact my ability to clone from other hosts using the git command.

mssun commented 7 years ago

Could be relevant. Let me reproduce this issue first. Could you detail your git configuration?

samdmarshall commented 7 years ago

On the server you mean? I have ssh enabled and did a git init --bare on the directory to create a repo, then added that remote to my password repo then pushed.

samdmarshall commented 7 years ago

Is there anything that can be done about this? it is really hindering my ability to migrate away from my old password manager.

yishilin14 commented 7 years ago

Both @mssun and I have been extremely busy recently. I might have some time later this week, will try go dig into this. This is the issue with the first priority now.

samdmarshall commented 7 years ago

Thanks for the update! I really appreciate that.

yishilin14 commented 7 years ago

I set up a local git server with a customized port today. And I was able to clone the repository. I am listing my steps here, and you may check whether there are anything interesting.

Is it possible for you to make the error message fatal: Interactive git shell is not enabled. gone temporarily and try again?

yishilin14 commented 7 years ago

Will provide more git clone error messages in the next TestFlight release, hope that will help.

Update: Released in v0.2.9 in TestFlight.

samdmarshall commented 7 years ago

this is the error message i get from the latest off testflight img_0038

yishilin14 commented 7 years ago

I can successfully clone my local git server using both password and ssh keys. I think your issue could be related to dependencies of ObjectiveGit.

I googled "Unable to exchange encryption keys" a bit and found some interesting posts. For example, this one: https://www.freefilesync.org/forum/viewtopic.php?t=1281.

I am not an expert on this, I don't know how to make any suggestions... The only thing I know is that googling "Unable to exchange encryption keys" may help.

samdmarshall commented 7 years ago

I'm going to mark this as closed because i've worked out how to get around this problem. it was part of the configuration on my NAS.