diff --git a/src/account/create.html b/src/account/create.html index 63a0905..f40eb78 100644 --- a/src/account/create.html +++ b/src/account/create.html @@ -2,8 +2,9 @@ Create Account - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} +
@@ -25,4 +26,4 @@
- \ No newline at end of file + diff --git a/src/account/index.html b/src/account/index.html index 8d58bf5..f1d7ec7 100644 --- a/src/account/index.html +++ b/src/account/index.html @@ -2,9 +2,10 @@ Dashboard - Caddy - {{include "/includes/account/head.html"}} - - + {{import "/includes/account/head.html"}} + {{template "account-head"}} + +
@@ -29,4 +30,4 @@
- \ No newline at end of file + diff --git a/src/account/login.html b/src/account/login.html index aa81a3a..abfe73a 100644 --- a/src/account/login.html +++ b/src/account/login.html @@ -2,8 +2,9 @@ Log In - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} +
@@ -22,4 +23,4 @@
- \ No newline at end of file + diff --git a/src/account/logout.html b/src/account/logout.html index dce0666..ba8ead9 100644 --- a/src/account/logout.html +++ b/src/account/logout.html @@ -2,10 +2,11 @@ Logout - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} + Logging out... - \ No newline at end of file + diff --git a/src/account/register-package.html b/src/account/register-package.html index 625a163..cf07d3d 100644 --- a/src/account/register-package.html +++ b/src/account/register-package.html @@ -2,8 +2,9 @@ Register Package - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} +
@@ -39,4 +40,4 @@
- \ No newline at end of file + diff --git a/src/account/reset-password.html b/src/account/reset-password.html index c20b46d..4c466c5 100644 --- a/src/account/reset-password.html +++ b/src/account/reset-password.html @@ -2,8 +2,9 @@ Reset Password - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} +
@@ -35,4 +36,4 @@
- \ No newline at end of file + diff --git a/src/account/verify.html b/src/account/verify.html index 87a1044..132d152 100644 --- a/src/account/verify.html +++ b/src/account/verify.html @@ -2,8 +2,9 @@ Confirm Account - Caddy - {{include "/includes/account/head.html"}} - + {{import "/includes/account/head.html"}} + {{template "account-head"}} +
@@ -21,4 +22,4 @@
- \ No newline at end of file + diff --git a/src/business.html b/src/business.html index df41579..96c0e31 100644 --- a/src/business.html +++ b/src/business.html @@ -2,7 +2,8 @@ Caddy for Business - {{include "/includes/head.html"}} + {{import "/includes/head.html"}} + {{template "head"}} diff --git a/src/docs/index.html b/src/docs/index.html index 144fb9d..98960de 100644 --- a/src/docs/index.html +++ b/src/docs/index.html @@ -8,7 +8,8 @@ {{$title}} — Caddy Documentation - {{include "/includes/docs/head.html"}} + {{import "/includes/docs/head.html"}} + {{template "docs-head"}} diff --git a/src/docs/json/index.html b/src/docs/json/index.html index dde87fe..9ecea52 100644 --- a/src/docs/json/index.html +++ b/src/docs/json/index.html @@ -2,11 +2,12 @@ JSON Config Structure - Caddy Documentation - {{include "/includes/docs/head.html"}} - + {{import "/includes/docs/head.html"}} + {{template "docs-head"}} + - - + + {{include "/includes/docs/header.html"}} diff --git a/src/docs/markdown/automatic-https.md b/src/docs/markdown/automatic-https.md index b9c51f0..55e0f7f 100644 --- a/src/docs/markdown/automatic-https.md +++ b/src/docs/markdown/automatic-https.md @@ -222,8 +222,6 @@ Enabling on-demand TLS happens in [TLS automation policies](/docs/json/apps/tls/ To prevent abuse of this feature, you must configure restrictions. This is done in the [`automation` object of the JSON config](/docs/json/apps/tls/automation/on_demand/), or the [`on_demand_tls` global option](/docs/caddyfile/options#on-demand-tls) of the Caddyfile. Restrictions are "global" and aren't configurable per-site or per-domain. The primary restriction is an "ask" endpoint to which Caddy will send an HTTP request to ask if it has permission to obtain and manage a certificate for the domain in the handshake. This means you will need some internal backend that can, for example, query the accounts table of your database and see if a customer has signed up with that domain name. -You can also configure rate limits as restrictions, though rate limits alone are not a sufficient protection; the "ask" endpoint is required. - Be mindful of how quickly your CA is able to issue certificates. If it takes more than a few seconds, this will negatively impact the user experience (for the first client only). Due to its deferred nature and the extra configuration required to prevent abuse, we recommend enabling on-demand TLS only when your actual use case is described above. diff --git a/src/docs/markdown/caddyfile/directives/respond.md b/src/docs/markdown/caddyfile/directives/respond.md index 7bf339b..513513c 100644 --- a/src/docs/markdown/caddyfile/directives/respond.md +++ b/src/docs/markdown/caddyfile/directives/respond.md @@ -55,9 +55,10 @@ respond /secret/* "Access denied" 403 { } ``` -Write an HTML response, using [heredoc syntax](/docs/caddyfile/concepts#heredocs) to control whitespace: +Write an HTML response, using [heredoc syntax](/docs/caddyfile/concepts#heredocs) to control whitespace, and also setting the `Content-Type` header to match the response body: ```caddy-d +header Content-Type text/html respond < Foo diff --git a/src/docs/modules/index.html b/src/docs/modules/index.html index b03e90e..7ffb20d 100644 --- a/src/docs/modules/index.html +++ b/src/docs/modules/index.html @@ -2,11 +2,12 @@ Modules - Caddy Documentation - {{include "/includes/docs/head.html"}} - + {{import "/includes/docs/head.html"}} + {{template "docs-head"}} + - - + + {{include "/includes/docs/header.html"}} diff --git a/src/download.html b/src/download.html index 7cd54b4..43a7025 100644 --- a/src/download.html +++ b/src/download.html @@ -2,11 +2,12 @@ Download Caddy - {{include "/includes/head.html"}} - + {{import "/includes/head.html"}} + {{template "head"}} + - +
diff --git a/src/includes/account/head.html b/src/includes/account/head.html index c95ac06..2ff15c3 100644 --- a/src/includes/account/head.html +++ b/src/includes/account/head.html @@ -1,5 +1,8 @@ -{{include "/includes/head.html"}} - - - - \ No newline at end of file +{{define "account-head"}} + {{import "/includes/head.html"}} + {{template "head"}} + + + + +{{end}} diff --git a/src/includes/docs/head.html b/src/includes/docs/head.html index c7525cc..be64df1 100644 --- a/src/includes/docs/head.html +++ b/src/includes/docs/head.html @@ -1,10 +1,13 @@ -{{include "/includes/head.html"}} - - -{{$directives := list }} -{{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}} - {{$directives = append $directives ($file | trimSuffix ".md")}} +{{define "docs-head"}} + {{import "/includes/head.html"}} + {{template "head"}} + + + {{$directives := list }} + {{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}} + {{$directives = append $directives ($file | trimSuffix ".md")}} + {{end}} + + + {{end}} - - - \ No newline at end of file diff --git a/src/includes/head.html b/src/includes/head.html index 2159aa9..d917d78 100644 --- a/src/includes/head.html +++ b/src/includes/head.html @@ -1,12 +1,20 @@ +{{define "cacheBust" -}} + {{- if fileExists "/.commit-hash" -}} + {{- $commitHash := (include "/.commit-hash") -}} + {{- trim (printf "?v=%v" $commitHash) -}} + {{- end -}} +{{- end}} + +{{define "head"}} - + - - + + @@ -41,3 +49,4 @@ +{{end}} diff --git a/src/index.html b/src/index.html index 563a800..98905ec 100644 --- a/src/index.html +++ b/src/index.html @@ -2,8 +2,9 @@ Caddy - The Ultimate Server with Automatic HTTPS - {{include "/includes/head.html"}} - + {{import "/includes/head.html"}} + {{template "head"}} + diff --git a/src/v2.html b/src/v2.html index b846bef..c300746 100644 --- a/src/v2.html +++ b/src/v2.html @@ -2,10 +2,11 @@ Caddy 2 - {{include "/includes/head.html"}} + {{import "/includes/head.html"}} + {{template "head"}} - +