Skip to content

Configure git-annex public S3 remote on dataset publication #101

Closed

Description

@neuromechanist

Problem

After a dataset is published, the S3 bucket policy allows public read access (addPublicReadPolicy), and the GitHub repo is made public. However, git-annex is never configured with the public S3 URL. This means consumers who clone a published dataset cannot use git annex get to download data files without AWS credentials.

Current State

  • configureS3Remote() exists in src/lib/git-annex.ts (L433-489) with publicUrl parameter support, but is never called
  • addPublicReadPolicy() in backend/src/services/s3.ts correctly enables s3:GetObject for Principal: "*" on the dataset prefix
  • Publication orchestrator in backend/src/routes/admin.ts has 13 steps but none configure git-annex for public access
  • The gap: S3 is publicly readable, but git-annex doesn't know about the public URL

Expected Behavior

After publication, anyone should be able to:

git clone https://github.com/nemarDatasets/nm000XXX.git
cd nm000XXX
git annex get .   # downloads all data files from public S3 without credentials

Implementation

Add a publication step (after s3_lock, before generate_archive) that configures the git-annex S3 remote with publicurl. Two approaches:

Option A: GitHub Actions workflow step

Add to the generate-archive.yml workflow (or a new workflow) a step that runs:

git annex initremote nemar-s3-public type=S3 \
  bucket=nemar \
  fileprefix=${DATASET_ID}/objects/ \
  public=yes \
  publicurl=https://nemar.s3.us-east-2.amazonaws.com \
  encryption=none
git push origin git-annex

Option B: Direct git-annex branch manipulation via GitHub API

Update the remote.log in the git-annex branch via the GitHub API (no git-annex installation needed, runs on CF Workers).

Considerations

  • Option A is simpler and more reliable (uses git-annex natively)
  • Option B avoids depending on GitHub Actions but requires understanding git-annex internal file formats
  • The configureS3Remote() function in the CLI could be reused if the configuration is done client-side
  • Must ensure fileprefix uses the new objects/ subdirectory layout (PR Reorganize S3 bucket to subdirectory layout #100)

Related

  • PR Reorganize S3 bucket to subdirectory layout #100: Extensible S3 bucket structure (objects/, version/, archives/)
  • src/lib/git-annex.ts:configureS3Remote() - existing but unused function
  • backend/src/services/s3.ts:addPublicReadPolicy() - already handles bucket policy

Activity

  1. added
    enhancement
    on Feb 7, 2026
  2. added 3 commits that reference this issue on Feb 7, 2026
    c957df1
    c5748fa
    9f7f73c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions