Watchtower HTTP API based updates (#432)

* Added HTTP API trigger to update running images

* Adds HTTP API authentication token parameter and handling

* Exposes port 8080 in Dockerfile to allow inter-container update triggering via HTTP API

* Fixes codacy issue

* Adds API usage doc

* Fix grammar

* Moves api logic to a package of its own

* Makes WT exit if token has not been set in HTTP API mode

* Adds lock to prevent concurrent updates when in HTTP API mode

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
This commit is contained in:
Victor Moura 2020-04-20 11:17:14 -03:00 committed by GitHub
parent 557f4abcb4
commit 0217e116c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 0 deletions

View file

@ -193,6 +193,26 @@ Run an update attempt against a container name list one time immediately and exi
Environment Variable: WATCHTOWER_RUN_ONCE
Type: Boolean
Default: false
```
## HTTP API Mode
Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request.
```
Argument: --http-api
Environment Variable: WATCHTOWER_HTTP_API
Type: Boolean
Default: false
```
## HTTP API Token
Sets an authentication token to HTTP API requests.
```
Argument: --http-api-token
Environment Variable: WATCHTOWER_HTTP_API_TOKEN
Type: String
Default: -
```
## Scheduling