Compare commits

..

37 Commits

Author SHA1 Message Date
André Germann
18458e8e0c Merge pull request #304 from buanet/v7.2.0-beta.1
V7.2.0 beta.1
2022-11-30 13:59:22 +01:00
buanet
b597178246 prepare beta 2022-11-30 13:58:24 +01:00
buanet
f609f0df8e fix restart in maintenance script 2022-11-30 13:48:35 +01:00
buanet
842e120920 fix device check 2022-11-29 23:07:28 +01:00
buanet
a8a3631665 typo 2022-11-29 22:56:30 +01:00
buanet
d6ac4c2445 remove ls, change log output 2022-11-29 21:02:47 +01:00
buanet
bf348c0c5b testing 2022-11-24 21:46:18 +01:00
buanet
eb32aa20b1 small fixes 2022-11-24 21:28:54 +01:00
buanet
2102d18299 add error handling for usb devices 2022-11-24 17:49:48 +01:00
buanet
5778c62097 add aliases in maintenance script 2022-11-24 17:15:09 +01:00
buanet
b18d22ddf8 Revert "switch from apt-get to apt"
This reverts commit eba7e6c5f9.
2022-11-13 20:51:11 +01:00
buanet
eba7e6c5f9 switch from apt-get to apt 2022-11-12 21:48:26 +01:00
buanet
b0d182adfa new ioBroker versions 2022-11-10 23:48:16 +00:00
buanet
9e74270705 fix logging 2022-11-10 11:51:23 +01:00
buanet
0a99ad9f93 Merge branch 'main' into v7.2.0-beta.1 2022-11-10 09:35:44 +01:00
buanet
d164d9f497 fix packages check 2022-11-09 17:28:14 +01:00
buanet
6fc6b71ac6 add enabled filter for iob list instances 2022-11-09 13:19:23 +01:00
buanet
210b99c643 fix typo 2022-11-09 12:30:20 +01:00
buanet
c8e5a424fe fix typo 2022-11-09 10:27:57 +01:00
buanet
b4eb36223b change error handling 2022-11-09 09:00:37 +01:00
buanet
6223cdad53 skip hostname check when multihost is slave 2022-11-08 22:25:01 +01:00
buanet
5f40675501 fix set adminport 2022-11-08 21:33:54 +01:00
buanet
2bda056f36 fix admin detection 2022-11-08 21:19:58 +01:00
buanet
2ead534cfa add env to disable permission check 2022-11-08 20:21:25 +01:00
buanet
cf175a820f fix hostname check 2022-11-08 19:44:59 +01:00
André Germann
3b73bdb961 Merge pull request #297 from buanet/admin-detection-patch
Admin detection patch
2022-11-08 17:03:34 +01:00
buanet
2f9a19b2a9 fix hostname check 2022-11-08 17:00:49 +01:00
buanet
d924e84366 fix hostname check 2022-11-08 15:03:24 +01:00
buanet
183403a8b3 extend debug logging 2022-11-07 18:10:10 +01:00
André Germann
6b35addabe Update problem_report.yaml 2022-11-04 23:28:18 +01:00
André Germann
019d1c2ace Update feature_request.yaml 2022-11-04 23:27:51 +01:00
André Germann
6942c69ed2 Update feature_request.yaml 2022-11-04 23:27:03 +01:00
André Germann
8babae506a Update feature_request.yaml 2022-11-04 23:26:42 +01:00
André Germann
407b4227ee Merge pull request #295 from buanet/issue_templates
Issue templates
2022-11-04 23:21:59 +01:00
buanet
a2558e3a7b move templates 2022-11-04 09:14:22 +01:00
buanet
6674d1b098 add issue templates 2022-11-04 09:12:07 +01:00
buanet
c08b0b45f1 add env and reorder dockerfile 2022-11-02 21:55:47 +01:00
12 changed files with 285 additions and 126 deletions

View File

@@ -1 +1 @@
v7.1.1
v7.2.0-beta.1

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: ioBroker Docker image discussions
url: https://github.com/buanet/ioBroker.docker/discussions
# about: You can ask your questions here.
- name: ioBroker Community Forum
url: https://forum.iobroker.net/
- name: ioBroker Discord channel
url: https://discord.gg/Ne3y6fUac3
- name: ioBroker Facebook group
url: https://www.facebook.com/groups/440499112958264/

View File

