- Turn a Raspberry PI into a camera
- Create a web service, that takes a photo, puts it in a S3 object storage and saves metadata in Elasticsearch
- Create a containerised web app, that shows available cameras and can call your web service
Software in this repo includes two services:
-
camera-webservice: Web service that exposes a RESTful API to use a local webcam to take a photo, upload it to an S3 target, and posts metadata to ElasticSearch. The service is written in Python and configured using a json formatted conf file. This service can be deployed on a raspberry pi or your laptop.
-
webapp: Web app that queries ElasticSearch for available cameras and existing photos and displays them. Also allows taking new photos by calling the RESTful API of the camera-webservice. This app is written in Ruby and includes a Dockerfile for containerized use.
- Domain name for raspberry access: See whiteboard (use ssh)
- User: pi
- Passwd: letMe!n
- Domain name for S3 access: See whiteboard
- Access Key ID: OVM1VCC08WJ79OYJP2ET
- Secret Access Key: cbcBxPBJPDp/o14hewnvtEgu0LSUPxho+iUiQgTD
- Access Key ID: 25Q9R91DFY5SCBWSFMM7
- Secret Access Key: C9B19B++T/oFpsbBIVniVeMTy6XmVPXFf4lFA1Di
- Access Key ID: UGZWGFLJV5KEWH85DZPC
- Secret Access Key: xH3TgDBTpP9UKmP5i4wSPnDF71LpPVylVrDQZWol
- Access Key ID: 255S3GEQKOXYY8SIZJFU
- Secret Access Key: UM7rgzUaCJyo4+hvpUXARtNeFDWF4RE3fBusKcGR
- Access Key ID: H424JOIIRN71V06ZRSN4
- Secret Access Key: q2GGMAzeA/sgknPgtjqyC7aDyB3Sb+CpJljtuopW
- Google and YouTube are your best friends. If you have a question, are getting an error message, or need to learn something, then google first
- If you then get stuck, ask your teammates
- If you are still stuck, ask Stefan for help
As with any tech challenge proceed in steps and verify all is well (including your knowledge) before continuing.
- Build your Raspberry Pi and access it via SSH. What linux does it run? Is your internet access working? Use
curl
to readhttp://www.google.com
- Setup your S3 bucket on the StorageGrid Webscale system (see credentials on whiteboard):
- Install a S3 browser tool like "S3 browser" for Windows or "CyberDuck" for Mac
- Create a bucket for your Pi using the credentials supplied; pick a bucket name that is unique for your team
- Use your S3 client to put stuff in the bucket and get it out
- Try to access the stuff in the bucket from your web browser. What URL would you use? Do you get access denied? Then set the bucket_policy.json to allow anonymous
read
andlist
anonymous access to objects and try again. - Note: CyberDuck won't allow you to set Bucket Policies, so you will have to do this another way. Ask Stefan if you can't google it :-) (Hint: s3cmd or aws cli)
- Find the steps here: camera-webservice/
- Find the steps here: webapp/
Can you take photos from your camera using the webapp and see the results? Yes, Success!
The repository has a file called OtherHackerIdeas.md. Attack one of those idea or come up with your own.