Skip to content

Commit 03899e0

Browse files
authored
Fix #1676 - Batch static files should be available without auth for viewing results (#1681)
1 parent 265deff commit 03899e0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docker/webserver/nginx_templates/app.conf.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ server {
230230

231231
# static files served from app
232232
location /static {
233+
# these are unauthenticated as they are used for batch results as well
234+
auth_basic off;
235+
allow all;
236+
233237
# enable cache
234238
proxy_cache ${NGINX_PROXY_CACHE};
235239
# static files don't change often, cache for long
@@ -241,7 +245,6 @@ server {
241245

242246
# pass host for Django's allowed_hosts
243247
proxy_set_header Host $host;
244-
include /etc/nginx/conf.d/basic_auth.include;
245248
proxy_pass http://${IPV4_IP_APP_INTERNAL}:8080;
246249
}
247250

integration_tests/batch/test_batch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ def test_batch_request(unique_id, register_test_user, test_domain):
126126
assert response.status_code == 200, "test results should be publicly accessible without authentication"
127127

128128

129+
def test_batch_static_requires_no_auth():
130+
"""Static files should be available without authentication for viewing batch results."""
131+
response = requests.get(f"https://{APP_DOMAIN}/static/js/menu-min.js", json={}, verify=False)
132+
assert response.status_code == 200
133+
134+
129135
def test_cron_delete_batch_results(trigger_cron, docker_compose_exec):
130136
"""Test if batch results are compressed and deleted."""
131137

0 commit comments

Comments
 (0)