Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
External Images and embedded maps no longer showing
slackline #1
Member since Oct 2017 · 9 posts
Group memberships: Members
Show profile · Link to this post
Subject: External Images and embedded maps no longer showing

My site uses the OpenLayersMap plugin to show the location of things and I embed images that I've hosted on Imgur to the site too.

Recently both stopped working in that neither are shown on the pages, I suspect the OpenLayersMap not working is related to the underlying image issue as the symbols I've used as pins on the map are displayed and these are hosted on the site, so its some related

For maps a table of the underlying points is rendered, whilst for images the filename appears with  "i.imgur.com_" preceeding it (if the image is a link that remains).

I've found a related thread...

after migrating from php 5.6 to 7.2 images don't show anymore - DokuWiki User Forum

I'm running PHP version 7.3.7 though and have tried placing a php.ini in the root of the wiki and /lib/exe as suggested and restarted both php-fpm and nginx but no joy.

Tried purging the cache as described under caching [DokuWiki] but again no joy.

I'm running this under ArchLinux on a VPS hosted by OVH if that is of any relevance.

If anyone has any ideas or suggestions I'm all ears as I'm stumped and would love to get the site back up and functioning properly.
slackline #2
Member since Oct 2017 · 9 posts
Group memberships: Members
Show profile · Link to this post
I've partially worked around the image problem by simply uploading the images to the wiki itself so the images are now on the same server.

However, the OpenLayersMap plugin still doesn't render unfortunately and since this was an issue with images hosted outside the site I don't think its going to be something specific to the plugin.

Does anyone else use the plugin and have any ideas?
schplurtz (Moderator) #3
Member since Nov 2009 · 511 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
It's a content security policy problem. (CSP); so most probably not related to PHP version. Please, also note that writting php.ini files at random places seldom solves problem.

Example on page . You get this in browser console :
Content Security Policy: Les paramètres de la page ont empêché le chargement d’une ressource à (« default-src »). (French... but you get the idea : external resource is forbidden as per default-src CSP rule)

your current settings are (in the request answer header) :
content-security-policy: default-src 'self' always; frame-ancestors 'none';

I don't know how you can adjust that, though. I don't think this is a standard PHP setting (so no php.ini solution), and I'm certain this is not a DokuWiki setting. Do you by chance use the plugin ? Does your hoster control panel has a CSP setting ? Did you blindly apply some advice and add an «header("content-security-policy: default-src 'self' always; frame-ancestors 'none';");» instruction to your inc/preload.php or conf/local.protected.php file ? Is this once again some archlinux weird^Wunsual default setting ?

Some technical articles on CSP (but your search engine will of course find hundreds more) :
slackline #4
Member since Oct 2017 · 9 posts
Group memberships: Members
Show profile · Link to this post
Ahha, I think you've hit the nail on the head.

I did some configuration of nginx and added some security headers, I've now changed the Content Security Policy and Referrer Policy (seems to be required by OSM) to...

add_header Content-Security-Policy  "default-src 'self' always; frame-ancestors 'none'; img-src *";
add_header Referrer-Policy "origin";

...and its sort of working again as a images are embedded but they're all black rather than OSM tiles and whilst the markers are plotted the underlying table that is used by the plugin to add them is also displayed.

Its progress though, thank you very much for taking the time to look at this and for the pointer.

Edit : After playing around I've opted to disable these two headers.  It seems the "frame-ancestors" field of the CSP also causes problems and despite trying the wild card to permit all the map didn't embed.  With these disabled it all works fine and the OpenLayersMap embeds without any problem as it did.
This post was edited on 2019-07-27, 15:38 by slackline.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 07:47:37 (UTC +01:00)