Coder Social home page Coder Social logo

fhem / fhem-docker Goto Github PK

View Code? Open in Web Editor NEW
85.0 10.0 27.0 786 KB

A basic Docker image for FHEM house automation system, based on Debian Linux.

Home Page: https://fhem.de/

License: MIT License

Shell 79.63% Perl 20.37%
fhem fhem-docker docker-fhem home-automation home-automation-system house-automation docker-image dockerfile

fhem-docker's Introduction

Main branch - Build and Test Development branch - Build and Test


Docker image for FHEM

A Docker image for FHEM house automation system, based on Debian.

Installation

Pre-build images are available on Docker Hub Reccomended pulling from Github Container Registry to allow automatic image for your system.

From Docker Hub

docker pull fhem/fhem:latest

From Github container registry

Image with serval services installed

Updated versions based on

  • debian bullseye

  • Perl 5.36.3 (optional threaded)

  • NodeJS 18 LTS

  • Python 3.9.2

  • Python 2.7.18

  • Supported Plattforms: linux/amd64, linux/arm/v7, linux/arm64

  • NOTE: alexa-fhem, alexa-cookie, gassistant-fhem, homebridge, homebridge-fhem, tradfri-fhem are not installed per default!

      docker pull ghcr.io/fhem/fhem-docker:4-bullseye
      docker pull ghcr.io/fhem/fhem-docker:4-threaded-bullseye
    

If you are using 3rd Party modules which are not available on the FHEM svn repository, you may need this image, because it has more perl modules preinstalled.

Not updated anymore since Jan 2024
  • debian buster

  • Perl 5.28.1

  • NodeJS 16 LTS

  • Python 3

  • Supported Plattforms: linux/amd64, linux/arm/v7, linux/arm64

  • NOTE: alexa-fhem, alexa-cookie, gassistant-fhem, homebridge, homebridge-fhem, tradfri-fhem are not installed per default!

      docker pull ghcr.io/fhem/fhem-docker:3-buster
    

are available.

Image with perl core services installed

  • debian bullseye

  • Perl 5.36.3 (optional threaded)

  • Python 3.9.2

  • Python 2.7.18

  • Supported Plattforms: linux/amd64, linux/arm/v7, linux/arm64, linux/i386,

      docker pull ghcr.io/fhem/fhem-minimal-docker:4-bullseye
      docker pull ghcr.io/fhem/fhem-minimal-docker:4-threaded-bullseye
    

If you are using only modules which are provided via FHEM svn repository, you mostly can use this smaller image.

Not updated anymore since Jan 2024
  • debian buster

  • Perl 5.28.1

  • Supported Plattforms: linux/amd64, linux/arm/v7, linux/arm64, linux/i386,

      docker pull ghcr.io/fhem/fhem-minimal-docker:3-buster
    

are available.

To start your container right away:

    docker run -d --name fhem -p 8083:8083 ghcr.io/fhem/fhem-docker:4-bullseye

Storage

Usually you want to keep your FHEM setup after a container was destroyed (or re-build) so it is a good idea to provide an external directory on your Docker host to keep that data:

    docker run -d --name fhem -p 8083:8083 -v /some/host/directory:/opt/fhem ghcr.io/fhem/fhem-docker:4-bullseye

You will find more general information about using volumes from the Docker documentation for Use volumes and Bind mounts.

It is also possible to mount CIFS mounts directly.

Access FHEM

After starting your container, you may now start your favorite browser to open one of FHEM's web interface variants like http://xxx.xxx.xxx.xxx:8083/.

You may want to have a look to the FHEM documentation sources for further information about how to use and configure FHEM.

Update strategy

Note that any existing FHEM installation you are mounting into the container will not be updated automatically, it is just the container and its system environment that can be updated by pulling a new FHEM Docker image. This is because the existing update philosophy is incompatible with the new and state-of-the-art approach of containerized application updates. That being said, consider the FHEM Docker image as a runtime environment for FHEM which is also capable to install FHEM for any new setup from scratch.

Customize your container configuration

Performance implications

The FHEM log file is mirrored to the Docker console output in order to give input for any Docker related tools. However, if the log file becomes too big, this will lead to some performance implications. For that reason, the default value of the global attribute logfile is different from the FHEM default configuration and set to a daily file (attr global logfile ./log/fhem-%Y-%m-%d.log).

It is highly recommended to keep this setting. Please note that FileLog are only patched if fhem is fresh installed. Devices might still need to be checked and adjusted manually if you would like to properly watch the log file from within FHEM.

Add custom packages

Since version 4

To extand the image wirh a custom package for example, you have to use standard docker tools.

If you are defining a docker-compose.yml file describing your configuration, then you can add a build definition instead of starting the image from the registry:

With this, you will create a new image, and install any tool which you additional need:

    build:
      context: .
      dockerfile_inline: |
        FROM ghcr.io/fhem/fhem-docker:4-bullseye 
        RUN <<EOF
          LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get update 
          LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends <DEBIAN PACKAGENAME>
          LC_ALL=C apt-get autoremove -qqy && LC_ALL=C apt-get clean 
        EOF

        RUN <<EOF
          pip install --no-cache-dir <PIP PACKAGENAME>
        EOF

See more examples in our docker-compose.yml file.

Important: If you need additional Perl CPAN Modules, you must install them directly from CPAN and not via apt!

till version 3 (deprecated)

Don't do this unless you really know what this does! You may define several different types of packages to be installed automatically during initial start of the container by adding one of the following parameters to your container run command:

  • Debian APT packages:

    -e APT_PKGS="package1 package2"
  • Perl CPAN modules:

    -e CPAN_PKGS="App::Name1 App::Name2"
  • Python PIP packages:

    -e PIP_PKGS="package1 package2"
  • Node.js NPM packages:

    -e NPM_PKGS="package1 package2"

Directory and file permissions

For security and functional reasons, directory and file permissions for FHEM will be set during every container startup. That means that directories and files can only be opened by members of the $FHEM_GID user group or the $FHEM_UID user itself. Also, the execution bit for files is only kept for a limited set of file names and directories, which are:

  • files named *.pl, *.py, *.sh
  • every file that is stored in any directory named bin or sbin
  • every file that is stored in any directory containing the string script in its name

Should you require any different permissions, you may read the next section to learn more about how to make any changes using custom pre start script /pre-start.sh or /docker/pre-start.sh.

Make any other changes during container start

In case you need to perform further changes to the container before it is ready for your FHEM instance to operate, there are a couple of entry points for your own scripts that will be run automatically if they are found at the right place. In order to achieve this, you need to mount the script file itself or a complete folder that contains that script to the respective destination inside your container. See Docker documentation about Use volumes and Bind mounts to learn how to achieve this in general.

If something needs to be done only once during the first start of a fresh container you just created, like after upgrading to a new version of the FHEM Docker Image, the *-init.sh scripts are the right place:

  • /pre-init.sh, /docker/pre-init.sh

    This script will be run at the very beginning of the initialization of the new container, even before any custom packages will be installed.

  • /post-init.sh, /docker/post-init.sh

    This script will be run at the very end of the initialization of the new container, also after your local FHEM configuration was checked and adjusted for compatibility with the container. Custom packages you defined using the environment variables mentioned above will be installed already at this point in time. This is likely the best place for you to do any final changes to the environment that need to be done only once for the lifetime of that container.

