Merge branch 'main' into hotfix/issue-335/avoid_setup_first_on_slaves

This commit is contained in:
André Germann
2023-04-17 20:48:23 +02:00
committed by GitHub
14 changed files with 77 additions and 34 deletions

View File

@@ -1 +1 @@
2.5.12 2.6.16

View File

@@ -43,7 +43,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0

View File

@@ -43,7 +43,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0
@@ -64,12 +64,17 @@ jobs:
context: ./debian context: ./debian
file: ./debian/node18/Dockerfile file: ./debian/node18/Dockerfile
push: true push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 platforms: |
linux/amd64
linux/arm/v7
linux/arm64/v8
tags: | tags: |
buanet/iobroker:beta, buanet/iobroker:beta,
buanet/iobroker:${{ env.version }}, buanet/iobroker:${{ env.version }},
ghcr.io/buanet/iobroker:beta, ghcr.io/buanet/iobroker:beta,
ghcr.io/buanet/iobroker:${{ env.version }} ghcr.io/buanet/iobroker:${{ env.version }}
provenance: false
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
- name: Delete untagged images from GitHub packages - name: Delete untagged images from GitHub packages
uses: actions/github-script@v6 uses: actions/github-script@v6

View File

@@ -37,7 +37,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0

View File

@@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3.5.0
with: with:
repository: 'buanet/ioBroker.docker' repository: 'buanet/ioBroker.docker'
- name: Fetching version tag and date - name: Fetch version tag and date
id: version id: version
run: | run: |
VERSION="$(cat .VERSION)" VERSION="$(cat .VERSION)"
@@ -37,7 +37,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0
@@ -52,19 +52,24 @@ jobs:
username: ${{ secrets.PACKAGES_USER }} username: ${{ secrets.PACKAGES_USER }}
password: ${{ secrets.PACKAGES_PASS }} password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image - name: Build and push Docker image
uses: docker/build-push-action@v4.0.0 uses: docker/build-push-action@v4.0.0
with: with:
context: ./debian context: ./debian
file: ./debian/node18/Dockerfile file: ./debian/node18/Dockerfile
push: true push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 platforms: |
linux/amd64
linux/arm/v7
linux/arm64/v8
tags: | tags: |
buanet/iobroker:dev, buanet/iobroker:dev,
ghcr.io/buanet/iobroker:dev ghcr.io/buanet/iobroker:dev
provenance: false
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
- name: Delete untagged images from GitHub packages - name: Delete untagged images from GitHub Container Registry
uses: actions/github-script@v6 uses: actions/github-script@v6.4.1
with: with:
github-token: ${{ secrets.PACKAGES_PASS }} github-token: ${{ secrets.PACKAGES_PASS }}
script: | script: |
@@ -81,4 +86,4 @@ jobs:
env: env:
OWNER: buanet OWNER: buanet
PACKAGE_NAME: iobroker PACKAGE_NAME: iobroker
PER_PAGE: 100 PER_PAGE: 100

View File

@@ -38,15 +38,15 @@ jobs:
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian/scripts/iobroker_startup.sh > ./debian/scripts/iobroker_startup.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian/scripts/iobroker_startup.sh > ./debian/scripts/iobroker_startup.tmp
mv -f ./debian/scripts/iobroker_startup.tmp ./debian/scripts/iobroker_startup.sh mv -f ./debian/scripts/iobroker_startup.tmp ./debian/scripts/iobroker_startup.sh
# amd64 # amd64
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" ./debian/node16/Dockerfile > ./debian/node16/Dockerfile.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" ./debian/node18/Dockerfile > ./debian/node18/Dockerfile.tmp
mv -f ./debian/node16/Dockerfile.tmp ./debian/node16/Dockerfile mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0 uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub (iobroker) - name: Login to DockerHub (iobroker)
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0
@@ -58,7 +58,7 @@ jobs:
uses: docker/build-push-action@v4.0.0 uses: docker/build-push-action@v4.0.0
with: with:
context: ./debian context: ./debian
file: ./debian/node16/Dockerfile file: ./debian/node18/Dockerfile
push: true push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
tags: | tags: |

