summarylogtreecommitdiffstats
path: root/caddy.install
diff options
context:
space:
mode:
authorcarlwgeorge2017-05-18 11:23:42 -0500
committercarlwgeorge2017-05-18 11:54:57 -0500
commit97c40162b0e3ffc7f76a942a0a4cc74255224061 (patch)
tree9d734ed7782f77309f7ee830d5a65d4c46ccfa4d /caddy.install
parent49fb7df51ea7d9869f87ce5473e6ae1bcaa870b9 (diff)
downloadaur-97c40162b0e3ffc7f76a942a0a4cc74255224061.tar.gz
0.10.2-2
* Remove conflicts. It is the responsiblity of alternate packages (-git, -bin, etc.) to conflict with the main package. The main package doesn't need to also conflict with them. * Build from GitHub tarball, not git clone. * Build using `go build` directly, not build.bash. * Run as the existing http user. * Store tls things in /var/lib/caddy (created by a tmpfiles config). * Create CADDYPATH with systemd tmpfiles, not in caddy.install. * Run appropriate systemctl commands in caddy.install. * Enable dns provider extensions. * Include a default example page (index.html and svg image). * Include a default Caddyfile.
Diffstat (limited to 'caddy.install')
-rw-r--r--caddy.install18
1 files changed, 12 insertions, 6 deletions
diff --git a/caddy.install b/caddy.install
index 94fd46d64239..d6fc74974b93 100644
--- a/caddy.install
+++ b/caddy.install
@@ -1,11 +1,17 @@
post_install() {
- getent passwd www-data || useradd --system -s /usr/bin/nologin -d / -U www-data
-
- mkdir -p /etc/ssl/caddy
- chmod 770 /etc/ssl/caddy
- chown www-data:www-data /etc/ssl/caddy
+ systemctl --quiet daemon-reload
+ systemctl --quiet preset caddy.service
}
post_upgrade() {
- post_install
+ systemctl --quiet daemon-reload
+ systemctl --quiet try-restart caddy.service
+}
+
+pre_remove() {
+ systemctl --quiet --no-reload disable --now caddy.service
+}
+
+post_remove() {
+ systemctl --quiet daemon-reload
}