Open nkm8 opened 3 years ago
First try working with go, but I was able to build and test this locally: go build .\\cmd\\portwarden\\portwarden.go
I confirmed it worked as expected. Obviously, the 2 caveats are:
This worked for my needs - feel free to discard or possibly hide behind a feature flag if others find it useful.
Thank you @nkm8 for the contribution. To be honest, I am getting rusted with my own code and also just currently don't have the bandwidth to review. Will find a chance in the following months to review this.
Thanks again.
@vwxyzjn no worries. If it helps, this is literally a one line code change - you can see it much more clearly with whitespace changes hidden: https://github.com/vwxyzjn/portwarden/pull/34/files?w=1
I don't have time to test this right now, but I wanted to throw it up as a possible suggestion. Currently, portwarden imports all vault items, including items associated with an organization. During the import, the organization(s) and collection(s) are erased and the item is imported as an orphaned item associated with the personal vault.
However, Bitwarden allows exporting all items associated with a given organization. I followed the following procedure:
This worked very well, but I ended up with duplicate entries because the organization vault items were imported by portwarden as ophaned entries. This PR should allow the process above to work, minus the duplicate orphaned entries.
In a perfect world, portwarden would handle creating the organization(s) and collection(s) - same as folders are already handled - but it looks like these commands aren't available in the Bitwarden CLI.
If given a build, I can test this PR. If it works as expected, I can update the Readme file with details about how Organizations/Collections can be handled with existing Bitwarden export/import tools.