samwilson / diagrams-extension

A MediaWiki extension that displays GraphViz, Mscgen, PlantUML, and Mermaid diagrams in wiki pages.
https://www.mediawiki.org/wiki/Extension:Diagrams
GNU General Public License v2.0
8 stars 11 forks source link

Not working with img_auth.php #61

Closed samwilson closed 8 months ago

samwilson commented 2 years ago

Bug reported at https://www.mediawiki.org/wiki/Topic:Wuj83a8ha1vvzw64

YOUR1 commented 1 year ago

I wonder if this gets fixed when https://github.com/samwilson/diagrams-extension/pull/44 is merged

akamuza commented 9 months ago

Still not working. Version 0.12.0

samwilson commented 8 months ago

Thanks for opening #81 @YOUR1, and submitting the PR for it (#82).

However, I'm not quite sure that it's targeting the root cause of the issue. The differences between getLocalRefPath() and getFullUrl() are not going to fix this in the case of (for example) using a different storage backend (such as the AWS extension):

In my testing it seems that this is more a configuration issue than anything that the extension can fix. The following LocalSettings.php config might be what you need:

$wgUploadPath = "$wgScriptPath/img_auth.php";
$wgImgAuthUrlPathMap['/diagrams/'] = 'mwstore://local-backend/local-public/diagrams/';
akamuza commented 8 months ago

With this config line everything works as expected.

$wgImgAuthUrlPathMap['/diagrams/'] = 'mwstore://local-backend/local-public/diagrams/';

Thank you!

samwilson commented 8 months ago

Great!

I've updated the docs at https://www.mediawiki.org/wiki/Extension:Diagrams#Installation