@@ -0,0 +1,17 @@
name: Feature Request
description: I want to request a new feature.
title: "[Feature Request]: "
labels: "enhancement"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to give us your feedback!
- type: textarea
id: description
attributes:
label: Description
description: Please describe your request.
placeholder: Waht are your ideas?
validations:
required: true

View File

@@ -0,0 +1,32 @@
name: Problem Report
description: I want to report a problem.
title: "[Problem]: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: description
attributes:
label: Description
description: Please describe your problem.
placeholder: What happened? What did you expect?
validations:
required: true
- type: input
id: version
attributes:
label: Image version
description: Which image version do you use?
placeholder: v1.2.3
validations:
required: true
- type: textarea
id: logs
attributes:
label: Docker logs
description: Please provide the full Docker log output from your Docker container startup.
render: shell
validations:
required: true

View File

@@ -1 +1 @@
2.4.12
2.5.4

View File

@@ -1,5 +1,17 @@
## Changelog
### v7.2.0-beta.1 (30.11.2022)
* fix restart option in maintenance script
* add error handling for usb devices
* add aliases to maintenance script
* add env PERMISSION_CHECK ([#251](https://github.com/buanet/ioBroker.docker/issues/251))
* add some more DEBUG messages to log
* add env IOB_BACKITUP_EXTDB to unlock external db backups in backitup adapter
* reorder dockerfile steps to fulfill ioBroker Docker check
### v7.1.2 (08.11.2022)
* fix hostname check ([#293](https://github.com/buanet/ioBroker.docker/issues/293))
### v7.1.1 (01.11.2022)
* fix setting gid of iobroker group ([#289](https://github.com/buanet/ioBroker.docker/issues/289))

View File

@@ -48,12 +48,13 @@ RUN chmod 777 /opt/scripts/ \
&& chmod +x /opt/scripts/*.sh \
&& chmod +x /opt/userscripts/*.sh
# Install ioBroker
RUN curl -sL https://iobroker.net/install.sh | bash - \
&& mkdir -p /opt/scripts/.docker_config/ \
# Prepare and install ioBroker
RUN mkdir -p /opt/scripts/.docker_config/ \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
&& echo $(hostname) > /opt/.firstrun \
# Run installer
&& curl -sL https://iobroker.net/install.sh | bash - \
# Deleting UUID from build
&& iobroker unsetup -y \
# Backup initial ioBroker and userscript folder

View File

@@ -48,12 +48,13 @@ RUN chmod 777 /opt/scripts/ \
&& chmod +x /opt/scripts/*.sh \
&& chmod +x /opt/userscripts/*.sh
# Install ioBroker
RUN curl -sL https://iobroker.net/install.sh | bash - \
&& mkdir -p /opt/scripts/.docker_config/ \
# Prepare and install ioBroker
RUN mkdir -p /opt/scripts/.docker_config/ \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
&& echo $(hostname) > /opt/.firstrun \
# Run installer
&& curl -sL https://iobroker.net/install.sh | bash - \
# Deleting UUID from build
&& iobroker unsetup -y \
# Backup initial ioBroker and userscript folder

View File

@@ -10,6 +10,7 @@ echo 'starting' > /opt/scripts/.docker_config/.healthcheck
set +u
adminport=$IOB_ADMINPORT
avahi=$AVAHI
backitup=$IOB_BACKITUP_EXTDB
debug=$DEBUG
multihost=$IOB_MULTIHOST
offlinemode=$OFFLINE_MODE
@@ -17,6 +18,7 @@ objectsdbhost=$IOB_OBJECTSDB_HOST
objectsdbport=$IOB_OBJECTSDB_PORT
objectsdbtype=$IOB_OBJECTSDB_TYPE
packages=$PACKAGES
permissioncheck=$PERMISSION_CHECK
setgid=$SETGID
setuid=$SETUID
statesdbhost=$IOB_STATESDB_HOST
@@ -28,6 +30,22 @@ set -u
pkill_timeout=10 # timeout for iobroker shutdown in seconds
# Stop on error function
stop_on_error() {
if [[ "$debug" == "true" ]]; then
echo ' '
echo "[DEBUG] Debug mode prevents the container from exiting on errors."
echo "[DEBUG] This enables you to investigate or fix your issue on the command line."
echo "[DEBUG] If you want to stop or restart your container you have to do it manually."
echo "[DEBUG] IoBroker is not running!"
tail -f /dev/null
else
echo ' '
echo "This Script will exit now."
exit 1
fi
}
# Getting date and time for logging
dati=`date '+%Y-%m-%d %H:%M:%S'`
@@ -36,14 +54,14 @@ echo ' '
echo "$(printf -- '-%.0s' {1..80})"
echo -n "$(printf -- '-%.0s' {1..25})" && echo -n " "$dati" " && echo "$(printf -- '-%.0s' {1..25})"
echo "$(printf -- '-%.0s' {1..80})"
echo '----- -----'
echo "----- -----"
echo "----- ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗ ███████╗ ██████╗ -----"
echo "----- ██║ ██╔═══██╗ ██╔══██╗ ██╔══██╗ ██╔═══██╗ ██║ ██╔╝ ██╔════╝ ██╔══██╗ -----"
echo "----- ██║ ██║ ██║ ██████╔╝ ██████╔╝ ██║ ██║ █████╔╝ █████╗ ██████╔╝ -----"
echo "----- ██║ ██║ ██║ ██╔══██╗ ██╔══██╗ ██║ ██║ ██╔═██╗ ██╔══╝ ██╔══██╗ -----"
echo "----- ██║ ╚██████╔╝ ██████╔╝ ██║ ██║ ╚██████╔╝ ██║ ██╗ ███████╗ ██║ ██║ -----"
echo "----- ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ -----"
echo '----- -----'
echo "----- -----"
echo "----- Welcome to your ioBroker Docker container! -----"
echo "----- Startupscript is now running! -----"
echo "----- Please be patient! -----"
@@ -64,6 +82,7 @@ echo "----- Environment Variables
if [[ "$adminport" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_ADMINPORT: $adminport)" && echo " -----"; fi
if [[ "$avahi" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" AVAHI: $avahi)" && echo " -----"; fi
if [[ "$debug" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" DEBUG: $debug)" && echo " -----"; fi
if [[ "$backitup" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_BACKITUP_EXTDB: $backitup)" && echo " -----"; fi
if [[ "$multihost" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_MULTIHOST: $multihost)" && echo " -----"; fi
if [[ "$objectsdbhost" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_OBJECTSDB_HOST: $objectsdbhost)" && echo " -----"; fi
if [[ "$objectsdbport" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_OBJECTSDB_PORT: $objectsdbport)" && echo " -----"; fi
@@ -73,6 +92,7 @@ if [[ "$statesdbport" != "" ]]; then echo -n "----- " && echo
if [[ "$statesdbtype" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" IOB_STATESDB_TYPE: $statesdbtype)" && echo " -----"; fi
if [[ "$offlinemode" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" OFFLINE_MODE: $offlinemode)" && echo " -----"; fi
if [[ "$packages" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" PACKAGES: "$packages")" && echo " -----"; fi
if [[ "$permissioncheck" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" PERMISSION_CHECK: $permissioncheck)" && echo " -----"; fi
if [[ "$setgid" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" SETGID: $setgid)" && echo " -----"; fi
if [[ "$setuid" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" SETUID: $setuid)" && echo " -----"; fi
if [[ "$usbdevices" != "" ]]; then echo -n "----- " && echo -n "$(printf "%-20s %-28s" USBDEVICES: $usbdevices)" && echo " -----"; fi
@@ -80,6 +100,19 @@ if [[ "$zwave" != "" ]]; then echo -n "----- " && echo -n "$(
echo "$(printf -- '-%.0s' {1..80})"
echo ' '
# Debug loggin notice
if [[ "$debug" == "true" ]]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!!!! DEBUG LOG ACTIVE !!!!"
echo "!!!! Environment variable DEBUG is set to true. !!!!"
echo "!!!! This will extend the logging output and may slow down container start. !!!!"
echo "!!!! Please make sure to deactivate if no longer needed. !!!!"
echo "!!!! For more information see ioBroker Docker image documentation: !!!!"
echo "!!!! https://docs.buanet.de/iobroker-docker-image/docs/ !!!!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ' '
fi
#####
# STEP 1 - Preparing container
#####
@@ -92,21 +125,21 @@ echo ' '
if [[ -f /opt/.firstrun ]]; then
# Updating Linux packages
if [[ "$offlinemode" = "true" ]]; then
echo 'OFFLINE_MODE is \"true\". Skipping Linux package updates on first run.'
echo "OFFLINE_MODE is \"true\". Skipping Linux package updates on first run."
echo ' '
else
echo 'Updating Linux packages on first run...'
echo "Updating Linux packages on first run... "
bash /opt/scripts/setup_packages.sh -update
echo 'Done.'
echo ' '
fi
# Installing packages from ENV
if [[ "$packages" != "" && "$offlinemode" = "true" ]]; then
echo 'PACKAGES is set, but OFFLINE_MODE is \"true\". Skipping Linux package installation.'
echo "PACKAGES is set, but OFFLINE_MODE is \"true\". Skipping Linux package installation."
echo ' '
else
echo 'PACKAGES is set. Installing additional Linux packages.'
echo "Checking the following packages:" $packages"..."
elif [[ "$packages" != "" ]]; then
echo "PACKAGES is set. Installing additional Linux packages."
echo "Checking the following packages:" $packages"... "
echo $packages > /opt/scripts/.docker_config/.packages
bash /opt/scripts/setup_packages.sh -install
echo 'Done.'
@@ -120,7 +153,7 @@ if [[ -f /opt/.firstrun ]]; then
echo 'Done.'
echo ' '
else
echo 'This is not the first run of this container. Skipping first run preparation.'
echo "This is not the first run of this container. Skipping first run preparation."
echo ' '
fi
@@ -160,9 +193,7 @@ elif [[ "$(ls *_backupiobroker.tar.gz 2> /dev/null | wc -l)" != "0" && "$(tar -z
exit 1
else
echo "IoBroker backup file detected in /opt/iobroker."
if [[ "$debug" == "true" ]]; then
echo "[DEBUG] Backup file name: " $(ls *_backupiobroker.tar.gz)
fi
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Backup file name: " $(ls *_backupiobroker.tar.gz); fi
echo -n "Preparing restore... "
mv /opt/iobroker/*.tar.gz /opt/
tar -xf /opt/initial_iobroker.tar -C /
@@ -175,14 +206,14 @@ elif [[ "$(ls *_backupiobroker.tar.gz 2> /dev/null | wc -l)" != "0" && "$(tar -z
bash iobroker restore 0 > /opt/iobroker/log/restore.log 2>&1
echo 'Done.'
echo ' '
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!!!!! IMPORTANT NOTE !!!!!"
echo "!!!!! The startup script restored iobroker from a backup file. !!!!!"
echo "!!!!! Check /opt/iobroker/log/restore.log to see if restore was successful. !!!!!"
echo "!!!!! When ioBroker now starts it will reinstall all Adapters automatically. !!!!!"
echo "!!!!! This might be take a looooong time! Please be patient! !!!!!"
echo "!!!!! You can view installation process by taking a look at ioBroker log. !!!!!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!!!! IMPORTANT NOTE !!!!"
echo "!!!! The startup script restored iobroker from a backup file. !!!!"
echo "!!!! Check /opt/iobroker/log/restore.log to see if restore was successful. !!!!"
echo "!!!! When ioBroker now starts it will reinstall all Adapters automatically. !!!!"
echo "!!!! This might be take a looooong time! Please be patient! !!!!"
echo "!!!! You can view installation process by taking a look at ioBroker log. !!!!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi
else
echo "There is data detected in /opt/iobroker but it looks like it is no instance of ioBroker or a valid backup file!"
@@ -204,11 +235,16 @@ echo "$(printf -- '-%.0s' {1..80})"
echo ' '
# (Re)Setting permissions to "/opt/iobroker" and "/opt/scripts"
echo -n "(Re)setting permissions (This might take a while! Please be patient!)... "
chown -R $setuid:$setgid /opt/iobroker
chown -R $setuid:$setgid /opt/scripts
echo 'Done.'
echo ' '
if [[ "$permissioncheck" == "false" ]]; then
echo "PERMISSION_CHECK is set to false. Use this at your own risk!"
echo ' '
else
echo -n "(Re)setting permissions (This might take a while! Please be patient!)... "
chown -R $setuid:$setgid /opt/iobroker
chown -R $setuid:$setgid /opt/scripts
echo 'Done.'
echo ' '
fi
# Backing up original iobroker-file and changing sudo to gosu
echo -n "Fixing \"sudo-bug\" by replacing sudo with gosu... "
@@ -218,38 +254,75 @@ echo -n "Fixing \"sudo-bug\" by replacing sudo with gosu... "
echo 'Done.'
echo ' '
# checking hostname in ioBroker to match container hostname
if [[ "$(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')" != "$(hostname)" && "$multihost" != "slave" ]]; then
echo "Hostname in ioBroker does not match the hostname of this container."
if [[ "$debug" == "true" ]]; then
echo "[DEBUG] Detected hostname in ioBroker: " $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')
echo "[DEBUG] Detected hostname in container: " $(hostname)
fi
echo -n "Updating hostname to "$(hostname)"... "
bash iobroker host $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')
echo 'Done.'
echo ' '
elif [[ "$multihost" == "slave" ]]; then
# hostname check
if [[ "$multihost" == "slave" ]]; then
echo "IOB_MULTIHOST ist set to \"slave\". Hostname check will be skipped."
echo ' '
elif [[ "$(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')" = "$(hostname)" && "$multihost" != "slave" ]]; then
echo "Hostname in ioBroker matches the hostname of this container."
if [[ "$debug" == "true" ]]; then
echo "[DEBUG] Detected hostname in ioBroker: " $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')
echo "[DEBUG] Detected hostname in container: " $(hostname)
fi
echo "No action required."
echo ' '
else
if [[ "$debug" == "true" ]]; then
echo "[DEBUG] There was a problem checking the hostname."
echo "[DEBUG] Detected hostname in ioBroker: " $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')
echo "[DEBUG] Detected hostname in container: " $(hostname)
# get admin instance and hostname
set +e
admininstance=$(bash iobroker list instances | grep 'enabled' | grep -m 1 -o 'system.adapter.admin..')
set -e
if [[ "$admininstance" != "" ]]; then
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected admin instance is:" $admininstance; fi
adminhostname=$(bash iobroker object get $admininstance --pretty | grep -oP '(?<="host": ")[^"]*')
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected admin hostname is:" $adminhostname; fi
else
echo "There was a problem detecting the admin instance of your iobroker."
echo "Make sure the ioBroker installation you use has an admin instance or start over with a fresh installation and restore your configuration."
echo "For more details see https://docs.buanet.de/iobroker-docker-image/docs/#restore"
stop_on_error
fi
# check hostname
if [[ "$adminhostname" != "" && "$adminhostname" != "$(hostname)" ]]; then
echo "Hostname in ioBroker does not match the hostname of this container."
echo -n "Updating hostname to "$(hostname)"... "
bash iobroker host $adminhostname
echo 'Done.'
echo ' '
elif [[ "$adminhostname" = "$(hostname)" ]]; then
echo "Hostname in ioBroker matches the hostname of this container."
echo "No action required."
echo ' '
else
echo "There was a problem checking the hostname."
stop_on_error
fi
fi
# extended debug output
if [[ "$debug" == "true" && "$multihost" != "slave" ]]; then
echo "[DEBUG] Collecting some more ioBroker debug information... "
echo ' '
# get information and send to array
IFS=$'\n'
instances_array=($(iob list instances))
repos_array=($(iob repo list))
updates_array=($(iob update))
# list iob instances
echo "[DEBUG] ##### iobroker list instances #####"
for i in ${instances_array[@]}
do
echo "[DEBUG]" $i
done
echo ' '
echo "[DEBUG] ##### iobroker repo list #####"
for i in ${repos_array[@]}
do
echo "[DEBUG]" $i
done
echo ' '
echo "[DEBUG] ##### iobroker update #####"
for i in ${updates_array[@]}
do
echo "[DEBUG]" $i
done
echo ' '
unset IFS
fi
#####
# STEP 4 - Setting up prerequisites for some ioBroker-adapters
# STEP 4 - Setting up special sessting for ioBroker-adapters
#####
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 4 of 5: Applying special settings -----"
@@ -261,24 +334,32 @@ echo "For more information see ioBroker Docker Image Docs (https://docs.buanet.d
echo ' '
# Checking ENV for Adminport
if [[ "$adminport" != "" ]]; then
if [[ "$adminport" != "$(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="port": )[^,]*')" ]]; then
if [[ "$adminport" != "" && "$multihost" != "slave" ]]; then
adminportold=$(bash iobroker object get $admininstance --pretty | grep -oP '(?<="port": )[^,]*')
admininstanceshort=$(echo $admininstance | grep -m 1 -o 'admin..')
if [[ "$adminport" != "$adminportold" ]]; then
echo "IOB_ADMINPORT is set and does not match port configured in ioBroker."
if [[ "$debug" == "true" ]]; then
echo "[DEBUG] Detected Admin Port in ioBroker: " $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="port": )[^,]*')
fi
echo -n "Setting Adminport to \""$adminport"\"... "
bash iobroker set admin.0 --port $adminport
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected Admin Port in ioBroker: " $adminportold; fi
echo "Setting Adminport to \""$adminport"\"... "
bash iobroker set $admininstanceshort --port $adminport
echo 'Done.'
echo ' '
fi
fi
# Checking ENV for Backitup (external database backups)
if [[ "$backitup" == "true" ]]; then
echo -n "IOB_BACKITUP_EXTDB is \"true\". Unlocking features... "
echo 'true' > /opt/scripts/.docker_config/.backitup
echo 'Done.'
echo ' '
fi
# Checking ENV for AVAHI
if [[ "$avahi" = "true" && "$offlinemode" = "true" ]]; then
echo 'AVAHI is \"true\", but OFFLINE_MODE is also \"true\". Skipping Avahi daemon setup.'
echo "AVAHI is \"true\", but OFFLINE_MODE is also \"true\". Skipping Avahi daemon setup."
elif [[ "$avahi" = "true" ]]; then
echo 'AVAHI is \"true\". Running setup script...'
echo "AVAHI is \"true\". Running setup script... "
chmod 755 /opt/scripts/setup_avahi.sh
bash /opt/scripts/setup_avahi.sh
echo 'Done.'
@@ -287,9 +368,9 @@ fi
# Checking ENV for Z-WAVE
if [[ "$zwave" = "true" && "$offlinemode" = "true" ]]; then
echo 'ZWAVE is \"true\", but OFFLINE_MODE is also \"true\". Skipping Z-Wave setup.'
echo "ZWAVE is \"true\", but OFFLINE_MODE is also \"true\". Skipping Z-Wave setup."
elif [[ "$zwave" = "true" ]]; then
echo 'ZWAVE is \"true\". Running setup script...'
echo "ZWAVE is \"true\". Running setup script... "
chmod 755 /opt/scripts/setup_zwave.sh
bash /opt/scripts/setup_zwave.sh
echo 'Done.'
@@ -298,21 +379,29 @@ fi
# checking ENV for USBDEVICES
if [[ "$usbdevices" != "" && "$usbdevices" != "none" ]]; then
echo 'USBDEVICES is set.'
echo "USBDEVICES is set."
IFS=';' read -ra devicearray <<< "$usbdevices"
for i in "${devicearray[@]}"
do
echo -n "Setting permissions for "$i"... "
if [[ -e $i ]]; then
echo -n "Setting permissions for "$i"... "
chown root:dialout $i
chmod g+rw $i
echo 'Done.'
echo 'Done.'
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Permissions set: " $(ls -al $i); fi
else
echo "Looks like the device \""$i"\" does not exist."
echo "Did you mount it correctly by using the \"--device\" option?"
echo "For more information see ioBroker Docker Image Docs (https://docs.buanet.de/iobroker-docker-image/docs/#mounting-usb-devices)."
stop_on_error
fi
done
echo ' '
fi
# Checking ENV for multihost setup
if [[ "$multihost" != "" ]]; then
echo "Checking for multihost settings..."
echo "Checking for multihost settings... "
# Configuring objects db host
if [[ "$multihost" = "master" && "$objectsdbtype" = "" && "$objectsdbhost" = "" && "$objectsdbport" = "" ]]; then
echo "IOB_MULTIHOST is set to \"master\" and no external objects db is set."
@@ -375,7 +464,7 @@ fi
# Checking ENVs for custom setup of objects db
if [[ "$objectsdbtype" != "" || "$objectsdbhost" != "" || "$objectsdbport" != "" ]]; then
echo "Checking for custom objects db settings ..."
echo "Checking for custom objects db settings ... "
if [[ "$objectsdbtype" != "$(jq -r '.objects.type' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then
echo "IOB_OBJECTSDB_TYPE is set and value is different from detected ioBroker installation."
echo -n "Setting type of objects db to \""$objectsdbtype"\"... "
@@ -403,13 +492,13 @@ if [[ "$objectsdbtype" != "" || "$objectsdbhost" != "" || "$objectsdbport" != ""
else
echo "IOB_OBJECTSDB_PORT is set and value meets detected ioBroker installation."
fi
echo "Done."
echo 'Done.'
echo ' '
fi
# Checking ENVs for custom setup of states db
if [[ "$statesdbtype" != "" || "$statesdbhost" != "" || "$statesdbport" != "" ]]; then
echo "Checking for custom states db settings..."
echo "Checking for custom states db settings... "
if [[ "$statesdbtype" != "$(jq -r '.states.type' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then
echo "IOB_STATESDB_TYPE is set and value is different from detected ioBroker installation."
echo -n "Setting type of states db to \""$statesdbtype"\"... "
@@ -437,7 +526,7 @@ if [[ "$statesdbtype" != "" || "$statesdbhost" != "" || "$statesdbport" != "" ]]
else
echo "IOB_STATESDB_PORT is set and value meets detected ioBroker installation."
fi
echo "Done."
echo 'Done.'
echo ' '
fi
@@ -452,17 +541,17 @@ if [[ `find /opt/userscripts -type f | wc -l` -lt 1 ]]; then
elif [[ -f /opt/userscripts/userscript_firststart.sh || -f /opt/userscripts/userscript_everystart.sh ]]; then
if [[ -f /opt/userscripts/userscript_firststart.sh && -f /opt/.firstrun ]]; then
echo "Userscript for first start detected and this is the first start of a new container."
echo "Running userscript_firststart.sh..."
echo "Running userscript_firststart.sh... "
chmod 755 /opt/userscripts/userscript_firststart.sh
bash /opt/userscripts/userscript_firststart.sh
echo "Done."
echo 'Done.'
echo ' '
fi
if [[ -f /opt/userscripts/userscript_everystart.sh ]]; then
echo "Userscript for every start detected. Running userscript_everystart.sh..."
echo "Userscript for every start detected. Running userscript_everystart.sh... "
chmod 755 /opt/userscripts/userscript_everystart.sh
bash /opt/userscripts/userscript_everystart.sh
echo "Done."
echo 'Done.'
echo ' '
fi
fi
@@ -479,7 +568,7 @@ echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 5 of 5: ioBroker startup -----"
echo "$(printf -- '-%.0s' {1..80})"
echo ' '
echo "Starting ioBroker..."
echo "Starting ioBroker... "
echo ' '
echo "##### #### ### ## # iobroker.js-controller log output # ## ### #### #####"
@@ -490,7 +579,7 @@ echo "running" > /opt/scripts/.docker_config/.healthcheck
shut_down() {
echo ' '
echo "Recived termination signal (SIGTERM)."
echo "Shutting down ioBroker..."
echo "Shutting down ioBroker... "
local status timeout
@@ -508,7 +597,7 @@ shut_down() {
# pgrep exits with status 1 when there are no matches
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
if (($(date +%s) > timeout)); then
echo -e '\nTimeout reached. Killing remaining processes...'
echo -e '\nTimeout reached. Killing remaining processes... '
pkill --signal SIGKILL -u iobroker
echo 'Done. Have a nice day!'
exit

View File

@@ -158,33 +158,6 @@ upgrade_jscontroller() {
pkill -u root
}
# restart container
restart_container() {
echo 'You are now going to call a restart of your container.'
echo 'Restarting will work depending on the configured restart policy.'
if [[ "$autoconfirm" != yes ]]; then
local reply
read -rp 'Do you want to continue [yes/no]? ' reply
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
: # continue
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
echo -n 'Stopping ioBroker...'
stop_iob
echo 'Container will be stopped or restarted in 5 seconds...'
sleep 5
echo 'stopping' > "$healthcheck"
pkill -u root
}
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
stop_iob() {
local status timeout
@@ -217,6 +190,33 @@ stop_iob() {
echo -e '\nDone.'
}
# restart container
restart_container() {
echo 'You are now going to call a restart of your container.'
echo 'Restarting will work depending on the configured restart policy.'
if [[ "$autoconfirm" != yes ]]; then
local reply
read -rp 'Do you want to continue [yes/no]? ' reply
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
: # continue
else
return 1
fi
else
echo 'This command was already confirmed by the -y or --yes option.'
fi
echo -n 'Stopping ioBroker...'
stop_iob
echo 'Container will be stopped or restarted in 5 seconds...'
sleep 5
echo 'stopping' > "$healthcheck"
pkill -u root
}
# parsing commands and options
# default command to run unless another was given
@@ -227,7 +227,7 @@ for arg in "$@"; do
help|-h|--help)
run=(display_help)
;;
status)
status|stat|s)
run=(maintenance_status)
;;
on)
@@ -236,10 +236,10 @@ for arg in "$@"; do
off)
run=(disable_maintenance)
;;
upgrade)
upgrade|upgr|u)
run=(upgrade_jscontroller)
;;
restart)
restart|rest|r)
run=(restart_container)
;;
-y|--yes)

View File

@@ -29,18 +29,16 @@ New major image versions (e.g. v4, v5, v6) always come with a new major version
It is highly recommended not to use the `latest` tag for production, especially when using any kind of automated update procedure like watchtower. Please use the `latest-v[X]` tag instead.
### Node 16 versions
* [`v7.0.1`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`latest-v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`latest`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile)
* [`v7.1.2`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`latest-v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`latest`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile)
* [`v7.1.1`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile)
* [`v7.1.0`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile)
* [`v7.0.1`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile)
* [`v7.0.0`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile)
### Node 14 versions
* [`v6.1.0`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`latest-v6`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile)
* [`v6.0.0`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile)
### Node 12 versions
* [`v5.2.0`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`latest-v5`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile)
* [`v5.1.0`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/amd64/Dockerfile), [`v5.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/amd64/Dockerfile), [`v5.1.0-armv7hf`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/armv7hf/Dockerfile), [`v5.1.0-aarch64`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/aarch64/Dockerfile)
* [`v5.0.0`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/amd64/Dockerfile), [`v5.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/amd64/Dockerfile), [`v5.0.0-armv7hf`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/armv7hf/Dockerfile), [`v5.0.0-aarch64`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/aarch64/Dockerfile)
# What is ioBroker?
IoBroker is a open source IoT platform written in JavaScript that easily connects smarthome components from different manufactures. With the help of plugins (called: "adapters") ioBroker is able to communicate with a big variety of IoT hardware and services using different protocols and APIs.<br>

View File

@@ -30,18 +30,16 @@ New major image versions (e.g. v4, v5, v6) always come with a new major version
It is highly recommended not to use the `latest` tag for production, especially when using any kind of automated update procedure like watchtower. Please use the `latest-v[X]` tag instead.
### Node 16 versions
* [`v7.0.1`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`latest-v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`latest`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile)
* [`v7.1.2`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`v7.1.2-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`latest-v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile), [`latest`](https://github.com/buanet/ioBroker.docker/blob/v7.1.2/debian/node16/Dockerfile)
* [`v7.1.1`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile), [`v7.1.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.1/debian/node16/Dockerfile)
* [`v7.1.0`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile), [`v7.1.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.1.0/debian/node16/Dockerfile)
* [`v7.0.1`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile), [`v7.0.1-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.1/debian/node16/Dockerfile)
* [`v7.0.0`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile), [`v7.0.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v7.0.0/debian/node16/Dockerfile)
### Node 14 versions
* [`v6.1.0`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`v6.1.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile), [`latest-v6`](https://github.com/buanet/ioBroker.docker/blob/v6.1.0/debian/node14/Dockerfile)
* [`v6.0.0`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile), [`v6.0.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v6.0.0/debian/node14/Dockerfile)
### Node 12 versions
* [`v5.2.0`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-arm32v7`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`v5.2.0-arm64v8`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile), [`latest-v5`](https://github.com/buanet/ioBroker.docker/blob/v5.2.0/debian/node12/Dockerfile)
* [`v5.1.0`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/amd64/Dockerfile), [`v5.1.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/amd64/Dockerfile), [`v5.1.0-armv7hf`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/armv7hf/Dockerfile), [`v5.1.0-aarch64`](https://github.com/buanet/ioBroker.docker/blob/v5.1.0/aarch64/Dockerfile)
* [`v5.0.0`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/amd64/Dockerfile), [`v5.0.0-amd64`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/amd64/Dockerfile), [`v5.0.0-armv7hf`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/armv7hf/Dockerfile), [`v5.0.0-aarch64`](https://github.com/buanet/ioBroker.docker/blob/v5.0.0/aarch64/Dockerfile)
# What is ioBroker?
IoBroker is a open source IoT platform written in JavaScript that easily connects smarthome components from different manufactures. With the help of plugins (called: "adapters") ioBroker is able to communicate with a big variety of IoT hardware and services using different protocols and APIs.<br>