Skip to content

Commit bc11c31

Browse files
committed
fix: review
1 parent 1ad8804 commit bc11c31

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ services:
2020
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
2121
DATABASE_URL: postgresql://${POSTGRES_USER:-symfony}:${POSTGRES_PASSWORD:-ChangeMe}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-13}
2222
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
23-
MERCURE_PUBLISH_URL: ${MERCURE_URL:-http://caddy/.well-known/mercure}
23+
MERCURE_URL: ${CADDY_MERCURE_URL:-http://caddy/.well-known/mercure}
24+
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeMe!}
2425
SYMFONY_VERSION:
2526

2627
caddy:
@@ -31,9 +32,8 @@ services:
3132
- php
3233
environment:
3334
SERVER_NAME: ${SERVER_NAME:-localhost, caddy:80}
34-
MERCURE_URL: ${MERCURE_URL:-http://caddy/.well-known/mercure}
35-
MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL:-https://localhost/.well-known/mercure}
36-
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET:-!ChangeMe!}
35+
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeMe!}
36+
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeMe!}
3737
restart: unless-stopped
3838
volumes:
3939
- php_socket:/var/run/php

docker/caddy/Caddyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ route {
1919
# Transport to use (default to Bolt)
2020
transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
2121
# Publisher JWT key
22-
publisher_jwt {env.MERCURE_JWT_SECRET} {env.MERCURE_JWT_ALG}
22+
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
2323
# Subscriber JWT key
24-
subscriber_jwt {env.MERCURE_JWT_SECRET} {env.MERCURE_JWT_ALG}
24+
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
2525
# Allow anonymous subscribers (double-check that it's what you want)
2626
anonymous
2727
# Enable the subscription API (double-check that it's what you want)

docs/production.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ Go into the directory containing your project (`<project-name>`), and start the
6565
```console
6666
SERVER_NAME=your-domain-name.example.com \
6767
APP_SECRET=ChangeMe \
68-
MERCURE_PUBLISHER_JWT_KEY=ChangeMe \
69-
MERCURE_SUBSCRIBER_JWT_KEY=ChangeMe \
68+
CADDY_MERCURE_JWT_SECRET=ChangeMe \
7069
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
7170
```
7271

73-
Be sure to replace `your-domain-name.example.com` by your actual domain name and to set the values of `APP_SECRET`, `MERCURE_PUBLISHER_JWT_KEY` and `MERCURE_SUBSCRIBER_JWT_KEY` to cryptographically secure random values.
72+
Be sure to replace `your-domain-name.example.com` by your actual domain name and to set the values of `APP_SECRET`, `CADDY_MERCURE_JWT_SECRET` to cryptographically secure random values.
7473

7574
Your server is up and running, and a Let's Encrypt HTTPS certificate has been automatically generated for you.
7675
Go to `https://your-domain-name.example.com` and enjoy!
@@ -82,9 +81,8 @@ Alternatively, if you don't want to expose an HTTPS server but only an HTTP one,
8281
```console
8382
SERVER_NAME=:80 \
8483
APP_SECRET=ChangeMe \
85-
MERCURE_PUBLISHER_JWT_KEY=ChangeMe \
86-
MERCURE_SUBSCRIBER_JWT_KEY=ChangeMe \
87-
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
84+
CADDY_MERCURE_JWT_SECRET=ChangeMe \
85+
-docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
8886
```
8987

9088
## Deploying on Multiple Nodes

0 commit comments

Comments
 (0)