TUN-528: Move cloudflared into a separate repo

This commit is contained in:
Areg Harutyunyan
2018-05-01 18:45:06 -05:00
parent e8c621a648
commit d06fc520c7
4726 changed files with 1763680 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
Upstart conf for Caddy
=====================
Usage
-----
Usage in this blogpost: [Running Caddy Server as a service with Upstart](https://denbeke.be/blog/servers/running-caddy-server-as-a-service/).
Short recap:
* Download Caddy in `/usr/local/bin/caddy` and execute `sudo setcap cap_net_bind_service=+ep /usr/local/bin/caddy`.
* Save the appropriate upstart config file in `/etc/init/caddy.conf`.
* Ensure that the folder `/etc/caddy` exists and that the subfolder .caddy is owned by `www-data`.
* Create a Caddyfile in `/etc/caddy/Caddyfile`.
* Now you can use `sudo service caddy start|stop|restart`.

View File

@@ -0,0 +1,25 @@
description "Caddy HTTP/2 web server"
start on runlevel [2345]
stop on runlevel [016]
console log
setuid www-data
setgid www-data
respawn
respawn limit 10 5
reload signal SIGUSR1
# Let's Encrypt certificates will be written to this directory.
env CADDYPATH=/etc/ssl/caddy
limit nofile 1048576 1048576
script
cd /etc/ssl/caddy
rootdir="$(mktemp -d -t "caddy-run.XXXXXX")"
exec /usr/local/bin/caddy -agree -log=stdout -conf=/etc/caddy/Caddyfile -root=$rootdir
end script

View File

@@ -0,0 +1,21 @@
description "Caddy HTTP/2 web server"
start on runlevel [2345]
stop on runlevel [016]
console output
respawn
respawn limit 10 5
# Let's Encrypt certificates will be written to this directory.
env CADDYPATH=/etc/ssl/caddy
limit nofile 1048576 1048576
script
cd /etc/ssl/caddy
rootdir="$(mktemp -d -t "caddy-run.XXXXXX")"
chown www-data:www-data $rootdir
exec sudo -u www-data /usr/local/bin/caddy -agree -log=/var/log/caddy.log -conf=/etc/caddy/Caddyfile -root=$rootdir
end script

View File

@@ -0,0 +1,26 @@
description "Caddy HTTP/2 web server"
start on runlevel [2345]
stop on runlevel [016]
console log
setuid www-data
setgid www-data
respawn
respawn limit 10 5
# 12.04 upstart version does not support reload
#reload signal SIGUSR1
# Let's Encrypt certificates will be written to this directory.
env CADDYPATH=/etc/ssl/caddy
limit nofile 1048576 1048576
script
cd /etc/ssl/caddy
rootdir="$(mktemp -d -t "caddy-run.XXXXXX")"
exec /usr/local/bin/caddy -agree -log=stdout -conf=/etc/caddy/Caddyfile -root=$rootdir
end script