Skip to content
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

Support for Nextcloud #324

Closed
enoch85 opened this issue Sep 27, 2016 · 36 comments
Closed

Support for Nextcloud #324

enoch85 opened this issue Sep 27, 2016 · 36 comments

Comments

@enoch85
Copy link
Collaborator

enoch85 commented Sep 27, 2016

I'm thinking of moving to Nextcloud and I want to be sure that this app supports it before I do.

Is this supported, or will it be in the future?

@ThomasDaheim
Copy link

Didn't have any issues after migrate and seems to work. But I do most of my editing with https://github.com/ThomasDaheim/ownNoteEditor these days ;-)

@enoch85
Copy link
Collaborator Author

enoch85 commented Oct 21, 2016

@ThomasDaheim Great news, will try. Btw, you should publish that App somewhere. :)

@enoch85
Copy link
Collaborator Author

enoch85 commented Oct 25, 2016

Just tested moving my whole ownCloud instance to a new testing domain to be sure everything works before I run it in production, and it seems like it fails. This is what's happening when trying to login on Nextcloud:


Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:47+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/ocs/routes.php on line 104 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67    2016-10-26T00:25:47+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:47+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/lib/private/Route/Router.php on line 369 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67  2016-10-26T00:25:47+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:47+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/lib/private/Route/Router.php on line 369 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67  2016-10-26T00:25:50+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:50+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/ocs/routes.php on line 104 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67    2016-10-26T00:25:50+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:50+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/lib/private/Route/Router.php on line 369 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67  2016-10-26T00:25:50+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:49+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/ocs/routes.php on line 104 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67    2016-10-26T00:25:49+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68    2016-10-26T00:25:49+02:00   daniel@en0ch.se
Error   PHP Missing argument 1 for OCP\AppFramework\App::__construct(), called in /var/www/nextcloud/lib/private/Route/Router.php on line 369 and defined at /var/www/nextcloud/lib/public/AppFramework/App.php#67  2016-10-26T00:25:49+02:00   daniel@en0ch.se
Error   PHP Undefined variable: appName at /var/www/nextcloud/lib/public/AppFramework/App.php#68

@Fmstrat Could you please fix this? Many people are using Nextcloud now, and I think it would be a good idea to fix this if you want to make more money from the app.

@enoch85
Copy link
Collaborator Author

enoch85 commented Oct 25, 2016

Btw, it works in the Nextcloud GUI, but the mobile app fails.

@Tamsy
Copy link

Tamsy commented Dec 14, 2016

ownnote used to work well with Nextcloud up to version 10.0.2.

Today we updated our servers to Nextcloud 11.0.0 but the ownnote app can not be activated anymore:

"Server version 10 or lower is required."

What a pity! Especially since we have paid for ownNote - Notes for ownCloud from the PlayStore.

I'm afraid ownnote might be a zombie project by now since the latest commit dbadf53 happened on 11 May 2016 ...

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 14, 2016

@Tamsy There is a hacky workaround. Change info.xml to max version 12 and it will work.

@Tamsy
Copy link

Tamsy commented Dec 14, 2016

@enoch85

Just did it and it works now. Thank you for the hint.
I was afraid the file integrity check for this app will fail if I tamper with the code. But it doesn't. Works as expected again now (also the Android client).

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 14, 2016

@Tamsy Glad I could help. :)

@Fmstrat
Copy link
Owner

Fmstrat commented Dec 14, 2016

Thanks for jumping in @enoch85. As mentioned in the other issue I'll get that merged in once I get Nextcloud set up.

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 14, 2016

Thank you @Fmstrat for showing that you are alive. ;) This app would really need some love. It has great potential.

Besides that maybe you should consider letting someone in on this as you don't even have time to (obviously) merge simple PRs. And what I mean by "letting in" is giving someone you trust merge permissions.

@Fmstrat
Copy link
Owner

Fmstrat commented Dec 14, 2016

@enoch85 - Totally open to that. I've even asked for contributors in the past but no-one wanted to help take on the work. If you (or anyone else with a similar background working with ownCloud/NextCloud already) would like to step in and help, I'm very, very open to granting access to this repo.

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 14, 2016

@Fmstrat I don't know PHP that well, but I know enough to see if the code are good or not. What I can offer are to merge simple PRs like translations and typos and stuff. I won't merge things I don't understand or haven't tested.

So let me in and I'll help you. :)

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 14, 2016

@Fmstrat Check my contact information here: https://www.techandme.se/contact/ Please send me an email so that I can reach you.

Thanks!

@julienval
Copy link

Thanks @enoch85 for the workaround. Altering info.xml allowed me to activate Ownnote again on my NextCloud 11 setup.
However, the Android app cannot synchronise. I get the following error when updating:
Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 240 path $.ocs.data

Any hint on how to fix this issue?

Cheers,
Julien

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 19, 2016

ping @Fmstrat

@Tamsy
Copy link

Tamsy commented Dec 19, 2016

Well, it only works sort of. When trying to edit a note through the web interface of NC 11 and upload pictures to that note, nothing gets saved...

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 19, 2016

@Tamsy Hmm... Is it saved locally if you do it from your phone?

@julienval
Copy link

Just noticed that I cannot edit my notes (the editor screen is blank, I just see the "save" / "cancel" ... commands in the upper part of the screen)

Julien

@Tamsy
Copy link

