scanfile/scanners/capa/config.py

13 lines
511 B
Python

import os
class Config:
# Read values from environment variables or use defaults
FILE_DIRECTORY = os.environ.get("FILE_DIRECTORY", "/mnt/storage/files")
HOST = os.environ.get("HOST", "127.0.0.1")
PORT = int(os.environ.get("PORT", 5000))
DEBUG = os.environ.get("DEBUG", "False").lower() in ("true", "1")
RULES = os.environ.get("RULES", "/usr/local/share/capa-rules/")
# Ensure upload directory exists
if not os.path.exists(Config.FILE_DIRECTORY):
os.makedirs(Config.FILE_DIRECTORY)