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

[NC27] Settings, Subscribe, New folder menus not opening with Nextcloud 27 #2242

Closed
3 tasks done
Grotax opened this issue May 20, 2023 · 39 comments · Fixed by nextcloud/server#38988
Closed
3 tasks done

Comments

@Grotax
Copy link
Member

Grotax commented May 20, 2023

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

  • I have read the CONTRIBUTING.md and followed the provided tips
  • I accept that the issue will be closed without comment if I do not check here
  • I accept that the issue will be closed without comment if I do not fill out all items in the issue template.

Explain the Problem

What problem did you encounter?

With Nextcloud 27 the slide up/open menus for Settings, Subscribe and New folder don't work anymore.
Under Nextcloud 26 it still works.

Steps to Reproduce

Explain what you did to encounter the issue

  1. Install NC 27
  2. Install News
  3. Try to open settings or any of the other menus
  4. not working

System Information

  • News app version: master
  • Nextcloud version: 27
  • Cron type: (system cron/python updater/...)
  • PHP version:
  • Database and version:
  • Browser and version: Firefox/Chromium latest
  • OS and version:
Contents of nextcloud/data/nextcloud.log
Not relevant
Contents of Browser Error Console Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put here
Nothing interesting
@Grotax Grotax added bug frontend impact Javascript/Frontend code labels May 20, 2023
@Grotax
Copy link
Member Author

Grotax commented May 20, 2023

working
Menu working as it should NC 26

not-working
Not working menu, it is still highlighted as "pressed"

explore
If you try to add one of the feeds from the explore page, the subscribe menu opens

@Grotax
Copy link
Member Author

Grotax commented May 20, 2023

Ah it seems like this is caused by a new content security policy, loading of the angular.js script is blocked by the browser with NC27 while under NC26 it is still allowed.

csp

@jakobroehrl
Copy link

same error, tested with 2 different browsers

@anoymouserver
Copy link
Contributor

If the main issue is caused by the stricter CSP, then it may be enough to just allow it in the controller for now (not tested though).
https://docs.nextcloud.com/server/27/developer_manual/basics/controllers.html?highlight=eval#modifying-the-content-security-policy

index abdd3f2f7..94c222102 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -93,7 +93,8 @@ class PageController extends Controller
         );

         $csp = new ContentSecurityPolicy();
-        $csp->addAllowedImageDomain('*')
+        $csp->allowEvalScript(true)
+            ->addAllowedImageDomain('*')
             ->addAllowedMediaDomain('*')
             ->addAllowedConnectDomain('*')// chrome breaks on audio elements
             ->addAllowedFrameDomain('https://youtube.com')

@Grotax
Copy link
Member Author

Grotax commented May 31, 2023

I think I tried this before and it did not work or it at least did not fix the issue.
The error was gone.

But I would need to repeat the testing too long ago, too much other stuff to do.

For everyone reading this, help is welcome, testing or even creating a PR 😊

@Grotax
Copy link
Member Author

Grotax commented Jun 3, 2023

If the main issue is caused by the stricter CSP, then it may be enough to just allow it in the controller for now (not tested though). https://docs.nextcloud.com/server/27/developer_manual/basics/controllers.html?highlight=eval#modifying-the-content-security-policy

index abdd3f2f7..94c222102 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -93,7 +93,8 @@ class PageController extends Controller
         );

         $csp = new ContentSecurityPolicy();
-        $csp->addAllowedImageDomain('*')
+        $csp->allowEvalScript(true)
+            ->addAllowedImageDomain('*')
             ->addAllowedMediaDomain('*')
             ->addAllowedConnectDomain('*')// chrome breaks on audio elements
             ->addAllowedFrameDomain('https://youtube.com')

I tested this, it will remove the error message from the browser, so the header is set.
But still the buttons don't work.

Nextcloud 27 RC3 (nextcloud/server@462940e), news master

@Grotax Grotax pinned this issue Jun 9, 2023
@Grotax Grotax changed the title Settings, Subscribe, New folder menus not opening with Nextcloud 27 [NC27] Settings, Subscribe, New folder menus not opening with Nextcloud 27 Jun 9, 2023
@blumentopferde
Copy link

Same issue here after upgrade from NC 26.0.2 to 27.0.0.

@stevleibelt
Copy link

stevleibelt commented Jun 15, 2023

Be happy with it, on my machine (NC 27.0.0) it says now:

App "News" cannot be installed because it is not compatible with this version of the server

occ app:update --all was tried of course.

@Grotax
Copy link
Member Author

Grotax commented Jun 16, 2023

Be happy with it, on my machine (NC 27.0.0) it says now:

App "News" cannot be installed because it is not compatible with this version of the server

occ app:update --all was tried of course.

Because we only released a beta version you might need to do this:

occ app:update --allow-unstable news

@stevleibelt
Copy link

Thank you very much!

Sorry for the harsh words. After reading today, I only noticed, little nice I wrote my comment yesterday.

@SMillerDev
Copy link
Contributor

I tested this, it will remove the error message from the browser, so the header is set.
But still the buttons don't work.

Let's at least remove the error then and maybe that'll allow me to dig up some more logs. If it doesn't... maybe it'll motivate someone to finish the Vue transition

@pbek
Copy link
Member

pbek commented Jun 16, 2023

Meanwhile, what would be the best way to add new subscriptions until the UI works again under Nextcloud 27?

@SMillerDev
Copy link
Contributor

CLI, API or changing the url to end in #/news/explore, clicking something and then updating the URL with the one you want.

@pbek
Copy link
Member

pbek commented Jun 16, 2023

Thank you!

@badrow
Copy link

badrow commented Jun 17, 2023

Hi, i have the same problem with a fresh install of nextcloud 27.
The current beta does not solve the problem unfortunately.
Is there a way to fix it ?

Thank you for all this excellent work.

@Grotax
Copy link
Member Author

Grotax commented Jun 17, 2023

No our frontend is very outdated (technology) for years and since the rest of the tech world didn't stop moving forward things start to fall apart.
Our frontend requires a rewrite in new technology (vue js) to be up to standard again.
So far nobody was able to create a complete rewrite.

This issue might still be possible to solve in the current technology but I have no idea how.

@Grotax
Copy link
Member Author

Grotax commented Jun 17, 2023

Let's at least remove the error then and maybe that'll allow me to dig up some more logs. If it doesn't... maybe it'll motivate someone to finish the Vue transition

#2262

@zzzealed
Copy link

Any updates on this? Experiencing the same issue, and would love to know if I need to switch feed-reader for now.

@Grotax
Copy link
Member Author

Grotax commented Jun 21, 2023

No update

@stevleibelt
Copy link

CLI, API or changing the url to end in #/news/explore, clicking something and then updating the URL with the one you want.

php occ news:feed:add <string: username> <string feedurl>

Just support the upcoming me with some laziness :-).

@pbek
Copy link
Member

pbek commented Jun 25, 2023

Ok, but seems like the api will be deprecated now... nextcloud/server#38988 (comment)

@SMillerDev
Copy link
Contributor

The news frontend has been deprecated for years. When they disable it again we'll just disable the news UI (unless someone actually updates it by then)

@stevleibelt
Copy link

So is there anyone available who can take the lead for this project?

I would spend some time and "do my duty", meaning coding something but I need help or a roadmap since I am all but not a JavaScript-Frontend-Guy.

@blumentopferde
Copy link

I would like to support but I'm no developer so I can't help with coding.

@anoymouserver
Copy link
Contributor

@stevleibelt @blumentopferde the current state of the UI rewrite using Vue.js can be found here: #748 with a sub-task here #1886. However, there is currently no real project leader for this rewrite, since both of the original authors are a bit busy with their personal lives.

@stevleibelt
Copy link

Personal lives ... I can sing you a song about that too :/. But anyways, thanks @anoymouserver. I will have a look.

@31337-4554551n
Copy link

I also miss the news app very much.
Is there an alternative anyone can recommend? Being able to use the same feed sync with phone and pc, without sending data to 3rd parties has been an amazing use case for me.

@SMillerDev
Copy link
Contributor

There is nothing to miss, the app still works fine. The frontend is just outdated and the "add feed" button is broken due to a nextcloud server bug.

@31337-4554551n
Copy link

Mine doesn't work at all. Just says only compatible with NC26 and below.

@SMillerDev
Copy link
Contributor

Yes, there is no stable release for NC 27 yet because of this server bug. If you updated anyway you'll need to install an unstable release, which NC very likely warned you about during the upgrade.

@31337-4554551n
Copy link

I'm happy waiting to not mess around with betas and enabling unstable things.
Is there a thread/issue I can follow so I can get a rough idea of when the 27 release will be out?

@SMillerDev
Copy link
Contributor

@31337-4554551n
Copy link

That'll only say whenit's actually out, right? Not like "aiming at a month from now" or whatever, right?

@SMillerDev
Copy link
Contributor

No but we're all volunteers so we don't give deadlines. It'll be ready when it's ready.

@31337-4554551n
Copy link

I do appreciate all the work you do :)
Just wanting to keep on top of things.
Thank you

@xelayz
Copy link

xelayz commented Jul 6, 2023

Anyone know how to export all newsfeeds? I just switched to a new Nextcloud server and now I can't export the data.

@badrow
Copy link

badrow commented Jul 6, 2023

alternat

look at freshrss

@anoymouserver
Copy link
Contributor

Anyone know how to export all newsfeeds? I just switched to a new Nextcloud server and now I can't export the data.

You can export your feeds using the following occ command, which will create a file in your home directory:

sudo -u www-data php occ news:opml:export username > ~/nextcloud-feeds.opml

@anoymouserver
Copy link
Contributor

The pre-release NC 27.0.1 RC1 has been released today and the affected menus are working again. The stable version is expected on 2023-07-20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.