View File

@@ -38,16 +38,15 @@ jobs:
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian/scripts/iobroker_startup.sh > ./debian/scripts/iobroker_startup.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian/scripts/iobroker_startup.sh > ./debian/scripts/iobroker_startup.tmp
mv -f ./debian/scripts/iobroker_startup.tmp ./debian/scripts/iobroker_startup.sh mv -f ./debian/scripts/iobroker_startup.tmp ./debian/scripts/iobroker_startup.sh
# amd64 # amd64
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" ./debian/node16/Dockerfile > ./debian/node16/Dockerfile.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" ./debian/node18/Dockerfile > ./debian/node18/Dockerfile.tmp
mv -f ./debian/node16/Dockerfile.tmp ./debian/node16/Dockerfile mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0 uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2.4.1 uses: docker/setup-buildx-action@v2.5.0
- name: Login to DockerHub (buanet) - name: Login to DockerHub (buanet)
uses: docker/login-action@v2.1.0 uses: docker/login-action@v2.1.0
with: with:
@@ -65,7 +64,8 @@ jobs:
uses: docker/build-push-action@v4.0.0 uses: docker/build-push-action@v4.0.0
with: with:
context: ./debian context: ./debian
file: ./debian/node16/Dockerfile file: ./debian/node18/Dockerfile
#provenance: false
push: true push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
tags: | tags: |

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.vscode/

View File

@@ -1,5 +0,0 @@
{
"cSpell.enableFiletypes": [
"shellscript"
]
}

View File

@@ -3,6 +3,12 @@
### v8.0.1 (17.04.2023) ### v8.0.1 (17.04.2023)
* fix calling of "iob setup first" on slaves ([#335](https://github.com/buanet/ioBroker.docker/issues/335)) * fix calling of "iob setup first" on slaves ([#335](https://github.com/buanet/ioBroker.docker/issues/335))
### v8.1.0-beta.1 (14.04.2023)
* enhance github actions
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333))
* allow iobroker admin to be disabled at startup ([#332](https://github.com/buanet/ioBroker.docker/issues/332))
* allow deletion of objects and states db password with value "none" ([#306](https://github.com/buanet/ioBroker.docker/issues/306))
### v8.0.0 (20.03.2023) ### v8.0.0 (20.03.2023)
* update readme and docs * update readme and docs
* remove manifests * remove manifests

View File

@@ -1,7 +1,7 @@
FROM debian:bullseye-slim FROM debian:bullseye-slim
LABEL org.opencontainers.image.title="Official ioBroker Docker Image" \ LABEL org.opencontainers.image.title="Official ioBroker Docker Image" \
org.opencontainers.image.description="Officical Docker image for ioBroker smarthome software (https://www.iobroker.net)" \ org.opencontainers.image.description="Official Docker image for ioBroker smarthome software (https://www.iobroker.net)" \
org.opencontainers.image.documentation="https://github.com/buanet/ioBroker.docker#readme" \ org.opencontainers.image.documentation="https://github.com/buanet/ioBroker.docker#readme" \
org.opencontainers.image.authors="André Germann <info@buanet.de>" \ org.opencontainers.image.authors="André Germann <info@buanet.de>" \
org.opencontainers.image.url="https://github.com/buanet/ioBroker.docker" \ org.opencontainers.image.url="https://github.com/buanet/ioBroker.docker" \

View File

@@ -352,10 +352,20 @@ else
adminhostname=$(bash iobroker object get "$admininstance" --pretty | grep -oP '(?<="host": ")[^"]*') adminhostname=$(bash iobroker object get "$admininstance" --pretty | grep -oP '(?<="host": ")[^"]*')
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected admin hostname is:" "$adminhostname"; fi if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected admin hostname is:" "$adminhostname"; fi
else else
echo "There was a problem detecting the admin instance of your iobroker." set +e
echo "Make sure the ioBroker installation you use has an admin instance or try again with a fresh installation and restore your configuration." admininstance=$(bash iobroker list instances | grep 'disabled' | grep -m 1 -o 'system.adapter.admin..')
echo "For more details see https://docs.buanet.de/iobroker-docker-image/docs/#restore" set -e
stop_on_error if [[ "$admininstance" != "" ]]; then
if [[ "$debug" == "true" ]]; then echo "[DEBUG] Detected admin instance is disabled."; fi
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 try again 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
fi fi
# check hostname # check hostname
if [[ "$adminhostname" != "" && "$adminhostname" != "$(hostname)" ]]; then if [[ "$adminhostname" != "" && "$adminhostname" != "$(hostname)" ]]; then

View File

@@ -242,7 +242,16 @@ restore_iobroker() {
#chown -R $setuid:$setgid /opt/iobroker/backup #chown -R $setuid:$setgid /opt/iobroker/backup
echo -n "Restoring ioBroker... " echo -n "Restoring ioBroker... "
set +e
bash iobroker restore 0 > /opt/iobroker/log/restore.log 2>&1 bash iobroker restore 0 > /opt/iobroker/log/restore.log 2>&1
return=$?
set -e
if [[ "$return" -ne 0 ]]; then
echo "Failed."
echo "For more details see \"/opt/iobroker/log/restore.log\"."
echo "Please check backup file location and permissions and try again."
return 1
fi
echo 'Done.' echo 'Done.'
echo ' ' echo ' '
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

View File

@@ -99,7 +99,13 @@ set_objectsdb_port() {
fi fi
} }
set_objectsdb_pass() { set_objectsdb_pass() {
if [[ "$objectsdbpass" != "$(jq -r '.objects.options.auth_pass' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then if [[ "$objectsdbpass" == "none" ]]; then
echo "IOB_OBJECTSDB_PASS is available but value is set to \"none\"."
echo -n "Removing password of objects db... "
jq '.objects.options.auth_pass = null' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp
write_iobroker_json
echo 'Done.'
elif [[ "$objectsdbpass" != "$(jq -r '.objects.options.auth_pass' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then
echo "IOB_OBJECTSDB_PASS is available but value is different from detected ioBroker installation." echo "IOB_OBJECTSDB_PASS is available but value is different from detected ioBroker installation."
echo -n "Setting password of objects db... " echo -n "Setting password of objects db... "
jq --arg value "$objectsdbpass" '.objects.options.auth_pass = $value' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp jq --arg value "$objectsdbpass" '.objects.options.auth_pass = $value' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp
@@ -188,7 +194,13 @@ set_statesdb_port() {
fi fi
} }
set_statesdb_pass() { set_statesdb_pass() {
if [[ "$statesdbpass" != "$(jq -r '.states.options.auth_pass' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then if [[ "$statesdbpass" == "none" ]]; then
echo "IOB_STATESDB_PASS is available but value is set to \"none\"."
echo -n "Removing password of states db... "
jq '.states.options.auth_pass = null' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp
write_iobroker_json
echo 'Done.'
elif [[ "$statesdbpass" != "$(jq -r '.states.options.auth_pass' /opt/iobroker/iobroker-data/iobroker.json)" ]]; then
echo "IOB_STATESDB_PASS is available but value is different from detected ioBroker installation." echo "IOB_STATESDB_PASS is available but value is different from detected ioBroker installation."
echo -n "Setting password of states db... " echo -n "Setting password of states db... "
jq --arg value "$statesdbpass" '.states.options.auth_pass = $value' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp jq --arg value "$statesdbpass" '.states.options.auth_pass = $value' /opt/iobroker/iobroker-data/iobroker.json > /opt/iobroker/iobroker-data/iobroker.json.tmp