项目作者: alphagov

项目描述 :
GOV.UK Notify Anti-Virus application
高级语言: Python
项目地址: git://github.com/alphagov/notifications-antivirus.git
创建时间: 2018-03-06T10:37:41Z
项目社区:https://github.com/alphagov/notifications-antivirus

开源协议:

下载


notifications-antivirus

Reads jobs from a queue, using the supplied filename to fetch files from an S3 bucket, and ClamAV to scan them. Sends the scan status back by creating a new job to update the notification status.

Setting up

Docker container

This app uses dependencies that are difficult to install locally. In order to make local development easy, we run app commands through a Docker container. Run the following to set this up:

  1. make bootstrap-with-docker

Because the container caches things like Python packages, you will need to run this again if you change things like “requirements.txt”.

AWS credentials

To run the app you will need appropriate AWS credentials. See the Wiki for more details.

environment.sh

In the root directory of the application, run:

  1. echo "
  2. export NOTIFICATION_QUEUE_PREFIX='YOUR_OWN_PREFIX'
  3. "> environment.sh

Things to change:

  • Replace YOUROWN_PREFIX with local_dev\ (to match other apps).

To run the application

  1. # install dependencies, etc.
  2. make bootstrap
  3. # run the web app
  4. make run-flask-with-docker
  5. # run the background tasks
  6. make run-celery-with-docker

To test the application

  1. # install dependencies, etc.
  2. make bootstrap
  3. make test-with-docker

If you need to run a specific command, such as a single test, you can use the run_with_docker.sh script. This is what test and other make rules use.

  1. ./scripts/run_with_docker.sh pytest tests/some_specific_test.py

Further documentation