mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-18 21:09:41 +02:00
max file size + documentation
This commit is contained in:
parent
678cf77d32
commit
1386e6d5a5
2 changed files with 29 additions and 8 deletions
30
README.md
30
README.md
|
@ -54,13 +54,31 @@ Edit `pandora-box.ini` at the root of the project:
|
|||
|
||||
```ini
|
||||
[DEFAULT]
|
||||
FAKE_SCAN = false
|
||||
USB_AUTO_MOUNT = true
|
||||
PANDORA_ROOT_URL = http://localhost
|
||||
QUARANTINE = true
|
||||
; Curses mode (full text)
|
||||
CURSES = False
|
||||
|
||||
; Set USB_AUTO_MOUNT to True is if the OS automaticaly mount USB keys
|
||||
USB_AUTO_MOUNT = False
|
||||
|
||||
; Set PANDORA_ROOT_URL to the URL of the Pandora server
|
||||
; the default value is "http://127.0.0.1:6100"
|
||||
PANDORA_ROOT_URL = http://127.0.0.1:6100
|
||||
|
||||
; Set FAKE_SCAN to true to fake the scan process (used during developement only)
|
||||
FAKE_SCAN = False
|
||||
|
||||
; Set to true to copy infected files to the quarantine folder
|
||||
; in the USB scanning station
|
||||
QUARANTINE = True
|
||||
|
||||
; Set quarantine folder
|
||||
QUARANTINE_FOLDER = /var/quarantine
|
||||
CURSES = true
|
||||
THREADS = 4
|
||||
|
||||
; Number of threads used by Pandora
|
||||
THREADS = 8
|
||||
|
||||
; Max File Size (1G)
|
||||
MAX_FILE_SIZE = 1080000000
|
||||
```
|
||||
|
||||
### Setup & Usage
|
||||
|
|
|
@ -58,6 +58,7 @@ quarantine_folder = None
|
|||
has_curses = None
|
||||
maxThreads = None
|
||||
boxname = socket.gethostname()
|
||||
maxFileSize = None
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Curses
|
||||
|
@ -100,7 +101,7 @@ class scanThread(threading.Thread):
|
|||
time.sleep(1)
|
||||
|
||||
def scan(self, file):
|
||||
global infected_files, scanned, file_count, f_used
|
||||
global infected_files, scanned, file_count, f_used, maxFileSize
|
||||
logging.info(f'{"Start scan."}')
|
||||
try:
|
||||
# get file information
|
||||
|
@ -120,7 +121,7 @@ class scanThread(threading.Thread):
|
|||
logging.info(f'{"Fake scan - skipped."}')
|
||||
else:
|
||||
# do not scan files bigger than 1G
|
||||
if file_size > (1024 * 1024 * 1024):
|
||||
if file_size > maxFileSize :
|
||||
status = "TOO BIG"
|
||||
logging.info(f'{"File too big."}')
|
||||
else:
|
||||
|
@ -225,6 +226,8 @@ def config():
|
|||
has_curses = config_parser["DEFAULT"]["CURSES"].lower() == "true"
|
||||
# MaxThreads
|
||||
maxThreads = int(config_parser["DEFAULT"]["THREADS"])
|
||||
# MaxFileSize
|
||||
maxFileSize = int(config_parser["DEFAULT"]["MAX_FILE_SIZE"])
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue