mssun / passforios

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

add user access to the local password repo #392

Open samdmarshall opened 4 years ago

samdmarshall commented 4 years ago

Updated Issue (as of February 23rd, 2021): This is a feature request to add functionality to the pass app which would allow the user to export or access the contents (and potentially the git history) of the local password repository used by the app. The purpose of this is to prevent data-loss in scenarios where the app cannot perform normal push/pull git operations to complete a sync between local and remote repositories successfully. Due to the massive complexity of git as a piece of software, there are a huge number of situations that this circumstance could arise in, examples include (but aren't limited to):

in any scenario, it would require having interactive access to the git repository, which is not always possible (either physically or because other interfaces lack the same set of commits as what passforios has locally). To work around this, my suggestion is having the ability to export the local repository directory. This would allow it to be brought to an interface that the user can resolve the problem at, or at the very least back up the data of to prevent it being lost before making any changes to the settings in passforios (which can cause permanent data loss).

I know there have been divided opinions about how necessary all of this is, because it comes down to how we each individually use git. however, i think we can all agree that giving all users the ability to prevent permanent data loss, especially for passwords, is of use to everyone. This could probably be done by making the app register as a data-provider and have it show up in the Files app as an accessible file system, which would require no new major functionality or interface work.


Original Issue: Title: no way to resolve sync conflict Body: i'm having a problem where performing a sync operation results in a merge conflict, but due to the way the git library is wrapped and no file-system access within the app; i cannot resolve this without permanent data-loss.

can there please be a diagnositic option added to the advanced settings that either:

my password store on my phone is out of sync for over a year now because of a minor conflict this app cannot resolve on it's own, and it is too risky/impossible to save or export the local copy of the password store.

SimplyDanny commented 4 years ago

You can always resolve merge conflicts on a device which allows to execute Git commands. Clone the repository, backup the current state, reset the branch synced with Pass for iOS to a state before any changes in the app happened, add your changes in the app to the branch, apply your locally saved changes and sync again.

samdmarshall commented 4 years ago

@SimplyDanny if it were possible to do that, i wouldn't have had to make this issue now would i?

SimplyDanny commented 4 years ago

Well, you may have your reasons. For me it is not clear what your actual issue is. You should rather describe your problem instead of proposing a possible solution.

tarak commented 4 years ago

"no file-system access within the app"...

How to perform git commands on an iOS device without being app developer, maybe?

The question is how to not lose passwords created on a device that are not pushed to the GIT repo due to a merge conflict, if I understand correctly?

What are the options when such problems arise?

I had different merge conflicts due to my own stupidity on MacBooks (with GIT installed) where I could solve these issues using my terminal, but what can one do on an iOS device to solve merge conflicts to resume sync other than deleting all data in the app (and with it the commits or passwords that were not pushed to the GIT repo)?

jmsundar commented 3 years ago

backup the current state

@SimplyDanny could you explain how I can backup the current state of the repository?

jmsundar commented 3 years ago

"no file-system access within the app"...

How to perform git commands on an iOS device without being app developer, maybe?

The question is how to not lose passwords created on a device that are not pushed to the GIT repo due to a merge conflict, if I understand correctly?

What are the options when such problems arise?

I had different merge conflicts due to my own stupidity on MacBooks (with GIT installed) where I could solve these issues using my terminal, but what can one do on an iOS device to solve merge conflicts to resume sync other than deleting all data in the app (and with it the commits or passwords that were not pushed to the GIT repo)?

https://github.com/mssun/passforios/issues/131#issuecomment-442642737

You should be able to use the process described in this comment to resolve this.

SimplyDanny commented 3 years ago

The comment you mentioned is exactly the workaround I had in mind when I wrote me first comment in this thread.

Depending on the overall setup, one device with access to the Git command line is usually sufficient to resolve conflicts. I see no reason why the app (a password manager) should offer all this functionality.

samdmarshall commented 3 years ago

i ended up being able to resolve this but it was a terrible experience -- the vast majority of this issue comes from git being a horrific piece of software.

to redirect the conversation to the actual issue: this app needs to provide a way to export current local data. i don't care if it is as a patch file, or a zip archive of the repo directory or whatever, but right now this app is a black box and that isn't helpful when trying to resolve any sync issue.

StarrWulfe commented 3 years ago

I agree. There at least should be a way to do a x-callback-URL workflow with something like Working Copy.

samdmarshall commented 3 years ago

i spotted this other issue #460 which sounds like it is fundamentally asking the same thing, eg: being able to access the contents of the local password repo, in a way that is needlessly complicated by the underlying reliance on git. in my case i want to examine the difference between my local and remote commits, whereas in the other thread, they just want to be able to push and pull their contents to another git origin because that would be the only way to work around local data loss when it all doesn't "just work". i'm going to update my original issue to try to better reflect what is desired here.