-
Notifications
You must be signed in to change notification settings - Fork 169
Install
Find videos about Shinobi on YouTube : https://www.youtube.com/user/MrMoea92
- Windows, Linux, Mac OS : Vagrant
- Windows, Linux, Mac OS : Plain VirtualBox
- Mac OS : Native
- Ubuntu 16.04 : The Easier Way
- Ubuntu 16.04 : The Harder Way
- How to Update
- Node.js 7.2.0 or higher
- check your version with
nodejs -vornode -v - FFMPEG 2.8 or higher with libvpx and libx264.
- libx265 is optional. Choosing not to install it simply means the options for it won't work.
- Linux or MacOS base operating system capable of running the previously mentioned libraries and programs.
- Virtual Machines use Linux.
- Currently Windows cannot natively run Shinobi. This is due to the choice of certain exec commands and not the JavaScript itself. You can adapt it for use on Windows but it will take one with a sharp mind and a bold heart.
This sets up an Ubuntu 16.04 Virtual Machine running on VirtualBox and uses Vagrant to setup and configure everything in one command.
-
Open
Terminal. -
Download the repo via GIT
git clone [email protected]:moeiscool/Shinobi.git -o origin
-
Download and Install Vagrant https://www.vagrantup.com/downloads.html
-
Go to the
/Shinobidirectory which you created in Step 2 Runvagrant upfrom the terminal or command line
VIDEO TUTORIAL : https://www.youtube.com/watch?v=kENOPPTA0Xg
- You know what to do with this if you know what VirtualBox is.
- Shinobi-12-29-2016.ova
https://mega.nz/#!rkZQHQBT!9gTBRwUU5UGpOvtBUAMUUVAJhEaW5zrDMs8MgaN1JNo
Username : shinobiPassword : night
- Shinobi-12-29-2016.ova
https://mega.nz/#!rkZQHQBT!9gTBRwUU5UGpOvtBUAMUUVAJhEaW5zrDMs8MgaN1JNo
-
Once logged in
cd shinobi -
Start server.
pm2 start camera.js -
Open up
http://localhost:8080in your browser.-
Note : if you are installed on a remote computer open up the IP in your web browser.
Username : [email protected]Password : password
-
Note : if you are installed on a remote computer open up the IP in your web browser.
-
To get your IP you can run the following command.
ifconfig
-
Open
Terminal. -
Install the required system packages
git nodejs npm mysqlviabrew. If you don't have brew, download it from here: http://brew.sh/ If you have these already on your system you can skip this step.brew install git nodejs npm mysql -
Install the
ffmpegpackage viabrew.brew install ffmpeg -
Download the repo via GIT
git clone [email protected]:moeiscool/Shinobi.git -o origin -
Import the
sql/framework.sqlSQL file, it will create a database calledcciocat sql/framework.sql | mysql -u root -p -
Import the
sql/default_data.sqlSQL file, it will create a default user and camera sourcecat sql/default_data.sql | mysql -u root -p ccio -
Run
npm installfrom yourShinobidirectory to install the requirednodejspackages.npm install -
Copy
conf.sample.jsontoconf.jsonin yourShinobidirectory and enter your database connection detailscp conf.sample.json conf.json -
Set your timezone in
conf.json. This is important if your event times are not matching."utcOffset":"-0800" -
Run
npm startfrom yourShinobidirectory to start the Shinobi App.npm start -
Open up
http://localhost:8080in your browser.-
Note : if you are installed on a remote computer open up the IP in your web browser.
Username : [email protected]Password : password
-
Note : if you are installed on a remote computer open up the IP in your web browser.
VIDEO TUTORIAL : https://www.youtube.com/watch?v=CZSKV5gRd90
-
Open
Terminal. -
Download Shinobi with
wgetif you don't havegitinstalled.- Do this only if you haven't already downloaded the files.
wget https://github.com/moeiscool/Shinobi/tarball/master -
Untar the downloaded file. The extracted directory is the shinobi directory.
tar -xzf master -
Rename the directory for easier access. The extracted folder name will be different.
moeiscool-Shinobi-XXXXXXXis only an example.mv moeiscool-Shinobi-XXXXXXX shinobi -
Open Shinobi directory.
cd shinobi -
Make INSTALL.sh an executable file.
chmod +x INSTALL.sh -
Execute
INSTALL.sh. Run :
-
This installs
libav-tools,nodejs,npm,pm2, andmysql-server./INSTALL.sh
-
Packages will be installed. MySQL will ask to create a password on first installation.
-
Then the installer will ask you for the credentials created. The default username is usually
root. -
Copy
conf.sample.jsonas another file namedconf.json.cp conf.sample.json conf.json -
Set your timezone in
conf.json. This is important if your event times are not matching."utcOffset":"-0800" -
Edit
conf.jsonto reflect your sql credentials. I don't reccommend using root.nano conf.json -
After installation is complete
pm2 start camera.js -
Open up
http://localhost:8080in your browser.-
Note : if you are installed on a remote computer open up the IP in your web browser.
Username : [email protected]Password : password
-
Note : if you are installed on a remote computer open up the IP in your web browser.
-
To get your IP you can run the following command.
ifconfig
VIDEO TUTORIAL : https://www.youtube.com/watch?v=jfgUNfVEEEc
Dont have FFMPEG installed?
-
Open
Terminal. -
To install :
apt-get install ffmpeg- If that doesn't work try :
apt-get install libav-tools
Dont have Node.js installed?
-
Open
Terminal. -
Install Node.js and it's package manager
-
Note :
#apt-get install nodeinstalls something else, not Node.js.
apt-get install nodejs npm -
Note :
-
Create a symlink to use nodejs.
- pm2 needs this. If you don't plan on using pm2, then ignore this step.
ln -s /usr/bin/nodejs /usr/bin/node -
Not on Ubuntu? Other operating systems can be found here.
Dont have MySQL installed?
-
Open
Terminal. Run :apt-get install mysql-server -
Installation of MySQL prompt you to set a password for
rootuser in MySQL on your first install.
- Mac OS (will need more techiness ironically, follow this link) : https://blog.joefallon.net/2013/10/install-mysql-on-mac-osx-using-homebrew/ .
Application Install
-
Open
Terminal. -
Download Shinobi with
wgetif you don't havegitinstalled.- Do this only if you haven't already downloaded the files.
wget https://github.com/moeiscool/Shinobi/tarball/master -
Untar the downloaded file. The extracted directory is the shinobi directory.
tar -xzf master -
Rename the directory for easier access. The extracted folder name will be different.
moeiscool-Shinobi-XXXXXXXis only an example.mv moeiscool-Shinobi-XXXXXXX shinobi -
Set permissions on the shinobi directory. Where
camera.jsis located.chmod -R 755 shinobi -
Open Shinobi directory.
cd shinobi
Setup SQL
-
Go to
sqland install the SQL files in your database.cd sql -
Terminal SQL client can be accessed by running :
- The password will have been set during the installation of MySQL.
mysql -u root -p -
OPTIONAL : Create New SQL User with privileges. If you choose to use your own pre-defined credentials skip this step.
source ./user.sql- or create your own
CREATE USER 'majesticflame'@'127.0.0.1' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON * . * TO 'majesticflame'@'127.0.0.1'; FLUSH PRIVILEGES; -
while still in the SQL client. Install the Shinobi database. It will create a database called
ccio.source ./framework.sql -
OPTIONAL :
default_data.sqlcontains a demo user and a demortsp to mp4monitor.source ./default_data.sql -
After importing the data. Exit the sql client.
exit -
Go up one directory to enter the main directory. Where
camera.jsis located.
```
cd ..
```
-
Copy
conf.sample.jsonas another file namedconf.json.cp conf.sample.json conf.json
14a. Edit conf.json to reflect your sql credentials. I don't reccommend using root.
```
nano conf.json
```
14b. Set your timezone in conf.json. This is important if your event times are not matching.
```
"utcOffset":"-0800"
```
Install Libraries
-
Run
npm installwhile in the main directory. This will install the libraries Shinobi needs.npm install- Can't get
npm installto work? Try downloading this, the required node libraries already built. Place thenode_modulesfolder in the same directory ascamera.js.
- Can't get
Launch Shinobi
-
To start :
node camera.js- If you did not make the symlink for nodejs then you must run
nodejs camera.jsinstead.
- If you did not make the symlink for nodejs then you must run
-
Open up
http://localhost:8080in your browser.-
Note : if you are installed on a remote computer open up the IP in your web browser.
Username : [email protected]Password : password
-
Note : if you are installed on a remote computer open up the IP in your web browser.
-
To get your IP you can run the following command.
ifconfig
PM2 is needed to use UPDATE.sh and to Daeomonize the process
npm install pm2 -g
then to start :
pm2 start camera.js
- run
pm2 logsto see the console for any errors. -
foreveris another program to daemonize, but i've had more success withpm2.
These commands remove and recreate camera.js, web, and UPDATE.sh. If you have made any changes to the source code please back them up before running the update command.
By Terminal
navigate to your Shinobi directory, then run the following command. This command only works for those with builds from 8/Jan/2017 and after
chmod +x UPDATE.sh&&./UPDATE.sh
By API
updateKey can be set in conf.json.
https://github.com/moeiscool/Shinobi/wiki/Configuration
http://xxx.xxx.xxx.xxx/[API KEY]/update/[UPDATE KEY]