Coder Social home page Coder Social logo

zipitn / resin-safebox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balena-io-experimental/resin-safebox

1.0 0.0 0.0 467 KB

An electronic safe-deposit box with 2FA, using resin.io and Authy.

Shell 0.07% JavaScript 94.69% CSS 3.30% HTML 1.94%

resin-safebox's Introduction

resin-safebox

An electronic safe-deposit box with 2FA, using resin.io and Twilio's Authy.

This demo shows how to bring 2-factor authentication to the physical world using a Raspberry Pi. The software consists on a node.js server running on the Pi; we use resin's port forwarding to expose it to the web. The usage is simple: a user logs in using email and a numeric code, and in this way closes the lock. To open it, the user must input the code and a token sent by Authy via SMS (or using the Authy mobile app).

The lock itself is a solenoid, connected with a driver circuit to one of the Pi's GPIOs.

Deployment using resin.io

You'll need an account and an application created on Authy.

First, create an account at resin.io and create an application. For more information on these steps check out resin's Getting Started guide (if you're using a Pi 2, as we did, the guide is here.

Once you've created the app and have the Pi running with resin's OS, all you have to do is add the resin remote to this repository and:

git push resin master

This will push the repo and build a Docker image using the project's Dockerfile. Your device will automatically download and run the code.

On the resin.io Dashboard, go to the application's Environment Variables tab and set the following environment variables:

AUTHY_API_KEY = (your Authy API key from [http://authy.com])
IS_PI = true
GPIO = 17 (or whichever GPIO you prefer for the solenoid)

Hardware

We built the solenoid driver using a 2n2222 transistor, a few resistors, and a diode, all on a small protoboard. It's this little arachnid:

Circuit on protoboard

The schematic looks like this:

Circuit schematic

The solenoid itself is a 5V model like this one. You could of course use another one, but you might have to adapt the driver circuit or even use a separate power source.

Trying the UI on a PC

You can run this on your PC as any node.js program. Just install it using:

npm install

And run it with:

AUTHY_API_KEY=your-authy-api-key node index.js

resin-safebox's People

Contributors

pcarranzav avatar james2710 avatar page- avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.