Code Monkey home page Code Monkey logo

addon-shinobi's Introduction

Community Hass.io Add-ons: Shinobi Pro

GitHub Release Project Stage License

GitLab CI Project Maintenance GitHub Activity

Bountysource Discord Community Forum

Buy me a coffee

Shinobi screenhost

Beautiful and feature-rich CCTV/NVR for your camera's

About

Shinobi is Open Source, written in Node.js, and real easy to use. It is the future of CCTV and NVR for developers and end-users alike. It is catered to by professionals and most importantly by the one who created it.

Shinobi can be used as a Baby Monitor, Construction Site Montage Viewer, Store Camera DVR, and much more.

You can use Shinobi Pro for personal use without a license in non-commercial locations, for educational, or simple testing. Schools, Colleges, and Universities do not require a subscription.

Installation

The installation of this add-on is pretty straightforward and not different in comparison to installing any other Hass.io add-on.

  1. Add our Hass.io add-ons repository to your Hass.io instance.
  2. Install the "Shinobi Pro" add-on.
  3. Start the "Shinobi Pro" add-on
  4. Check the logs of the "Shinobi Pro" add-on to see if everything went well.
  5. Surf to the superuser admin panel: http://hassio.local:7440/super
  6. Log in with the superuser credentials as specified in the add-on configuration.
  7. Create a Shinobi user account.
  8. Logout from the superuser panel.

You are now ready to use Shinobi, use the freshly created login from now on.

NOTE: Do not add this repository to Hass.io, please use: https://github.com/hassio-addons/repository.

Docker status

Docker Architecture Docker Version Docker Layers Docker Pulls Anchore Image Overview

Docker Architecture Docker Version Docker Layers Docker Pulls Anchore Image Overview

Docker Architecture Docker Version Docker Layers Docker Pulls Anchore Image Overview

Docker Architecture Docker Version Docker Layers Docker Pulls Anchore Image Overview

Configuration

Note: Remember to restart the add-on when the configuration is changed.

Example add-on configuration:

{
    "log_level": "info",
    "super_username": "[email protected]",
    "super_password": "admin",
    "mysql": false,
    "mysql_host": "core-mariadb",
    "mysql_username": "shinobi",
    "mysql_password": "sh1n0b1",
    "mysql_database": "shinobi",
    "mysql_port": 3306,
    "mail_service": "gmail",
    "mail_username": "[email protected]",
    "mail_password": "your_password",
    "mail_host": "smtp.example.com",
    "mail_port": 587,
    "mail_secure": false,
    "mail_cert_verify": true,
    "ssl": false,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
}

Note: This is just an example, don't copy and past it! Create your own!

Option: log_level

The log_level option controls the level of log output by the addon and can be changed to be more or less verbose, which might be useful when you are dealing with an unknown issue. Possible values are:

  • trace: Show every detail, like all called internal functions.
  • debug: Shows detailed debug information.
  • info: Normal (usually) interesting events.
  • warning: Exceptional occurrences that are not errors.
  • error: Runtime errors that do not require immediate action.
  • fatal: Something went terribly wrong. Add-on becomes unusable.

Please note that each level automatically includes log messages from a more severe level, e.g., debug also shows info messages. By default, the log_level is set to info, which is the recommended setting unless you are troubleshooting.

Option: super_username

The username to access the superuser control panel. This user is an administrative user. This user does not have cameras to manage nor can it see any cameras. Its purpose is to manage Admin accounts settings, limitations, and view system logs.

Option: super_password

The password for superuser of the superuser control panel.

Option: mysql

By default, the add-on uses an internal SQLite database for its data. Set this option to true to enable MySQL as the database backend for this add-on. You'll need an external database server for this, like the MariaDB core add-on provided by Home Assistant.

Note: There is no migration system. When using SQLite at first, and switching to MySQL later on, would result in data loss.

Note: When using the core MariaDB add-on, please be sure to create a separate database and user for Shinobi. DO NOT use the same database as Home Assistant.

Option: mysql_host

The hostname of the MySQL server to connect to. In case you are using the MariaDB core add-on, please use core-mariadb as the hostname.

Option: mysql_username

The username to use when connecting to a MySQL server.

Option: mysql_password

The password to use when connecting to a MySQL server.

Option: mysql_database

The MySQL database to store all Shinobi's data in.

Note: DO NOT store Shinobi's data in the same database as Home Assistant!

Option: mysql_port

The port the MySQL server is running on. Should be 3306 in most cases.

Option: mail_service

The mail service to use. Can be either smtp or gmail.

Option: mail_username

The username to use when connecting to the mail service.

Note: Please use your full mail address when using gmail.

Option: mail_password

The password to use when connecting to the mail service.

Option: mail_host

The smtp host or IP to connect to for sending emails.

Note: This option is ignored when using gmail as the mail service.

Option: mail_port

The port the smtp host is listening on.

Note: This option is ignored when using gmail as the mail service.

Option: mail_secure

If true the connection will use TLS when connecting to the server. If false (the default) then TLS is used if a server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false.

Note: This option is ignored when using gmail as the mail service.

Option: mail_cert_verify

Setting this to false would allow Shinobi to open a connection to TLS server with self-signed or invalid TLS certificate.

Note: This option is ignored when using gmail as the mail service.

Option: ssl

Enables/Disables SSL (HTTPS) on the web interface of Shinobi. Set it true to enable it, false otherwise.

Note: Enabling SSL would be additional to the already active plain HTTP server. HTTPS will be available on port 5443, which, of course, can be changed in the Hass.io add-on configuration.

Option: certfile

The certificate file to use for SSL.

Note: The file MUST be stored in /ssl/, which is default for Hass.io

Option: keyfile

The private key file to use for SSL.

Note: The file MUST be stored in /ssl/, which is default for Hass.io

Shinobi configuration and user manuals

The add-on does not configure Shinobi for you. For example, you will need to configure all your camera's and other things yourself.

For more information about configuring Shinobi, please refer to the extensive documentation they offer:

https://shinobi.video/docs

Setting up the MariaDB core add-on

Setting up Shinobi to use MySQL can be a little complex for some users. So, let us give you some examples.

First, install the core MariaDB add-on provided by Home Assistant (in case you didn't already have).

Edit the add-on configuration of MariaDB. We need to do 3 things:

  1. Add a database for Shinobi
  2. Add a user for Shinobi
  3. Give the created user access to the created database.

An example configuration would look like this:

{
  "databases": [
    "homeassistant",
    "shinobi"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "%",
      "password": "god"
    },
    {
      "username": "shinobi",
      "host": "%",
      "password": "sh1n0b1"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "%",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    },
    {
      "username": "shinobi",
      "host": "%",
      "database": "shinobi",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

After modifying your MariaDB add-on configuration, be sure to restart the MariaDB add-on.

For the Shinobi add-on configuration, the defaults are matching the MariaDB example above. So, you'd only need to enable the mysql option by setting it to true.

This is a part of the Shinobi add-on configuration that matches the above example:

{
  "mysql": true,
  "mysql_host": "core-mariadb",
  "mysql_username": "shinobi",
  "mysql_password": "sh1n0b1",
  "mysql_database": "shinobi",
  "mysql_port": 3306,
}

Save the configuration and restart the Shinobi add-on. The add-on will create all database internals (tables and structure) for you, the first time it connects.

Embedding into Home Assistant

It is possible to embed Shinobi directly into Home Assistant. Home Assistant provides the panel_iframe component, for these purposes.

Example configuration:

panel_iframe:
  shinobi:
    title: Shinobi
    icon: mdi:cctv
    url: http://addres.to.your.hass.io:7440

Changelog & Releases

This repository keeps a change log using GitHub's releases functionality. The format of the log is based on Keep a Changelog.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Support

Got questions?

You have several options to get them answered:

You could also open an issue here GitHub.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! ๐Ÿ˜

Authors & contributors

The original setup of this repository is by Franck Nijhof.

For a full list of all authors and contributors, check the contributor's page.

We have got some Hass.io add-ons for you

Want some more functionality to your Hass.io Home Assistant instance?

We have created multiple add-ons for Hass.io. For a full list, check out our GitHub Repository.

License

MIT License

Copyright (c) 2018 Franck Nijhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

addon-shinobi's People

Contributors

frenck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

addon-shinobi's Issues

Revise/improve all log messages

Problem/Motivation

There are several reasons for this:

  • Not all log messages are consistent across all add-ons.
  • Some messages are unclear to the novice user.

Unable to login to dashboard due to missing roles

Problem/Motivation

Seeing error logs in hass.io supervisor after addon successfully installed

Expected behavior

Log in to the dashboard and work. Create a role maybe on install of addon?

Actual behavior

Page just reloads after clicking Login

Steps to reproduce

Try to login again

Logs attached
image

Unable to log in to dashboard

Problem/Motivation

Unable to install and use shinobi addon

Expected behaviour

Addon installs and the dashboard is accessible via the web ui

Actual behaviour

Addon installs.
On starting - addon generates errors - https://pastebin.com/S9MhHkWy
Once started:
Unable to log in with username/password configured. Login page just refreshes.

Steps to reproduce

Add shinobi addon. Click start. Open WebUI. Login with default credentials.

Proposed changes

None at this time.

Pastebin

ERROR 2003 (HY000): Can't connect to MySQL server on 'core-mariadb' (111 "Connection refused")

Shinobi Pro log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Shinobi Pro v0.1.0
 Beautiful and feature-rich CCTV/NVR for your cameras
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 03-version-requirements.sh: executing... 
[cont-init.d] 03-version-requirements.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-symlink-configuration.sh: executing... 
[cont-init.d] 21-symlink-configuration.sh: exited 0.
[cont-init.d] 30-superuser.sh: executing... 
[cont-init.d] 30-superuser.sh: exited 0.
[cont-init.d] 31-mail.sh: executing... 
[cont-init.d] 31-mail.sh: exited 0.
[cont-init.d] 32-db.sh: executing... 
[cont-init.d] 32-db.sh: exited 0.
[cont-init.d] 33-ssl.sh: executing... 
[cont-init.d] 33-ssl.sh: exited 0.
[cont-init.d] 40-mysql.sh: executing... 
ERROR 2003 (HY000): Can't connect to MySQL server on 'core-mariadb' (111 "Connection refused")
[cont-init.d] 40-mysql.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

Shinobi Config:

{
  "log_level": "info",
  "super_username": "[email protected]",
  "super_password": "admin",
  "mysql": true,
  "mysql_host": "core-mariadb",
  "mysql_username": "shinobi",
  "mysql_password": "sh1n0b1",
  "mysql_database": "shinobi",
  "mysql_port": 3306,
  "mail_service": "gmail",
  "mail_username": "[email protected]",
  "mail_password": "your_password",
  "mail_host": "smtp.example.com",
  "mail_port": 587,
  "mail_secure": false,
  "mail_cert_verify": true,
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

MariaDB log:

starting version 3.2.2
[INFO] Use exists mariadb initial system
[INFO] Start MariaDB
180416 00:25:39 mysqld_safe Logging to '/data/databases/core-mariadb.err'.
180416 00:25:39 mysqld_safe Starting mysqld daemon with databases from /data/databases

MariaDB config:

{
  "databases": [
    "homeassistant",
    "shinobi"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "%",
      "password": "god"
    },
    {
      "username": "shinobi",
      "host": "%",
      "password": "sh1n0b1"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "%",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    },
    {
      "username": "shinobi",
      "host": "%",
      "database": "shinobi",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

CPU usage is shown as NaN

Problem/Motivation

(Why the issue was filed)

The CPU usage is shown as NaN in Shinobi running in standard Hassio.

cpu_shinobi

Also the memory is shown as nearly 98% but Hassio reports less than 50% at the same moment.

cpu

Expected behavior

(What you expected to happen)

CPU and Memory to be displayed as Hassio reports

Actual behavior

(What actually happened)

CPU is NaN
Memory is double the real usage

Steps to reproduce

(How can someone else make/see it happen)

Install Shinobi add-on from dashboard Hassio menu

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

In the community blog of shinobi addon for hassio, the user g0g0 has proposed the following change:

in the file:

https://github.com/hassio-addons/addon-shinobi/blob/master/shinobi/rootfs/etc/cont-init.d/20-init-configuration.sh#L22

change this

CONFIG=$(hass.jq "${CONFIG}" ".cpuUsageMarker=\"cpu\"")

to this

CONFIG=$(hass.jq "${CONFIG}" ".cpuUsageMarker=\"CPU\"")

GitHub
addon-shinobi - Shinobi Pro - Community Hass.io Add-on for Home Assistant

Unable to start service.

Problem/Motivation

Attempting to follow the simple installation instructions.

Expected behavior

Expecting the service to start after installation, step 3 "Start the Shinobi Pro Add-on"

Actual behavior

The start button spins, turns red, fades out, and nothing happens. No log of errors on the add-on page. Set the log level to trace...still nothing.

Open Web Ui not updating when port is changed

Problem/Motivation

When changing the TCP port from 5000 to something else the Open Web Ui link doesn't update

(Why the issue was filed)

Expected behavior

Link should be changing based on the port number used in the config

(What you expected to happen)

Actual behavior

Open Web Ui link hard coded with port 5000

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

Link should be changing based on the port number used in the config

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Videos are not deleted per "Number of Days to keep Videos" setting

Expected behavior

Videos should be deleted if older than "Number of Days to keep Videos".

Actual behavior

All videos are retained regardless of "Number of Days to keep Videos" setting.

Steps to reproduce

Set "Number of Days to keep Videos" to any integer. Videos are not erased once the days have surpassed.

Shinobi on alternative device/IP

My Shinobi server is on a different device to my hass installation - is there anyway to set the IP address? The addon seems to assume they're running on the same device.

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.