Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 0a9ea6b

Browse files
committed
Version 2.0.7.3
1 parent 5474381 commit 0a9ea6b

File tree

8 files changed

+565
-544
lines changed

8 files changed

+565
-544
lines changed

Configuration.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ If you're using a HTTP proxy to communicate with the internet, configure the HTT
2626

2727
Starting with version 2.0.0.0 an option has been added under the File menu to temporarily mark the KeeOneDriveSync plugin for offline mode. This means no attempts will be made to synchronize the database after opening or saving it. This setting is purposely not retained after restarting KeePass. It could be useful if your connection isn't ideal for syncing and you have to make a lot of changes. Note that offline mode goes for all KeePass databases you may have open. If you wish to manually sync one even though you're in offline mode, just open the KeePass database, go to Tools -> KeeOneDriveSync Options -> right click on database to sync -> Sync Now.
2828

29+
## SharePoint Online (Team)sites
30+
31+
If you want to store your KeePass database on a SharePoint Online (Team)site, the easiest way to do so is to follow these steps.
32+
33+
### If you already have your KeePass database uploaded to SharePoint Online
34+
35+
1. With your internet browser go to the SharePoint Online site and into the document library where you have stored the KeePass database
36+
2. Right click on the KeePass database and choose Share
37+
3. Choose "Specific people" and check "Allow editing"
38+
4. Enter the e-mail address(es) of the people you want to share it with. If you just want to share it with yourself, enter your own e-mail address, even if you already have rights to the KeePass database. This sharing is required for it to show up under "Shared with me" in the KeePass OneDriveSync plugin.
39+
5. In KeePass use Open -> Open from OneDrive -> Microsoft Graph -> log in with your Office 365 account -> in the file picker choose the "Shared with me" tab -> it should show your KeePass database -> click on it and open it
40+
41+
### If you still only have your KeePass database locally and would like to upload it to SharePoint Online
42+
43+
1. With your internet browser go to the SharePoint Online site and into the document library where you want to store the KeePass database.
44+
2. Create a folder in which you want to store the KeePass database. Storing it in the root of a document library is not easily possible for now.
45+
3. Right click on the folder you just created and choose Share
46+
4. Choose "Specific people" and check "Allow editing"
47+
5. Enter the e-mail address(es) of the people you want to share it with. If you just want to share it with yourself, enter your own e-mail address, even if you already have rights to the folder. This sharing is required for it to show up under "Shared with me" in the KeePass OneDriveSync plugin.
48+
6. In KeePass open the KeePass database you have locally and would like to upload to the SharePoint Online site
49+
7. Hit CTRL+S to initiate the KeePass OneDriveSync dialog to sync it
50+
8. Choose the Microsoft Graph option and log in with your Office 365 account
51+
9. In the file picker choose the "Shared with me" tab
52+
10. It should show the folder you shared with yourself at step 3, double click on it to go in there
53+
11. Save the database as you wish and it will be uploaded to the SharePoint Online site and stay in sync with that location
54+
2955
## SharePoint 2013, 2016, 2019 and SharePoint Online support
3056

3157
Starting with version 2.0.0.0 it is now also possible to sync your KeePass database with SharePoint. As the Microsoft Graph API support for SharePoint is still very limited and I wanted to support on premises farms as well, I've chosen to implement SharePoint REST API calls with Low Trust oAuth to access SharePoint. This makes it fully asynchronous, support the KeePass proxy configuration and very little data traffic will be used. This also means you will manually have to set up the oAuth token and your SharePoint farm needs to support the Low Trust (ACS) oAuth scenario for SharePoint. You can set up an oAuth token only if you're a site collection administrator of the SharePoint site where you want to store the KeePass database. If you are, then follow these steps to set up the token:

KeeOneDriveSync.plgx

-12 KB
Binary file not shown.

KoenZomers.KeePass.OneDriveSync/Forms/OneDriveFilePickerDialog.Designer.cs

Lines changed: 47 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoenZomers.KeePass.OneDriveSync/Forms/OneDriveFilePickerDialog.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ public async Task LoadFolderItems(string parentItemId = null)
113113

