Small update to this - I added a proof of concept here (migration + router):
Adding it to the Central container like so:
# Add custom code s3-sync endpoint
# https://forum.getodk.org/t/possibility-of-an-endpoint-to-trigger-pending-uploads-to-s3/54110
COPY s3-sync/20250313-01-s3-sync-permission.js /usr/odk/lib/model/migrations/
COPY s3-sync/s3.js /usr/odk/lib/resources/
# Modify the lib/http/service.js file to include our new router
RUN sed -i "/require('\.\.\/resources\/oidc')(service, endpoint);/a \ \ require('../resources/s3')(service, endpoint);" lib/http/service.js
1 Like
We have been using this code in production for a few months and it works well.
We found a bug upon doing some load testing, in preparation for 500 users submitting in parallel - fixed now.
I made a PR based on the code: https://github.com/getodk/central-backend/pull/1494
If it's useful to anyone please thumbs up! 