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
|
```ini
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
FAKE_SCAN = false
|
; Curses mode (full text)
|
||||||
USB_AUTO_MOUNT = true
|
CURSES = False
|
||||||
PANDORA_ROOT_URL = http://localhost
|
|
||||||
QUARANTINE = true
|
; 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
|
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
|
### Setup & Usage
|
||||||
|
|
|
@ -58,6 +58,7 @@ quarantine_folder = None
|
||||||
has_curses = None
|
has_curses = None
|
||||||
maxThreads = None
|
maxThreads = None
|
||||||
boxname = socket.gethostname()
|
boxname = socket.gethostname()
|
||||||
|
maxFileSize = None
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Curses
|
# Curses
|
||||||
|
@ -100,7 +101,7 @@ class scanThread(threading.Thread):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
def scan(self, file):
|
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."}')
|
logging.info(f'{"Start scan."}')
|
||||||
try:
|
try:
|
||||||
# get file information
|
# get file information
|
||||||
|
@ -120,7 +121,7 @@ class scanThread(threading.Thread):
|
||||||
logging.info(f'{"Fake scan - skipped."}')
|
logging.info(f'{"Fake scan - skipped."}')
|
||||||
else:
|
else:
|
||||||
# do not scan files bigger than 1G
|
# do not scan files bigger than 1G
|
||||||
if file_size > (1024 * 1024 * 1024):
|
if file_size > maxFileSize :
|
||||||
status = "TOO BIG"
|
status = "TOO BIG"
|
||||||
logging.info(f'{"File too big."}')
|
logging.info(f'{"File too big."}')
|
||||||
else:
|
else:
|
||||||
|
@ -225,6 +226,8 @@ def config():
|
||||||
has_curses = config_parser["DEFAULT"]["CURSES"].lower() == "true"
|
has_curses = config_parser["DEFAULT"]["CURSES"].lower() == "true"
|
||||||
# MaxThreads
|
# MaxThreads
|
||||||
maxThreads = int(config_parser["DEFAULT"]["THREADS"])
|
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