Pods with camo can't load my post's images?

I had two people reply that this post’s image wasn’t viewable:

Both are in pods other than my own, the one who has responded is in a pod that uses camo.

What could cause this? I’m using camo on my own server and it works for other pods, and I can also view my post just fine in private mode without logging in.

The image in that post, https://social.schwend.us/uploads/images/scaled_full_89485bf4e4fdad7b84c1.png, is served with a apng content type (Content-Type: image/vnd.mozilla.apng). apng is nothing diaspora* supports, and camo is set by default not to serve unknown mime types.

However, your image isn’t even an apng, it’s a regular png. Did you add custom mime type definitions to your apache config?

1 Like

Wow, interesting! Thanks.
tyler@host:/etc/apache2$ sudo grep -iR apng *

yielded nothing.

Searching for PNG yielded a bunch of images and this in the magic file:
#PNG Image Format
0 string \x89PNG image/png

Nothing odd there. All my config is in /etc/apache2, save for anything I might’ve gotten from the mostly vanilla Diaspora installdocs.

The original file is a screen shot taken from XFCE screenshot utility:

I notice there is a difference between these files… Is it possible the Diaspora upload process that strips out metadata also changes the mime-type?

Also running Linux’s file utility gives:

Original:
PNG image data, 802 x 348, 8-bit/color RGB, non-interlaced

Diaspora:
PNG image data, 802 x 348, 8-bit colormap, non-interlaced

Hm that is weird. Let’s hope that someone with more Apache knowledge comes along and knows how to debug this. :confused:

Ah yeah! diaspora* transforms the files a bit, including stripping private metadata (unless you have disabled that in your settings), and it also rescales the file into different versions for thumbnails etc. However, both of those files are fine - none of them is a APNG. In fact, you couldn’t even upload a apng if you tried.

And it’s even weirder, because diaspora* just stores those new versions to the disk, it does not actually serve those files. We leave the static file serving up to the reverse proxy (in your case Apache), because those things are really fast at delivering statics. So something is making your Apache send a apng content type for .png files. That issue is not just affecting uploaded files, though - even your Favicon (https://social.schwend.us/assets/favicon-158d223c914fb4936d3b14294dbc3f0d4d87ffced0694cc013cca43910ef2324.png) is served with a apng mime type.

Just for reference, can you share your entire Apache config with us? Just paste them here as a response into code blocks. :slight_smile:

I can actually confirm that this happens with my other sites as well… even the very basic ones:

$ cat /etc/apache2/sites-enabled/[redact] | grep -v '^\s*#'
<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerName [redact]
	ServerAdmin [redact]
	DocumentRoot [redact]



	ErrorLog ${APACHE_LOG_DIR}/[redact]/error.log
	CustomLog ${APACHE_LOG_DIR}/[redact]/access.log combined


	SSLCertificateFile [redact]
	SSLCertificateKeyFile [redact]
	Include /etc/letsencrypt/options-ssl-apache.conf

	<Directory [redact]>
		Options -Indexes
	</Directory>
</VirtualHost>

</IfModule>

And the letsencrypt SSL above contains:

# Baseline setting to Include for SSL sites

SSLEngine on

# Intermediate configuration, tweak to your needs
SSLProtocol             -All +TLSv1.2 +TLSv1
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLHonorCipherOrder     on
SSLCompression          off

SSLOptions +StrictRequire

# Add vhost name to log entries:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

#CustomLog /var/log/apache2/access.log vhost_combined
#LogLevel warn
#ErrorLog /var/log/apache2/error.log

# Always ensure Cookies have "Secure" set (JAH 2012/1)
#Header edit Set-Cookie (?i)^(.*)(;\s*secure)??((\s*;)?(.*)) "$1; Secure$3$4"

Ah-ha. Found:
/etc/mime.types

image/vnd.ms-modi                               mdi
image/vnd.mozilla.apng                          apng png
image/vnd.net-fpx

This appears to be a default of the media-types Debian package: https://salsa.debian.org/debian/media-types/-/blob/master/mime.types#L1860
and there’s a related commit to fix this here:
https://salsa.debian.org/debian/media-types/-/commit/90a5cc8c3f4575e1222f323cfff121940e0f16e8

So I’ll just remove png from there! Eureka!

Oh wow, that’s nasty. You’re on the most recent version of the media-types package and the entry is still wrong? That’s good to know, I expect others to run into similar issues…

Glad it’s working for you!

The media-types package is only available on testing, I’m still on debian stable where the package is still named mime-support and doesn’t contain this line. So I don’t expect many to run into this issue (hoping that this gets released before testing turns into stable).

1 Like

This is my first testing bug to bite me in the rear. I feel so special!

3 Likes