This commit is contained in:
elmø 2023-08-13 21:29:06 +02:00
commit 8205054ec6
19 changed files with 87 additions and 59 deletions

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Create Account - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/create.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/create.js{{template "cacheBust"}}"></script>
</head>
<body>
<form action="/api/create-account" class="card">

View file

@ -2,9 +2,10 @@
<html>
<head>
<title>Dashboard - Caddy</title>
{{include "/includes/account/head.html"}}
<link rel="stylesheet" href="/resources/css/account/dashboard.css">
<script src="/resources/js/account/dashboard.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<link rel="stylesheet" href="/resources/css/account/dashboard.css{{template "cacheBust"}}">
<script src="/resources/js/account/dashboard.js{{template "cacheBust"}}"></script>
</head>
<body>
<div class="container">

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Log In - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/login.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/login.js{{template "cacheBust"}}"></script>
</head>
<body>
<form action="/api/login" class="card">

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Logout - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/logout.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/logout.js{{template "cacheBust"}}"></script>
</head>
<body>
Logging out...

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Register Package - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/register-package.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/register-package.js{{template "cacheBust"}}"></script>
</head>
<body>
<div class="container">

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Reset Password - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/reset-password.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/reset-password.js{{template "cacheBust"}}"></script>
</head>
<body>
<form action="/api/reset-password" class="card" id="reset-password-step1">

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Confirm Account - Caddy</title>
{{include "/includes/account/head.html"}}
<script src="/resources/js/account/verify.js"></script>
{{import "/includes/account/head.html"}}
{{template "account-head"}}
<script src="/resources/js/account/verify.js{{template "cacheBust"}}"></script>
</head>
<body>
<form action="/api/verify-account" class="card">

View file

@ -2,7 +2,8 @@
<html>
<head>
<title>Caddy for Business</title>
{{include "/includes/head.html"}}
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/business.css">
<meta property="og:title" content="Caddy 2 for Business">
<meta name="twitter:title" value="Caddy 2 for Business">

View file

@ -8,7 +8,8 @@
<html>
<head>
<title>{{$title}} &mdash; Caddy Documentation</title>
{{include "/includes/docs/head.html"}}
{{import "/includes/docs/head.html"}}
{{template "docs-head"}}
<meta property="og:title" content="{{$title}} - Caddy Documentation">
<meta name="twitter:title" value="{{$title}} - Caddy Documentation">
</head>

View file

@ -2,11 +2,12 @@
<html>
<head>
<title>JSON Config Structure - Caddy Documentation</title>
{{include "/includes/docs/head.html"}}
<link rel="stylesheet" href="/resources/css/docs-json.css">
{{import "/includes/docs/head.html"}}
{{template "docs-head"}}
<link rel="stylesheet" href="/resources/css/docs-json.css{{template "cacheBust"}}">
<script src="/resources/js/marked-0.8.0.min.js"></script>
<script src="/resources/js/docs-api.js"></script>
<script src="/resources/js/json-docs.js"></script>
<script src="/resources/js/docs-api.js{{template "cacheBust"}}"></script>
<script src="/resources/js/json-docs.js{{template "cacheBust"}}"></script>
</head>
<body>
{{include "/includes/docs/header.html"}}

View file

@ -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.

View file

@ -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 <<HTML
<html>
<head><title>Foo</title></head>

View file

@ -2,11 +2,12 @@
<html>
<head>
<title>Modules - Caddy Documentation</title>
{{include "/includes/docs/head.html"}}
<link rel="stylesheet" href="/resources/css/docs-json.css">
{{import "/includes/docs/head.html"}}
{{template "docs-head"}}
<link rel="stylesheet" href="/resources/css/docs-json.css{{template "cacheBust"}}">
<script src="/resources/js/marked-0.8.0.min.js"></script>
<script src="/resources/js/docs-api.js"></script>
<script src="/resources/js/module-docs.js"></script>
<script src="/resources/js/docs-api.js{{template "cacheBust"}}"></script>
<script src="/resources/js/module-docs.js{{template "cacheBust"}}"></script>
</head>
<body>
{{include "/includes/docs/header.html"}}

View file

