DoorJam is the meatspace firewall for sudo room
sudo aptitude install build-essential libusb-1.0-0-dev libnfc-bin
npm install
Users swipe their access card in a Magtek USB magnetic swipe card reader and if the hash of their card data matches a hash in the access control file then a character is sent over serial to an arduino that then closes a relay for a number of seconds to open the door.
If the card is not recognized then its hash is logged in the failed_attempts file with the date and time of the attempt.
Swipe a new card and run the grant_access_to_last_failed_attempt.js script to grant people access.
sudo cp doorjam.initd.with-forever /etc/init.d/doorjam
sudo update-rc.d doorjam defaults
Now edit the /etc/init.d/doorjam file to ensure all paths are correct.
sudo cp doorjam.initd.no-forever /etc/init.d/doorjam
sudo update-rc.d doorjam defaults
Now edit the /etc/init.d/doorjam file to ensure all paths are correct.
Change the IP, path and :
ssh root@192.168.1.2 "cd /root/doorjam; ./grant_access_to_last_attempt.js <name and contact info of new user>"
You can also use the sudo_grant_access.sh script, but you should edit it to suit your environment.
GPLv3+
Copyright 2014 Marc Juul
If the program is killed (or dies) then the program will stall on next startup until an rfid chip is scanned. This is because of this problem: camme/node-nfc#9