made webhook domain variable

This commit is contained in:
Zehka 2020-07-05 18:38:38 +02:00
parent ea71bc727c
commit 0210037e90
2 changed files with 8 additions and 4 deletions

View File

@ -5,7 +5,7 @@ services:
image: cryptkiddie2/webhook-docker:latest
restart: always
labels:
- traefik.frontend.rule=Host:site.webhook.nachtigall.chaospott.de
- traefik.frontend.rule=Host:${WEBHOOK_DOMAIN}
- traefik.port=9000
- traefik.docker.network=web
networks:

10
init.sh
View File

@ -5,9 +5,11 @@ exe() {
}
SITE_REPO="https://git.chaospott.de/chaospott/site.git"
echo "Where should the site store all volumes?"
read -p "PATH: " VOLUMES_PATH
read -p "PATH: " VOLUMES_PATH_RAW
read -p "Hook endpoint ID (just make something up):" ENDPOINT_ID
read -p "Hook endpoint Password:" ENDPOINT_PW
read -p "Hook Domain (NOT site domain):" HOOK_DOMAIN
VOLUMES_PATH=$(echo $VOLUMES_PATH_RAW | sed 's/\/$//g')
echo "Creating volumes structure"
exe mkdir $VOLUMES_PATH
exe git clone $SITE_REPO $VOLUMES_PATH/repo
@ -23,6 +25,8 @@ echo """[
}
}
]""" > $VOLUMES_PATH/webhook/hooks.json
VOLUMES_PATH_SANITIZED=$(echo $VOLUMES_PATH | sed 's/\/$//g')
echo "DATA_ROOT=$VOLUMES_PATH_SANITIZED" > .env
echo """DATA_ROOT=$VOLUMES_PATH
WEBHOOK_DOMAIN=$HOOK_DOMAIN""" > .env
exe chmod 777 $VOLUMES_PATH -Rc
echo "configure your git with the following hook URL:"
echo "https://$HOOK_DOMAIN/hooks/$ENDPOINT_ID"