@ -2,11 +2,12 @@
<html>
<head>
<title>Download Caddy</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/download.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/download.css{{template "cacheBust"}}">
<script src="/resources/js/jquery-3.4.1.min.js"></script>
<script src="/resources/js/sweetalert.min.js"></script>
<script src="/resources/js/download.js"></script>
<script src="/resources/js/download.js{{template "cacheBust"}}"></script>
</head>
<body>
<div class="wrapper">

View file

@ -1,5 +1,8 @@
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/account/common.css">
<script src="/resources/js/jquery-3.4.1.min.js"></script>
<script src="/resources/js/sweetalert.min.js"></script>
<script src="/resources/js/account/common.js"></script>
{{define "account-head"}}
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/account/common.css{{template "cacheBust"}}">
<script src="/resources/js/jquery-3.4.1.min.js"></script>
<script src="/resources/js/sweetalert.min.js"></script>
<script src="/resources/js/account/common.js{{template "cacheBust"}}"></script>
{{end}}

View file

@ -1,10 +1,13 @@
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/docs.css">
<link rel="stylesheet" href="/resources/css/chroma.css">
{{$directives := list }}
{{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}}
{{define "docs-head"}}
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/docs.css{{template "cacheBust"}}">
<link rel="stylesheet" href="/resources/css/chroma.css{{template "cacheBust"}}">
{{$directives := list }}
{{range $i, $file := (listFiles "/docs/markdown/caddyfile/directives")}}
{{$directives = append $directives ($file | trimSuffix ".md")}}
{{end}}
<script type="text/javascript">window.CaddyfileDirectives = {{$directives | toJson}};</script>
<script src="/resources/js/jquery-3.4.1.min.js"></script>
<script src="/resources/js/docs.js{{template "cacheBust"}}"></script>
{{end}}
<script type="text/javascript">window.CaddyfileDirectives = {{$directives | toJson}};</script>
<script src="/resources/js/jquery-3.4.1.min.js"></script>
<script src="/resources/js/docs.js"></script>

View file

@ -1,12 +1,20 @@
{{define "cacheBust" -}}
{{- if fileExists "/.commit-hash" -}}
{{- $commitHash := (include "/.commit-hash") -}}
{{- trim (printf "?v=%v" $commitHash) -}}
{{- end -}}
{{- end}}
{{define "head"}}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin />
<link rel="icon" href="/resources/images/favicon.png">
<link rel="icon" href="/resources/images/favicon.png{{template "cacheBust"}}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:400,700|Maven+Pro:400,700,900|Montserrat:400,700|PT+Mono&display=swap">
<link rel="stylesheet" href="/resources/css/common.css">
<script src="/resources/js/common.js"></script>
<link rel="stylesheet" href="/resources/css/common.css{{template "cacheBust"}}">
<script src="/resources/js/common.js{{template "cacheBust"}}"></script>
<!-- General metatags -->
<meta name="author" content="Caddy Web Server">
@ -41,3 +49,4 @@
<!-- Alpine.js to augment markdown docs -->
<script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
{{end}}

View file

@ -2,8 +2,9 @@
<html>
<head>
<title>Caddy - The Ultimate Server with Automatic HTTPS</title>
{{include "/includes/head.html"}}
<link rel="stylesheet" href="/resources/css/home.css">
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="/resources/css/home.css{{template "cacheBust"}}">
<meta property="og:title" content="Caddy 2 - The Ultimate Server with Automatic HTTPS">
<meta name="twitter:title" value="Caddy 2 - The Ultimate Server with Automatic HTTPS">
</head>

View file

@ -2,10 +2,11 @@
<html>
<head>
<title>Caddy 2</title>
{{include "/includes/head.html"}}
{{import "/includes/head.html"}}
{{template "head"}}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Dancing+Script:wght@700&display=swap">
<link rel="stylesheet" href="/resources/css/asciinema-player-2.6.1.css">
<link rel="stylesheet" href="/resources/css/v2-landing.css">
<link rel="stylesheet" href="/resources/css/v2-landing.css{{template "cacheBust"}}">
<meta property="og:title" content="Introducing Caddy 2 - The Ultimate Server with Automatic HTTPS">
<meta name="twitter:title" value="Introducing Caddy 2 - The Ultimate Server with Automatic HTTPS">
</head>