diff options
| author | Mia Herkt <mia@0x0.st> | 2024-08-14 08:09:09 +0200 |
|---|---|---|
| committer | Mia Herkt <mia@0x0.st> | 2024-09-27 18:30:28 +0200 |
| commit | 45a414c5ee004fbb4e6d7563be8e65cf2be84f37 (patch) | |
| tree | 606995abeafce241fd1479eec21e19b4a36d9dc3 /instance | |
| parent | 6393538333338f695e30cce98a82836b04d2658a (diff) | |
Implement request filters
This moves preexisting blacklists to the database, and adds the
following filter types:
* IP address
* IP network
* MIME type
* User agent
In addition, IP address handling is now done with the ipaddress
module.
Diffstat (limited to 'instance')
| -rw-r--r-- | instance/config.example.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/instance/config.example.py b/instance/config.example.py index 7acfe3b..831498e 100644 --- a/instance/config.example.py +++ b/instance/config.example.py @@ -139,30 +139,6 @@ FHOST_EXT_OVERRIDE = { "text/x-diff" : ".diff", } - -# Control which files aren't allowed to be uploaded -# -# Certain kinds of files are never accepted. If the file claims to be one of -# these types of files, or if we look at the contents of the file and it looks -# like one of these filetypes, then we reject the file outright with a 415 -# UNSUPPORTED MEDIA EXCEPTION -FHOST_MIME_BLACKLIST = [ - "application/x-dosexec", - "application/java-archive", - "application/java-vm" -] - - -# A list of IP addresses which are blacklisted from uploading files -# -# Can be set to the path of a file with an IP address on each line. The file -# can also include comment lines using a pound sign (#). Paths are resolved -# relative to the instance/ directory. -# -# If this is set to None, then no IP blacklist will be consulted. -FHOST_UPLOAD_BLACKLIST = None - - # Enables support for detecting NSFW images # # Consult README.md for additional dependencies before setting to True |
