diff options
author | Thomas Fanninger | 2016-09-29 16:59:58 +0200 |
---|---|---|
committer | Andreas Linz | 2016-09-29 18:26:21 +0200 |
commit | 58cf2b8275c3f999421d52b07cd80b02a4929935 (patch) | |
tree | 76cb08c84b66c40479990b3bf207d95b5ecf53a2 /caddy-full-bin.install | |
parent | 3977b933d3cd7bdf342dd40ff845989d213bb705 (diff) | |
download | aur-58cf2b8275c3f999421d52b07cd80b02a4929935.tar.gz |
Add migration from user www-data to http
Diffstat (limited to 'caddy-full-bin.install')
-rw-r--r-- | caddy-full-bin.install | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/caddy-full-bin.install b/caddy-full-bin.install index 67f7a9567412..abafe456684f 100644 --- a/caddy-full-bin.install +++ b/caddy-full-bin.install @@ -1,6 +1,5 @@ post_install() { - getent passwd www-data || useradd --system --shell /usr/bin/nologin www-data - mkdir -p /etc/ssl/caddy && chown -R www-data:www-data /etc/ssl/caddy + mkdir -p /etc/ssl/caddy && chown -R http:http /etc/ssl/caddy } pre_upgrade() { @@ -9,6 +8,16 @@ pre_upgrade() { post_upgrade() { systemctl daemon-reload + if [ $(vercmp $2 0.9.3-4) -lt 0 ]; then + userdel -r -f www-data + groupdel www-data + + 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-4 the caddy user is changed from 'www-data' to 'http'." + echo "You need to update the right for your caddy web directory with 'chown -R http:http <web-root>'" + fi } pre_remove() { |