Skip to content

Commit

Permalink
ADDED Mariadb, MotionEye, NextCloud, webthings_gateway, blynk_server
Browse files Browse the repository at this point in the history
  • Loading branch information
gcgarner committed Nov 27, 2019
1 parent 054d6fd commit 3df64fd
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .templates/blynk_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM adoptopenjdk/openjdk11
MAINTAINER Graham Garner <[email protected]>

#RUN apt-get update
#RUN apt-get install -y apt-utils
#RUN apt-get install -y default-jdk curl

ENV BLYNK_SERVER_VERSION 0.41.10
RUN mkdir /blynk
RUN curl -L https://github.com/blynkkk/blynk-server/releases/download/v${BLYNK_SERVER_VERSION}/server-${BLYNK_SERVER_VERSION}.jar > /blynk/server.jar

# Create data folder. To persist data, map a volume to /data
RUN mkdir /data

# Create configuration folder. To persist data, map a file to /config/server.properties
RUN mkdir /config && touch /config/server.properties
VOLUME ["/config", "/data/backup"]

# IP port listing:
# 8080: Hardware without ssl/tls support
# 9443: Blynk app, https, web sockets, admin port
EXPOSE 8080 9443

WORKDIR /data
ENTRYPOINT ["java", "-jar", "/blynk/server.jar", "-dataFolder", "/data", "-serverConfig", "/config/server.properties"]
11 changes: 11 additions & 0 deletions .templates/blynk_server/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blynk_server:
build: ./services/blynk_server/.
container_name: blynk_server
restart: unless-stopped
ports:
- 8180:8080
- 8441:8441
- 9443:9443
volumes:
- ./volumes/blynk_server/data:/data

7 changes: 7 additions & 0 deletions .templates/mariadb/mariadb.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TZ=Europe/London
PUID=1000
PGID=1000
MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD
#MYSQL_DATABASE=USER_DB_NAME
#MYSQL_USER=MYSQL_USER
#MYSQL_PASSWORD=DATABASE_PASSWORD
11 changes: 11 additions & 0 deletions .templates/mariadb/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mariadb:
image: linuxserver/mariadb
container_name: mariadb
env_file:
- ./services/mariadb/mariadb.env
volumes:
- ./volumes/mariadb/config:/config
ports:
- 3306:3306
restart: unless-stopped

4 changes: 4 additions & 0 deletions .templates/mariadb/terminal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! bin/bash

echo "run 'mysql -uroot -p' for terminal access"
docker exec -it mariadb bash
14 changes: 14 additions & 0 deletions .templates/motioneye/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
motioneye:
image: "ccrisan/motioneye:master-armhf"
container_name: "motioneye"
restart: unless-stopped
ports:
- 8765:8765
- 8081:8081
volumes:
- /etc/localtime:/etc/localtime:ro
- ./volumes/motioneye/etc_motioneye:/etc/motioneye
- ./volumes/motioneye/var_lib_motioneye:/var/lib/motioneye
#devices:
# - "/dev/video0:/dev/video0"

25 changes: 25 additions & 0 deletions .templates/nextcloud/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
nextcloud:
image: nextcloud
container_name: nextcloud
ports:
- 9321:80
volumes:
- ./volumes/nextcloud/html:/var/www/html
restart: unless-stopped
depends_on:
- nextcloud_db
links:
- nextcloud_db

nextcloud_db:
image: linuxserver/mariadb
container_name: nextcloud_db
volumes:
- ./volumes/nextcloud/db:/config
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
restart: unless-stopped

13 changes: 13 additions & 0 deletions .templates/webthings_gateway/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
webthings_gateway:
image: mozillaiot/gateway:arm
container_name: webthings_gateway
network_mode: host
#ports:
# - 8080:8080
# - 4443:4443
#devices:
# - /dev/ttyACM0:/dev/ttyACM0
volumes:
- ./volumes/webthings_gateway/share:/home/node/.mozilla-iot