If something needs to be done every time you (re)start your container, the *-start.sh scripts are the right place:

  • /pre-start.sh, /docker/pre-start.sh

    This script will be run every time the container starts, even before the FHEM Docker Image's own startup preparations. FHEM will not yet be running at this point in time.

  • /post-start.sh, /docker/post-start.sh

    This script will be run every time the container starts and after the FHEM process was already started.

Role of the telnet device in FHEM

since version 4

There is no internal use of the telnet device anymore

till version 3 (deprecated)

The Docker container will need to communicate with FHEM to shutdown nicely instead of just killing the process. For this to work properly, a telnet device is of paramount importance. Unless you are using configDB, the container will try to automatically detect and adjust your telnet configuration for it to work. If for any reason that fails or you are using configDB, it is your own obligation to configure such telnet device (define telnetPort telnet 7072). It may listen on the standard port 7072 or can be any other port (see environment variable TELNETPORT to re-configure it).

It is enough for the telnet device to only listen on the loopback device (aka localhost) but it cannot have any password protection enabled for loopback connections. If you require your telnet instance to listen for external connections, it is usually best-practice to set a password for it. In that case, make sure that any allowed device you might have configured for this purpose only requires a password for non-loopback connections (e.g. using attribute globalpassword instead of password - also see allowed commandref). The same applies when using the deprecated attribute password for the telnet device itself (see telnet commandref).

Docker health check control

The image comes with a built-in script to check availability, which communicates with the DockerImageInfo Definition.

If for whatever reason you want to disable checking a specific FHEMWEB instance, you may set the user attribute DockerHealthCheck to 0 on that particular FHEMWEB device.

Note that the health check itself cannot be entirely disabled as it will ensure to notify you in case of failures, hindering proper shutdown of FHEM when triggered by Docker or OS shutdown procedure.

Map USB devices to your container

  1. Find out the USB device path/address from your Docker host machine first:

    lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
  2. You may then derive the device path from it and add the following parameter to your container run command:

    --device=/dev/bus/usb/001/002

Tweak container settings using environment variables

  • Change FHEM logfile format: To set a different logfile path and format (default is ./log/fhem-%Y-%m-%d.log):

    -e LOGFILE=./log/fhem-%Y-%m-%d.log
  • Change FHEM local Telnet port for health check and container restart handling: (deprecated since v4) To set a different Telnet port for local connection during health check and container restart (default is 7072):

    -e TELNETPORT=7072

    Note that this is of paramount importance if you are running more than one instance in host network mode on the same server, otherwise the instances will interfere each other with their restart behaviours.

  • Change FHEM system user ID: To set a different UID for the user fhem (default is 6061):

    -e FHEM_UID=6061
  • Change FHEM group ID: To set a different GID for the group fhem (default is 6061):

    -e FHEM_GID=6061
  • Change FHEM directory permissions: To set different directory permissions for $FHEM_DIR (default is 0750):

    -e FHEM_PERM_DIR=0750
  • Change FHEM file permissions: To set different file permissions for $FHEM_DIR (default is 0640):

    -e FHEM_PERM_FILE=0640
  • Change umask: To set a different umask for FHEM_UID (default is 0037):

        -e UMASK=0037
    
  • Change Bluetooth group ID: To set a different GID for the group bluetooth (default is 6001):

    -e BLUETOOTH_GID=6001
  • Change GPIO group ID: To set a different GID for the group gpio (default is 6002):

    -e GPIO_GID=6002
  • Change I2C group ID: To set a different GID for the group i2c (default is 6003):

    -e I2C_GID=6003
  • Change shutdown timeout: To set a different setting for the timer during FHEM shutdown handling, you may add this environment variable:

    -e TIMEOUT=10
  • Set locale: For maximum compatibility, standard locale is set to US english with some refinements towards the European standards and German defaults. This may be changed according to your needs (also see Debian Wiki for more information):

    -e LANG=en_US.UTF-8
    -e LANGUAGE=en_US:en
    -e LC_ADDRESS=de_DE.UTF-8
    -e LC_MEASUREMENT=de_DE.UTF-8
    -e LC_MESSAGES=en_DK.UTF-8
    -e LC_MONETARY=de_DE.UTF-8
    -e LC_NAME=de_DE.UTF-8
    -e LC_NUMERIC=de_DE.UTF-8
    -e LC_PAPER=de_DE.UTF-8
    -e LC_TELEPHONE=de_DE.UTF-8
    -e LC_TIME=de_DE.UTF-8
  • Set timezone: Set a specific timezone in POSIX format:

    -e TZ=Europe/Berlin
  • Using configDB: Should you be using FHEM config type configDB, you need to change the FHEM configuration source for correct startup by setting the following environment variable:

    -e CONFIGTYPE=configDB

    Note that some essential global configuration that is affecting FHEM during startup is being enforced using FHEM_GLOBALATTR environment variable (nofork=0 and updateInBackground=1; logfile and pidfilename accordingly, based on environment variables LOGFILE and PIDFILE). These settings cannot be changed during runtime in FHEM and any setting that might be in your configDB configuration will be overwritten the next time you save your configuration. It might happen that FHEM will show you some warnings as part of the "message of the day" (motd attribute), stating that an attribute is read-only. That's okay, just clear that message and save your FHEM configuration at least once so the configuration is back in sync.

    Only for v3 and lower: Last but not least you need to make sure the telnet device configuration described above is correct.

  • Starting the demo: To start the demo environment:

    -e CONFIGTYPE=fhem.cfg.demo
  • Set Docker host IPv4 address for host.docker.internal:

    -e DOCKER_HOST=172.17.0.1

    If this variable is not present, host IP will automatically be detected based on the subnet network gateway (also see variable DOCKER_GW below). In case the container is running in network host network mode, host.docker.internal is set to 127.0.127.2 to allow loopback network connectivity. host.docker.internal will also be evaluated automatically for SSH connection on port 22 by adding the servers public key to /opt/fhem/.ssh/known_hosts so that unattended connectivity for scripts is available.

  • Set Docker gateway IPv4 address for gateway.docker.internal:

    -e DOCKER_GW=172.17.0.1

    If this variable is not present, the gateway will automatically be detected.

  • Manipulating software in the container using their own environment variables: For security reasons, only allowed environment variables are passed to the FHEM user environment. To control certain behaviours of Perl, Node.js and Python, those language interpreters come with their own environment variables. Any variable that was set for the container and with a prefix of either PERL, NODE or PYTHON is exported to the FHEM user environment so it is available there during runtime of the fhem.pl main process and subsequently all its child processes.

Further tweaks for your FHEM configuration

Connect to Docker host from within container

If you would like to connect to a service that is running on your Docker host itself or to a container that is running in host network mode, you may use the following DNS alias names that are automatically being added to /etc/hosts during container bootup:

  • gateway.docker.internal
  • host.docker.internal

That is, if you did not configure those in your local DNS, of course.

In case the container is running in host network mode, the host IP address will be set to 127.0.127.2 as an alias for 'localhost'. That means a service you would like to reach needs to listen on the loopback interface as well. If a service you would like to reach is only listening on a particular IP address or interface instead, you need to set the environment variable DOCKER_HOST to the respective IP address as there is no way for the FHEM Docker Image to automatically detect what you need. When running in host network mode, the gateway will reflect your actual network segment gateway IP address.

Also, for host.docker.internal, the SSH host key will automatically be added and updated in /opt/fhem/.ssh/known_hosts so that FHEM modules and other scripts can automatically connect without any further configuration effort. Note that the SSH client keys that FHEM will use to authenticate itself are shown as readings in the DockerImageInfo device in FHEM. You may copy & paste those to the destination host into the respective destination user home directory with filename ~/.ssh/authorized_keys.

If for some reason the host details are not detected correctly, you may overwrite the IP addresses using environment variables (see DOCKER_HOST and DOCKER_GW above).

Adding Git for version control of your Home Automation Docker containers

Prerequisites on your Docker host:

  1. Ensure docker-compose is installed: See Install Docker Compose
  2. Ensure Git command is installed, e.g. run sudo apt install git

Follow initial setup steps:

  1. Put docker-compose.yml and .gitignore into an empty sub-folder, e.g. /docker/home

    sudo mkdir -p /docker/home
    sudo curl -fsSL -o /docker/home/docker-compose.yml https://github.com/fhem/fhem-docker/raw/master/docker-compose.yml
    sudo curl -fsSL -o /docker/home/.gitignore https://github.com/fhem/fhem-docker/raw/master/.gitignore

    Note that the sub-directory "home" will be the base prefix name for all your Docker containers (e.g. resulting in home_SERVICE_1). This will also help to run multiple instances of your Stack on the same host, e.g. to separate production environment in /docker/home from development in /docker/home-dev.

  2. Being in /docker/home, run command to start your Docker stack:

    cd /docker/home; sudo docker-compose up -d

    All FHEM files including your individual configuration and changes will be stored in ./fhem/ . You may also put an existing FHEM installation into ./fhem/ before the initial start, it will be automatically updated for compatibility with fhem-docker. Note that if you are using configDB already, you need to ensure Docker compatibility before starting the container for the very first time (see DOCKER_* environment variables above).

  3. Create a local Git repository and add all files as an initial commit:

    cd /docker/home
    sudo git init
    sudo git add -A
    sudo git commit -m "Initial commit"

    Run the following command whenever you would like to mark changes as permanent:

    cd /docker/home; sudo git add -A; sudo git commit -m "FHEM update"

    Note: This will also add any new files within your whole Docker Stack outside of the ./fhem/ folder. Please see Git documentation for details and further commands.

  4. Optional - Add remote repository for external backup. It is strongly recommended to have your external repository set to private before doing so:

    sudo git remote add origin [email protected]:user/repo.git
    sudo git push --force --set-upstream origin master

    Note that after updating your local repository as described above, you also want to push those changes to the remote server:

    cd /docker/home; sudo git push

    To restore your Docker Stack from remote Git backup on a fresh Docker host installation:

    sudo mkdir -p /docker
    cd /docker; sudo git clone [email protected]:user/repo.git
    cd /docker/home; sudo docker-compose up -d

Testing the Image itself in a container

Basic testing of the image is done in the pipeline. The pipeline will start a container and verify that the health check reports the container is alive.

The bash scripts inside the container, are tested via bats:

To run the test, build the image with the specific target:

docker build --rm --load -f "Dockerfile-bullseye" -t fhemdocker:test --target with-fhem-bats "."

Then this image, can be used to start a new container and running bats inside the container. docker run -it --rm -v "${PWD}/src/tests/bats:/code" fhemdocker:test .

fhem-docker's People

Contributors

cabal2k avatar cheanrod avatar cmpprk avatar cooltuxnet avatar dependabot[bot] avatar donjonsn avatar git-developer avatar haraldr42 avatar heinz-otto avatar joschamiddendorf avatar jpawlowski avatar renovate[bot] avatar sidey79 avatar stormmurdoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fhem-docker's Issues

FAIL install Image-Magick-7.1.1-28

Installation of Image-Magick fails


#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28| Magick.xs:56:10: fatal error: MagickCore/MagickCore.h: No such file or directory
#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28|    56 | #include <MagickCore/MagickCore.h>
#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28| compilation terminated.
#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28| make: *** [Makefile:351: Magick.o] Error 1
#55 539.9 2024-04-14T11:55:47,26,Image-Magick-7.1.1-28| Failed to install distribution

Configurable telnet port for healthcheck?

I am running several FHEM container and so I have to forward the ports like this:

5083:8083 (FHEMWEB)
5072:7072 (Telnet)

Your healthcheck-script is using the telnet port 7072 hardcoded.

Could you please make this port configurable? Perhaps as an environment value?

CUL_HM version with bugs

Hey Folks,

the actual version contains a buggy module --> CUL_HM.pm.
This cause a problem if users try to peer virtual temperature sensors with Homematic thermostats.
To solve this problem users must update the whole system as described here: https://wiki.fhem.de/wiki/Update

@ALL Contributors: Could you kindly update the whole container to a version with the newest modules? Just to avoid future questions and bug reports.

Thanks
Niko

Memory leak with Perl 5.32

I migrated my fhem installation from an old desktop pc (Debian buster with perl 5.28.1) to the current docker image with perl 5.32
and ran into the perl memory leakage described here:
https://forum.fhem.de/index.php/topic,112649.msg1069721.html#msg1069721

I need to restart ~ every 60h to prevent my fhem instance to crash.

Accourding to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994834#10
the bug is fixed with perl version 5.34.0.1 .
An imminent release of a new image based on Debian Bookworm would solve the problem,
since this release uses Perl 5.36.0-7+deb12u.

Error docker build

Step 64/73 : COPY src/fhem/trunk/fhem/ /fhem/
lstat src/fhem/trunk/fhem/: no such file or directory

Error in Dockerfile

There is an Error in Dockerfile, this Folder does not exist.

COPY src/fhem/trunk/fhem/ /fhem/

best regards Jan

Update nodejsVersion to >18.x or higher for support of npm >10.x

Using the latest provided version of dockerized FHEM there are issues updating npm inside of docker to 10.x. The requirements therefore are requesting nodejsVersion >18.x instead of the provided version 16.20.2.

What else is needed from my side?

Thanks in advance and best regards
Volker

Connection refused from 127.0.0.1:50562

Hello,

i have lots of messages like:

2021.07.17 13:08:27.623 1: Connection refused from 127.0.0.1:46166
2021.07.17 13:08:49.252 1: Connection refused from 127.0.0.1:46294
2021.07.17 13:09:10.682 1: Connection refused from 127.0.0.1:46452
2021.07.17 13:09:31.986 1: Connection refused from 127.0.0.1:46602
2021.07.17 13:09:53.233 1: Connection refused from 127.0.0.1:46726

I tried to find the cause using tcpdump, but could not find the cause.

I have 2 fhem instances defined.
This one works fine without errors:
docker run --name=fhem-prod --ulimit nofile=98304:98304 -e TELNETPORT=7072 -e CPAN_PKGS="IO::File RPC::XML::Client RPC::XML::Server SubProcess JSON" -d -p 8083:8083 -p 7072:7072 -p 7411:7411 -p 7420:7420 -v /share/CACHEDEV1_DATA/Container/Volumes/fhem:/opt/fhem --restart always fhem/fhem

The second one with the connection attempt errors is defined like:
docker run --name=fhem-test --ulimit nofile=98304:98304 -e TELNETPORT=7072 -e CPAN_PKGS="IO::File RPC::XML::Client RPC::XML::Server SubProcess JSON" -d -p 8084:8083 -p 7074:7072 -p 7511:7511 -p 7520:7520 -p 14211:14211 -v /share/CACHEDEV1_DATA/Container/Volumes/fhem-test:/opt/fhem --restart always fhem/fhem

I also tried to set the telnet port to something other than 7072 -> same issue. (TELNETPORT=xxxx and -p xxxx:xxxx)
The other ports (except web) are for CCU RPC. (rpcserverport set to 5500)

Any idea how to debug this connection attempt?
Thanks

No credits on Travis CI for build job

Describe the bug
Travis CI has migrated to credit based service.
May there is a chance of getting credits from travis for that open source project, but on the other hand the build process can be migrated to github actions which integrates better into github overall.

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://travis-ci.com/github/fhem/fhem-docker
  2. Look at the banner and the build process

Additional context
image

Missing packages for BOSEST module

Hallo,

mir fällt gerade auf, dass man das Bose-Modul BOSEST nicht in Betrieb nehmen kann.
Es fehlen Packages unter Linux.

Beispiel: libmojolicious-perl

BOSEST
BOSEST is used to control a BOSE SoundTouch system (one or more SoundTouch 10, 20 or 30 devices)

Note: The followig libraries are required for this module:
libwww-perl
libmojolicious-perl
libxml-simple-perl
libnet-bonjour-perl
libev-perl
liburi-escape-xs-perl
sox
libsox-fmt-mp3

