Configuration

Everything is optional: D2HA works with the example compose file as it is. The full list is also in .env.example.

Environment variables

VariableDefaultWhat it does
DOCKER_HOSTthe mounted socketHow D2HA reaches Docker. With the socket proxy: tcp://docker-proxy:2375.
D2HA_CHECK_INTERVAL_HOURS6Hours between update checks on a new install; later, Settings decides.
D2HA_GITHUB_TOKEN—A GitHub token without scopes: release notes for 5,000 lookups per hour instead of 60.
D2HA_TELEGRAM_TOKEN—The token of your Telegram bot (Telegram).
D2HA_TELEGRAM_CHAT_ID—The chat that receives the messages; several, comma separated.
D2HA_READ_ONLYfalsetrue: notifications and logs only, no updates or image cleanup.
D2HA_FRAME_ANCESTORS—Addresses allowed to show D2HA in an iframe, such as a Home Assistant dashboard; space separated.
D2HA_DATA_DIR/app/dataWhere D2HA keeps its files inside the container.
D2HA_SECRET_KEYgeneratedThe key that signs sessions. Leave it empty: D2HA creates one and keeps it in the data folder.
D2HA_LOG_LEVELINFODEBUG, INFO, WARNING or ERROR.

After a change, recreate the container: docker compose up -d.

Container labels

Labels on your containers that D2HA reads:

LabelEffect
d2ha.notify=falseNo crash or unhealthy alerts for this container (Telegram).
com.docker.compose.projectSet by Compose: the stack the container is grouped under.

Labels of the images that D2HA reads, for those who build them:

LabelUsed for
org.opencontainers.image.versionThe version shown, and the release to look for. Also io.hass.version, org.label-schema.version, version.
org.opencontainers.image.sourceThe GitHub repository of the release notes. Also org.opencontainers.image.url, org.label-schema.vcs-url.

The data folder

Mounted on /app/data. Back it up with your other Docker data.

FileContents
d2ha.jsonThe account (password hash, two-factor secret), the hash of the API token, the settings, which containers Home Assistant sees, and the session key
state.jsonThe results of the last check, and which updates were already announced on Telegram
Keep it private

d2ha.json holds the two-factor secret and the session key: treat the folder like a password.

Port

D2HA listens on port 12021 inside the container. Publish it as you need, ideally on 127.0.0.1 only, as in the example.

Something wrong or missing on this page? Open an issue.