3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The bulk of the README has moved to the Wiki. Please check it out [here](https://github.com/gcgarner/IOTstack/wiki)

* 2019-11-27 Additions: NextCloud, MariaDB, MotionEye, Mozilla Webthings, blynk-server (fixed issue with selection.txt)
* 2019-11-22 BUGFIX selection.txt failed on fresh install, added pushd IOTstack to menu to ensure correct path
* 2019-11-22 Added notification into menu if project update is available
* 2019-11-20 BUGFIX influxdb backup: Placing docker_backup in crontab caused influxdb backup not to execute correctly
Expand All @@ -14,8 +15,6 @@ The bulk of the README has moved to the Wiki. Please check it out [here](https:/
* Added RTL_433 native and docker installs
* Added update project through the menu
* Added bash aliases for easier docker stop and start commands
* The project up procedure has been rewritten #73 (now git pull), please check your duck.sh file because the old method reset it
* BUGFIX: incorrect permissions in docker_backup: PR @Paraphraser


***
Expand Down
28 changes: 25 additions & 3 deletions menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare -A cont_array=(
[grafana]="Grafana"
[mosquitto]="Eclipse-Mosquitto"
[postgres]="Postgres"
[mariadb]="MariaDB (MySQL fork)"
[adminer]="Adminer"
[openhab]="openHAB"
[zigbee2mqtt]="zigbee2mqtt"
Expand All @@ -19,9 +20,16 @@ declare -A cont_array=(
[tasmoadmin]="TasmoAdmin"
[rtl_433]="RTL_433 to mqtt"
[espruinohub]="EspruinoHub"
[motioneye]="motionEye"
[webthings_gateway]="Mozilla webthings-gateway"
[blynk_server]="blynk-server"
[nextcloud]="Next-Cloud"
[nginx]="NGINX by linuxserver"

)
declare -a armhf_keys=("portainer" "nodered" "influxdb" "grafana" "mosquitto" "telegraf" "postgres" "adminer" "openhab" "zigbee2mqtt" "pihole" "plex" "tasmoadmin" "rtl_433" "espruinohub")
declare -a armhf_keys=("portainer" "nodered" "influxdb" "grafana" "mosquitto" "telegraf" "mariadb" "postgres"
"adminer" "openhab" "zigbee2mqtt" "pihole" "plex" "tasmoadmin" "rtl_433" "espruinohub"
"motioneye" "webthings_gateway" "blynk_server" "nextcloud")

sys_arch=$(uname -m)

Expand All @@ -36,6 +44,17 @@ timezones() {

}

# this function creates the volumes, services and backup directories. It then assisgns the current user to the ACL to give full read write access
docker_setfacl() {
[ -d ./services ] || mkdir ./services
[ -d ./volumes ] || mkdir ./volumes
[ -d ./backups ] || mkdir ./backups

#give current user rwx on the volumes and backups
[ $(getfacl ./volumes | grep -c "default:user:$USER") -eq 0 ] && sudo setfacl -Rdm u:$USER:rwx ./volumes
[ $(getfacl ./backups | grep -c "default:user:$USER") -eq 0 ] && sudo setfacl -Rdm u:$USER:rwx ./backups
}

#future function add password in build phase
password_dialog() {
while [[ "$passphrase" != "$passphrase_repeat" || ${#passphrase} -lt 8 ]]; do
Expand Down Expand Up @@ -197,10 +216,13 @@ case $mainmenu_selection in
echo "version: '2'" >docker-compose.yml
echo "services:" >>docker-compose.yml

#set the ACL for the stack
docker_setfacl

# store last sellection
[ -f ./services/selection.txt ] && rm ./services/selection.txt
#first run service directory wont exist
[ -d .services] || mkdir services
[ -d ./services ] || mkdir services
touch ./services/selection.txt
#Run yml_builder of all selected containers
for container in "${containers[@]}"; do
Expand Down Expand Up @@ -367,4 +389,4 @@ case $mainmenu_selection in

esac

popd
popd

0 comments on commit 3df64fd

Please sign in to comment.