nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.37k stars 4.06k forks source link

Theming of favicon breaks too easily, needs fallback #3428

Closed oparoz closed 7 years ago

oparoz commented 7 years ago
### Steps to reproduce 1. Theme your instance with a logo ### Expected behaviour I guess I should see my logo as a favicon? If not, I should at least see the NC logo, not nothing ### Actual behaviour No favicon at all ### Server configuration **PHP version:** 7.0 **Nextcloud version:** 11.0.1 ### Logs #### Nextcloud log (data/nextcloud.log)
Nextcloud log ``` ImagickException: not authorized `/var/tmp/magick-14107C6pdCS4zPdMR' @ error/constitute.c/ReadImage/412 public_html/apps/theming/lib/IconBuilder.php - line 157: Imagick->readimageblob('renderAppIcon('settings', 32) public_html/apps/theming/lib/Controller/IconController.php - line 130: OCA\Theming\IconBuilder->getFavicon('settings') [internal function] OCA\Theming\Controller\IconController->getFavicon('settings') public_html/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array) public_html/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Theming\Controller\IconController), 'getFavicon') public_html/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Theming\Controller\IconController), 'getFavicon') public_html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OCA\\Theming\\Con...', 'getFavicon', Object(OC\AppFramework\DependencyInjection\DIContainer), Array) [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array) public_html/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array) public_html/lib/base.php - line 1010: OC\Route\Router->match('/apps/theming/f...') public_html/index.php - line 40: OC handleRequest() {main} ```
#### Browser log
Browser log ``` GET https://superuberdupercloud.com/apps/theming/favicon/files?v=68 500 () ```
MorrisJobke commented 7 years ago

cc @juliushaertl

MorrisJobke commented 7 years ago

@oparoz What browser do you use?

oparoz commented 7 years ago

I've investigated a bit and it's browser independent. It requires an insecure installation of Imagemagick with a policy which authorises the MVG engine. Maybe @LukasReschke knows how to define a safe way to only allow this request to happen... :)

juliusknorr commented 7 years ago

@oparoz I'll have a look. We should have a fallback to the default favicon here.

caco3 commented 7 years ago

This still seems not to work as expected!

When I log out, and redirect to https://***.ch/index.php/login, it gets shown correctly: <link rel="icon" href="/core/img/favicon.ico"> But as soon as I log in (which redirects me to https://***.ch/index.php/apps/files/?dir=/&fileid=9322), it is broken again: <link rel="icon" href="/index.php/apps/theming/favicon/files?v=9">

It seems to be independent on the browser (FF, Chromium) or cleared cache. Guess: The login page and the files (resp. any other app page) get handled differently.

Now, when I enter https://***.ch/index.php/apps/theming/favicon/files?v=9 in the browser, I get a message that the graphic contains errors: grafik Strangely this text can not be copied from within FF...

Artiom-M commented 5 years ago

Still (again?) doesn't work in NC15.0.5. I have the same message when try to open the link directly. No errors in nginx.log with debug log level. The only error I can find is in the webserver log : "/usr/local/www/nextcloud/favicon.ico" failed (2: No such file or directory) If I put a file there there is no error any more, but still no favicon in any browser and still the same message when trying to open the link. Imagemagick is installed and has SVG built it.