The consumer make a polling on the potential-infected-notification queue and send notification to the devices. Make sure the machine have access to the AWS queue
- Python 3
- Pip 3
- Boto3
- requests
- hyper
Download repository (we will put it on ~/consumer-notifications folder)
Edit following constants in /config.py file:
KEY_FCM = "XXXXXXX"
SQS_QUE_URL_NOTIFICATIONS = "XXXXXXX"
Get the current user, type # whoami
Open consumer-notifications.service and edit the user value with the name of the current user.
In order to set consumer-notifications.service as systemctl service, create a symlink of our service
sudo ln -s ~/consumer-notifications/consumer-notifications.service /etc/systemd/system/consumer-notifications.serviceGo in the system directory
cd /etc/systemd/system/Start the service:
systemctl start consumer-notifications.serviceAnd automatically get it to start at boot:
systemctl enable ~/consumer-notifications/consumer-notifications.serviceTo test the system, simply type:
systemctl status consumer-notifications.serviceThe output should be something like:
consumer-notifications.service - Consumer Notifications.
Loaded: loaded
Active: active (running)