Skip to content

Commit 072bb53

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7442d85 + e4fa6ee commit 072bb53

File tree

5 files changed

+82
-21
lines changed

5 files changed

+82
-21
lines changed

.templates/espruinohub/service.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
espruinohub:
2+
container_name: espruinohub
3+
image: humbertosales/espruinohub-docker-rpi
4+
network_mode: host
5+
privileged: true
6+
restart: unless-stopped

.templates/nodered/service.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
build: ./services/nodered/.
44
restart: unless-stopped
55
user: "0"
6+
privileged: true
67
env_file: ./services/nodered/nodered.env
78
ports:
89
- 1880:1880

.templates/rtl_433/service.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
- ./services/rtl_433/rtl_433.env
66
devices:
77
- /dev/bus/usb
8-
restart: unless-stopped
8+
restart: unless-stopped
9+

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
* Node-RED: serial port. New template adds privileged which allows acces to serial devices
6+
* EspurinoHub: is available for testing see wiki entry
7+
* Menu: Now remembers last stack selection, first build will be blank then the next will select your last containers
8+
* BUGFIX: fixed issue where rsync gave issue on 'Preserve Environment and Config files'
59
* BUGFIX: I incorrecly changed mosquittos volume mapping and it caused the container to restart. Reverted to the old volume mapping
610
* Added RTL_433 native and docker installs
711
* Added update project through the menu
@@ -31,7 +35,15 @@ The bulk of the README has moved to the Wiki. Please check it out [here](https:/
3135

3236
# Coming soon
3337

34-
* [EspurinoHub](https://hub.docker.com/r/humbertosales/espruinohub-docker-rpi)
38+
* Detection of arhcitecture for seperate stack options for amd64, armhf, i386
39+
* autocleanup of backups on cloud
40+
* motioneye
41+
* reverse proxy
42+
* python contaienr
43+
* webthings gateway
44+
* Gitea
45+
* NextCloud
46+
* OwnCloud
3547

3648
***
3749

@@ -56,6 +68,7 @@ This Docker stack consists of:
5668
* Plex media server
5769
* Telegraf (wiki coming soon)
5870
* RTL_433
71+
* EspruinoHub (testing)
5972

6073
In addition, there is a write-up and some scripts to get a dynamic DNS via duckdns and VPN up and running.
6174

menu.sh

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
#!/bin/bash
22

3+
declare -A cont_array=(
4+
[portainer]="Portainer"
5+
[nodered]="Node-RED"
6+
[influxdb]="InfluxDB"
7+
[telegraf]="Telegraf (Requires InfluxDB and Mosquitto)"
8+
[grafana]="Grafana"
9+
[mosquitto]="Eclipse-Mosquitto"
10+
[postgres]="Postgres"
11+
[adminer]="Adminer"
12+
[openhab]="openHAB"
13+
[zigbee2mqtt]="zigbee2mqtt"
14+
[pihole]="Pi-Hole"
15+
[plex]="Plex media server"
16+
[tasmoadmin]="TasmoAdmin"
17+
[rtl_433]="RTL_433 to mqtt"
18+
[espruinohub]="EspruinoHub"
19+
20+
)
21+
declare -a armhf_keys=("portainer" "nodered" "influxdb" "grafana" "mosquitto" "telegraf" "postgres" "adminer" "openhab" "zigbee2mqtt" "pihole" "plex" "tasmoadmin" "rtl_433" "espruinohub" )
22+
23+
sys_arch=$(uname -m)
24+
325
#timezones
426
timezones() {
527

@@ -38,7 +60,7 @@ function yml_builder() {
3860
sevice_overwrite=$(whiptail --radiolist --title "Overwrite Option" --notags \
3961
"$1 service directory has been detected, use [SPACEBAR] to select you overwrite option" 20 78 12 \
4062
"none" "Do not overwrite" "ON" \
41-
"env" "Preserve Environment and Config file" "OFF" \
63+
"env" "Preserve Environment and Config files" "OFF" \
4264
"full" "Pull full service from template" "OFF" \
4365
3>&1 1>&2 2>&3)
4466

@@ -50,7 +72,7 @@ function yml_builder() {
5072
;;
5173
"env")
5274
echo "...pulled $1 excluding env file"
53-
rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh' --exclude '$1.env' --exclude $(*.conf)
75+
rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh' --exclude '$1.env' --exclude '*.conf'
5476
;;
5577
"none")
5678
echo "...$1 service not overwritten"
@@ -67,6 +89,8 @@ function yml_builder() {
6789
#if an env file exists check for timezone
6890
[ -f "./services/$1/$1.env" ] && timezones ./services/$1/$1.env
6991

92+
#add new line then append service
93+
echo "">>docker-compose.yml
7094
cat $service >>docker-compose.yml
7195

7296
#test for post build
@@ -118,23 +142,34 @@ case $mainmenu_selection in
118142
;;
119143
#MAINMENU Build stack ------------------------------------------------------------
120144
"build")
121-
container_selection=$(whiptail --title "Container Selection" --notags --separate-output --checklist \
122-
"Use the [SPACEBAR] to select which containers you would like to install" 20 78 12 \
123-
"portainer" "Portainer" "ON" \
124-
"nodered" "Node-RED" "ON" \
125-
"influxdb" "InfluxDB" "ON" \
126-
"telegraf" "Telegraf (Requires InfluxDB and Mosquitto)" "OFF" \
127-
"grafana" "Grafana" "ON" \
128-
"mosquitto" "Eclipse-Mosquitto" "ON" \
129-
"postgres" "Postgres" "OFF" \
130-
"adminer" "Adminer" "OFF" \
131-
"openhab" "openHAB" "OFF" \
132-
"zigbee2mqtt" "zigbee2mqtt" "OFF" \
133-
"pihole" "Pi-Hole" "OFF" \
134-
"plex" "Plex media server" "OFF" \
135-
"tasmoadmin" "TasmoAdmin" "OFF" \
136-
"rtl_433" "RTL_433 to mqtt" "OFF" \
137-
3>&1 1>&2 2>&3)
145+
146+
title=$'Container Selection'
147+
message=$'Use the [SPACEBAR] to select which containers you would like to install'
148+
entry_options=()
149+
150+
#check architecture and display appropriate menu
151+
if [ $(echo "$sys_arch" | grep -c "arm") ]; then
152+
keylist=("${armhf_keys[@]}")
153+
else
154+
echo "your architecture is not supported yet"
155+
exit
156+
fi
157+
158+
#loop through the array of descriptions
159+
for index in "${keylist[@]}"; do
160+
entry_options+=("$index")
161+
entry_options+=("${cont_array[$index]}")
162+
163+
#check selection
164+
if [ -f ./services/selection.txt ]; then
165+
[ $(grep "$index" ./services/selection.txt) ] && entry_options+=("ON") || entry_options+=("OFF")
166+
else
167+
entry_options+=("OFF")
168+
fi
169+
done
170+
171+
container_selection=$(whiptail --title "$title" --notags --separate-output --checklist \
172+
"$message" 20 78 12 -- "${entry_options[@]}" 3>&1 1>&2 2>&3)
138173

139174
mapfile -t containers <<<"$container_selection"
140175

@@ -144,10 +179,14 @@ case $mainmenu_selection in
144179
echo "version: '2'" >docker-compose.yml
145180
echo "services:" >>docker-compose.yml
146181

182+
# store last sellection
183+
[ -f ./services/selection.txt ] && rm ./services/selection.txt
184+
touch ./services/selection.txt
147185
#Run yml_builder of all selected containers
148186
for container in "${containers[@]}"; do
149187
echo "Adding $container container"
150188
yml_builder "$container"
189+
echo "$container" >>./services/selection.txt
151190
done
152191

153192
echo "docker-compose successfully created"
@@ -221,6 +260,7 @@ case $mainmenu_selection in
221260
"rclone")
222261
sudo apt install -y rclone
223262
echo "Please run 'rclone config' to configure the rclone google drive backup"
263+
224264
#add enable file for rclone
225265
[ -d ~/IOTstack/backups ] || sudo mkdir -p ~/IOTstack/backups/
226266
sudo touch ~/IOTstack/backups/rclone

0 commit comments

Comments
 (0)