/hypso

Primary LanguageJavaMIT LicenseMIT

Hypso

Description

Hypso is a simple web server that executes a given script when it receives a request. Its main purpose is to deploy containers on image update thanks to Docker hub web hooks.

It leverages Faya tokens to act only upon authorized requests.

Configuration

Table 1. Environment variables
Name Default Description

SCRIPT

null

Absolute path of the target script

PORT

4567

Hypso port

FAYA_URL

null

Faya instance URL

FAYA_API_KEY

null

Faya API key

FAYA_NAMESPACE

null

A Faya namespace name to valid token against

Once the configuration is done, simply make an HTTP POST request to

/trigger?token=<FAYA_TOKEN>

in order to trigger script execution.

Note
It is highly recommended to set up a reverse proxy providing HTTPS support

Docker

To run Hypso in Docker :

docker run \
-e FAYA_URL=<FAYA_URL> \
-e FAYA_API_KEY=<FAYA_AKI_KEY> \
-e FAYA_NAMESPACE=<FAYA_NAMESPACE> \
-e DOCKER_GID=<DOCKER_GID> \
-p 4567:4567 \
-v <SCRIPT_PATH>:/home/hypso/script/ \
-v /var/run/docker.sock:/var/run/docker.sock \
tzoratto/hypso

Hypso will execute <SCRIPT_PATH>/deploy.sh. This script can contain Docker and docker-compose commands.