aboutsummarylogtreecommitdiffstats
path: root/caddy-full-bin.install
blob: cf55626943539ec493d9f4d0fd5b49c7fdac3e9c (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
32
33
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
        userdel -f www-data

        # only remove group if no other users are part of it
        if [ -z "$(getent group www-data | sed 's/.*://')" ]; then
            groupdel www-data
        fi
        
        chown -R http:http /etc/ssl/caddy
	
    	echo "Migration guide for caddy <0.9: https://github.com/klingtnet/caddy-AUR/blob/master/README.md"
        echo "With the package level 0.9.3-5 the caddy user is changed from 'www-data' to 'http'."
        echo "You need to update the permissions for your caddy web directory with 'chown -R http:http <web-root>'"
    fi
}

pre_remove() {
    systemctl stop caddy
}

post_remove() {
    systemctl daemon-reload
}