2020-05-12 14:51:19 -07:00
|
|
|
# caddy.service
|
|
|
|
#
|
|
|
|
# For using Caddy with a config file.
|
|
|
|
#
|
|
|
|
# Make sure the ExecStart and ExecReload commands are correct
|
|
|
|
# for your installation.
|
|
|
|
#
|
|
|
|
# WARNING: This service does not use the --resume flag, so if you
|
|
|
|
# use the API to make changes, they will be overwritten by the
|
|
|
|
# Caddyfile next time the service is restarted. If you intend to
|
|
|
|
# use Caddy's API to configure it, add the --resume flag to the
|
|
|
|
# `caddy run` command or use the caddy-api.service file instead.
|
2020-11-27 08:11:48 -08:00
|
|
|
# use sed to get caddy directory at install
|
2020-05-12 14:51:19 -07:00
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Caddy
|
|
|
|
Documentation=https://caddyserver.com/docs/
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
2020-11-27 08:11:48 -08:00
|
|
|
# base directory must be hard coded
|
2020-05-12 14:51:19 -07:00
|
|
|
User=caddy
|
|
|
|
Group=caddy
|
|
|
|
WorkingDirectory=/opt/caddy
|
2020-11-27 08:11:48 -08:00
|
|
|
ExecStart=
|
|
|
|
|
|
|
|
ExecReload=/opt/caddy/scripts/caddy reload --config /opt/caddy/conf/%.conf --adapter=caddyfile
|
2020-05-12 14:51:19 -07:00
|
|
|
TimeoutStopSec=5s
|
|
|
|
LimitNOFILE=1048576
|
|
|
|
LimitNPROC=512
|
|
|
|
PrivateTmp=true
|
|
|
|
ProtectSystem=full
|
|
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|