From c873e9233a58f688284015cff59b8032b56bcaa7 Mon Sep 17 00:00:00 2001 From: Stanislau Kviatkouski <7zete7@gmail.com> Date: Wed, 26 Nov 2025 19:45:47 +0300 Subject: [PATCH 1/3] feat: add MERCURE_BOLT_PATH and MERCURE_BOLT_EXTRA_DIRECTIVES Caddyfile options --- docs/options.md | 2 ++ frankenphp/Caddyfile | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/docs/options.md b/docs/options.md index 4504d6f00..648ebd77b 100644 --- a/docs/options.md +++ b/docs/options.md @@ -85,6 +85,8 @@ to inject options block, directive or configuration. | `FRANKENPHP_CONFIG` | a list of extra [FrankenPHP global directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | | `FRANKENPHP_WORKER_CONFIG` | a list of extra [FrankenPHP worker directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | | `MERCURE_TRANSPORT_URL` | the value passed to the `transport_url` directive | `bolt:///data/mercure.db` | +| `MERCURE_BOLT_PATH` | path of the Bolt database file | `/data/mercure.db` | +| `MERCURE_BOLT_EXTRA_DIRECTIVES` | a list of extra [Mercure Bolt Adapter directives](https://mercure.rocks/docs/hub/config#bolt-adapter), one per line | | | `MERCURE_PUBLISHER_JWT_KEY` | the JWT key to use for publishers | | | `MERCURE_PUBLISHER_JWT_ALG` | the JWT algorithm to use for publishers | `HS256` | | `MERCURE_SUBSCRIBER_JWT_KEY` | the JWT key to use for subscribers | | diff --git a/frankenphp/Caddyfile b/frankenphp/Caddyfile index df0b7112b..22b45d417 100644 --- a/frankenphp/Caddyfile +++ b/frankenphp/Caddyfile @@ -31,6 +31,11 @@ encode zstd br gzip mercure { + # The transport to use + transport bolt { + path {$MERCURE_BOLT_PATH:/data/mercure.db} + {$MERCURE_BOLT_EXTRA_DIRECTIVES} + } # Publisher JWT key publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG} # Subscriber JWT key From 647b561c2813772acb51e49bd4e678f6dee8f7a1 Mon Sep 17 00:00:00 2001 From: Stanislau Kviatkouski <7zete7@gmail.com> Date: Wed, 26 Nov 2025 19:46:51 +0300 Subject: [PATCH 2/3] fix!: remove MERCURE_TRANSPORT_URL env --- Dockerfile | 3 --- docs/options.md | 1 - 2 files changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2602fb82d..e1a56e69c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,9 +34,6 @@ RUN set -eux; \ # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser ENV COMPOSER_ALLOW_SUPERUSER=1 -# Transport to use by Mercure (default to Bolt) -ENV MERCURE_TRANSPORT_URL=bolt:///data/mercure.db - ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d" ###> recipes ### diff --git a/docs/options.md b/docs/options.md index 648ebd77b..932404362 100644 --- a/docs/options.md +++ b/docs/options.md @@ -84,7 +84,6 @@ to inject options block, directive or configuration. | `SERVER_NAME` | the server name or address | `localhost` | | `FRANKENPHP_CONFIG` | a list of extra [FrankenPHP global directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | | `FRANKENPHP_WORKER_CONFIG` | a list of extra [FrankenPHP worker directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | -| `MERCURE_TRANSPORT_URL` | the value passed to the `transport_url` directive | `bolt:///data/mercure.db` | | `MERCURE_BOLT_PATH` | path of the Bolt database file | `/data/mercure.db` | | `MERCURE_BOLT_EXTRA_DIRECTIVES` | a list of extra [Mercure Bolt Adapter directives](https://mercure.rocks/docs/hub/config#bolt-adapter), one per line | | | `MERCURE_PUBLISHER_JWT_KEY` | the JWT key to use for publishers | | From 5e34cb6e3f64058b37a0583b4bbfecb5b9c5bd63 Mon Sep 17 00:00:00 2001 From: Stanislau Kviatkouski <7zete7@gmail.com> Date: Wed, 26 Nov 2025 19:47:24 +0300 Subject: [PATCH 3/3] chore(docs): format docs/options.md --- docs/options.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/options.md b/docs/options.md index 932404362..49407bc9d 100644 --- a/docs/options.md +++ b/docs/options.md @@ -75,22 +75,22 @@ to inject options block, directive or configuration. -| Environment variable | Description | Default value | -| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | -| `CADDY_GLOBAL_OPTIONS` | the [global options block](https://caddyserver.com/docs/caddyfile/options#global-options), one per line | | -| `CADDY_EXTRA_CONFIG` | the [snippet](https://caddyserver.com/docs/caddyfile/concepts#snippets) or the [named-routes](https://caddyserver.com/docs/caddyfile/concepts#named-routes) options block, one per line | | -| `CADDY_SERVER_EXTRA_DIRECTIVES` | the [`Caddyfile` directives](https://caddyserver.com/docs/caddyfile/concepts#directives) | | -| `CADDY_SERVER_LOG_OPTIONS` | the [server log options block](https://caddyserver.com/docs/caddyfile/directives/log), one per line | | -| `SERVER_NAME` | the server name or address | `localhost` | -| `FRANKENPHP_CONFIG` | a list of extra [FrankenPHP global directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | -| `FRANKENPHP_WORKER_CONFIG` | a list of extra [FrankenPHP worker directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | -| `MERCURE_BOLT_PATH` | path of the Bolt database file | `/data/mercure.db` | -| `MERCURE_BOLT_EXTRA_DIRECTIVES` | a list of extra [Mercure Bolt Adapter directives](https://mercure.rocks/docs/hub/config#bolt-adapter), one per line | | -| `MERCURE_PUBLISHER_JWT_KEY` | the JWT key to use for publishers | | -| `MERCURE_PUBLISHER_JWT_ALG` | the JWT algorithm to use for publishers | `HS256` | -| `MERCURE_SUBSCRIBER_JWT_KEY` | the JWT key to use for subscribers | | -| `MERCURE_SUBSCRIBER_JWT_ALG` | the JWT algorithm to use for subscribers | `HS256` | -| `MERCURE_EXTRA_DIRECTIVES` | a list of extra [Mercure directives](https://mercure.rocks/docs/hub/config), one per line | | +| Environment variable | Description | Default value | +| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | +| `CADDY_GLOBAL_OPTIONS` | the [global options block](https://caddyserver.com/docs/caddyfile/options#global-options), one per line | | +| `CADDY_EXTRA_CONFIG` | the [snippet](https://caddyserver.com/docs/caddyfile/concepts#snippets) or the [named-routes](https://caddyserver.com/docs/caddyfile/concepts#named-routes) options block, one per line | | +| `CADDY_SERVER_EXTRA_DIRECTIVES` | the [`Caddyfile` directives](https://caddyserver.com/docs/caddyfile/concepts#directives) | | +| `CADDY_SERVER_LOG_OPTIONS` | the [server log options block](https://caddyserver.com/docs/caddyfile/directives/log), one per line | | +| `SERVER_NAME` | the server name or address | `localhost` | +| `FRANKENPHP_CONFIG` | a list of extra [FrankenPHP global directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | +| `FRANKENPHP_WORKER_CONFIG` | a list of extra [FrankenPHP worker directives](https://frankenphp.dev/docs/config/#caddyfile-config), one per line | | +| `MERCURE_BOLT_PATH` | path of the Bolt database file | `/data/mercure.db` | +| `MERCURE_BOLT_EXTRA_DIRECTIVES` | a list of extra [Mercure Bolt Adapter directives](https://mercure.rocks/docs/hub/config#bolt-adapter), one per line | | +| `MERCURE_PUBLISHER_JWT_KEY` | the JWT key to use for publishers | | +| `MERCURE_PUBLISHER_JWT_ALG` | the JWT algorithm to use for publishers | `HS256` | +| `MERCURE_SUBSCRIBER_JWT_KEY` | the JWT key to use for subscribers | | +| `MERCURE_SUBSCRIBER_JWT_ALG` | the JWT algorithm to use for subscribers | `HS256` | +| `MERCURE_EXTRA_DIRECTIVES` | a list of extra [Mercure directives](https://mercure.rocks/docs/hub/config), one per line | |