-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fixed Keeweb application for NC 28.x.x #231
Conversation
Thanks for your help, great! Did you check, if that version still works with NC 27 as well? If not, we need to increase the minimum supported version to 28 as well and keep the older version for NC 27 and below unchanged. |
Hi, It partially works for NC 27 (file association is broken due to changes in |
Ok, thanks for the feedback. I'll change the supported version since NC 27 is still maintained and the older version works fine there. |
Since this version will not work fully with Nextcloud 27, it is better to only publish it for Nextcloud 28 and higher.
Hmm - it does not work here with NC 28 either :-( Clicking a KDBX file will open Keeweb - but the file is not opened then. Edit: the URL called then is |
Looking on it, I didn't had this problem on my previous test |
Okay, it seems there is two issues:
The following patch should solve these issues: diff --git a/keeweb/lib/Controller/PageController.php b/keeweb/lib/Controller/PageController.php
index 005ced5..847afac 100644
--- a/keeweb/lib/Controller/PageController.php
+++ b/keeweb/lib/Controller/PageController.php
@@ -87,6 +87,7 @@ class PageController extends Controller {
public function config($file) {
$csrfToken = \OC::$server->getCSRFTokenManager()->getToken()->getEncryptedValue();
$webdavBase = \OCP\Util::linkToRemote('webdav');
+ $webdavBase = str_replace("http://", "https://", $webdavBase);
$config = ['settings' => (object) null];
if (isset($file)) {
$config['files'] = [
@@ -136,6 +137,7 @@ class PageController extends Controller {
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedConnectDomain('https://services.keeweb.info');
$csp->addAllowedScriptDomain('https://plugins.keeweb.info');
+ $csp->addAllowedScriptDomain("blob:");
$csp->addAllowedScriptDomain("'unsafe-inline'");
$csp->addAllowedConnectDomain('https://plugins.keeweb.info');
$csp->allowEvalScript(true); Tested on a fresh NC28 install. @arnowelzel can you try on your side and confirm ? |
Sorry - still does not work here. Same effect: KeeWeb is loaded but does not open the file. Server is using HTTPS (as it was before). Same error in the console:
About this line - I don't think we need that. When the instance is not using HTTPS the resource can not be loaded anyway, since it will not be available using HTTPS:
|
I can't reproduce from my side on a fresh and a old Nextcloud server, using Firefox 115.6.0esr (normal & private browsing), and Chromium 120.0.6099.129 (normal & private browsing)... Also checked using Chrome and Brave on mobile (last version available on Play Store) without issue. My server is deployed using the official docker image, with a Traefik acting as reverse-proxy. Can you give more information on how your Nextcloud is deployed, so I could create the same environment to check ? |
I don't use Docker but a plain server setup with NC 28 using Apache 2.4, PHP-FPM 8.3 and MariaDB. To be sure I repeated the test with a fresh setup - and now it works. The replacement of http with https is not needed since KeeWeb would not work when loaded via HTTP anyway. I will apply the change |
Now the release action does not work any longer :-(.
@jhass Can you have a look what is missing? I can't update the workflow actions, just trigger them. |
Github deprecated Thanks guys! |
Thanks for the quick response and help! |
@florian-forestier is da real MVP. Thank you for this! |
Hi,
This MR aim to fix #229 and #230.
The most important part of this MR is the
viewer.js
file. As Nextcloud removed theOCA.Files
API, I had to use the new one. The original problem (CORS issue) was solved by adding$csp->addAllowedScriptDomain("'unsafe-inline'");
tolib/Controller/PageController.php
. Tested on Nextcloud 28.0.1.I also seen #221. Please note that I am interested in continuing your work on this Nextcloud plugin, as I use it on a daily basis, for personal and professional use.
I also also take the opportunity of this PR to thank you for the job you've done over the years on this project, having access to my keepass files directly on my Nextcloud saved me several times 😄
Note: don't be affraid of the
+6,515
added lines, 99.9% of them are in thepackage-lock.json
file...👋