13.push
OPTIONAL
Push notification service
-
Install dependencies
shell cd /opt/rbt/server/services/push npm install -
Make file environment ".env" and edit vars
shell cp .env_example .env -
Put your FCM and APN files into "assets" folder
assets/pushServiceAccountKey.json
assets/certificate-and-privatekey.pem
pushServiceAccountKey.json - data from Firebase Cloud Messaging (FCM)
certificate-and-privatekey.pem - certificate for Apple's VoIP APN
shell
openssl pkcs12 -in <YOUR-VOIP-CERTIFICATE>.p12 -out assets/certificate-and-privatekey.pem -nodes -legacy
-
Add user and group:
shell groupadd rbt useradd -g rbt -s /bin/true -d /dev/null rbt -
Make logging dir:
shell mkdir -p /var/log/rbt_push_service/ chown -R rbt:rbt /var/log/rbt_push_service/ -
Make logrotate:
shell echo '/var/log/rbt_push_service/*.log { daily missingok rotate 7 compress notifempty copytruncate dateext dateformat -%Y-%m-%d }' | tee /etc/logrotate.d/rbt_pushRestart service
shell systemctl restart logrotate -
Make service:
shell ln -sf /opt/rbt/server/services/push/push.service /usr/lib/systemd/system/push@.service -
Enable and start service
shell systemctl enable push@0.service --now