Skip to content

Commit

Permalink
feat: simplify Caddyfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Oct 18, 2023
1 parent a548081 commit 0e54497
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
24 changes: 13 additions & 11 deletions Caddyfile
@@ -1,24 +1,24 @@
# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
order mercure before request_header

{$GLOBAL_OPTIONS}
}

{$SERVER_NAME:localhost}
{$CADDY_EXTRA_CONFIG}

log {
format filter {
wrap console
fields {
uri query {
replace authorization REDACTED
{$SERVER_NAME:localhost} {
log {
format filter {
wrap console
fields {
uri query {
replace authorization REDACTED
}
}
}
}
}

{$EXTRA_DIRECTIVES}

route {
encode zstd gzip

mercure {
Expand All @@ -32,6 +32,8 @@ route {
{$MERCURE_EXTRA_DIRECTIVES}
}

{$CADDY_SERVER_EXTRA_DIRECTIVES}

header / Content-Type "text/html; charset=utf-8"
respond / `<!DOCTYPE html>
<html lang=en>
Expand Down
25 changes: 13 additions & 12 deletions Caddyfile.dev
@@ -1,24 +1,24 @@
# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
order mercure before request_header

{$GLOBAL_OPTIONS}
}

{$SERVER_NAME:localhost}
{$CADDY_EXTRA_CONFIG}

log {
format filter {
wrap console
fields {
uri query {
replace authorization REDACTED
{$SERVER_NAME:localhost} {
log {
format filter {
wrap console
fields {
uri query {
replace authorization REDACTED
}
}
}
}
}

{$EXTRA_DIRECTIVES}

route {
encode zstd gzip

mercure {
Expand All @@ -38,7 +38,8 @@ route {
{$MERCURE_EXTRA_DIRECTIVES}
}

{$CADDY_SERVER_EXTRA_DIRECTIVES}

redir / /.well-known/mercure/ui/
respond /healthz 200
respond "Not Found" 404
}

0 comments on commit 0e54497

Please sign in to comment.