npm install
npm start
This starts mocked services on these ports
- 44444 - User Datastore
- 44445 - User Filestore
- 44446 - Submitter
You can now run the runner or editor with a command like so
cd /path/to/runner-or-editor
SERVICE_SLUG=slug \
SERVICE_SECRET=secret \
SERVICE_TOKEN=token \
USER_DATASTORE_URL=http://localhost:44444 \
USER_FILESTORE_URL=http://localhost:44445 \
USER_FILESTORE_URL=http://localhost:44446 \
SERVICE_PATH=/path/to/form \
npm start
If you have a .env
file, it will be loaded automatically if you specify the MOCKENV
environment varibale
MOCKENV=yes npm start
USER_DATASTORE=4001 \
USER_FILESTORE=4002 \
SUBMITTER=4003 \
npm start
MAIL='Form Builder <form-builder-messages@digital.justice.gov.uk' npm start
If you're using your digital.justice.gov.uk
account to send from, you need to use an app password
sudo vi /etc/postfix/main.cf
Add the following:
### Additions
relayhost=smtp.gmail.com:587
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_use_tls=yes
smtp_tls_security_level=encrypt
smtp_sasl_security_options = noanonymous
smtp_always_send_ehlo = yes
smtp_sasl_mechanism_filter = plain
sudo vi /etc/postfix/sasl_passwd
Add the follwing
smtp.gmail.com:587 your_email@digital.justice.gov.uk:your_password
Create the Postfix lookup table from the sasl_passwd file
sudo postmap /etc/postfix/sasl_passwd
If postfix is not running
sudo postfix start
otherwise
sudo postfix reload
Create a trial account at Twilio
Create a number to send from and find your Account Sid and Auth Token in the console
ACCOUNTSID='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
AUTHTOKEN='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
MOBILE='+447777123456' \
npm start