diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..327019d --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,58 @@ +name: Docker Image Homehub + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + attestations: write + id-token: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..15fa12a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM alpine:latest +LABEL description="Alpine based image with apache2 and php8 for HomeHub." + +# Setup apache and php +RUN apk --no-cache --update \ + add apache2 \ + curl \ + php83-apache2 \ + php83-curl \ + php83-xml \ + php83-simplexml \ + php83-mbstring \ + php83-ctype \ + && mkdir /htdocs + +COPY ./ /htdocs/ +COPY docker-entrypoint.sh / +RUN chmod +x /docker-entrypoint.sh + +EXPOSE 80 + +HEALTHCHECK CMD wget -q --no-cache --spider localhost + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/README.md b/README.md index 992d286..e3dfada 100644 --- a/README.md +++ b/README.md @@ -55,5 +55,31 @@ Bei folgenden Komponenten lässt sich durch Angabe von ``"showtime":"true"`` die - Program - SysVar +## Docker Integration +``` +docker run \ +-d \ +--name=HomeHub \ +--restart unless-stopped \ +-p 8080:80 \ +-e TZ=Europe/Berlin \ +-v /FOLDER/OF/YOUR/CONFIG:/htdocs/config \ +ghcr.io/etofi/homehub_docker:master +``` + +Verfügbare Parameters im Detail: + +| Parameter | Optional | Beispiel | Erklärung | +| ---- | --- | --- | --- | +| `TIMEZONE` | yes | Europe/Berlin | Timezone im Container | +| `-p` | no | 80:8080 | Zuweisung des Apache2 Port innerhalb dieses Containers auf den Docker-Host Port (Bridge Mode). Mit dieser Konfiguration kann HomeHub dann über Port 8080 des Docker-Hosts erreicht werden, z. B. 192.168.178.100:8080| + +Volumes: + +| Volume | Erklärung | +| ---- | --- | +| `/FOLDER/OF/YOUR/CONFIG` | Das Verzeichnis /htdocs/config, in dem die HomeHub-Einstellungen gespeichert werden sollen. Dieser Ordner befindet sich auf dem PC, auf dem Docker ausgeführt wird und die Dateien aus dem Verzeichnis config werden dort abgelegt. Sie werden dann automatisch an die HomeHub-Docker-Instanz weitergeleitet. | + + ## Lizenzen HomeHub nutzt [jQuery](https://jquery.com/license/), [Chartjs](Chartjs.org), [knx-uf-iconset](https://github.com/OpenAutomationProject/knx-uf-iconset), [Bootstrap](https://getbootstrap.com/) diff --git a/components/HmIP-eTRV-3.php b/components/HmIP-eTRV-3.php new file mode 100644 index 0000000..0da9ef7 --- /dev/null +++ b/components/HmIP-eTRV-3.php @@ -0,0 +1,75 @@ +' + . '