[Freedombox-discuss] Mediawiki - no access rights for images

Joseph Nuthalapati njoseph at thoughtworks.com
Thu Aug 9 17:04:29 BST 2018


Dietmar,

Thanks for reporting this issue. I've just raised a merge request
on Debian Salsa with the fix [1]. It should be automatically
applied when your FreedomBox upgrades to version 0.36.0.

I've added an additional Apache configuration file called
mediawiki-freedombox.conf in the last release. It has the
following lines in it.

<Directory /var/lib/mediawiki/>
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^/index.php/(.*)$ /$1 [R,L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php [L]
    </IfModule>
</Directory>

This file overrides Debian's MediaWiki configuration in
mediawiki.conf. You can find both of these files in the directory
/etc/apache2/conf-available on your FreedomBox.

The fix is to append the following configuration to the file
mediawiki-freedombox.conf

<Directory /var/lib/mediawiki/images>
    <IfModule mod_rewrite.c>
        RewriteEngine Off
    </IfModule>
</Directory>

<Directory /var/lib/mediawiki/uploads>
    <IfModule mod_rewrite.c>
        RewriteEngine Off
    </IfModule>
</Directory>

I have attached the file to this email so that you can directly
scp it into your FreedomBox and copy it to
/etc/apache2/conf-available. The next upgrade of FreedomBox will
be shipped with the same file, so the upgrade should be smooth.

After copying the file, you can issue the command "systemctl
reload apache2" through an ssh session to your FreedomBox.
Another approach is to enable and disable MediaWiki from the
FreedomBox web UI, which will have the same effect.

P.S. Enabling file uploads was implemented in Plinth 0.35.0, but
we didn't add a functional test for it. I've rectified the
mistake this time so that we can immediately catch it if this
feature ever breaks.


1.
https://salsa.debian.org/freedombox-team/plinth/merge_requests/1307


permondes - sagen <sagen at permondes.de> wrote:
> Changing the subject of the mail as I think this is an access
> right issue introduced by Plinth 0.35. Read access to the
> mediawiki should be available for anyone. Even logged in to
> mediawiki the images are not visible.Checking some directories:
> > @freedombox:/var/lib/mediawiki$ ls -al 
> > ...
> > drwx------ 1 www-data www-data 106 Jul 22 17:06 images
> Is it correct that the owner of the images folder is
> "www-data"? And only the owner has access, not the group, nor
> anyone else? For the individual images rights are:
> > @freedombox:/var/lib/mediawiki$ sudo ls -al images/0/01
> > insgesamt 36
> > drwxr-xr-x 1 www-data www-data    44 Jun 21 20:58 .
> > drwxr-xr-x 1 www-data www-data     8 Aug  2 21:07 ..
> > -rw-r--r-- 1 www-data www-data 32863 Jun 21 20:58
> > Fadenbild_genagelt.jpg
> which looks okay.
> Checking
> https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads
> :
> > Check directory security...
> > Set the /images folder (or the /uploads folder in previous versions)
> > to have permission "755":
> > 
> > 
> > 
> > User can read, write and execute;Group can read and execute;
> > World can read and execute.
> 
> So the rights of the 'images' folder are set wrong, am I right?
> Should it be drwxr-xr-x?Was there an change on this in Plinth
> 0.35?Is it save for me to try this change? Thanks for your help
> Dietmar
> 
> Am Dienstag, den 07.08.2018, 21:24 +0200 schrieb permondes -
> sagen:
> > I just observe that all images in my Mediawiki are gone or cannot be
> > displayed any more. I am not sure since when this is, I just found
> > that imagemagick was updated 4 days ago:
> > 
> > ' 2018-08-03 06:26:18,634 INFO Packages that will be upgraded:
> > bsdutils fdisk imagemagick imagemagick-6-common imagemagick-6.q16
> > libblkid1 libfdisk1 libimage-magick-perl libimage-magick-q16-perl
> > libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra libmagickwand-
> > 6.q16-6 libmount1 libsmartcols1 libsocket6-perl libuuid1 login mount
> > passwd python-cryptography python3-cryptography rfkill util-linux-- 
> > 
> > Mediainformation in Firefox gives an image size of 0px x 0px or type
> > text (no wonder). 
> > Checking all files (see https://permondes.de/mediawiki/Spezial:Dateie
> > n ) I get the error message
> > > You don't have permission to access /mediawiki/images/5/59/Tor_-
> > > _klein.JPG
> > > on this server.
> > 
> > So, some change of permissions? Maybe with the last Plinth?
> > 
> > Here is how ugly the wiki looks like now: https://permondes.de/mediaw
> > iki/index.php/Basteln
> > 
> > 	Dietmar
> > 
> > FreedomBox: https://permondes.de
> > _______________________________________________
> > Freedombox-discuss mailing list
> > Freedombox-discuss at alioth-lists.debian.net
> > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-d
> > iscuss_______________________________________________
> Freedombox-discuss mailing list
> Freedombox-discuss at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss

-- 
-- 
Regards
Joseph Nuthalapati
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mediawiki-freedombox.conf
Type: application/octet-stream
Size: 539 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/freedombox-discuss/attachments/20180809/cd38d050/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1175 bytes
Desc: OpenPGP Digital Signature
URL: <http://alioth-lists.debian.net/pipermail/freedombox-discuss/attachments/20180809/cd38d050/attachment.sig>


More information about the Freedombox-discuss mailing list