Skip to content

opavlyuk/quarantine

Repository files navigation

quarantine

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.

Usage

Dockerized usage (Recommended)

  1. Install docker (https://docs.docker.com/install/).
  2. git clone git@github.com:opavlyuk/quarantine.git && cd quarantine
  3. Make sure, to set all volumes in docker-compose.yml (howto).
  4. docker-compose build
  5. docker-compose up

Usage without docker

  1. git clone git@github.com:opavlyuk/quarantine.git && cd quarantine.
  2. Install and run redis or use docker docker run -d -p 6379:6379 redis.
  3. Configure config.yml.
  4. Make sure, that all catalogues, configured in config.yml exist in your system and have proper permissions.
  5. Create and activate virtual environment with python3.7, e.g. python -m venv venv && source venv/bin/activate.
  6. Install requirement pip install -r requirements.txt
  7. 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
  8. Run monitoring script python src/watcher.py
  9. To stop celery celery -A src.celery_app.application control shutdown

TODO

  1. Improve README
  2. Set uid and gid for celery worker
  3. Investigate the best approach to save and report callback results
  4. Improve celery workers configuration

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published