From 41fbc5f94bf6d54abddb3db81b974979ff372b73 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 21 Apr 2017 00:07:28 -0600 Subject: [PATCH] more proper default index.html --- install-caddy | 17 ++++--------- srv/www/index.html | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 srv/www/index.html diff --git a/install-caddy b/install-caddy index 3b0c755..35a6d53 100755 --- a/install-caddy +++ b/install-caddy @@ -7,6 +7,7 @@ installer_base="https://git.daplie.com/Daplie/caddy-installer/raw/master" caddy_systemd_service="$installer_base/etc/systemd/system/caddy.service" caddy_systemd_tmpfiles="$installer_base/etc/tmpfiles.d/caddy.conf" caddy_launchd_service="$installer_base/Library/LaunchDaemons/com.caddyserver.web.plist" +caddy_localhost_index="$installer_base/srv/www/index.html" all_oses="windows,darwin,linux,freebsd,openbsd" all_arches="arm64,amd64,386,armv5,armv6l,armv7l" @@ -320,18 +321,10 @@ CADDY_EOF $sudo_cmd chmod 755 $PREFIX/srv/www/localhost if [ ! -f "$PREFIX/srv/www/localhost/index.html" ] || [ -z "$(cat $PREFIX/srv/www/localhost)" ]; then - cat <<'CADDY_EOF' >> $PREFIX/tmp/$caddy_dir/index.html - - - - Welcome to Caddy! - - -

Welcome to Caddy!

- - -CADDY_EOF - $sudo_cmd mv "$PREFIX/tmp/$caddy_dir/index.html" "$PREFIX/srv/www/localhost/index.html" + $http_get $http_opts "$caddy_localhost_index" $http_out $PREFIX/tmp/$caddy_dir/index.html + $sudo_cmd mv $PREFIX/tmp/$caddy_dir/index.html $PREFIX/srv/www/localhost/ + $sudo_cmd chown -R $caddy_user:$caddy_group $PREFIX/srv/www/localhost/ + $sudo_cmd chmod 664 $PREFIX/srv/www/localhost/index.html fi if setcap_cmd=$(type -p setcap); then diff --git a/srv/www/index.html b/srv/www/index.html new file mode 100644 index 0000000..9a21bee --- /dev/null +++ b/srv/www/index.html @@ -0,0 +1,63 @@ + + + + Welcome to Caddy! + + +

Welcome to Caddy!

+

Here's some info to help you know what to do next

+ +

Where do my sites go?

+

+ Your sites are in /srv/www. In fact, this page is served from /srv/www/localhost/index.html +

+

+ If you have a site, say example.com, you can put it in /srv/www/example.com and then edit the Caddyfile + to reflect the change: +

+
https://example.com {
+  tls john@email.com
+  root /srv/www/example.com
+}
+https://www.example.com {
+  redir https://example.com
+}
+
+ +

What was installed to where?

+
/usr/local/bin/caddy
+/etc/caddy/Caddyfile
+/etc/ssl/caddy/
+/etc/ssl/caddy/acme/
+/etc/ssl/caddy/ocsp/
+/etc/systemd/system/caddy.service
+/etc/tmpfiles.d/caddy.conf
+/srv/www/localhost/index.html
+/var/log/caddy/
+/Library/LaunchDaemons/com.caddyserver.web.plist
+
+ +

How do I start / stop / reload / see logs for Caddy?

+ + + + + + + + + + + +
WindowsMacLinux
The world may never know...
launchctl unload com.caddyserver.web
+launchctl load -w com.caddyserver.web
+launchctl list | grep caddy
+launchctl remove grep caddy
+
systemctl status caddy
+systemctl enable caddy
+systemctl start caddy
+systemctl stop caddy
+journalctl --boot -u caddy.service
+
+ +