-
Notifications
You must be signed in to change notification settings - Fork 1
/
caddy
executable file
·30 lines (22 loc) · 1.08 KB
/
caddy
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
#!/usr/bin/env bash
# Copyright (C) 2021 Rodrigo Silva (MestreLion) <linux@rodrigosilva.com>
# License: GPLv3 or later. See <http://www.gnu.org/licenses/gpl.html>
# -----------------------------------------------------------------------------
DESCRIPTION='Caddy Web Server'
ARGS=''
setuplib=${SETUP_LIB_PATH:-"$(dirname "$(readlink -f "$0")")"/../setuplib}
# shellcheck source=../setuplib
if [[ -r "$setuplib" ]]; then source "$setuplib"; else
echo "Setup library not found: $setuplib" >&2; exit 1;
fi
# -----------------------------------------------------------------------------
# https://caddyserver.com/docs/install#debian-ubuntu-raspbian
url='https://dl.cloudsmith.io/public/caddy/stable'
install_package debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf "$url"/gpg.key | setup_run sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
curl -1sLf "$url"/debian.deb.txt | setup_run sudo tee /etc/apt/sources.list.d/caddy-stable.list
setup_run sudo apt update
install_package caddy
# One-shot install trust
# sudo HOME=~caddy caddy trust
# TODO: Add /etc/caddy/Caddyfile