114114
if (oneDriveItem.Size > 0)
115115
{
116-
oneDriveListViewItem.ToolTipText += string.Format("Size: {0} bytes", oneDriveItem.Size) + Environment.NewLine;
116+
oneDriveListViewItem.ToolTipText += string.Format("Size: {0:n0} bytes", oneDriveItem.Size) + Environment.NewLine;
117117
}
118118
else if (oneDriveItem.RemoteItem != null && oneDriveItem.RemoteItem.Size > 0)
119119
{
120-
oneDriveListViewItem.ToolTipText += string.Format("Size: {0} bytes", oneDriveItem.RemoteItem.Size) + Environment.NewLine;
120+
oneDriveListViewItem.ToolTipText += string.Format("Size: {0:n0} bytes", oneDriveItem.RemoteItem.Size) + Environment.NewLine;
121121
}
122122
if (oneDriveItem.CreatedDateTime != null)
123123
{
@@ -181,11 +181,11 @@ public async Task LoadSharedWithMeItems(OneDriveItem parentItem = null)
181181
}
182182
if (oneDriveItem.Size > 0)
183183
{
184-
oneDriveListViewItem.ToolTipText += Environment.NewLine + string.Format("Size: {0} bytes", oneDriveItem.Size);
184+
oneDriveListViewItem.ToolTipText += Environment.NewLine + string.Format("Size: {0:n0} bytes", oneDriveItem.Size);
185185
}
186186
else if(oneDriveItem.RemoteItem != null && oneDriveItem.RemoteItem.Size > 0)
187187
{
188-
oneDriveListViewItem.ToolTipText += Environment.NewLine + string.Format("Size: {0} bytes", oneDriveItem.RemoteItem.Size);
188+
oneDriveListViewItem.ToolTipText += Environment.NewLine + string.Format("Size: {0:n0} bytes", oneDriveItem.RemoteItem.Size);
189189
}
190190
if (oneDriveItem.CreatedDateTime != null)
191191
{
@@ -202,12 +202,13 @@ public async Task LoadSharedWithMeItems(OneDriveItem parentItem = null)
202202
else
203203
{
204204
// Parent folder provided, get its children
205-
var itemCollection = await _oneDriveApi.GetAllChildrenFromDriveByFolderId(parentItem.RemoteItem != null ? parentItem.RemoteItem.ParentReference.DriveId : parentItem.ParentReference.DriveId, parentItem.RemoteItem != null ? parentItem.RemoteItem.ParentReference != null ? string.IsNullOrEmpty(parentItem.RemoteItem.ParentReference.Id) ? parentItem.RemoteItem.Id : parentItem.RemoteItem.ParentReference.Id : parentItem.RemoteItem.Id : parentItem.Id);
205+
var itemCollection = await _oneDriveApi.GetAllChildrenFromDriveByFolderId(parentItem.RemoteItem != null ? parentItem.RemoteItem.ParentReference.DriveId : parentItem.ParentReference.DriveId,
206+
parentItem.RemoteItem != null ? parentItem.RemoteItem.ParentReference != null ? string.IsNullOrEmpty(parentItem.RemoteItem.ParentReference.Id) || parentItem.RemoteItem.Folder != null ? parentItem.RemoteItem.Id : parentItem.RemoteItem.ParentReference.Id : parentItem.RemoteItem.Id : parentItem.Id);
206207

207208
SharedWithMeUpButton.Tag = parentItem.Name == "root" || parentItem.ParentReference == null || parentItem.ParentReference.Id == null || (parentItem.ParentReference.Path != null && parentItem.ParentReference.Path.EndsWith("root:")) ? null : await _oneDriveApi.GetItemFromDriveById(parentItem.ParentReference.Id, parentItem.ParentReference.DriveId);
208209
CurrentSharedWithMeOneDriveItem = parentItem;
209210
GoToSharedWithMeRootTtoolStripMenuItem.Enabled = true;
210-
SharedWithMeUpButton.Enabled = CurrentSharedWithMeOneDriveItem.ParentReference != null;
211+
SharedWithMeUpButton.Enabled = true;
211212

212213
if (CurrentSharedWithMeOneDriveItem.ParentReference != null && CurrentSharedWithMeOneDriveItem.ParentReference.Path != null)
213214
{

0 commit comments

Comments
 (0)