Skip to content

Adds support for local minio#298

Merged
andersweinstein merged 1 commit intomasterfrom
support-local-minio
Mar 30, 2026
Merged

Adds support for local minio#298
andersweinstein merged 1 commit intomasterfrom
support-local-minio

Conversation

@rgachuhi
Copy link
Copy Markdown
Contributor

Summary

This PR adds local MinIO support to course-digest so media uploads can target a local S3-compatible store
during development.

What changed

  • Added a --localMinio CLI option for upload flows.
  • Added MinIO-specific environment handling for local development:
    • MINIO_ROOT_USER
    • MINIO_ROOT_PASSWORD
    • MINIO_BUCKET_NAME
    • MINIO_ENDPOINT
    • MINIO_MEDIA_URL_PREFIX
  • Updated local MinIO mode to use MinIO-specific variables instead of falling back to AWS credentials.
  • Added default local media URL prefix derivation when --localMinio is enabled and MINIO_MEDIA_URL_PREFIX
    is not set.
  • Added support for stripping bucket-prefixed local MinIO URLs when deriving object keys for upload.
  • Added .env.example entries documenting the new MinIO configuration.
  • Updated the README with local MinIO setup and usage instructions.

Implementation details

  • src/index.ts

    • added --localMinio
    • added helpers to derive the local MinIO bucket name and media URL prefix from env
    • routed upload actions through MinIO-aware config when the flag is enabled
  • src/utils/upload.ts

    • added MinIO-aware upload config resolution
    • configured path-style S3 access for MinIO
    • ensured local MinIO uploads use MinIO env vars only
    • normalized object key extraction for local bucket-prefixed URLs
  • .env.example

    • added MinIO example variables for local development
  • README.md

    • documented .env-based local MinIO setup and usage

Tests

Added coverage for:

  • local MinIO URL key extraction
  • MinIO default config resolution
  • MinIO upload client configuration
  • local media URL prefix derivation from env
  • ensuring local MinIO mode ignores AWS credentials

@andersweinstein andersweinstein merged commit a1ea0a4 into master Mar 30, 2026
2 checks passed
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.

2 participants