aboutsummarylogtreecommitdiffstats
path: root/caddy-full-bin.install
blob: c931506c2e486034117ce0d46973d28ce4edc3ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
post_install() {
    mkdir -p /etc/ssl/caddy && chown -R http:http /etc/ssl/caddy
}

pre_upgrade() {
    systemctl stop caddy
}

post_upgrade() {
    systemctl daemon-reload
    if [ $(vercmp $2 0.9.3-5) -lt 0 ]; then
        cat <<EOF \
With the package level 0.9.3-5 the caddy user is changed from 'www-data' to 'http'.
You need to update the permissions for your caddy web directory with 'chown -R http:http <web-root>'

Instruction to remove the www-data user and group (please check if it is not used in other places):
$ userdel -f www-data
$ groupdel www-data
EOF

        echo "Changing ownership of /etc/ssl/caddy to http:http"
        chown -R http:http /etc/ssl/caddy
fi

pre_remove() {
    systemctl stop caddy
}

post_remove() {
    systemctl daemon-reload
}