Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
/ notifications-ftp Public archive

Sends letters from GOV.UK Notify to DVLA over FTP

License

Notifications You must be signed in to change notification settings

alphagov/notifications-ftp

Repository files navigation

notifications-ftp

Celery app that sends letters from GOV.UK Notify to DVLA over FTP

Setting Up

Running the app locally is currently broken on some machines, so you can skip all of the following steps. See #367

AWS credentials

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

environment.sh

Create and edit an environment.sh file.

echo "
export NOTIFICATION_QUEUE_PREFIX="YOUR_OWN_PREFIX"
export NOTIFY_ENVIRONMENT="development"
export FTP_HOST="localhost"
export FTP_USERNAME="YOUR_LDAP_USERNAME" # optional (if running the task)
export FTP_PASSWORD="YOUR_LDAP_PASSWORD" # optional (if running the task)
"> environment.sh

Things to change:

  • Replace YOUR_OWN_PREFIX with local_dev_<first name>.
  • Replace YOUR_LDAP_USERNAME with the one you use to sign in to your machine.
  • Replace YOUR_LDAP_PASSWORD with the one you use to sign in to your machine.*

* Storing your LDAP password unencrypted is far from ideal. We would like to improve this in the future.

FTP Server (optional)

This app needs to connect to an FTP server. You can install one locally:

brew install pure-ftpd

brew services start pure-ftpd

Since the SFTP client does something similar to ssh localhost, you also need to enable remote login:

  • Go to "System Preferences > Sharing"
  • Check the "Remote Login" service

pure-ftpd will use your home directory as it's root. The code expects there to be a notify directory there, so you will need to create one (or adjust your FTP server settings to use an alternative root directory):

mkdir ~/notify

To run the application

# install dependencies, etc.
make bootstrap

make run-celery

This is currently broken on some machines. See #367

To test the application

# install dependencies, etc.
make bootstrap

make test

To run a local shell

Although this app includes Flask, it's not possible to run flask shell. Run the following instead:

make shell

Further documentation