Provides the functionality from https://github.com/oderwat/hubic2swiftgate in dockerized fashion. Inspired by https://github.com/jkaberg/docker-hubic2swiftgate.
All configuration can be passed via a docker volume. That volume is also used to store the cache file. So a restart of the docker container image does not require a new registration.
The original hubic2swiftgate code is pathched to read the config.php and get the cache folder from the docker volume. It should always be mounted to /config.
The Repo contains a config-sample folder, which can be used as copy template. The structure is as follows:
apache: Contains the vhost conf for apache. The file001-hubic2swiftgate.confwill be linked to/etc/apache2/sites-enabled. If you are using ssl ensure proper certificates in folderssl, otherwise apache will not start.cache: Folder wherehubic2swiftgatewill store access token and endpoint url.ssl: Put yourserver.crtandserver.keyhere. Check that the vhost conf001-hubic2swiftgate.confwill use it accordingly.config.php: Put you HubiCclient_id,client_secretandpasswordhere. The password is bound to the fixed userhubicwhich is used fromhubic2swiftgate.
If you are facing issues with permissions from the container to host directory, change the ownership of that files: chown -R 33:33 /path/to/config
Alternatively you can specify a user PUID and group id PGID via the environment. In that case the www-data user and group will get this ids.
The main documentation can be found on hubic2swiftgate
-
Put the values to
/path/to/config/config.php -
Starting the container image
docker run -d --restart always -p 8443:443 -v </path/to/config>:/config reimannf/hubic2swiftgate4docker -
Or starting the container image with user and group id
docker run -d --restart always -p 8443:443 -v </path/to/config>:/config -e PGID=<gid> -e PUID=<uid> reimannf/hubic2swiftgate4docker -
http[s]://yourserver.com:8443/register/?client=hubic&password=pwd_from_config.php
-
Check Usage
http[s]://yourserver.com:8443/usage
-
Why a docker volume?
I prefer to have such configurations not baked into the docker image. Now the docker container image can run multiple configurations and the externalised
cachefolder allows that the app registrations on HubiC survives a restart. -
Why Apache?
nginx with php-fhm would require additional orchestration effort to run more than 1 process in one container.