Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add minio support #4

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions conf/nginx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,30 @@ http {
}
# tpl__use_bento_public__end

# -- Fallback 404 to avoid returning web HTML when an API request is made
location /api/ {
return 404;
}

# tpl__use_minio__start
# -- Minio
location /api/minio { return 302 https://${BENTOV2_DOMAIN}/api/minio/; }
location /api/minio/ {
# Reverse proxy settings
include /gateway/conf/proxy.conf;
include /gateway/conf/proxy_minio.conf;

# Pass rewritten request to Minio
rewrite ^ $request_uri;
rewrite ^/api/minio/(.*) /$1 break;
return 400;
proxy_pass http://${BENTO_MINIO_CONTAINER_NAME}:${BENTO_MINIO_INTERNAL_PORT}$uri;

# Log errors
error_log /var/log/bento_minio_errors.log;
}
# tpl__use_minio__end

# Include all public service location blocks (mounted into the container)
include bento_public_services/*.conf;

Expand Down
6 changes: 6 additions & 0 deletions conf/proxy_minio.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
client_body_timeout 660s;
proxy_read_timeout 660s;
proxy_send_timeout 660s;
send_timeout 660s;

client_max_body_size 4000m;
8 changes: 8 additions & 0 deletions entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ else
'/tpl__use_bento_public__start/,/tpl__use_bento_public__end/d' \
./nginx.conf.pre
fi
if [[ "$(true_values_to_1 $BENTO_MINIO_ENABLED)" == 1 ]]; then
echo "[bento_gateway] [entrypoint] Fine-tuning nginx.conf to use Minio"
else
echo "[bento_gateway] [entrypoint] Fine-tuning nginx.conf to disable Minio"
sed -i.bak \
'/tpl__use_minio__start/,/tpl__use_minio__end/d' \
./nginx.conf.pre
fi
if [[ "$(true_values_to_1 $BENTO_CBIOPORTAL_ENABLED)" == 1 ]]; then
echo "[bento_gateway] [entrypoint] Fine-tuning nginx.conf to use cBioPortal"
else
Expand Down