Skip to content

Fix wildcard mime type, add storage quota#23

Open
0ceanSlim wants to merge 3 commits intosebdeveloper6952:masterfrom
0ceanSlim:master
Open

Fix wildcard mime type, add storage quota#23
0ceanSlim wants to merge 3 commits intosebdeveloper6952:masterfrom
0ceanSlim:master

Conversation

@0ceanSlim
Copy link

I had issues setting a wildcard mime type, so I fixed that. Then I added a storage quota setting to cap the storage per allowed pubkey.

  type wildcard handling

  Features:
  - Add configurable storage quota per pubkey (default 10GB)
  - New config option: max_storage_per_pubkey_bytes
  - Set to 0 or negative to disable quota (unlimited storage)
  - Add SQL query GetTotalStorageByPubkey to calculate current usage
  - Storage quota validation before upload with clear error message

  Fixes:
  - Fix wildcard mime type handling when "*" is configured
  - Previously failed with "mime type not allowed" due to charset mismatch
  - Now properly allows all mime types when wildcard is set
  - Fix YAML syntax in config files (quote wildcard "*")

  Technical changes:
  - Add ValidateStorageQuota method to BlobStorage interface
  - Add ErrStorageQuotaExceeded error type
  - Update blob service to track and enforce storage limits
  - Add allowAll flag to mime type service for wildcard handling
  - Update config struct with MaxStoragePerPubkeyBytes field

  Config updates:
  - Update config.yml with new storage quota option
  - Update config.example.yml with documentation and fixed syntax
  and fix mime type wildcard handling

  Features:
  - Add configurable storage quota per pubkey (default 10GB)
  - New config option: max_storage_per_pubkey_bytes
  - Set to 0 or negative to disable quota (unlimited storage)
  - Add SQL query GetTotalStorageByPubkey to calculate current usage
  - Storage quota validation before upload with clear error message

  Fixes:
  - Fix wildcard mime type handling when "*" is configured
  - Previously failed with "mime type not allowed" due to charset mismatch
  - Now properly allows all mime types when wildcard is set
  - Fix YAML syntax in config files (quote wildcard "*")

  Technical changes:
  - Add ValidateStorageQuota method to BlobStorage interface
  - Add ErrStorageQuotaExceeded error type
  - Update blob service to track and enforce storage limits
  - Add allowAll flag to mime type service for wildcard handling
  - Update config struct with MaxStoragePerPubkeyBytes field

  Config updates:
  - Update config.yml with new storage quota option
  - Update config.example.yml with documentation and fixed syntax
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.

1 participant