orhun / rustypaste

A minimal file upload/pastebin service.
https://blog.orhun.dev/blazingly-fast-file-sharing
MIT License
760 stars 47 forks source link

feat: support `max_upload_dir_size` config #335

Open Narayanbhat166 opened 3 weeks ago

Narayanbhat166 commented 3 weeks ago

Description

This Pull Request adds a feature to limit the uploads if the ./uploads dir is full. The size of ./uploads dir can be set by the config key max_upload_dir_size under the server config.

[server]
max_upload_dir_size = "100G"

Motivation and Context

This is required to restrict the number / size of uploads that can be made to the server when hosted publicly. This fixes #282

How Has This Been Tested?

Changelog Entry

Types of Changes

Checklist: