Skip to content

Serve filesystem-storage attachments from the kpi nginx sidecar - #123

Merged
olive-KTB merged 2 commits into
kobotoolbox:mainfrom
icrc:feature/nginx-protected-media
Oct 12, 2026
Merged

olive-KTB merged 2 commits into
kobotoolbox:mainfrom
icrc:feature/nginx-protected-media

Conversation

@ebr-ICRC

@ebr-ICRC ebr-ICRC commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #115

With filesystem storage, KPI answers attachment downloads with X-Accel-Redirect: /protected/<path relative to KOBOCAT_MEDIA_ROOT> (kobo/apps/openrosa/apps/logger/models/attachment.py). The sidecar had no /protected/ location and could not mount the media volume.

@ScottMillard
ScottMillard requested review from olive-KTB and a balanced review from Copilot October 7, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The feature must use a minor version according to the repository’s documented SemVer policy.

2 open findings
What changed in this PR

Adds filesystem-backed KPI attachment serving through the nginx sidecar.

Changes:

  • Adds configurable protected-media aliasing and sidecar volume mounts.
  • Adds Helm unit tests for default and configured behavior.
  • Updates chart version and changelog.
File Description
values.yaml Defines protected-media and sidecar mount values.
templates/​kpi/​deployment.yaml Mounts configured media volumes in nginx.
files/​kpi/​nginx.conf.tpl Adds the internal /protected/ location.
tests/​kpi_nginx_protected_media_test.yaml Tests nginx configuration and mounts.
tests/​values/​required.yaml Supplies required test values.
Chart.yaml Updates the chart version.
CHANGELOG.md Documents the feature.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread CHANGELOG.md Outdated
@@ -1,3 +1,6 @@
# 7.0.5
Comment thread Chart.yaml Outdated
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 7.0.0
version: 7.0.5
@ebr-ICRC
ebr-ICRC force-pushed the feature/nginx-protected-media branch 2 times, most recently from f087b41 to a4a40e0 Compare October 8, 2026 12:08
olive-KTB
olive-KTB previously approved these changes Oct 8, 2026
@olive-KTB

olive-KTB commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

@ebr-ICRC Please resolve merge conflicts

ebr-ICRC and others added 2 commits October 12, 2026 15:22
With filesystem storage, KPI answers attachment downloads with
X-Accel-Redirect to /protected/..., but the sidecar had no such
location and could not mount the media volume. Add
nginx.extraVolumeMounts and kpi.nginx.protectedMediaPath, which
renders an internal /protected/ location. Defaults render unchanged.

Fixes kobotoolbox#115

Co-Authored-By: Claude <noreply@anthropic.com>
@ebr-ICRC
ebr-ICRC force-pushed the feature/nginx-protected-media branch from fea1465 to 898417b Compare October 12, 2026 13:39
@ebr-ICRC

Copy link
Copy Markdown
Contributor Author

@olive-KTB Conflicts resolved: rebased on main (after #122), chart version is now 7.2.0.

@olive-KTB
olive-KTB merged commit 167c836 into kobotoolbox:main Oct 12, 2026
1 check passed
@ebr-ICRC
ebr-ICRC deleted the feature/nginx-protected-media branch October 13, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nginx sidecar: serve protected media from the filesystem

3 participants