ARTbio / GalaxyKickStart

Ansible playbooks for Galaxy Server deployment
GNU General Public License v3.0
24 stars 22 forks source link

Fix nginx upload serving with prefix in docker #241

Closed mvdbeek closed 7 years ago

mvdbeek commented 7 years ago

This was reported by @remimarenco on gitter. The problem is that we are are setting the environment variables GALAXY_CONFIG_NGINX_X_ACCEL_REDIRECT_BASE, GALAXY_CONFIG_NGINX_X_ARCHIVE_FILES_BASE, and GALAXY_CONFIG_NGINX_UPLOAD_PATH as a composite of NGINX_GALAXY_LOCATION plus the specific path. In docker we are appending all current (i.e user-specified variables) to /etc/default/supervisor and then we source these variables. The problem is that by default we are setting NGINX_GALAXY_LOCATION="" (i.e no prefix). The following order would be sourced currently:

NGINX_GALAXY_LOCATION=""
GALAXY_CONFIG_NGINX_X_ACCEL_REDIRECT_BASE="$NGINX_GALAXY_LOCATION/_x_accel_redirect"
GALAXY_CONFIG_NGINX_X_ARCHIVE_FILES_BASE="$NGINX_GALAXY_LOCATION/_x_accel_redirect"
NGINX_GALAXY_LOCATION="my-subirectory"

This breaks uploading and downloading files for instances with a proxy prefix, while they appear otherwise functional.

The new approach is to not append the current env vars in the docker startup script, but to set these variables via ansible. Sourcing /etc/default/supervisor before starting supervisor will then load the environment variables into the current session.

drosofff commented 7 years ago

Hi @mvdbeek

Coud you comment on https://travis-ci.org/ARTbio/GalaxyKickStart/builds/232889576#L2475 so that we can move on with this PR ?

Thanks

drosofff commented 7 years ago

👍 Thanks @mvdbeek