-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono/.Net Core/Linux Support #18
Comments
I never used Mono, so I have to dig deeper into it first. I'm not sure whether this could be achieved beacuse some third party libraries may not be Mono compatible. I also highly use .Net 4.5 Async/Await. Maybe someone can help out? |
I believe the issue may be that the CSharpCodeProvider object used in KeePass to compile the plgx files does not reference any dlls by default. Therefore if it is not referenced in the csproj file it can't find the dll to compile and thus the errors you received. Although, I would think the same problem would exist on Windows as well. I tried adding a reference to System.Threading.Tasks in the project but that caused the compiling to fail because xbuild automatically includes a reference to that dll. |
@jdm12989: I saw your fork and your ongoing development in mono/linux support. Many thanks for that. Are you willing to complete this task and create a pull request for that? Or is your goal to only create your "private" copy (which is also ok for me)? |
Yes, all Linux user will be very pleased if you complete and share it! |
+1 for Linux support |
+1 for Linux support! |
+1 for Linux support |
+1 for Linux support, I'd imagine this would work under Mac OS as well since we're talking mono. If I have time coming up, I'll start looking at making a PR as well. |
+1 |
Please +1 |
If anyone is familiar with mono, help would be appreciated. I have the plugin running on Linux Mint, but not when it is compiled to a plgx. |
I'm not familiar with mono at all, but I'm an adequate search engine user if I could be of use. |
Hi @jdm12989, the upcoming release 1.3.0 will be a huge milestone. In it I have changed some things to be better prepared for mono support. Maybe we can work together on mono support after that? Regards, |
Hi everyone, I wanted to use KeeAnywhere on Linux, so although I am a total newbie to the KeePass and C# in general, I tried to use it. Good news: KeeAnywhere 0.13.0 builds on Mono out of the box ! Bad news: I can't get to be loaded by KeePass 2.34, it keeps telling me that I need a "newer .NET framework", although I am using Mono 4.4.2 which is compatible with .NET 4.5/4.6. |
at first: KeeAnywhere compiles on Linux but currently does not work out of the box (because there is some Windows specific code in it). See @jdm12989's fork of KeeAnywhere. I'm trying to pull these changes in the near future. Comin back to your problem: <configuration>
...
<startup>
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
...
</configuration> Regards, |
It seems the Forms/SettingsForm does not resize it's content correctly. Maybe it has to do with the anchors I set for several controls (like Top, Left, Bottom, Right for the ListView control). Try switching it to something static - maybe then the "hidden" or "dislocated" controls become visible. |
Thanks, I moved the controls around and they now appear! But now, whenever I click on "Add... -> Google Drive", the application crashes with:
Followed by a |
@ronki2304 |
Not the most useful update, but I spent some time looking at running KeeAnywhere this evening. The largest issue appears to be embedding the browser (for the various oauth options):
The remaining choices I'm aware of would be to either interact with the CEF APIs directly (supposedly not that difficult, but a lot messier than the current setup), or try to use chromiumfx which reportedly does still support Mono... in theory (https://bitbucket.org/chromiumfx/chromiumfx/issues/9/mono-support). Very surprised to find it's so difficult to host a web-browser in mono! @jdm12989 - a long time ago now, but did you come across this issue in your fork? I was unable to get your fork to build anymore, so wasn't able to determine for myself. |
I believe I came up with a more feasible approach for this for Mono (Unix). Instead of trying to embed a browser, the application could instead host a simple web server, then launch the system browser (via This should definitely work for Google OAuth2 - whether the other providers have a similar mechanism I don't yet know. I plan to start looking at this personally over the next few weeks in my spare time; if it turns out to be sane I will ultimately aim to contribute something back - but no promises yet! :) |
@stephenmcgruer I have not run into this as I have only worked on getting it running with Google drive which for me at least opens up Chrome vs the embedded browser. |
Hi @stephenmcgruer , using system's default browser works for some of the providers but not for all. The problems are mainly in issues, how providers handle authorization (callback) URL:
This all leads to the requirement to use an internal browser to have the best user experience. There are some options in which the authorization may take place in default browser and the user must copy and paste authorization token/code to a an input field in KeeAnywhere. But I'm looking forward for solution :-) |
Ah, I was not aware of such requirements from OAuth2 providers, thank you for bringing it to my attention. My knowledge is mainly from the Google OAuth2 implementation, which actually specifies that using a local loopback server is preferred over the deprecated programmatic extraction or copy/paste[0]! I will have a look through the various provider's docs and see what the situation is for each, then loop back (pun entirely intended) here for further discussion :). I was successful last night in hacking together a local webserver solution for Google Drive on Linux (Mono). It was remarkably easy - a few small patches for general Mono support, a replacement class for OAuth2Form, and changing the redirect URL to a localhost one. [0]: https://developers.google.com/identity/protocols/OAuth2InstalledApp#creatingcred |
@Kyrodan any progress on this? TIA |
Currently noch Progress in that. Sorry.
Fazle Rabbi <[email protected]> schrieb am Sa., 31. Aug. 2019, 15:13:
… @Kyrodan <https://github.com/Kyrodan> any progress on this? TIA
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18?email_source=notifications&email_token=AACWW2R7BLGZBWPSVE36C4TQHJU57A5CNFSM4BZ2WWM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TMQ7I#issuecomment-526829693>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACWW2UM5ACSLQTQVBOPUZDQHJU57ANCNFSM4BZ2WWMQ>
.
|
Hello @Kyrodan , |
I believe there are no news about this yet.
To circumvent 3) I'm preparing my bash to use kioclient move all the files but the latest one to an .old folder in gdrive. Anyways, I still hope to see someday KeeAnywhere working with mono. Cheers |
I wasn't able to find a maintained solution for in-application web browser support in Mono. |
For embedding a web browser in Mono, this might be useful. |
I'm in progress of abandoning the internal browser and improving linux support. For further v2.0.0-Beta-Tests please move on to #252. |
Somthing that you might be able to do, is use Microsoft webview2 which is powered by the new cross-platform Microsoft Edge.
Sent from my T-Mobile 4G LTE Device
…-------- Original message --------
From: Daniel Bölts <[email protected]>
Date: 2/12/21 8:05 AM (GMT-06:00)
To: Kyrodan/KeeAnywhere <[email protected]>
Cc: Wyatt Jackson <[email protected]>, Comment <[email protected]>
Subject: Re: [Kyrodan/KeeAnywhere] Mono/.Net Core/Linux Support (#18)
I'm in progress of abandoning the internal browser and improving linux support.
For further v2.0.0-Beta-Tests please move on to #252<#252>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#18 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKIAII7267SK22RFS5U2OR3S6UYTHANCNFSM4BZ2WWMQ>.
|
I released v2.0.0 today. During abandoning the WebView I did some changes to improve Mono/Linux-Support. |
Ah, I see the 2.0.0 is now in the master repo, when I find some time, I'll see if I can get it to work |
You need the zip archive and unzip into the plugins folder, that however has that issue that i showed there |
@Kyrodan is there something in specific i could help with debugging about getting the buttons to appear under mono? I feel like this is propably something very minor and pretty much the last thing needed to having this working. |
Unfortunately, for me KeeAnywhere 2.0.3 also doesn't work. I'm on up-to-date (as of today) Gentoo with
When I use the .plgx file I'm also getting: When I use the .zip file I'm getting: When I run KeePass from console with the --debug parameter, for the .plgx there's no output but for the .zip file I'm getting the following: According to https://keepass.info/help/v2_dev/plg_index.html there should be an output to a temporary file, but I can't find it or maybe it never gets created? What can I do to help debug this further? |
I wonder if using .net core would make a difference? |
On ubuntu 21.04 with the latest mono preview version(currently 6.12.0.147) from the mono website, the plugin works. But the buttons to add/remove accounts are not visible. They are out of the form for some reason. If I do the bellow patch, I can see them on the form. diff --git a/KeeAnywhere/Forms/SettingsForm.Designer.cs b/KeeAnywhere/Forms/SettingsForm.Designer.cs
index 59647e9..b6e3c90 100644
--- a/KeeAnywhere/Forms/SettingsForm.Designer.cs
+++ b/KeeAnywhere/Forms/SettingsForm.Designer.cs
@@ -132,7 +132,7 @@
// m_btnAccountCheck
//
this.m_btnAccountCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.m_btnAccountCheck.Location = new System.Drawing.Point(490, 96);
+ this.m_btnAccountCheck.Location = new System.Drawing.Point(100, 96);
this.m_btnAccountCheck.Name = "m_btnAccountCheck";
this.m_btnAccountCheck.Size = new System.Drawing.Size(75, 23);
this.m_btnAccountCheck.TabIndex = 12;
@@ -143,7 +143,7 @@
// m_btnAccountAdd
//
this.m_btnAccountAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.m_btnAccountAdd.Location = new System.Drawing.Point(490, 38);
+ this.m_btnAccountAdd.Location = new System.Drawing.Point(100, 38);
this.m_btnAccountAdd.Menu = this.m_mnuAdd;
this.m_btnAccountAdd.Name = "m_btnAccountAdd";
this.m_btnAccountAdd.Size = new System.Drawing.Size(75, 23);
@@ -159,7 +159,7 @@
// m_btnAccountRemove
//
this.m_btnAccountRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.m_btnAccountRemove.Location = new System.Drawing.Point(490, 67);
+ this.m_btnAccountRemove.Location = new System.Drawing.Point(100, 67);
this.m_btnAccountRemove.Name = "m_btnAccountRemove";
this.m_btnAccountRemove.Size = new System.Drawing.Size(75, 23);
this.m_btnAccountRemove.TabIndex = 10;
@@ -178,7 +178,7 @@
this.m_lvAccounts.Location = new System.Drawing.Point(7, 38);
this.m_lvAccounts.MultiSelect = false;
this.m_lvAccounts.Name = "m_lvAccounts";
- this.m_lvAccounts.Size = new System.Drawing.Size(476, 217);
+ this.m_lvAccounts.Size = new System.Drawing.Size(100, 100);
this.m_lvAccounts.SmallImageList = this.m_imlProviderIcons;
this.m_lvAccounts.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.m_lvAccounts.TabIndex = 9; I can even build the plugin under mono if I remove the dropbox dependency, patch bellow. diff --git a/KeeAnywhere/KeeAnywhere.csproj b/KeeAnywhere/KeeAnywhere.csproj
index e27527e..639dd63 100644
--- a/KeeAnywhere/KeeAnywhere.csproj
+++ b/KeeAnywhere/KeeAnywhere.csproj
@@ -362,9 +362,9 @@
<Compile Include="StorageProviders\Box\BoxHttpRequestHandler.cs" />
<Compile Include="StorageProviders\Box\BoxStorageConfigurator.cs" />
<Compile Include="StorageProviders\Box\BoxStorageProvider.cs" />
- <Compile Include="StorageProviders\Dropbox\DropboxHelper.cs" />
+ <!--<Compile Include="StorageProviders\Dropbox\DropboxHelper.cs" />
<Compile Include="StorageProviders\Dropbox\DropboxStorageConfigurator.cs" />
- <Compile Include="StorageProviders\Dropbox\DropboxStorageProvider.cs" />
+ <Compile Include="StorageProviders\Dropbox\DropboxStorageProvider.cs" />-->
<Compile Include="StorageProviders\ProxyProvider.cs" />
<Compile Include="StorageProviders\GoogleDrive\GoogleDriveHelper.cs" />
<Compile Include="StorageProviders\GoogleDrive\GoogleDriveHttpClientFactory.cs" />
diff --git a/KeeAnywhere/StorageProviders/StorageRegistry.cs b/KeeAnywhere/StorageProviders/StorageRegistry.cs
index b23d9f0..bf0839d 100644
--- a/KeeAnywhere/StorageProviders/StorageRegistry.cs
+++ b/KeeAnywhere/StorageProviders/StorageRegistry.cs
@@ -3,7 +3,7 @@ using System.Linq;
using KeeAnywhere.StorageProviders.AmazonS3;
using KeeAnywhere.StorageProviders.Azure;
using KeeAnywhere.StorageProviders.Box;
-using KeeAnywhere.StorageProviders.Dropbox;
+//using KeeAnywhere.StorageProviders.Dropbox;
using KeeAnywhere.StorageProviders.GoogleDrive;
using KeeAnywhere.StorageProviders.HiDrive;
using KeeAnywhere.StorageProviders.HubiC;
@@ -24,8 +24,8 @@ namespace KeeAnywhere.StorageProviders
d.Add(new StorageDescriptor(StorageType.AzureBlob, "Azure Blob Storage", "azureblob", account => new AzureBlobStorageProvider(account), () => new AzureStorageConfigurator(StorageType.AzureBlob), PluginResources.Azure_16x16));
d.Add(new StorageDescriptor(StorageType.AzureFile, "Azure File Storage", "azurefile", account => new AzureFileStorageProvider(account), () => new AzureStorageConfigurator(StorageType.AzureFile), PluginResources.Azure_16x16));
if (!isUnix) d.Add(new StorageDescriptor(StorageType.Box, "Box", "box", account => new BoxStorageProvider(account), () => new BoxStorageConfigurator(), PluginResources.Box_16x16));
- d.Add(new StorageDescriptor(StorageType.Dropbox, "Dropbox", "dropbox", account => new DropboxStorageProvider(account), () => new DropboxStorageConfigurator(false), PluginResources.Dropbox_16x16));
- d.Add(new StorageDescriptor(StorageType.DropboxRestricted, "Dropbox-Restricted", "dropbox-r", account => new DropboxStorageProvider(account), () => new DropboxStorageConfigurator(true), PluginResources.Dropbox_16x16));
+ //d.Add(new StorageDescriptor(StorageType.Dropbox, "Dropbox", "dropbox", account => new DropboxStorageProvider(account), () => new DropboxStorageConfigurator(false), PluginResources.Dropbox_16x16));
+ //d.Add(new StorageDescriptor(StorageType.DropboxRestricted, "Dropbox-Restricted", "dropbox-r", account => new DropboxStorageProvider(account), () => new DropboxStorageConfigurator(true), PluginResources.Dropbox_16x16));
d.Add(new StorageDescriptor(StorageType.GoogleDrive, "Google Drive", "gdrive", account => new GoogleDriveStorageProvider(account), () => new GoogleDriveStorageConfigurator(), PluginResources.GoogleDrive_16x16));
d.Add(new StorageDescriptor(StorageType.HiDrive, "HiDrive", "hidrive", account => new HiDriveStorageProvider(account), () => new HiDriveStorageConfigurator(), PluginResources.HiDrive_16x16));
if (!isUnix) d.Add(new StorageDescriptor(StorageType.HubiC, "hubiC", "hubic", account => new HubiCStorageProvider(account), () => new HubiCStorageConfigurator(), PluginResources.HubiC_16x16)); |
Is it possible to add a Google Drive account manually within a config file? |
I am on openSUSE Tumbleweed with mono version 6.12.0.122. Unfortunately it still refuses to compile, it ask for newer .NET version. Other plugins just work fine. Do you have some workaround to make it work? |
Another solution would be to setup rclone. It has an option for cached mount. Initial setup of google drive is here. |
Is there someone out there to give it a try again:
I noticed that CodeQL is using Mono for compiling this project and it does not fail. |
I attempted to run the plgx from this build. I still have an error upon keepass start up. Thank you for working on this! I use the extension on Window, and love it. Would really like to use it on Linux as well as I am trying to transition to Linux. System:
|
Do you mean testing with latest build? If not, how can I create a plgx file from master? |
I was able to get the plugin to work by adjusting the csproj file. I had to add a HintPath for "netstandard", and adjust the one for "System.Threading.Tasks". Had to add oauth2 keys for Google of course, now it work. Still a few UI issues, but that didn't impact the functionality. |
I've created a binary which works for me (google drive only): https://github.com/vossim/KeeAnywhere/releases/tag/2.1.0-linux And a PR here: #434 |
@vossim Your release does not work for me, if I have it installed keepass keeps crashing (2.57, ubuntu-24.04) |
It would be awesome if Mono could be supported as well. I had to fix an image reference and remove OS and .NET restrictions to get a working .plgx file (see this branch), but the compilation by KeePass fails. I don't really know anything about C# and .NET, so I have no clue how to fix this.
Here's the compiler error given when launching
KeePass.exe --debug
:The text was updated successfully, but these errors were encountered: