Make mercure work correctly

This commit is contained in:
Frank van den Berg
2026-01-08 13:05:40 +01:00
parent e54c870f05
commit 65070688ec
3 changed files with 8 additions and 6 deletions

View File

@@ -7,11 +7,11 @@ services:
environment: environment:
# Uncomment the following line to disable HTTPS, # Uncomment the following line to disable HTTPS,
#SERVER_NAME: ':80' #SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureJWTSignedBySymfonySecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureJWTSignedBySymfonySecretKey!'
# Set the URL of your Symfony project (without trailing slash!) as value of the cors_origins directive # Set the URL of your Symfony project (without trailing slash!) as value of the cors_origins directive
MERCURE_EXTRA_DIRECTIVES: | MERCURE_EXTRA_DIRECTIVES: |
cors_origins http://127.0.0.1:8000 cors_origins http://localhost:8080
# Comment the following line to disable the development mode # Comment the following line to disable the development mode
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
healthcheck: healthcheck:

View File

@@ -3,4 +3,6 @@ mercure:
default: default:
url: '%env(MERCURE_URL)%' url: '%env(MERCURE_URL)%'
public_url: '%env(MERCURE_PUBLIC_URL)%' public_url: '%env(MERCURE_PUBLIC_URL)%'
jwt: '%env(MERCURE_JWT_SECRET)%' jwt:
secret: '%env(MERCURE_JWT_SECRET)%'
publish: ['*']

View File

@@ -63,8 +63,8 @@ services:
container_name: escapepage-mercure container_name: escapepage-mercure
environment: environment:
SERVER_NAME: ":80" SERVER_NAME: ":80"
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureJWT!} MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureJWTSignedBySymfonySecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureJWT!} MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureJWTSignedBySymfonySecretKey!'
MERCURE_CORS_ALLOWED_ORIGINS: http://localhost:8080 MERCURE_CORS_ALLOWED_ORIGINS: http://localhost:8080
MERCURE_PUBLISH_ALLOWED_ORIGINS: http://localhost:8080 MERCURE_PUBLISH_ALLOWED_ORIGINS: http://localhost:8080
MERCURE_EXTRA_DIRECTIVES: | MERCURE_EXTRA_DIRECTIVES: |