Skip to content

Commit

Permalink
New installation instruction based on docker (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivadim committed Nov 19, 2019
1 parent 0fb95f8 commit ca810c7
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 28 deletions.
106 changes: 83 additions & 23 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
# Installing fruitnanny

## Generate certificates
## Docker-based installation

### OS image
* Raspbian Buster Lite - https://downloads.raspberrypi.org/raspbian_lite_latest

### Install tools
* git and extra libs
```console
sudo apt-get update
sudo apt-get -y install git curl libffi-dev python python-pip
```
* docker
```console
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker pi
```
* docker-compose
```console
sudo apt-get -y install docker-compose
```
### Reboot system
```console
sudo shutdown -r 0
```
### Clone repository

```console
cd /opt
sudo mkdir fruitnanny
sudo chown pi:pi fruitnanny
git clone https://github.com/ivadim/fruitnanny
```

### Generate certificates

The Docker installation expects certificates available under
`configuration/ssl`. To generate self-signed certificates suitable
for all components, run this command.

```
```console
cd /opt/fruitnanny
openssl req -x509 -sha256 -nodes -days 2650 -newkey rsa:2048 \
-keyout configuration/ssl/fruitnanny.key -out configuration/ssl/fruitnanny.pem
```
Expand All @@ -15,28 +51,52 @@ openssl req -x509 -sha256 -nodes -days 2650 -newkey rsa:2048 \
important prompt here is "Common Name" The common name should be the hostname
for your Raspberry Pi.

## Non-Docker installation
### Generate apache passwords
```console
cd /opt/fruitnanny
echo -n 'fruitnanny:' >> ./configuration/nginx/.htpasswd
openssl passwd -apr1 >> ./configuration/nginx/.htpasswd
```

These directions assume a recent Raspbian installation.
`openssl` will prompt for password

### janus
### Run the system
```console
cd /opt/fruitnanny
docker-compose up -d
```

* Set up mDNS.
```
apt-get install avahi-daemon libnss-mdns
```
* Install janus
### Check website
Access http://RASPBERRY_IP/ to see Fruitnanny interface

```
apt install janus janus-tools
```
* Replace the default configuration with our config:
```
sudo rm /etc/janus/*
sudo cp configuration/janus/* /etc/janus
```
* Edit janus configuration files
* In `/etc/janus/janus.jcfg`, edit the `certificates` section to point to your
SSL certificates.
* In `/etc/janus/janus.transport.http.jcfg`, edit the `certificates` section
to point to your SSL certificates.
### Debug issues
* Run `docker-compose ps` to check if all containers are in 'UP' state
```console
Name Command State Ports
-----------------------------------------------------------------------------
fruitnanny_fruitnanny_1 /usr/bin/entry.sh node ser ... Up
fruitnanny_gstreamer-audio_1 /usr/bin/entry.sh gst-laun ... Up
fruitnanny_gstreamer-video_1 /usr/bin/entry.sh gst-laun ... Up
fruitnanny_janus_1 /usr/bin/entry.sh /bin/sh ... Up
fruitnanny_nginx_1 nginx -g daemon off; Up
```

* Run `docker-compose logs` to get logs from all containers
```console
gstreamer-audio_1 | Setting pipeline to PAUSED ...
fruitnanny_1 | Fruitnanny app listening on port 7000!
gstreamer-video_1 | Setting pipeline to PAUSED ...
janus_1 | [WARN] Admin/monitor HTTPS webserver disabled
```

* Re-download new docker images for fruitnanny
```console
docker-compose stop
docker-compose rm -f
docker-compose pull
docker-compose up -d
```

## Non-Docker installation

Please follow https://ivadim.github.io/2017-08-21-fruitnanny/
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,37 @@
**Fruitnanny** is a code name for a DIY *geek* baby monitor.
It uses RaspberryPi, a NoIR camera module, infrared lights, temperature and humidity sensors, and a custom Web UI.
Chrome and Firefox with native WebRTC are used as clients.
Right now it means support of all major platforms like Windows, Linux, Android, MacOS and iOS soon.
Right now it means support of all major platforms like Windows, Linux, Android, MacOS and iOS.

This repository contains NodeJS application and configurations files.

![video](public/project/img/video-mobile.gif)
For more information: https://ivadim.github.io/2017-08-21-fruitnanny/

# How to setup instruction
![video](public/project/img/video-mobile.gif)

https://ivadim.github.io/2017-08-21-fruitnanny/
# How to setup

Follow [installation instruction](INSTALLATION.md)

# Tested platforms (docker-based installation)

* Windows 10 (64 bit)
* Chrome 77.0.3865.120 πŸ‘
* Firefox 70.0 πŸ‘
* macOS 10.14.6
* Safari 13.0.2 πŸ‘
* Chrome 78.0.3904.70 πŸ‘
* Firefox 70.0 πŸ‘
* Linux (64 bit, Debian testing)
* Chrome 78.0.3904.70 πŸ‘
* Chromium 76.0.3809.100 (latest in Debian repo) πŸ‘Ž (Reports a failure to negotiate STP, I think it doesn't have the correct codecs)
* Firefox 60.8.0esr (latest in Debian repo) πŸ‘Ž
* Firefox 70.0 (downloaded from Mozilla) πŸ‘
* Android
* Chrome 78.0.3904.62 πŸ‘
* Firefox (latest stable) πŸ‘Ž
* iOS (13.1, Xcode emulator)
* Safari πŸ‘

# Configuration

Expand All @@ -37,4 +59,4 @@ To update baby's picture you need to replace file `public\project\img\baby.png`.

* Install nodejs
* Run `npm install`
* Run `npm run grunt`
* Run `npm run grunt`

0 comments on commit ca810c7

Please sign in to comment.