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 4504d6f00..49407bc9d 100644 --- a/docs/options.md +++ b/docs/options.md @@ -75,21 +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_TRANSPORT_URL` | the value passed to the `transport_url` directive | `bolt:///data/mercure.db` | -| `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 | | 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