This is the Check service which is part of the Conclave Document Upload Services
- Client: used for basic token authentication. For each application that can post to this service, a Client object needs to be created
- Document: used to store the state of the file and to be used to retrieve the file once threat scanning succeeds
- UncheckedDocument: used to store the file initially, until the threat scanning is run. This is also the object that gets passed through to the Checker service to run threat scanning
This is a Ruby on Rails application that takes a unchecked_document_id and runs threat scanning on the attached document_file. It's only presented as an internal API and doesn't face public users.
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install rbenv
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 3.3.3
rbenv global 3.3.3
gem install rails -v X.X.X
Go to https://www.postgresql.org/ and download the installer
brew install redis
rake db:create && rake db:migrate
Setup instructions can be found here: https://www.clamav.net/documents/installing-clamav
To run clamd:
/usr/local/sbin/clamd --foreground=yes
From your console run redis-server, sidekiq and the rails server:
redis-server
bundle exec sidekiq -C config/sidekiq.yml
bundle exec sidekiq -C config/sidekiq-small-files.yml
rails s
You can now use the service by sending a PUT request to: localhost:3000/documents/:id
To run the specs, from your console do:
rspec spec