Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Apr 20, 2015
0 parents commit 0bf2e11
Show file tree
Hide file tree
Showing 125 changed files with 3,757 additions and 0 deletions.
34 changes: 34 additions & 0 deletions 1.0.0/1_getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Getting started

* [What is Kerberos.io](#what-is-kerberos-io)
* [How does it work](#how-does-it-work)
* [Installation](#installation)
* [Contribute](#contribute)

## Let's get started

In the video below you get a quick overview of how Kerberos works and how you can configure it. The video isn't technical but explains the different features Kerberos offers you.

<iframe src="https://player.vimeo.com/video/121532472?autoplay=0&color=943633" style="width:100%; height: 400px;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

<a name="what-is-kerberos-io"></a>
## What's Kerberos.io?

Kerberos is a low-budget surveillance solution created for the **Rapsberry Pi**. Kerberos is open source, so you and others, can customize the source code to your needs and share it. It has a *low-energy* footprint when deploying on the Raspberry Pi and it's *easy to install*, you only need to transfer the image to your SD card and you're done.

Use your mobile phone, tablet or PC to keep an eye on your property. View the activity with our *responsive* and *user-friendly* web interface. Look at the dashboard to get a graphical overview of the past days. *Multiple* Kerberos *instances* can be installed and can be viewed with [only one web interface](/1.0.0/addons/Cloud).

<a name="how-does-it-work"></a>
## How does it work?

Kerberos is devided into two parts: the **machinery** (Back end, C++) and the **webinterface** (Front end, PHP). The machinery is responsible for the image processing and the webinterface is used to configure the machinery and to view the events that were detected by the machinery. Both parts are installed on the device, in most cases the Raspberry Pi. The machinery can trigger multiple output devices when an event occurred; it can trigger a GPIO pin, save an image to disk or send a TCP packet.

<a name="installation"></a>
## Installation

Kerberos is **easy to install**, you just have to copy the kerberos image to your SD card, plug it into your Raspberry Pi and that's it. Kerberos can be installed on other devices than the Raspberry Pi; for development or production. Therefore you will need to compile the machinery yourself and install the webinterface with your favorite webserver; nginx, apache, etc.

<a name="contribute"></a>
## Contribute

Want to contribute? You're a front end designer, user experience guru, an ambitious programmer, or a Ph.D. in Computer Vision who wants to take kerberos.io to the next level? Then we like to welcome you to the community. Contributions are taken very seriously, besides your code, testing and documentation are very important!
Binary file added 1.0.0/2_edimax-wifi-dongle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/2_micro-usb-5V-charger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/2_raspberry-camera-module.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/2_raspberry-pi-a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions 1.0.0/2_requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Requirements

* [Which hardware do I need?](#which-hardware-do-i-need)

<a name="which-hardware-do-i-need"></a>
## Which hardware do I need?

Kerberos.io is created for the **Rapsberry Pi**. So it is obvious you will need a Raspberry Pi before you can start using Kerberos. However you can also use Kerberos.io on your local environment, but of course that is not the main goal of Kerberos.
You can select which Raspberry Pi model you need: **Raspberry Pi Model A, A+, B, B+ or Raspberry Pi 2**.

![Raspberry Pi Model A](2_raspberry-pi-a.png)

You need a **4GB or bigger SD card**, on which you will have to deploy the Kerberos.io image; look at the installation page for more information about the deployment.

![4GB SD card](2_sandisk_4gb_sd_card.png)

A **micro USB 5V** charger.

![Micro USB 5V charger](2_micro-usb-5V-charger.png)

A **USB camera** or the **Raspberry Pi camera** module.

![Raspberry Pi Camera Module](2_raspberry-camera-module.png)

*(Optional)* We can use a **WIFI dongle** instead of an ethernet cable, but this is not required. We recommend the **Edimax** ew-7811un WIFI dongle.

![Edimax WIFI dongle](2_edimax-wifi-dongle.png)

*(Optional)* The **Scorpi B+**, a flexible Mount for the Raspberry Pi Camera Board.
Binary file added 1.0.0/2_sandisk_4gb_sd_card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/2_scorpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions 1.0.0/3_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Installation

* [Install from image](#install-from-image)
* [Download the image](#download-the-image)
* [Insert your SD card](#insert-your-sd-card)
* [OSX: transfer image](#osx-transfer-image)
* [Windows: transfer image](#windows-transfer-image)
* [OSX/Linux: transfer image with terminal](#transfer-image-with-terminal)
* [(Optional) Setup WIFI connection](#setup-wifi-connection)
* [Install from source](#install-from-source)

Kerberos is **easy to install**, you just have to copy the Kerberos image to your SD card, plug the SD card into your Raspberry Pi and that's it. It can also be installed on other devices than the Raspberry Pi; for development or production. Therefore you will need to compile the machinery from source and install the webinterface with your favorite webserver.

<a name="install-from-image"></a>
## Install from image

If you want to use Kerberos.io **as a service**, this would be the preferred way. Kerberos is provided as an image, a pre-installed operating system. The only thing you have to do to make things work, is to transfer the image to your SD card. After transferring you can just plug the SD card into your Raspberry Pi and kerberos will work; isn't that great!


The're a lot of different ways to accomplish this, and they are different according the operating system you will be using to transfer the image.

<a name="download-the-image"></a>
### 1. Download the image

First you will need to download the Kerberos image; click on the image below. The Kerberos.io image contains a Linux operating system, built on Arch Linux. The image has the machinery and webinterface installed, and ofcourse all the dependencies Kerberos needs. With this image you just have to plugin the SD card in your Raspberry Pi and you're done.

#### Raspberry Pi Model A, A+, B and B+

The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video.

![Kerberos.io image](3_kerberos-image.png)

#### Raspberry Pi Model 2

The Raspberry Pi 2 is the successor to the Raspberry Pi. It builds upon the original model B+ upgrading to 1 GB of RAM, and replacing the aged ARMv6l single-core with an ARMv7l Cortex-A7 quad-core.

![Kerberos.io image](3_kerberos-image.png)

<a name="insert-your-sd-card"></a>
### 2. Insert your SD Card

Ensure that you have inserted the SD card, that you wish to clone, into the SD card reader. If your PC/Mac does'nt have an internal SD card reader, you will need to plug in an external SD card reader via a USB socket.

<a name="osx-transfer-image"></a>
### 3. OSX: transfer image

* Download the .dmg file (RPi-sd card builder v1.2)

[![RPi logo](3_rpi-logo-cloner.png)](https://mega.co.nz/#!PZc2HTTQ!eD9dtFpoKnbZqP1hkvrv43_Pvc9xadMVxRP2K-M8n88)

* Run the app
* Select the operating system distributions (.img file)
* You will prompt with this. After you connect your SD card press continue.
* Now you have to select your SD card.
* Now the program will need administrator privileges. insert your password
* Confirm that your SD card has been unmounted.

<a name="windows-transfer-image"></a>
### 3. Windows: transfer image

* Download and install the [Win32DiskImager](http://sourceforge.net/projects/win32diskimager/files/latest/download).
* Select the image file you've downloaded earlier and the drive letter of the SD card.

<a name="transfer-image-with-terminal"></a>
### 3. OSX/Linux: transfer image with terminal

#### Locate Your SD Card

Open Terminal and enter the following command to locate your SD Card:

diskutil list

Look for your SD card; you can look at the size of the disk. In most cases you will be using a 4GB or bigger SD card.

#### Unmount SD card

We located our SD card at the /dev/disk3 drive; please note that this can be another disk drive, see previous step. In Terminal, enter the following command:

diskutil unmountDisk /dev/disk3

#### Format SD card

To format the SD card, enter the following command:

sudo newfs_msdos -F 16 /dev/disk3

#### Transfer image to your SD card

In Terminal, enter the following command ensuring that you identify the correct destination disc.

sudo dd if=~/Desktop/kerberos-io.img of=/dev/disk3

<a name="setup-wifi-connection"></a>
### 4. (Optional) Setup WIFI connection

If you will be using Kerberos.io with a WIFI dongle, then check out the [F.A.Q. page](/1.0.0/FAQ#setup-wifi).

<a name="install-from-source"></a>
## Install from source

This will be the procedure if you want to contribute to Kerberos or if you want to use Kerberos on your local machine. To install Kerberos from source; you will need to [compile the machinery](/1.0.0/machinery/installation) from source and [import the webinterface](/1.0.0/web/installation) into your favorite webserver.
Binary file added 1.0.0/3_kerberos-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/3_rpi-logo-cloner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.0.0/40_web/1_how-to-access.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions 1.0.0/40_web/1_introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Introduction

* [The web interface](#the-web-interface)
* [How does it work](#how-does-it-work)
* [Installation](#installation)
* [How to access](#how-to-access)

<a name="the-web-interface"></a>
## The web interface

Kerberos.web, the webinterface, allows you to configure the machinery and to view events that were detected by the machinery. You can use your mobile phone, tablet or desktop to view the images with the *responsive* and *intuitive* web interface.

<a name="how-does-it-work"></a>
## How does it work?

The webinterface is written in PHP using the extremely popular PHP Framework **Laravel**. It visualizes images, taken by the machinery, in a intuitive and responsive way. Besides a server-side framework, it also uses a client-side framework **Backbone** to create the dynamic behaviour. The webinterface includes the latest development tools, to increase development efficiency: RequireJS, bower, LESS, etc.

Besides visualization, the webinterface is also used to configure the machinery. On the settings page a user can select different options, for example a user could select a region where motion should be detected or could select a time range when motion could be detected, which algorithm is used, etc.

The webinterface can also be used to configure Kerberos with our [**cloud application**](/1.0.0/addons/Cloud). The setup is very easy, you only need to create an account on our cloud application, request a key, and enter it in every webinterface you want to have synced.

<a name="installation"></a>
## Installation

If Kerberos is installed from the image, the webinterface will be pre-installed and nothing is left to do. If you want to install the webinterface from source, you will need to create a new webapplication on your webbrowser and transfer the webproject.

<a name="how-to-access"></a>
## How to access

You can access the webinterface by entering the ip address of the Raspberry Pi in your favorite browser. When the webapplication is loaded you will see a login page, on which you will need to enter your credentials. The default username and password is **root**. You are able to change this password by editing the **app/config/app.php** file.

![Login page kerberos.io webinterface](1_how-to-access.png)
106 changes: 106 additions & 0 deletions 1.0.0/40_web/2_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Installation

* [Install from source](#install-from-source)
* [Install on Arch Linux](#install-from-source-on-arch-linux)

The web interface is already installed on the Kerberos image, however you can also install the webinterface from source; you don't need to do this if you've deployed the Kerberos image on the SD card.

<a name="install-from-source"></a>
## Install from source

The web interface can be installed standalone, for example to host the web interface on an external server; e.g. to increase performance and to centralize multiple kerberos instances.

<a name="install-from-source-on-arch-linux"></a>
### Install on Arch Linux

Update the Arch Linux kernel

pacman -Syyu

Install git, nginx, php with extensions and nodejs

pacman -S git nginx php php-fpm php-gd php-mcrypt php-apc php-composer nodejs

Start nginx and php-fpm on boot

systemctl enable nginx
systemctl enable php-fpm

Edit nginx config

nano /etc/nginx/nginx.conf

Copy and paste following config

user http http;
worker_processes 1;
worker_rlimit_nofile 8192;

events {
worker_connections 1024;
}

http {
index index.html index.htm index.php;
include mime.types;
root /home/kerberos-web/public;
server {
server_name kerberos.rpi kerberos.rpi;
index index.php index.html index.htm;

location /{
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}
}

Make sure you've enabled following php extensions: mcrypt, phar, gd and openssl.

nano /etc/php/php.ini

Uncomment following extensions

extension=mcrypt.so
extension=phar.so
extension=gd.so
extension=openssl.so

Add the APC extension at the end of the extensions list

extension=apcu.so

Go to home directory

cd /home

Get the source code from github

git clone https://github.com/kerberos-io/web kerberos-web

Install php packages by using composer

cd kerberos-web
composer install

Change config file: edit the "config" variable, link it to the config directory of the kerberos-io repository. If you don't have the kerberos-io repository installed on that specific server, you can make it an empty string. In this case the option "settings" won't show up in the navigation menu. Please note that the default value is set to the destination of the machinery when installed on the Raspberry Pi.

nano app/config/app.php

Change write permission on the storage directory

chmod -R 777 app/storage

Install bower globally by using node package manager, this is installed when installing nodejs.

npm -g install bower

Install Front end dependencies with bower

cd public
bower --allow-root install
40 changes: 40 additions & 0 deletions 1.0.0/40_web/3_contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contribute

* [Versioning](#versioning)
* [Composer](#composer)
* [Laravel](#laravel)
* [Bower](#bower)

This documents describes how to contribute to Kerberos and describes all the technical stuff you will need to know. If you want to contribute you will need to install the source code on your local environment.

<a name="versioning"></a>
## Versioning

The source is managed on [Github](https://github.com/kerberos-io), and thus we are using git as our version control. For simplicity we are using following [branching model](http://nvie.com/posts/a-successful-git-branching-model/). The model includes:

* main branch
* develop branch
* hotfix and release branches

If you are a new developer, fork the development branch and send a pull request.

<a name="composer"></a>
## Composer

Make sure you have [composer installed](https://getcomposer.org/download/) on your local system. Run this in your terminal to get the latest Composer version:

curl -sS https://getcomposer.org/installer | php

Or if you don't have curl:

php -r "readfile('https://getcomposer.org/installer');" | php

<a name="laravel"></a>
## Laravel

We're using Laravel as our PHP framework. You will find all the information you need on the laravel [documentation site](http://laravel.com/docs).

<a name="bower"></a>
## Bower

Bower is used for managing our front end dependencies. Bower can be installed with npm, so make sure you have installed node.
40 changes: 40 additions & 0 deletions 1.0.0/40_web/4_project_structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Project structure

* [Configuration](#configuration)
* [File structure](#file-structure)
* [Server](#server)
* [Client](#client)

The web interace contains several important concepts and this is the right place where we will explain them briefly.

<a name="configuration"></a>
## Configuration

The web interface can be used to configure the machinery and therefore provides a *settings* page where algorithms, expositors, etc can be configured. The web interface will convert the configuration files into HTML elements, so when adding new algorithms or heuristics, the parameters will be reflected in the web interface automatically. The only thing you need to do is to specify a type to each parameter. You will find an equivalent *view* with the same name in the **app/views/controls** directory.

The webinterface can be used to configure Kerberos with our [**cloud application**](/1.0.0/addons/Cloud). The setup is very easy, you only need to create an account on our cloud application, request a key, and enter it in every webinterface you want to have synced. Once Kerberos is configured with the cloud application, a filewatcher, **Gruntjs**, will push new images to the cloud application immediately.

<a name="file-structure"></a>
## File structure

Laravel has been used as back end framework, so if you aren't familiar with Laravel, check out their [documentation website](http://laravel.com/docs). However we will give a briefly explanation of the most important directories.

<a name="server"></a>
### Server
* **app/config/app.php** - this file contains Kerberos specific parameters; where the configuration files can be found, the user credentials to sign in, etc.
* **app/controllers** - MVC controllers
* **app/repositories** -repositories are injected into the controller.
* **app/api.php** - contains all the URI endpoints for Ajax calls.
* **app/repositories.php** - bind repositories to a specific interface - dependency injection.
* **app/routes.php** - url routing for pages.

<a name="client"></a>
### Client

* **public/css/less** - LESS is used for the CSS.
* **public/js/app** - BackboneJS and RequireJS is used for building modular JS classes.
* **public/js/mustache** - Mustache is used for the client-side view rendering.
* **public/js/vendor** - This is where the bower extensions are installed.
* **public/capture** - A directory where images are written to by default.
* **public/bower.json** - The bower extensions used in the kerberos project.
* **public/Gruntfile.js** - We are using Grunt for our task manager.
Loading

0 comments on commit 0bf2e11

Please sign in to comment.