Tamsy commented Dec 19, 2016

Nope, it doesn't work. I just tried to edit one of my notes through my phone (SGS7, Android 6.01). It didn't save but instead the note itself is gone (empty).

Seems that the ownnote app is broken with NC 11.

@julienval
Copy link

Please just forget my comment regarding the mobile app - I was using the wrong app!! :(
Sorry for this

@Japhys
Copy link

Japhys commented Dec 21, 2016

Just noticed that I cannot edit my notes (the editor screen is blank, I just see the "save" / "cancel" ... commands in the upper part of the screen)
Julien

Exact same problem here

@Japhys
Copy link

Japhys commented Dec 28, 2016

Any news on a possible update?

@q4z1
Copy link
Contributor

q4z1 commented Dec 28, 2016

check #333 for the blank editor screen issue (tinymce vs CSP) ;)

@q4z1
Copy link
Contributor

q4z1 commented Dec 28, 2016

@Tamsy pic upload with browser based web interface works for me now after implementing the CSP workaround. Pic upload with the ownNote app on Android 4.2.2 works for me too.

@Tamsy
Copy link

Tamsy commented Dec 29, 2016

@q4z1

Thank you for the hint.

I have patched #333 for the blank editor screen issue. While ownnote now works on Android 6.01 (creating and editing notes) the web interface through the web browser doesn't let me edit any notes (creating new notes works though). The whole ribbon/tool bar for editing notes is not visible anymore.

Server: Ubuntu 16.04
Webserver: Apache 2.4.25 with PHP 7.0.14
Certificate: Official Comodo PositiveSSL
Web browsers: Pale Moon 27.03 (x64) on Win 10 Pro 64 Bit and Microsoft Edge 38.14393.0.0

@q4z1
Copy link
Contributor

q4z1 commented Dec 29, 2016

@Tamsy

I see ... Edge does not support CSP Level 2 (see https://content-security-policy.com/). You have to patch a nextcloud-core file then :(

  • file lib/public/AppFramework/Http/EmptyContentSecurityPolice.php - line 354:

replace
$policy = "default-src 'none';";

with
$policy = "default-src 'self';";

... just tested it with Edge - it works for me now.

EDIT: I edited the #333 patch in order to avoid local/global scope variable issues regarding CSP - therefore I was able to reduce this Edge patch a bit - please check as this Edge patch will cause a javascript error now if the #333 patch is not changed.

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 29, 2016

Can someone make a PR for this workaround --^ or does @Fmstrat have a better idea?

@q4z1
Copy link
Contributor

q4z1 commented Dec 29, 2016

I can put the ownnote changes into my fork and create a pull request if needed. Just let me know (for being able to impelement future tinymce updates it would be better to ask the tinymce-dev team, if they can implement support for nonce hash mechanism though - but it seems to be tricky as the nonce hash creation has to be done on server-side).

For Microsoft Edge I did not find a better solution than changing a nextcloud core file = not inside of this repo(!) - as it is in my eyes more a bug from nextcloud not setting CSP directive default-src to 'self' instead of 'none' for browsers which do not support CSP Level 2 with the nonce hash mechanism.

@enoch85
Copy link
Collaborator Author

enoch85 commented Dec 29, 2016

as it is in my eyes more a bug from nextcloud not setting CSP directive default-src to 'self' instead of 'none' for browsers which do not support CSP Level 2 with the nonce hash mechanism.

cc @LukasReschke

@Tamsy
Copy link

Tamsy commented Dec 29, 2016

@q4z1

Thank you for the follow-up.

Edge is not really the web browser of my choice but Pale Moon is. Unfortunately ownnote is not working correctly on both browsers.

To avoid failures with the file integrity checks with NC I refrain from patching the NC-core. I am very much hoping that the NC-devs will come up with a solution to the CSP Level 2 matter.

@q4z1
Copy link
Contributor

q4z1 commented Dec 30, 2016

@Tamsy

I made some tests with Palemoon (Portable-27.0.3.win64).

Regarding https://content-security-policy.com/browser-test/ it supports CSP Level 2 - and the nonce hash mechanism works as expected for me with the #333 patch.

Also editing existing notes, adding pictures and removing them works as expected for me.
Editor Menu Bar always shows up in a proper way for me.

Can you maybe open Inspector and post console errors (if there are any) for the issues you have?

@Tamsy
Copy link

Tamsy commented Dec 30, 2016

@q4z1

Thank you again for your continuous support.

I just re-downloaded the file ./apps/ownnote/templates/main.php from GIT and patched that file again using the #333 patch.

There must have something gone wrong with the first patch. Now ownnote is working well again with Pale Moon 27.03 (x64): I can create, edit, upload notes as it should be.

Many thanks again!

@vvevans
Copy link

vvevans commented Feb 22, 2017

Where is this "info.xml" file to alter and make ownnote work? I can't seem to find it.

@enoch85
Copy link
Collaborator Author

enoch85 commented Feb 22, 2017

@vvevans
Copy link

vvevans commented Feb 22, 2017

@enoch85 - thank you very much. I was running the "find" command in my apps directory, but it didn't find it for some reason. Know now!

@enoch85
Copy link
Collaborator Author

enoch85 commented Jul 2, 2017

This has been forked and the work will continue in https://github.com/brantje/ownnote Please join!

@enoch85 enoch85 closed this as completed Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants