Skip to content

Fix wildcard mime type, add storage quota#23

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

Fix wildcard mime type, add storage quota#23
0ceanSlim wants to merge 79 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.

Add a HEAD /upload endpoint that allows a client to query the server if uploading a file
with certain properties will be possible. This avoids the need of the client having to
call PUT /upload to find out if an upload is possible.

Right now there is not much permission logic build so this PR only adds some basic
HTTP header checks to see if the request is valid. Permission logic will come in a
future PR.
sebdeveloper6952 and others added 29 commits October 12, 2024 22:54
Add live instance details.
  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.

2 participants