Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Verstraeten committed Feb 10, 2017
2 parents 3386ad6 + 7e9f388 commit d526f32
Show file tree
Hide file tree
Showing 151 changed files with 11,352 additions and 1,951 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

[![Feature Requests](http://feathub.com/kerberos-io/machinery?format=svg)](http://feathub.com/kerberos-io/machinery)

#CC-NC-ND license

THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

## Why Kerberos.io?

As burgalary is very common, we believe that video surveillance is a **trivial tool** in our daily lifes which helps us to **feel** a little bit more **secure**. Responding to this need, a lot of companies have started developing their own video surveillance software in the past few years.
Expand All @@ -16,7 +20,7 @@ Nowadays we have a myriad of **expensive** camera's, recorders and software solu

## Introduction

[Kerberos.io](http://kerberos.io) is a **low-budget** video surveillance solution, that uses computer vision algorithms to detect changes, and that can trigger other devices. [Kerberos.io](http://kerberos.io) is open source so everyone can customize the source code to its needs and share it with the community. When deployed on the Raspberry Pi, it has a **green footprint** and it's **easy to install**; you only need to transfer the [Kerberos.io OS (KIOS)](https://doc.kerberos.io/2.0/installation/KiOS) to your SD card and that's it.
[Kerberos.io](http://kerberos.io) is a **low-budget** video surveillance solution, that uses computer vision algorithms to detect changes, and that can trigger other devices. [Kerberos.io](http://kerberos.io) is open source so everyone can customize the source code to its needs and share it with the community under the [**CC-NC-ND license model**](https://doc.kerberos.io/license). When deployed on the Raspberry Pi, it has a **green footprint** and it's **easy to install**; you only need to transfer the [Kerberos.io OS (KIOS)](https://doc.kerberos.io/2.0/installation/KiOS) to your SD card and that's it.

Use your mobile phone, tablet or PC to keep an eye on your property. View the images taken by [Kerberos.io](http://kerberos.io) with our responsive and user-friendly web interface. Look at the dashboard to get a graphical overview of the past days. Multiple [Kerberos.io](http://kerberos.io) instances can be installed and can be viewed with only 1 web interface.

Expand Down Expand Up @@ -46,7 +50,13 @@ If you already have a Raspberry Pi running with Raspbian, you probably don't wan

[Read more](https://doc.kerberos.io/2.0/installation/Raspbian)

###Advanced
###Armbian (for Orange Pi, PCDuino, etc)

Kerberos.io can also be installed on other boards, which run the Armbian OS.

[Read more](https://doc.kerberos.io/2.0/installation/Armbian)

###Generic

If you want to install **the web**, you'll need to have **a webserver** (e.g. nginx) and **PHP** running with some extensions. You also need **nodejs** and **npm** installed to install **bower**. Below you can find the installation procedure to install the web on the Ubuntu OS; the process is similar for another Linux OS.

Expand Down Expand Up @@ -105,9 +115,10 @@ Install PHP packages by using composer.
sudo mv composer.phar /usr/bin/composer
sudo composer install

Change write permission on the storage directory.
Add write permission for the storage directory, and the kerberos config file.

sudo chmod -R 777 app/storage
sudo chmod 777 app/config/kerberos.php

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

Expand All @@ -126,6 +137,6 @@ Restart nginx

## How to access

You can access **the web** by entering the IP-address in your favorite browser. You'll see a login page showing up, 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.
You can access **the web** by entering the IP-address in your favorite browser. You'll see a welcome page showing up, on which you will be able to choose an username and password; the default username and password is **root**.

![Login page kerberos.io webinterface](https://doc.kerberos.io/documentation/2.0/70_installation/1_how-to-access.png)
![Welcome](https://doc.kerberos.io/documentation/develop/70_installation/1_how-to-access.png)
45 changes: 43 additions & 2 deletions app/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
// Methods for authorized

Route::group(['before' => 'auth'], function()
{
{
// -----------------
// User Controller

Route::get('users/current', 'Controllers\UserController@current');
Route::post('users/current', 'Controllers\UserController@updateCurrent');

// -----------------
// System Controller

Expand All @@ -50,6 +56,10 @@
Route::get('system/upgrade/reboot', 'Controllers\SystemController@reboot');
Route::get('system/reboot', 'Controllers\SystemController@rebooting');
Route::get('system/shutdown', 'Controllers\SystemController@shuttingdown');

Route::get('system/os', 'Controllers\SystemController@getOS');
Route::get('system/kerberos', 'Controllers\SystemController@getKerberos');
Route::get('system/kios', 'Controllers\SystemController@getKiOS');

// -----------------
// Image Controller
Expand All @@ -71,7 +81,6 @@

Route::group(['before' => 'auth.basic'], function()
{

// --------------------
// Settings Controller

Expand All @@ -89,7 +98,39 @@
Route::put('io', 'Controllers\SettingsController@updateIos');
Route::get('io/webhook', 'Controllers\SettingsController@getIoWebhook');
Route::put('io/webhook', 'Controllers\SettingsController@updateIoWebhook');

Route::get('configure', array('uses' => 'Controllers\SettingsController@getConfiguration'));
Route::put('configure', array('uses' => 'Controllers\SettingsController@changeProperties'));

// --------------------
// System Controller

Route::get('system/health', 'Controllers\SystemController@isStreamRunning');
Route::post('system/reboot', 'Controllers\SystemController@rebooting');
Route::post('system/shutdown', 'Controllers\SystemController@shuttingdown');

App::missing(function($exception)
{
return Response::json([
'error' => 'API method does not exists'
], 404);
});
});


// -----------------
// Translate Controller

Route::get('translate/{page}', 'Controllers\TranslateController@index');

// --------------------
// Installation wizard

if(!Config::get('kerberos')['installed'])
{
Route::post('user/language', 'Controllers\UserController@changeLanguage');
Route::post('user/install', 'Controllers\UserController@install');
}
});

/**********************************
Expand Down
27 changes: 4 additions & 23 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@

return array(

/*
|-----------------------------------------------------------
| Authentication Kerberos.web - Simpleauth by cedricverst
|-----------------------------------------------------------
|
| When you first open the kerberos web application a user
| needs to sign-in, it can sign-in with following credentials.
|
*/

'users' => [
[
"id" => 1,
"username" => "root",
"password" => "root",
"firstname" => "Cédric",
"secondname" => "Verstraeten"
]
],

/*
|-----------------------------------------------------------
| Configuration Kerberos.io
Expand All @@ -33,7 +13,7 @@
|
*/

'version' => '2.1.0',
'version' => '2.2.0',

'config' => '/etc/opt/kerberosio/config',

Expand Down Expand Up @@ -167,13 +147,14 @@
'Illuminate\Auth\Reminders\ReminderServiceProvider',
'Illuminate\Database\SeedServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Cedricve\Lockfile\LockfileServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider',
'Intervention\Image\ImageServiceProvider',
'Cedricve\Simpleauth\SimpleauthServiceProvider',
'Aws\Laravel\AwsServiceProvider',
//'Aws\Laravel\AwsServiceProvider',
),

/*
Expand Down Expand Up @@ -241,7 +222,7 @@
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Image' => 'Intervention\Image\Facades\Image',
'AWS' => 'Aws\Laravel\AwsFacade',
//'AWS' => 'Aws\Laravel\AwsFacade',
),

);
17 changes: 17 additions & 0 deletions app/config/kerberos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php return array (
'type' => 'basic',
'radius' => '1',
'installed' => false,
'users' =>
array (
0 =>
array (
'id' => 1,
'username' => 'root',
'password' => 'root',
'firstname' => 'Firstname',
'secondname' => 'Lastname',
'language' => 'en',
),
),
);
2 changes: 1 addition & 1 deletion app/config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
|
*/

'driver' => 'file',
'driver' => 'lockfile',

/*
|--------------------------------------------------------------------------
Expand Down
20 changes: 7 additions & 13 deletions app/controllers/DashboardController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace Controllers;

use App, View;
use App, View, Config;
use Repositories\ImageHandler\ImageHandlerInterface as ImageHandlerInterface;
use Repositories\ConfigReader\ConfigReaderInterface as ConfigReaderInterface;

Expand All @@ -12,6 +12,8 @@ public function __construct(ImageHandlerInterface $imageHandler,
parent::__construct($imageHandler, $reader);
$this->imageHandler = $imageHandler;
$this->reader = $reader;
$this->config = Config::get("app.config");
$this->kerberos = Config::get("kerberos");
}

/****************************
Expand All @@ -23,21 +25,13 @@ public function index()
// Get last x days from the imagehandler -> move to BaseController

$days = $this->imageHandler->getDays(5);
$directory = $this->config;
$settings = $this->reader->parse($directory)["instance"]["children"];

$lastImage = $this->imageHandler->getLatestImage();
if($lastImage)
{
$lastImage = $lastImage['src'];
}
else
{
$lastImage = '';
}

return View::make('dashboard', [
'days' => $days,
'lastImage' => $lastImage,
'isUpdateAvailable' => $this->isUpdateAvailable()
'kerberos' => $this->kerberos,
'fps' => $settings['io']['dropdown']['Video']['children']['fps']['value'],
]);
}
}
35 changes: 32 additions & 3 deletions app/controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function index($selectedDay = "")
return View::make('image', [
'days' => $days,
'selectedDay' => $selectedDay,
'lastHourOfDay' => $lastHourOfDay,
'isUpdateAvailable' => $this->isUpdateAvailable()
'lastHourOfDay' => $lastHourOfDay
]);
}

Expand Down Expand Up @@ -84,14 +83,44 @@ public function getLatestImage()
return $this->imageHandler->getLatestImage();
}

/********************************
/**********************************
* Get the latest sequence.
*
* - these extra checks are needed when you're recording video.
* it's possible that while you're changing the region
* a video is recording. Therefore no image can be retrieved.
*/

public function getLatestSequence()
{
$images = $this->imageHandler->getLatestSequence();

$videosFound = false;
for($i = 0; $i < count($images); $i++)
{
if($images[$i]['type'] === 'video')
{
$videosFound = true;
break;
}
}

if($videosFound)
{
if(count($images) > 1)
{
$lastMedia = $images[count($images)-1];
if($lastMedia['type'] === 'video')
{
array_pop($images);
}
}
else
{
$images = $this->imageHandler->getSecondLatestSequence();
}
}

return Response::json($images);
}

Expand Down
5 changes: 4 additions & 1 deletion app/controllers/LoginController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace Controllers;

use Auth, Input;
use Auth, Input, Session;
use View, Response, Redirect;

class LoginController extends BaseController
Expand All @@ -23,6 +23,9 @@ public function login()
if($user = Auth::attempt(["username" => $credentials["username"],
"password" => $credentials["password"]]))
{
$user = Auth::user();
$language = $user->language;
Session::put('language',$language);
return Response::json($user);
}

Expand Down
Loading

0 comments on commit d526f32

Please sign in to comment.