Skip to content

Commit

Permalink
chore: rename Caddyfile.dev to dev.Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jun 4, 2024
1 parent 90a976a commit 37255e0
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ archives:
- LICENSE
- README.md
- Caddyfile
- Caddyfile.dev
- dev.Caddyfile
format_overrides:
- goos: windows
format: zip
Expand Down Expand Up @@ -106,7 +106,7 @@ dockers:
- "--platform=linux/amd64"
extra_files:
- Caddyfile
- Caddyfile.dev
- dev.Caddyfile
- ids:
- caddy
goos: linux
Expand All @@ -121,7 +121,7 @@ dockers:
- "--platform=linux/arm64/v8"
extra_files:
- Caddyfile
- Caddyfile.dev
- dev.Caddyfile
- ids:
- legacy
dockerfile: Dockerfile.legacy
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion charts/mercure/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
8 changes: 4 additions & 4 deletions docs/hub/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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/`.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/hub/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37255e0

Please sign in to comment.