Trickier than it seems.
Let's assume that you've already created an unprivileged user named myapp
. You should never run your Node.js applications as root!
Switch to the myapp
user, and do the following:
from here – https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd
If you are running a Linux distro that uses Systemd, then you may find that your command in /etc/rc.local file would not run on system boot. This guide explains how to enable /etc/rc.local script to run on system startup. If you type the following command in terminal:
sudo systemctl status rc-local
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
function getAgentSign(missionId) { | |
let signs = get(/databases/$(database)/documents/missions/$(missionId)).data.agentSigns; | |
return signs[request.auth.uid] ?? 'Ophiuchus'; | |
} | |
function isAstroSpymaster() { | |
return request.auth.token.role == 'astro-spymaster'; |