Skip to content

Commit

Permalink
Set mercure to version 0.15.5 (#561)
Browse files Browse the repository at this point in the history
* Set mercure to version 0.15.5

* Update nodejs
Update csp
  • Loading branch information
frankdekker committed Dec 23, 2023
1 parent 2e21d1c commit e741cbd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MYSQL_PORT=3306
MYSQL_DATA_DIR=./docker/db/data
RABBITMQ_CLIENT_PORT=5672
RABBITMQ_API_PORT=15672
MERCURE_VERSION=v0.15.5
MERCURE_SSL_PORT=6443
HIGHLIGHTJS_HOST=nodejs
HIGHLIGHTJS_PORT=3000
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18.x
- name: Use Node.js 21.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 21.x

# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ services:
mercure:
container_name: ${MERCURE_CONTAINER:-mercure}
build:
args:
VERSION: $MERCURE_VERSION
context: .
dockerfile: ./docker/mercure/Dockerfile
environment:
Expand Down
4 changes: 3 additions & 1 deletion docker/mercure/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM dunglas/mercure AS base
ARG VERSION=latest

FROM dunglas/mercure:${VERSION} AS base

##
# production
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function onResponse(ResponseEvent $event): void
$policy = [
"default-src 'self'",
"img-src 'self' data:",
"object-src: 'none'",
"object-src 'none'",
"require-trusted-types-for 'script'",
"base-uri 'none'",
sprintf("connect-src 'self' %s:*", $this->hostname),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function testOnResponseWithIdeUrl(): void
$subscriber->onResponse($event);

static::assertSame(
"default-src 'self'; img-src 'self' data:; object-src: 'none'; connect-src 'self' host:*; frame-src http://localhost:*",
"default-src 'self'; img-src 'self' data:; object-src 'none'; require-trusted-types-for 'script'; base-uri 'none'; " .
"connect-src 'self' host:*; frame-src http://localhost:*",
$response->headers->get("Content-Security-Policy")
);
}
Expand All @@ -53,7 +54,8 @@ public function testOnResponseWithoutIdeUrl(): void
$subscriber->onResponse($event);

static::assertSame(
"default-src 'self'; img-src 'self' data:; object-src: 'none'; connect-src 'self' host:*",
"default-src 'self'; img-src 'self' data:; object-src 'none'; require-trusted-types-for 'script';" .
" base-uri 'none'; connect-src 'self' host:*",
$response->headers->get("Content-Security-Policy")
);
}
Expand Down

0 comments on commit e741cbd

Please sign in to comment.