10000 feat: Add CADDY_EXTRA_DIRECTIVES by blackheaven · Pull Request #660 · dunglas/mercure · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add CADDY_EXTRA_DIRECTIVES #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ log {
}
}

{$EXTRA_DIRECTIVES}

route {
encode zstd gzip

Expand Down
2 changes: 2 additions & 0 deletions Caddyfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ log {
}
}

{$EXTRA_DIRECTIVES}

route {
redir / /.well-known/mercure/ui/
encode zstd gzip
Expand Down
1 change: 1 addition & 0 deletions charts/mercure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ To install the chart with the release name `my-release`, run the following comma
| autoscaling | object | Disabled by default. | Autoscaling must not be enabled unless you are using [the High Availability version](https://mercure.rocks/docs/hub/cluster) (see [values.yaml](values.yaml) for details). |
| dev | bool | `false` | Enable the development mode, including the debug UI and the demo. |
| extraDirectives | string | `""` | Inject extra Mercure directives in the Caddyfile. |
| caddyExtraDirectives | string | `""` | Inject extra Caddy directives in the Caddyfile. |
| fullnameOverride | string | `""` | A name to substitute for the full names of resources. |
| globalOptions | string | `""` | Inject global options in the Caddyfile. |
| image.pullPolicy | string | `"IfNotPresent"` | [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for updating already existing images on a node. |
Expand Down
5 changes: 5 additions & 0 deletions charts/mercure/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ spec:
configMapKeyRef:
name: {{ include "mercure.fullname" . }}
key: global-options
- name: EXTRA_DIRECTIVES
valueFrom:
secretKeyRef:
name: {{ include "mercure.fullname" . }}
key: caddy-extra-directives
- name: MERCURE_TRANSPORT_URL
valueFrom:
secretKeyRef:
Expand Down
1 change: 1 addition & 0 deletions charts/mercure/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ data:
subscriber-jwt-key: {{ .Values.subscriberJwtKey | default (randAlphaNum 40) | b64enc | quote }}
extra-directives: {{ .Values.extraDirectives | b64enc | quote }}
license: {{ .Values.license | b64enc | quote }}
caddy-extra-directives: {{ .Values.caddyExtraDirectives | b64enc | quote }}
2 changes: 2 additions & 0 deletions charts/mercure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dev: false
transportUrl: bolt:///data/mercure.db
# -- Inject extra Mercure directives in the Caddyfile.
extraDirectives: ""
# -- Inject extra Caddy directives in the Caddyfile.
caddyExtraDirectives: ""

# -- The JWT key to use for publishers, a random key will be generated if empty.
publisherJwtKey: ""
Expand Down
3 changes: 2 additions & 1 deletion docs/hub/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ The provided `Caddyfile` and the Docker image provide convenient environment var

| Environment variable | Description | Default value |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
| `GLOBAL_OPTIONS` | the [global options block](https://caddyserver.com/docs/caddyfile/options#global-options) to inject in the `Caddyfile`, one per line |
| `GLOBAL_OPTIONS` | the [global options block](https://caddyserver.com/docs/caddyfile/options#global-options) to inject in the `Caddyfile`, one per line | |
| `EXTRA_DIRECTIVES` | [`Caddyfile` statements](https://caddyserver.com/docs/caddyfile) | |
| `SERVER_NAME` | the server name or address | `localhost` |
| `MERCURE_TRANSPORT_URL` | the value passed to the `transport_url` directive | `bolt://mercure.db` |
| `MERCURE_PUBLISHER_JWT_KEY` | the JWT key to use for publishers | |
Expand Down
0