diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 433fc8dd..680f7d75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: - name: Start Mercure working-directory: caddy/mercure/ - run: sudo MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run main.go start --config ../../Caddyfile.dev + run: sudo MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run main.go start --config ../../dev.Caddyfile - uses: actions/setup-node@v4 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index a12074cf..ffbf6587 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -70,7 +70,7 @@ archives: - LICENSE - README.md - Caddyfile - - Caddyfile.dev + - dev.Caddyfile format_overrides: - goos: windows format: zip @@ -106,7 +106,7 @@ dockers: - "--platform=linux/amd64" extra_files: - Caddyfile - - Caddyfile.dev + - dev.Caddyfile - ids: - caddy goos: linux @@ -121,7 +121,7 @@ dockers: - "--platform=linux/arm64/v8" extra_files: - Caddyfile - - Caddyfile.dev + - dev.Caddyfile - ids: - legacy dockerfile: Dockerfile.legacy diff --git a/.vscode/launch.json b/.vscode/launch.json index 6e262022..f410a5c4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,7 +15,7 @@ "SERVER_NAME": "localhost, host.docker.internal", "CADDY_SERVER_EXTRA_DIRECTIVES": "tls internal" }, - "args": ["run", "--config", "../../Caddyfile.dev"] + "args": ["run", "--config", "../../dev.Caddyfile"] } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24d3140a..d8065cbc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ To run the test suite: To test the Caddy module: cd caddy/mercure - MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run main.go run --config ../../Caddyfile.dev + MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run main.go run --config ../../dev.Caddyfile Go to `https://localhost` and enjoy! diff --git a/Dockerfile b/Dockerfile index 910ab9ee..eb246a83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,4 @@ ENV MERCURE_TRANSPORT_URL=bolt:///data/mercure.db COPY mercure /usr/bin/caddy COPY Caddyfile /etc/caddy/Caddyfile -COPY Caddyfile.dev /etc/caddy/Caddyfile.dev +COPY dev.Caddyfile /etc/caddy/dev.Caddyfile diff --git a/charts/mercure/templates/deployment.yaml b/charts/mercure/templates/deployment.yaml index 9e2348b6..9fb9bada 100644 --- a/charts/mercure/templates/deployment.yaml +++ b/charts/mercure/templates/deployment.yaml @@ -36,7 +36,7 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" {{- if .Values.dev }} command: ["caddy"] - args: ["run", "--config", "/etc/caddy/Caddyfile.dev", "--adapter", "caddyfile"] + args: ["run", "--config", "/etc/caddy/dev.Caddyfile", "--adapter", "caddyfile"] {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: diff --git a/Caddyfile.dev b/dev.Caddyfile similarity index 100% rename from Caddyfile.dev rename to dev.Caddyfile diff --git a/docs/UPGRADE.md b/docs/UPGRADE.md index 0ea21531..edc521ac 100644 --- a/docs/UPGRADE.md +++ b/docs/UPGRADE.md @@ -1,5 +1,10 @@ # Upgrade +## 0.16.2 + +The `Caddyfile.dev` file has been renamed `dev.Caddyfile` to match new Caddy best practices +and prevent "ambigous adapter" issues. + ## 0.14.4 This release is built on top of [Caddy 2.6](https://github.com/caddyserver/caddy/releases/tag/v2.6.0). diff --git a/docs/hub/install.md b/docs/hub/install.md index 9cd6a9ca..1279a204 100644 --- a/docs/hub/install.md +++ b/docs/hub/install.md @@ -18,13 +18,13 @@ To start the Mercure.rocks Hub in development mode on Linux and macOS, run: ```console MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' \ MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' \ -./mercure run --config Caddyfile.dev +./mercure run --config dev.Caddyfile ``` On Windows, start PowerShell, go into the extracted directory and run: ```powershell -$env:MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!'; $env:MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!'; .\mercure.exe run --config Caddyfile.dev +$env:MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!'; $env:MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!'; .\mercure.exe run --config dev.Caddyfile ``` *Note:* The Windows Defender Firewall will ask you if you want to allow `mercure.exe` to communicate through it. @@ -65,7 +65,7 @@ docker run \ -e MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' \ -p 80:80 \ -p 443:443 \ - dunglas/mercure caddy run --config /etc/caddy/Caddyfile.dev + dunglas/mercure caddy run --config /etc/caddy/dev.Caddyfile ``` The server is then available on `https://localhost`. Anonymous subscribers are allowed and the debugger UI is available on `https://localhost/.well-known/mercure/ui/`. @@ -125,7 +125,7 @@ services: MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' # Uncomment the following line to enable the development mode - #command: /usr/bin/caddy run --config /etc/caddy/Caddyfile.dev + #command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile healthcheck: test: ["CMD", "curl", "-f", "https://localhost/healthz"] timeout: 5s diff --git a/docs/hub/traefik.md b/docs/hub/traefik.md index df856b39..8420aa8d 100644 --- a/docs/hub/traefik.md +++ b/docs/hub/traefik.md @@ -30,7 +30,7 @@ services: MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' # Enables the development mode, comment the following line to run the hub in prod mode - command: /usr/bin/caddy run --config /etc/caddy/Caddyfile.dev + command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile healthcheck: test: ["CMD", "curl", "-f", "https://localhost/healthz"] timeout: 5s