quarantine
is a tool for tracking file writes and executing callbacks.
Requires GNU\Linux or FreeBSD. Depends on inotify. Python 3.7 required.
It tracks write to file in catalogue, set in config.yml
and run callback, specified in quarantine/src/celery_app/tasks.py:check_code
.
By default, writes captured filename to log, specified config.yml
.
- Install
docker
(https://docs.docker.com/install/). git clone [email protected]:opavlyuk/quarantine.git && cd quarantine
- Make sure, to set all volumes in
docker-compose.yml
(howto). docker-compose build
docker-compose up
git clone [email protected]:opavlyuk/quarantine.git && cd quarantine
.- Install and run redis or use docker
docker run -d -p 6379:6379 redis
. - Configure
config.yml
. - Make sure, that all catalogues, configured in
config.yml
exist in your system and have proper permissions. - Create and activate virtual environment with python3.7, e.g.
python -m venv venv && source venv/bin/activate
. - Install requirement
pip install -r requirements.txt
- Run celery worker
celery worker -A src.celery_app.application -l DEBUG --time-limit=3 --max-memory-per-child=30000 --logfile="/var/log/quarantine/%n%I.log" -D
- Run monitoring script
python src/watcher.py
- To stop celery
celery -A src.celery_app.application control shutdown
- Improve README
- Set uid and gid for celery worker
- Investigate the best approach to save and report callback results
- Improve celery workers configuration