Adding caddy support

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
Ondrej Kubik 2017-11-04 19:23:28 +00:00
parent 3665a9131c
commit e077c85d00
6 changed files with 63 additions and 1 deletions

12
snap-src/bin/caddy-control Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
# get wekan/mongo settings
source $SNAP/bin/wekan-read-settings
if [ "$CADDY_ENABLED" = "true" ]; then
env LC_ALL=C caddy -conf=$SNAP_DATA/Caddyfile -host=localhost:${CADDY_PORT}
else
snapctl stop caddy-service 2>&1 || true
# sleep here, in case snapctl fails to stop service so we do not restart too often
sleep 60
fi