Clarification on watchtower metrics and API token for a noob #1615
-
I am trying to get watchtower api working on my homepage dashboard, but I'm not going to lie. I am very stuck. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 17 replies
-
i went through literally this exact situation earlier this morning. In fact I did a double take thinking i'd posted your comment under a different name somehow, it was that similar. Anyway, after a lot of digging around and fiddling, I got it working. This is my working compose yaml which just notifies of updates instead of automatically updating them ( version: "2"
services:
app:
image: containrrr/watchtower
hostname: 192.168.1.64
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
environment:
- TZ=Europe/London
- NO_COLOR=true
- WATCHTOWER_SCHEDULE=0 0 19 * * *
- WATCHTOWER_INCLUDE_STOPPED=true
- WATCHTOWER_INCLUDE_RESTARTING=true
- WATCHTOWER_MONITOR_ONLY=true
- WATCHTOWER_HTTP_API_UPDATE=true
- WATCHTOWER_HTTP_API_METRICS=true
- WATCHTOWER_HTTP_API_TOKEN=mytoken
- WATCHTOWER_HTTP_API_PERIODIC_POLLS=true
- DOCKER_TLS_VERIFY=true
- WATCHTOWER_NOTIFICATIONS=slack
- WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=https://hooks.slack.com/services/XXXXX
- WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER=watchtower-2
- WATCHTOWER_NOTIFICATION_SLACK_CHANNEL=#Crispy my homepage services.yaml entry reads thus: - Watchtower:
icon: https://github.com/walkxcode/dashboard-icons/raw/main/png/watchtower.png
href: http://192.168.1.64:8080
widget:
type: watchtower
fields: ["containers_scanned", "containers_updated", "containers_failed"]
url: http://192.168.1.64:8080
key: mytoken like you, i was totally stuck on how to create or find a watchtower api key of some kind, until someone explained to me it's just generated in the compose file itself. So in the example above, it's literally "mytoken", in both the compose and the homepages yamls hope this helps |
Beta Was this translation helpful? Give feedback.
-
can confirm this all worked fine in homepage once the schedule ran in watchtower. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Look at documentation here; https://containrrr.dev/watchtower/http-api-mode/
|
Beta Was this translation helpful? Give feedback.
-
I am already using Port 8080 for pihole. What now? How to change the port for the http API for watchtower? |
Beta Was this translation helpful? Give feedback.
i went through literally this exact situation earlier this morning. In fact I did a double take thinking i'd posted your comment under a different name somehow, it was that similar.
Anyway, after a lot of digging around and fiddling, I got it working. This is my working compose yaml which just notifies of updates instead of automatically updating them (
WATCHTOWER_MONITOR_ONLY=true
), sends updates to my slack channel (you don't have to use this) and is working with homepage: