all gzipped artifacts are served as text/plain
Open, HighPublic

Description

We compress all our artifacts to save space, which is great. However it seems it breaks mimetypes and everything is served as text/plain. For example, this html:
https://taskotron-dev.fedoraproject.org/artifacts/all/55a5d4d6-dd7a-11e6-a20a-525400cb0b45/task_output/results/job_report.html
is served as plain text.

Our current apache rule seems to be this:

<DirectoryMatch "^{{ public_artifacts_dir }}/all/(.+)/task_output/">
    RewriteEngine on

    RewriteCond   "{{ public_artifacts_dir }}/all/$1/task_output/$2.gz"  -f
    RewriteCond   "{{ public_artifacts_dir }}/all/$1/task_output/$2"     !-f
    RewriteRule   "^{{ public_artifacts_dir }}/all/(.+)/task_output/(.*)$"  "{{ public_artifacts_dir }}/all/$1/task_output/$2.gz"

    # mod_deflate doesnt work as expected for some reason
    # use custom filter instead
    SetOutputFilter gz-to-plain

    # keep the mod_deflate for reference though
    #AddEncoding x-gzip .gz
    #SetOutputFilter INFLATE
    #ForceType text/plain
</DirectoryMatch>

I guess SetOutputFilter gz-to-plain is to blame, but I'm not familiar with it.

One solution is to fix this properly (so that mimetypes are respected). A fallback option is to compress only our logs and not task artifacts, but that would need T880 to be solved first.

kparal created this task.Jan 18 2017, 1:26 PM
mkrizek raised the priority of this task from "Normal" to "High".Apr 20 2017, 11:24 AM
mkrizek claimed this task.

We need to fix this sooner than later since this will impact dist git tasks that will have reports in html.

It also affects task-modularity-testing-framework, which reports in html.

So I fixed it for html. It's not pretty but it should do for this particular use case, for now. Leaving open until I come up with a proper solution.

Gzipping disabled on dev for the modularity demo next week.