Skip to content

How to see compiled Caddyfile? #989

@Arkemlar

Description

@Arkemlar

I found two Caddyfiles files under /etc/caddy/ path: Caddyfile and dev.Caddyfile
Both are templates that looks like this:

Caddyfile
# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
	{$GLOBAL_OPTIONS}
}

{$CADDY_EXTRA_CONFIG}

{$SERVER_NAME:localhost} {
	log {
		format filter {
			fields {
				request>uri query {
					replace authorization REDACTED
				}
			}
		}
	}

	encode zstd gzip

	mercure {
		# Transport to use (default to Bolt)
		transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
		# Publisher JWT key
		publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
		# Subscriber JWT key
		subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
		# Permissive configuration for the development environment
		cors_origins *
		publish_origins *
		demo
		anonymous
		subscriptions
		# Extra directives
		{$MERCURE_EXTRA_DIRECTIVES}
	}

	{$CADDY_SERVER_EXTRA_DIRECTIVES}

	redir / /.well-known/mercure/ui/

	respond /healthz 200
	respond /robots.txt `User-agent: *
Disallow: /`
	respond "Not Found" 404
}

The question is...

How to see its compiled version with env variables substituted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions