Closed dayton-outar closed 3 months ago
you indeed need xcaddy build --with github.com/dunglas/mercure/caddy
. Can you double-check that you don't see the module with this change?
Here's the response from platform.sh when I run ./caddy run --config dev.Caddyfile
,
2024/08/13 12:49:21.588 INFO using config from file {"file": "dev.Caddyfile"}
Error: adapting config using caddyfile: dev.Caddyfile:8: unrecognized directive: mercure
See below the dev.Caddyfile,
{
# Optional: Enable debug logging
debug
}
:3000 {
# Enable the Mercure module
mercure {
# Publisher JWT key
jwt_key {env.MERCURE_PUBLISHER_JWT_KEY}
# Subscribers JWT key
jwt_key_subscriber {env.MERCURE_SUBSCRIBER_JWT_KEY}
# Transport URL
transport_url {env.MERCURE_TRANSPORT_URL}
# Allow all CORS origins
cors_origins *
# Allow all publishers
publish_origins *
# Enable the subscription endpoint (default is enabled)
subscriptions
# Enable the publishing endpoint (default is enabled)
publish
# Enable UI
ui
# Configure the hub path and address
# address :3000
# path /hub
}
# Health check endpoint
respond /health 200
}
See below the full list of modules when I run ./caddy list-modules
,
admin.api.load
admin.api.metrics
admin.api.pki
admin.api.reverse_proxy
caddy.adapters.caddyfile
caddy.config_loaders.http
caddy.filesystems
caddy.listeners.http_redirect
caddy.listeners.proxy_protocol
caddy.listeners.tls
caddy.logging.encoders.append
caddy.logging.encoders.console
caddy.logging.encoders.filter
caddy.logging.encoders.filter.cookie
caddy.logging.encoders.filter.delete
caddy.logging.encoders.filter.hash
caddy.logging.encoders.filter.ip_mask
caddy.logging.encoders.filter.query
caddy.logging.encoders.filter.regexp
caddy.logging.encoders.filter.rename
caddy.logging.encoders.filter.replace
caddy.logging.encoders.json
caddy.logging.writers.discard
caddy.logging.writers.file
caddy.logging.writers.net
caddy.logging.writers.stderr
caddy.logging.writers.stdout
caddy.storage.file_system
events
http
http.authentication.hashes.bcrypt
http.authentication.providers.http_basic
http.encoders.gzip
http.encoders.zstd
http.handlers.acme_server
http.handlers.authentication
http.handlers.copy_response
http.handlers.copy_response_headers
http.handlers.encode
http.handlers.error
http.handlers.file_server
http.handlers.headers
http.handlers.intercept
http.handlers.invoke
http.handlers.log_append
http.handlers.map
http.handlers.metrics
http.handlers.push
http.handlers.request_body
http.handlers.reverse_proxy
http.handlers.rewrite
http.handlers.static_response
http.handlers.subroute
http.handlers.templates
http.handlers.tracing
http.handlers.vars
http.ip_sources.static
http.matchers.client_ip
http.matchers.expression
http.matchers.file
http.matchers.header
http.matchers.header_regexp
http.matchers.host
http.matchers.method
http.matchers.not
http.matchers.path
http.matchers.path_regexp
http.matchers.protocol
http.matchers.query
http.matchers.remote_ip
http.matchers.vars
http.matchers.vars_regexp
http.precompressed.br
http.precompressed.gzip
http.precompressed.zstd
http.reverse_proxy.selection_policies.client_ip_hash
http.reverse_proxy.selection_policies.cookie
http.reverse_proxy.selection_policies.first
http.reverse_proxy.selection_policies.header
http.reverse_proxy.selection_policies.ip_hash
http.reverse_proxy.selection_policies.least_conn
http.reverse_proxy.selection_policies.query
http.reverse_proxy.selection_policies.random
http.reverse_proxy.selection_policies.random_choose
http.reverse_proxy.selection_policies.round_robin
http.reverse_proxy.selection_policies.uri_hash
http.reverse_proxy.selection_policies.weighted_round_robin
http.reverse_proxy.transport.fastcgi
http.reverse_proxy.transport.http
http.reverse_proxy.upstreams.a
http.reverse_proxy.upstreams.multi
http.reverse_proxy.upstreams.srv
pki
tls
tls.ca_pool.source.file
tls.ca_pool.source.http
tls.ca_pool.source.inline
tls.ca_pool.source.pki_intermediate
tls.ca_pool.source.pki_root
tls.ca_pool.source.storage
tls.certificates.automate
tls.certificates.load_files
tls.certificates.load_folders
tls.certificates.load_pem
tls.certificates.load_storage
tls.client_auth.verifier.leaf
tls.get_certificate.http
tls.get_certificate.tailscale
tls.handshake_match.local_ip
tls.handshake_match.remote_ip
tls.handshake_match.sni
tls.issuance.acme
tls.issuance.internal
tls.issuance.zerossl
tls.leaf_cert_loader.file
tls.leaf_cert_loader.folder
tls.leaf_cert_loader.pem
tls.leaf_cert_loader.storage
tls.permission.http
tls.stek.distributed
tls.stek.standard
Standard modules: 121
Non-standard modules: 0
Unknown modules: 0
I'm going to try an older version.
Went back to xcaddy 0.4.1 and now getting,
Error: loading initial config: loading new config: loading http app module: provision http: server srv0: setting up route handlers: route 0: loading handler modules: position 0: loading module 'mercure': provision http.handlers.mercure: a JWT key or the URL of a JWK Set for publishers must be provided
I use the following commands to build a
caddy
with mercure.After the script is completed, I cannot find mercure handler. See output below,
What could I be missing?
N.B. I also tried building with
xcaddy build --with github.com/dunglas/mercure/caddy