Könntest du hier aushelfen?
Macht das eigentlich auf Dauer überhaupt Sinn, alle möglichen Pakete mit aufzunehmen? Oder könnte man das evtl. auslagern wie bspw. bei Homebridge (https://github.com/oznu/docker-homebridge#homebridge-plugins)
Oder kann man bereits mittels "pre-init.sh" die Pakete hinzufügen ohne dafür ein eigenes Build durchzuführen? Kann man die "pre-init.sh" irgendwie rein-mounten?

Reduce size of v4 minimal image

(Migrated from #115)

This is a request to reduce the size of the v4 minimal image.

The minimal image has grown significantly between v3 and v4:

$ docker images | grep fhem
ghcr.io/fhem/fhem-minimal-docker   3.3.1-bullseye                       c9b1f0c873e7   4 months ago    635MB
ghcr.io/fhem/fhem-minimal-docker   dev-bullseye                         cf28244b08a3   12 hours ago    905MB

Maybe a switch to the slim base image helps (not verified).

$ docker image ls | grep perl
perl                 5.36.3-slim-bullseye   52a305760451   3 weeks ago     132MB
perl                 5.36.3-bullseye        61325f916a7e   3 weeks ago     692MB

Abrupt daemon termination

a few days ago the file "entry.sh" was changed.

now fhem is constantly restarting with the message "Abrupt daemon termination".

if I change line 535 from "export PERL_JSON_BACKEND= ..." to "PERL_JSON_BACKEND= ..." everything will work.

Everything works without change in a second fhem container.

what could that be?

Timeout handling for /bin/bash /health-check.sh is missing

Describe the bug
A clear and concise description of what the bug is.

Currently i figured out a problem.
Perl fhem process has 100% cpu usage
Health-Check script is called somewhere and seems not to have some timeout / abort functiion

root      866907       0  0 09:59 ?        00:00:00 /bin/sh -c /health-check.sh
root      866912  866907  0 09:59 ?        00:00:00 /bin/bash /health-check.sh
root      866916  866912  0 09:59 ?        00:00:00 /bin/bash /health-check.sh
root      867567       0  0 09:59 ?        00:00:00 /bin/sh -c /health-check.sh
root      867572  867567  0 09:59 ?        00:00:00 /bin/bash /health-check.sh
root      867576  867572  0 09:59 ?        00:00:00 /bin/bash /health-check.sh
root      868227       0  0 10:00 ?        00:00:00 /bin/sh -c /health-check.sh
root      868234  868227  0 10:00 ?        00:00:00 /bin/bash /health-check.sh
root      868238  868234  0 10:00 ?        00:00:00 /bin/bash /health-check.sh
root      868889       0  0 10:00 ?        00:00:00 /bin/sh -c /health-check.sh
root      868899  868889  0 10:00 ?        00:00:00 /bin/bash /health-check.sh
root      868903  868899  0 10:00 ?        00:00:00 /bin/bash /health-check.sh
root      869554       0  0 10:01 ?        00:00:00 /bin/sh -c /health-check.sh
root      869559  869554  0 10:01 ?        00:00:00 /bin/bash /health-check.sh
root      869563  869559  0 10:01 ?        00:00:00 /bin/bash /health-check.sh
root      870214       0  0 10:01 ?        00:00:00 /bin/sh -c /health-check.sh
root      870219  870214  0 10:01 ?        00:00:00 /bin/bash /health-check.sh
root      870223  870219  0 10:01 ?        00:00:00 /bin/bash /health-check.sh
root      870874       0  0 10:02 ?        00:00:00 /bin/sh -c /health-check.sh
root      870880  870874  0 10:02 ?        00:00:00 /bin/bash /health-check.sh
root      870884  870880  0 10:02 ?        00:00:00 /bin/bash /health-check.sh
root      871535       0  0 10:02 ?        00:00:00 /bin/sh -c /health-check.sh
root      871552  871535  0 10:02 ?        00:00:00 /bin/bash /health-check.sh
root      871556  871552  0 10:02 ?        00:00:00 /bin/bash /health-check.sh
root      872197       0  0 10:03 ?        00:00:00 /bin/sh -c /health-check.sh
root      872213  872197  0 10:03 ?        00:00:00 /bin/bash /health-check.sh
root      872217  872213  0 10:03 ?        00:00:00 /bin/bash /health-check.sh
root      872861       0  0 10:03 ?        00:00:00 /bin/sh -c /health-check.sh
root      872874  872861  0 10:03 ?        00:00:00 /bin/bash /health-check.sh
root      872878  872874  0 10:03 ?        00:00:00 /bin/bash /health-check.sh
root      873529       0  0 10:04 ?        00:00:00 /bin/sh -c /health-check.sh
root      873535  873529  0 10:04 ?        00:00:00 /bin/bash /health-check.sh
root      873539  873535  0 10:04 ?        00:00:00 /bin/bash /health-check.sh
root      874190       0  0 10:04 ?        00:00:00 /bin/sh -c /health-check.sh
root      874195  874190  0 10:04 ?        00:00:00 /bin/bash /health-check.sh
root      874199  874195  0 10:04 ?        00:00:00 /bin/bash /health-check.sh
root      874859       0  0 10:05 ?        00:00:00 /bin/sh -c /health-check.sh
root      874865  874859  0 10:05 ?        00:00:00 /bin/bash /health-check.sh
root      874869  874865  0 10:05 ?        00:00:00 /bin/bash /health-check.sh
root      875523       0  0 10:05 ?        00:00:00 /bin/sh -c /health-check.sh
root      875528  875523  0 10:05 ?        00:00:00 /bin/bash /health-check.sh
root      875532  875528  0 10:05 ?        00:00:00 /bin/bash /health-check.sh
root      876183       0  0 10:06 ?        00:00:00 /bin/sh -c /health-check.sh
root      876192  876183  0 10:06 ?        00:00:00 /bin/bash /health-check.sh
root      876196  876192  0 10:06 ?        00:00:00 /bin/bash /health-check.sh
root      876851       0  0 10:06 ?        00:00:00 /bin/sh -c /health-check.sh
root      876858  876851  0 10:06 ?        00:00:00 /bin/bash /health-check.sh
root      876862  876858  0 10:06 ?        00:00:00 /bin/bash /health-check.sh
root      878179       0  0 10:07 ?        00:00:00 /bin/sh -c /health-check.sh
root      878185  878179  0 10:07 ?        00:00:00 /bin/bash /health-check.sh
root      878189  878185  0 10:07 ?        00:00:00 /bin/bash /health-check.sh
root      878840       0  0 10:08 ?        00:00:00 /bin/sh -c /health-check.sh
root      878853  878840  0 10:08 ?        00:00:00 /bin/bash /health-check.sh
root      878860  878853  0 10:08 ?        00:00:00 /bin/bash /health-check.sh
root      879500       0  0 10:08 ?        00:00:00 /bin/sh -c /health-check.sh
root      879517  879500  0 10:08 ?        00:00:00 /bin/bash /health-check.sh
root      879521  879517  0 10:08 ?        00:00:00 /bin/bash /health-check.sh
root      880172       0  0 10:09 ?        00:00:00 /bin/sh -c /health-check.sh
root      880178  880172  0 10:09 ?        00:00:00 /bin/bash /health-check.sh
root      880182  880178  0 10:09 ?        00:00:00 /bin/bash /health-check.sh
root      881496       0  0 10:10 ?        00:00:00 /bin/sh -c /health-check.sh
root      881504  881496  0 10:10 ?        00:00:00 /bin/bash /health-check.sh
root      881508  881504  0 10:10 ?        00:00:00 /bin/bash /health-check.sh
root      881743  874652  0 10:10 pts/0    00:00:00 grep health-check

To Reproduce
Steps to reproduce the behavior:

Currently not clear

  1. block fhem
  2. call perl fhem.pl 7072 jsonlist2 TYPE=FHEMWEB:FILTER=TEMPORARY!=1:FILTER=DockerHealthCheck!=0
  3. Process never times out

Expected behavior
Call of
perl fhem.pl 7072 jsonlist2 TYPE=FHEMWEB:FILTER=TEMPORARY!=1:FILTER=DockerHealthCheck!=0
needs tome timeout handling like this for example
timeout 20 perl fhem.pl 7072 jsonlist2 TYPE=FHEMWEB:FILTER=TEMPORARY!=1:FILTER=DockerHealthCheck!=0

May complete health-check.sh needs some timeout handling.

Additional context
Add any other context about the problem here.

root@1e65b9fd71b2:/opt/fhem# cat /image_info
org.opencontainers.image.created=2020-08-03T11:22:51+00:00
org.opencontainers.image.authors=Julian Pawlowski (Forum.fhem.de:@loredo, Twitter:@loredo)
org.opencontainers.image.url=https://hub.docker.com/r/fhem/fhem-amd64_linux
org.opencontainers.image.documentation=https://github.com/fhem/fhem-docker/blob/e96d817971ec68f3a191c0dfa7a27e87b4d2e8be/README.md
org.opencontainers.image.source=https://github.com/fhem/fhem-docker/
org.opencontainers.image.version=6.0-s22528_v2.2.4
org.opencontainers.image.revision=e96d817971ec68f3a191c0dfa7a27e87b4d2e8be
org.opencontainers.image.vendor=Julian Pawlowski
org.opencontainers.image.licenses=MIT
org.opencontainers.image.title=fhem-amd64_linux
org.opencontainers.image.description=A basic Docker image for FHEM house automation system, based on Debian Buster.
org.fhem.authors=https://fhem.de/MAINTAINER.txt
org.fhem.url=https://fhem.de/
org.fhem.documentation=https://fhem.de/#Documentation
org.fhem.source=https://svn.fhem.de/
org.fhem.version=6.0-s22528
org.fhem.revision=22528
org.fhem.vendor=FHEM e.V.
org.fhem.licenses=GPL-2.0
org.fhem.description=FHEM (TM) is a GPL'd perl server for house automation. It is used to automate some common tasks in the household like switching lamps / shutters / heating / etc. and to log events like temperature / humidity / power consumption.

FAIL install Net-Bluetooth-0.41

The installation of net-bluetooth is failing

#53 517.5 2024-04-14T11:55:18,25,Net-Bluetooth-0.41| Bluetooth.xs:11:10: fatal error: bluetooth/bluetooth.h: No such file or directory
#53 517.5 2024-04-14T11:55:18,25,Net-Bluetooth-0.41|    11 | #include <bluetooth/bluetooth.h>
#53 517.5 2024-04-14T11:55:18,25,Net-Bluetooth-0.41|       |          ^~~~~~~~~~~~~~~~~~~~~~~
#53 517.5 2024-04-14T11:55:18,25,Net-Bluetooth-0.41| compilation terminated.
#53 517.5 2024-04-14T11:55:19,25,Net-Bluetooth-0.41| make: *** [Makefile:342: Bluetooth.o] Error 1
#53 517.5 2024-04-14T11:55:19,25,Net-Bluetooth-0.41| Failed to install distribution

Empty new lines written to docker log file

Describe the bug
Docker logs get flooded with empty new lines, i.e. the file gets appended even though there is nothing new in the FHEM log file.
If the container is recreated the docker logs are deleted, otherwise they grow quite large (under /var/lib/docker/containers/<id>/<id>-json.log).

To Reproduce
Steps to reproduce the behavior:
Run sudo docker logs <name of container> -f and watch.

Expected behavior
No adding of blank new lines if there is nothing new in the FHEM log file.

Desktop (please complete the following information):

  • OS: Debian bookworm
  • Docker version: 24.0.6 (compose version 2.21.0)
  • Image version: 3.2.3-bullseye

Additional context
I investigated the issue and it seems like there is a problem in entry.sh where on line 459 printf '%s\n' "${logArray[@]}" is executed, even though $logArray is empty.

I fixed it by moving the contents of line 459 into the else-branch on line 464, i.e. PrintNewLines looks like this now:

function PrintNewLines {
  LOGFILENAME=$( date +"${LOGFILE}" )
  if [ -s "${LOGFILENAME}" ]; then
    mapfile -t logArray < <(tail -n "+$((${OLDLINES} + 1))" "${LOGFILENAME}" )
    [ -n "$1" ] && printf '%s\n' "${logArray[@]}" | grep -q -e "$1" && FOUND=true || FOUND=false
    if [ ${#logArray[@]} -eq 0 ]; then
      MAXLINES=$( wc -l < "${LOGFILENAME}" )
  	  [ ${OLDLINES} -gt ${MAXLINES} ] && OLDLINES=-1  # logfile rotation
    else
      printf '%s\n' "${logArray[@]}" # moved to here
      OLDLINES=$((${OLDLINES} + ${#logArray[@]} ))
    fi
  fi
}

While this does seem to fix the bug, I haven't tested it yet with log rotation and don't know if there are other implications from moving the printf statement …

FAIL install HiPi-0.92

Installation of HiPi fails

#55 539.9 2024-04-14T11:55:54,24,HiPi-0.92| I2C.c:22:10: fatal error: i2c/smbus.h: No such file or directory

FAIL install Net-DBus-1.2.0

#55 539.9 2024-04-14T11:54:55,26,Net-DBus-1.2.0| ! Retrying (you can turn off this behavior by --no-retry)
#55 539.9 2024-04-14T11:54:55,26,Net-DBus-1.2.0| Executing /usr/local/bin/perl Makefile.PL
#55 539.9 2024-04-14T11:54:56,26,Net-DBus-1.2.0| DBus >= 1.3.0 is required
#55 539.9 2024-04-14T11:54:56,26,Net-DBus-1.2.0| Failed to configure distribution

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: config
Error type: Invalid allowedVersions
Message: The following allowedVersions does not parse as a valid version or range: "^(5\.)([1-9][02468])(\.\d)?(.*)$"

Device::SerialPort is missing in v4 arm images

(Migrated from #115)

The v4 arm/v7 image does not contain the Device::SerialPort module which is required for many USB devices:

$ docker run --rm -ti --entrypoint /bin/sh ghcr.io/fhem/fhem-minimal-docker:3.3.1-bullseye -c "perl -e 'use Device::SerialPort'"

$ docker run --rm -ti --entrypoint /bin/sh ghcr.io/fhem/fhem-minimal-docker:dev-bullseye -c "perl -e 'use Device::SerialPort'"
Can't locate Device/SerialPort.pm in @INC (you may need to install the Device::SerialPort module) (@INC contains: /usr/local/lib/perl5/site_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/5.36.3) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

The arm64 build is probably affected, too.

Related PR: #196

FAIL install GDTextUtil-0.86

#55 539.9 2024-04-14T12:02:58,11,GDTextUtil-0.86| Failed to install distribution, because of installing some dependencies failed

HEALTHCHECK Error

Step 69/72 : HEALTHCHECK --interval=20s --timeout=10s --start-period=60s --retries=5 CMD /health-check.sh
Unknown flag: start-period

FHEM is killed if delayed shutdown is in progress

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Load a module which uses delayed restart
  2. Stop Container (not fhem)
  3. wait until logfile prints "Server shutdown delayed ..."
  4. error occures, fhem is killed by entry script

Expected behavior

The container shoud wait until "Server shutdown" is reported.

Additional context

Reported via fhem forum:
https://forum.fhem.de/index.php?topic=133468.msg1276417#msg1276417

Default: gateway.docker.internal is not set

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy a container "ghcr.io/fhem/fhem-minimal-docker:4.0.0-beta7-bullseye"
  2. wait until entry.shhas prepared the environment
  3. run cat /etc/hosts

Expected behavior
A clear and concise description of what you expected to happen.

Entry with name is present:
gateway.docker.internal

Current behavior

Entry with name is missing:
gateway.docker.internal

Additional context

Lines which are interessting :
hostAddr

ip command not found:

if ip -4 addr show docker0 >/dev/null 2>&1 ; then

root@2a30104b5003:/opt/fhem# cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.3      2a30104b5003
172.17.0.1      host.docker.internal

Source: https://forum.fhem.de/index.php?topic=137309.msg1308654#msg1308654

Jabber is broken for certain servers (e.g. jabber.de)

Bug description

  • When this Docker image is used for a FHEM instance containing a Jabber client connecting to jabber.de, Jabber fails to authenticate and remains Disconnected.

Steps to reproduce

  1. Prepare an account at jabber.de
  2. Start a container from this Dockerfile.
  3. Create a Jabber module instance, e.g.
    define jabber Jabber jabber.de 5222 <username> <password> 1 0
  4. Look at the modules internal CONNINFO:
    it contains the server response message error invalid-mechanism

Expected behavior

  • The device state should be Connected
  • The internal CONNINFO should contains the message Connected to jabber.de with username <username>

Environment

  • Raspberry Pi 3B+
  • Raspbian Buster
  • Docker 18.09.1

Additional context

  • The Dockerfile bundles package libauthen-sasl-cyrus-perl which enables support for the SASL authentication mechanism SCRAM-SHA-1. This triggers the problem.
  • Root cause for the problem is issue dap/XML-Stream#27.
  • Summary: when both server and client support more than 1 SASL authentication mechanism, the XML-Stream library that is used within 70_Jabber.pm creates an invalid authentication request.

Workaround

  • The problem does not occur when package libauthen-sasl-cyrus-perl is removed from this Dockerfile. This may be done by a tiny pre-init.sh script containing the line
    apt-get remove -y libauthen-sasl-cyrus-perl

Suggestion

  • Depending on whether libauthen-sasl-cyrus-perl is required for other purposes, it may be reasonable to remove this package from the Dockerfile and so avoid the problem without the need for an pre-init script.

ERROR: Service 'habridge' failed to build

I am using raspberry PI and i get this error when I want enter docker-compose up.
I followed the steps in the youtube video.

this is the output:

Building habridge
Step 1/7 : FROM java:8-jdk
 ---> d23bdf5b1b1b
Step 2/7 : MAINTAINER Matthias Kleine <[email protected]>
 ---> Using cache
 ---> 0d7b74e373c4
Step 3/7 : ENV BRIDGE_VERSION 5.2.1
 ---> Using cache
 ---> ededec52eb44
Step 4/7 : RUN mkdir -p /opt/habridge && wget https://github.com/bwssytems/ha-bridge/releases/download/v${BRIDGE_VERSION}/ha-bridge-${BRIDGE_VERSION}.jar -O /opt/habridge/ha-bridge-${BRIDGE_VERSION}.jar
 ---> Running in a48683746bf2
standard_init_linux.go:207: exec user process caused "exec format error"
ERROR: Service 'habridge' failed to build: The command '/bin/sh -c mkdir -p /opt/habridge && wget https://github.com/bwssytems/ha-bridge/releases/download/v${BRIDGE_VERSION}/ha-bridge-${BRIDGE_VERSION}.jar -O /opt/habridge/ha-bridge-${BRIDGE_VERSION}.jar' returned a non-zero code: 1

Docker container is always restarting after new setup via git clone

I am trying to integrate this container into my git version control as described in the README. At first, everything is going well, that is, once I set up a docker-compose.yml in my /docker/home folder on a Raspberry Pi 3, I can successfully create the container. I am using the following docker-compose.yml:

version: '2.3'

networks:
  net:
    driver: bridge
    # enable_ipv6: true
    ipam:
      driver: default
      config:
        - subnet: 172.27.0.0/24
          gateway: 172.27.0.1
        # - subnet: fd00:0:0:0:27::/80
        #   gateway: fd00:0:0:0:27::1

services:

  fhem:
    image: fhem/fhem:latest
    container_name: fhem_slave
    restart: always
    networks:
      - net
    ports:
      - "8083:8083"
    volumes:
      - "./fhem/:/opt/fhem/"
    devices:
      - "dev/ttyACM0:/dev/ttyACM0"
      - "dev/ttyACM1:/dev/ttyACM1"
      - "dev/ttyAMA0:/dev/ttyAMA0"
    environment:
      FHEM_UID: 6061
      FHEM_GID: 6061
      TIMEOUT: 10
      RESTART: 1
      TELNETPORT: 7072
      TZ: Europe/Berlin

After first start of the container, FHEM is up and running. I then did some changes within the frontend of FHEM, did an update all and then commited those changes to my online repo at bitbucket. I wanted to try if this is working as a suitable backup solution. To test it, I stopped and removed the container and completely deleted the home folder using sudo rm -r home. Then, I cloned my online repo back into the home folder. All files looked exactly the same as before I deleted the home folder. However, when trying to build the container and start it via docker-compose up -d the container is not starting properly anymore. Using docker ps, I can see that it always tries to start the container for some seconds. It looks like the container is in a restarting loop.

grafik

I'm wondering what I am supposed to do in order to check what causes these restart issues?

should not touch populated volume by default

I gave a copy of my existing /opt/fhem directory to the docker image as a volume, expecting it to more or less run as-is. To my surprise, running the image changed the ownership and permissions of all files & directories, ruining my setup. It's setup just so, with a couple of files, notably fhem.cfg, read-only to the fhem user by default, for a reason!

Easily restored of course, but I don't think the container setup should meddle around in the external volume at all, that sort of defeats the point of keeping code and data/configuration separate.

Error in building fhem-docker image

hello everybody,

maybe someone is experiencing the same issue while building the container image.

Step 59/68 : COPY src/fhem/trunk/fhem/ /fhem/
ERROR: Service 'fhem' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder657142930/src/fhem/trunk/fhem: no such file or directory

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

$ docker version
Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:49:01 2018
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:16:44 2018
OS/Arch: linux/amd64
Experimental: false

If this trunk folder is related to the SVN repository of FHEM - is there any chance to include this into the Dockerfile?

Just to mention - I don't want to use the pre-build docker image

Thanks / Cheers, Jens

Endless loop

This causes endless looping, because $FOUND will not change during loop operation:

fhem-docker/src/entry.sh

Lines 472 to 475 in fcf2e72

until $FOUND; do
sleep $SLEEPINTERVAL
PrintNewLines "Server shutdown"
done

fhemdebug memusage: Size.pm missing

Can't locate Devel/Size.pm in @INC (you may need to install the Devel::Size module) (@INC contains: . /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base ./FHEM) at (eval 16252) line 2.
BEGIN failed--compilation aborted at (eval 16252) line 2.

Pyhten Link fehlt

Für das Fhem-Modul speedtest. wird das Phyton-scipt speedtest benötig.

Dies wirft in fhem den Fehler

/usr/bin/env: ‘python’: No such file or directory

In der bash funktioniert es.

Hier wird der link python zu python3 benötigt.

Rewrite of entry.sh / question on contributing

Dear maintainers,

I did a fairly massive rewrite of the entry.sh script. It mainly addresses:

  • In the past there were a number of regressions in sending the log to the console.
    With my new version, sending the log to the console is done by a background process heavily using "tail",
    but also taking care of line-buffering, changed log file etc.
    And performance wise it uses much less calls to the various unix tools, as it doesn't poll any more.
  • Checking for process startup and process termination is more robust.
  • General rewrite, making the script more modular and robust.

So my question is: Should I make a pull request on the original entry.sh, resulting in a massive (and mostly useless diff),
or should I request pulling a new file?

Thx in advance
Harald

avahi-daemon not startable

Hi,
i need avahi-browse inside of Fhem Docker.
So i need to install those packets:
apt-get install -y avahi-utils avahi-daemon libnss-mdns systemd

My Dockerfile:

FROM fhem/fhem:bullseye

RUN apt-get update -y &&  \
    apt-get upgrade -y && \
    apt-get install -y avahi-utils avahi-daemon libnss-mdns systemd && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

My docker compose file:

  fhem:
    build:
      context: fhem
    image: fhem:1.0
    container_name: fhem
    hostname: fhem
    volumes:
      - fhem:/opt/fhem
      - /var/run/dbus:/var/run/dbus
    ports:
      - 8083:8083
      - 7072:7072
    restart: unless-stopped

After starting the docker the daemon didn´t start:

root@fhem:/tmp# avahi-browse -a
Failed to create client object: Daemon not running

So I have to do the following steps for a proper working inside of docker:

rm /run/dbus/pid
dbus-daemon --system
/etc/init.d/avahi-daemon start
avahi-browse -a
[.....]

Its a problem inside of the fhem docker why dbus is not startable?
If not, how can i add a custom startscript to execute the needed steps after each container start?

Update speedtest-cli: Buggy version is installed

Hello,

in the container, the installed speedtest-cli version (2.0.2) includes a bug that the measured upload-speed is wrong (too low).
Here, the bug is described: Github: sivel/speedtest-cli/issues/575
The current version is 2.1.2.

Exec inside the container and check the speedtest-cli version and measured uplink speed by:
docker exec -ti fhem_fhem_1 speedtest-cli --version
docker exec -ti fhem_fhem_1 speedtest-cli

The buggy version of speedtest-cli is included in the debian repos for over 1,5 years.

A better way to install the speedtest-cli is by installing it directly from the git repo or via pip:

  • Via pip: pip install speedtest-cli
  • Directly via : git clone https://github.com/sivel/speedtest-cli.git && cd speedtest-cli && python setup.py install

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: File contents are invalid JSON but parse using JSON5. Support for this will be removed in a future release so please change to a support .json5 file name or ensure correct JSON syntax.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile-bullseye
  • docker/dockerfile 1@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e
  • perl 5.36.3-slim-bullseye
  • perl 5.36.3-bullseye
Dockerfile-threaded-bullseye
  • docker/dockerfile 1@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e
  • perl 5.36.3-slim-threaded-bullseye
  • perl 5.36.3-threaded-bullseye
github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • shogo82148/actions-setup-perl v1
  • actions/cache v4
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • docker/build-push-action v5
  • actions/checkout v4
  • rlespinasse/github-slug-action v4.5.0
  • actions/download-artifact v4
  • actions/download-artifact v4
  • docker/build-push-action v5
  • actions/checkout v4
  • rlespinasse/github-slug-action v4.5.0
  • actions/download-artifact v4
  • actions/download-artifact v4
  • docker/metadata-action v5
  • docker/build-push-action v5
  • docker/build-push-action v5
  • Wandalen/wretry.action v3.5.0
  • Wandalen/wretry.action v3.5.0
  • docker/build-push-action v5
  • docker/build-push-action v5
  • Wandalen/wretry.action v3.5.0
  • actions/checkout v4
  • rlespinasse/github-slug-action v4.5.0
  • actions/download-artifact v4
  • actions/download-artifact v4
  • docker/metadata-action v5
  • docker/build-push-action v5
  • docker/metadata-action v5
  • docker/build-push-action v5
.github/workflows/cacheCleanup.yml
.github/workflows/prepare-docker/action.yml
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action v3
.github/workflows/prepare-svn/action.yml
  • actions/cache v4

  • Check this box to trigger a request for Renovate to run again on this repository

SONOS not longer working

Describe the bug
After upgrade to 4 (latest) SONOS is not longer working.

To Reproduce
Steps to reproduce the behavior:

  1. After upgrade to latest
  2. Cannot load module SONOS setuuid: Please define XXXX first Cannot load module SONOSPLAYER setuuid: Please define XXXX first

Expected behavior
It should work as before.

Logs

2024.06.02 08:20:44.165 1: reload: Error:Modul 00_SONOS deactivated:
 This Perl not built to support threads
Compilation failed in require at ./FHEM/00_SONOS.pm line 137, <$fh> line 73.
BEGIN failed--compilation aborted at ./FHEM/00_SONOS.pm line 137, <$fh> line 73.

2024.06.02 08:20:44.165 0: This Perl not built to support threads
Compilation failed in require at ./FHEM/00_SONOS.pm line 137, <$fh> line 73.
BEGIN failed--compilation aborted at ./FHEM/00_SONOS.pm line 137, <$fh> line 73.

2024.06.02 08:20:44.179 1: reload: Error:Modul 21_SONOSPLAYER deactivated:
 syntax error at ./FHEM/21_SONOSPLAYER.pm line 216, near "SONOS_Log undef"
Global symbol "$def" requires explicit package name (did you forget to declare "my $def"?) at ./FHEM/21_SONOSPLAYER.pm line 224, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 235, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 236, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 238, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 239, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 242, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 244, <$fh> line 77.
Global symbol "$hash" requires explicit package name (did you forget to declare "my $hash"?) at ./FHEM/21_SONOSPLAYER.pm line 245, <$fh> line 77.
syntax error at ./FHEM/21_SONOSPLAYER.pm line 248, near "}"
./FHEM/21_SONOSPLAYER.pm has too many errors.

Desktop (please complete the following information):

  • raspberry pi 4
  • Rocky Linux release 9.4
  • docker 26.1.3
  • fhem/fhem latest

Crypt::Cipher::AES wird nicht installiert

Die Pakete Crypt::Cipher::AES werden trotz https://github.com/docker-home-automation-stack/fhem-docker/blob/master/Dockerfile#L173 nicht installiert.

Versuche ich das innerhalb des Containers per Hand, so erscheint folgender Fehler:

root@0d63d51780fa:/opt/fhem# sudo cpan Crypt::Cipher::AES
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/root/.cpan/Metadata'
   Database was generated on Tue, 23 Oct 2018 09:29:02 GMT
Running install for module 'Crypt::Cipher::AES'
Checksum for /root/.cpan/sources/authors/id/M/MI/MIK/CryptX-0.061.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring M/MI/MIK/CryptX-0.061.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for CryptX
Writing MYMETA.yml and MYMETA.json
   MIK/CryptX-0.061.tar.gz
   /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for M/MI/MIK/CryptX-0.061.tar.gz
   MIK/CryptX-0.061.tar.gz
   make -- NOT OK

Scheinbar sind die build-tools erforderlich. Also habe ich manuell
apt-get install build-essential
installiert.

Dies werden im Dockefile zwar vorher installiert und auch nachher wieder per 'purge' entfernt, aber ich kann nicht sagen, warum Crypt::Cipher::AES zwischendurch (auf einer amd64-Architektur) nicht installiert wird.

Beim Erstaufruf von cpan (nicht cpanm) habe ich festgestellt, dass dieses eine Ersteinrichtung durchgeführt hat. Vielleicht ist dies von Interesse.

Kurz und knapp:
Kannst du feststellen, wieso Crypt::Cipher::AES auf einer amd64-Plattform nicht installiert wird?

Jabber module does not work

Describe the bug
libauthen-sasl-cyrus-perl prevents the jabber module from connecting properly to a jabber server. (Bullseye Image)

To Reproduce
Steps to reproduce the behavior:
Try to connect to a jabber server within a FHEM-Bullseye container.
(If libauthen-sasl-cyrus-perl is removed a connection can be established.)

Expected behavior
A connection to a jabber server should be established properly.

Updating of NPM packages not possible through FHEM UI

Hello,

after starting the Docker container and logging into the FHEM UI there are pending NPM updates indicated by fhemServerNpm. When calling "set update all" through the UI an error occurs:

Error code E403
Summary:
Forbidden - passwordless sudo permissions required

Detail:
sudo: sorry, you are not allowed to set the following environment variables: NODE_ENV

The required commands to update are part of /etc/sudoers.d/fhem-docker, unfortunately the user is not allowed to set/retain environment variables, calling the update to fail.

I have solved this by adding

Defaults !env_reset

to /etc/sudoers.d/fhem-docker. Afterwards updating the packages through the UI works fine.

I am not sure if this is an issue that only occurs for me but I thought I better report it.

Thank you,
Andre

Add cpm install filter

The extended cpan 3rdparty layer tries to install those packages. They should be filtered:

#53 517.5 FAIL resolve ABFALL_getEvents
#53 517.5 FAIL resolve ABFALL_setUpdate
#53 517.5 FAIL resolve Blocking
#53 517.5 FAIL resolve Device::LIFX
#53 517.5 FAIL resolve Device::LIFX::Constants
#53 517.5 FAIL resolve FHEM
#53 517.5 FAIL resolve FHEM::Meta
#53 517.5 FAIL resolve GPUtils
#53 517.5 FAIL resolve HM485d::HM485_Protocol
#53 517.5 FAIL resolve HttpUtils
#53 517.5 FAIL resolve Slim::Plugin::Base
#53 517.5 FAIL resolve Slim::Utils::Log
#53 517.5 FAIL resolve Slim::Utils::Misc
#53 517.5 FAIL resolve Slim::Utils::Prefs
#53 517.5 FAIL resolve Slim::Utils::Strings
#53 517.5 FAIL resolve TradfriUtils
#53 517.5 FAIL resolve carp
#53 517.5 FAIL resolve encode
#53 517.5 FAIL resolve fhconverter
#53 517.5 FAIL resolve fhwebsocket
#53 517.5 FAIL resolve lib::HM485::ConfigurationManager
#53 517.5 FAIL resolve lib::HM485::Constants
#53 517.5 FAIL resolve lib::HM485::Device
#53 517.5 FAIL resolve lib::HM485::PeeringManager
#53 517.5 FAIL resolve lib::HM485::Util
#53 517.5 FAIL resolve lib::HM485::XmlConverter
#53 517.5 FAIL resolve lib::OWNet
#53 517.5 FAIL resolve lib::SD_Protocols
#53 517.5 FAIL resolve longer
#53 517.5 FAIL resolve myCtrlHAL

Compatible path between docker hub and ghcr.io

Is your feature request related to a problem? Please describe.
At the moment the image can be found on docker hub with fhem/fhem but on ghcr with fhem/fhem/fhem-docker.

Describe the solution you'd like
Please change the package name on ghcr to fhem to be found also under fhem/fhem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.