mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Adding caddy support
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
parent
3665a9131c
commit
e077c85d00
6 changed files with 63 additions and 1 deletions
12
snap/hooks/configure
vendored
12
snap/hooks/configure
vendored
|
@ -7,4 +7,16 @@ echo "$(date '+%Y-%m-%d %H:%M:%S') $0: Entering hook"
|
|||
. $SNAP/bin/config
|
||||
|
||||
# settings were altered by user, safest way to get them applied is to restart service
|
||||
# first check if caddy service is enabled
|
||||
value=$(snapctl get caddy-enabled)
|
||||
if [ "$value" = "true" ]; then
|
||||
# update caddy file
|
||||
bind_port=$(snapctl get caddy-bind-port)
|
||||
port=$(snapctl get port)
|
||||
[ "x" != "x${bind_port}" ] && sed -i 's|proxy / localhost:.* {|proxy / localhost:'"${bind_port}"' {|g' $SNAP_COMMON/Caddyfile
|
||||
[ "x" != "x$port" ] && sed -i 's|http://:.*|http://:'"${port}"'|g' $SNAP_COMMON/Caddyfile
|
||||
snapctl start caddy-service 2>&1 || true
|
||||
else
|
||||
snapctl stop caddy-service 2>&1 || true
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue