martinstoeckli / SilentNotes

SilentNotes is a simple note taking app which respects your privacy.

Home Page:https://www.martinstoeckli.ch/silentnotes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Portable Installation

RaXorX opened this issue · comments

Describe the solution you'd like
Is there any chance of having a portable installation of this? Moving to UWP apps mean that it can't be used portable, and puts a windows restriction on users. New to silentnotes and was wondering what was the reason to have to switch to UWP instead of continuing with the old win32 installers.

Additional context
I'd like to use this in a portable manner. Provided notes aren't encrypted if not being stored in a safe, and not sure whether safe requires windows credentials or not. Plus with win32 apps, till the port to linux comes users could have still used it in wine.

Thank you for writing! The decision to move to UWP was made, because of the OAuth2 login (Dropbox/GoogleDrive/...) which requires to do the authorization in an external browser window. After a successful login, the server has to do a callback to the app (deep-linking) which needs the OS to pass control back to the app when a certain URL schema is called. This was only possible with either UWP apps, or with elevated admin privileges and SilentNotes should not have admin rights, nor would every user have the privileges to elevate the app.

Soon I will release Version 8.0 which will move away from UWP to WinUI3, such apps can also register for this redirect URL. But at the same time the need to register the custom URL to satisfy the OAuth2 protocol, is also the reason why an app allowing to sync with an OAuth2 storage service can never be portable.

Hope I could explain it understandable, OAuth2 is really a difficult topic.

You did indeed. I might be wrong but how does rclone does the authentication? I've never had to run rclone as admin afaik.

I'm not familiar with rclone, but there is one alternative way I know of, one can also let the user copy a code from the login page and paste it into the application. Do you remember to have to copy/paste something when login to e.g. GoogleDrive/OneDrive (Dropbox only recently started to require the external browser)? I think this way is not really user friendly, especially because SilentNotes is not an expert tool, so I didn't consider it.

Have you considered this approach for doing OAuth2? Essentially you setup a loopback redirect url on a port above 1024, and setup an HttpListener to handle the callback.

Here's a sample that does this: https://github.com/IdentityModel/IdentityModel.OidcClient.Samples/tree/main/WindowsConsoleSystemBrowser

Thank you for the tip. After a quick glance at the project, I got the impression that it uses a similar approach, as this sample project, which I tried because it was linked from the Google OAuth2 documentation.

Both use the HttpListener (here and here).

But at the time I did the tests, I was not able to register the HttpListener without the app running with admin privileges. If I remember correctly, it worked for some private URN schemas, but not for listening to "https://" Urls (tested with Windows10). Don't know if anything changed in the mean time.