Skip to content

Commit

Permalink
Replace /hub with /.well-known/mercure
Browse files Browse the repository at this point in the history
  • Loading branch information
Yggdrasil committed Nov 21, 2019
1 parent 0f77822 commit 72d7f5a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ and is configurable using [environment variables](https://en.wikipedia.org/wiki/
| `AGENT_ENDPOINT` | _undefined_ | the address to broadcast requests to (example: `127.0.0.1:6800`). When not defined, the broadcaster will only listen on requests. `SERVER_ADDR` or `AGENT_ENDPOINT` is required. |
| `AGENT_RETRY_DELAY` | `60s` | maximum duration for retrying the replay of the request. |
| `DEBUG` | `0` | set to `1` to enable the debug mode (prints recovery stack traces). |
| `HUB_ENDPOINT` | **required** | the address of the the mercure hub to push and fetch messages (example: `https://example.com/hub`). |
| `HUB_ENDPOINT` | **required** | the address of the the mercure hub to push and fetch messages (example: `https://example.com/.well-known/mercure`). |
| `HUB_GUARD_TOKEN` | =`HUB_TOPIC` | the token used to prevent infinite loop (in case an agent broadcast request to iteself). |
| `HUB_PUBLISH_TOKEN` | =`HUB_TOKEN` | valid JWT token to allow publishing. |
| `HUB_SUBSCRIBE_TOKEN` | =`HUB_TOKEN` | valid JWT token to allow subscribing. |
| `HUB_TARGET` | _undefined_ | name of the mercure's target. Used to secure the communication between the hub and the agent (example `http-broadcast`). This parameter can also be defined with by the queryString of `HUB_ENDPOINT`. example `HUB_ENDPOINT=https://example.com/hub?target=my_target`. |
| `HUB_TARGET` | _undefined_ | name of the mercure's target. Used to secure the communication between the hub and the agent (example `http-broadcast`). This parameter can also be defined with by the queryString of `HUB_ENDPOINT`. example `HUB_ENDPOINT=https://example.com/.well-known/mercure?target=my_target`. |
| `HUB_TIMEOUT` | `5s` | maximum duration for pushing the message into the HUB, set to `0s` to disable. |
| `HUB_TOKEN` | **required** | valid JWT token to allow both publishing and subscribing. On could use this [JWT example] to generate a new one. |
| `HUB_TOPIC` | `http-broadcast` | name of the Mercure's topic to exchange messages. This parameter can also be defined with by the queryString of `HUB_ENDPOINT`. example `HUB_ENDPOINT=https://example.com/hub?topic=my_topic`. |
| `HUB_TOPIC` | `http-broadcast` | name of the Mercure's topic to exchange messages. This parameter can also be defined with by the queryString of `HUB_ENDPOINT`. example `HUB_ENDPOINT=https://example.com/.well-known/mercure?topic=my_topic`. |
| `LOG_FORMAT` | `text` | the log format, can be `json`, `fluentd` or `text`. |
| `LOG_LEVEL` | `info` | the log verbosity, can be `trace`, `debug`, `info`, `warn`, `error`, `fatal`. |
| `SERVER_ADDR` | _undefined_ | the address to listen on (example: `0.0.0.0:6081`). When not defined, the broadcaster will only pusblish requests. `SERVER_ADDR` or `AGENT_ENDPOINT` is required. |
Expand Down
4 changes: 2 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Grab the binary corresponding to your operating system and architecture from
the release page, then run:

```bash
$ SERVER_ADDR=0.0.0.0:6801 AGENT_ENDPOINT=http://localhost:6800 HUB_TOKEN=<valid-jwt-token> HUB_ENDPOINT=https://example.com/hub http-broadcast
$ SERVER_ADDR=0.0.0.0:6801 AGENT_ENDPOINT=http://localhost:6800 HUB_TOKEN=<valid-jwt-token> HUB_ENDPOINT=https://example.com/.well-known/mercure http-broadcast
```
## Docker Container

Expand All @@ -22,7 +22,7 @@ docker run --rm -ti \
-e SERVER_ADDR=0.0.0.0:6801 \
-e AGENT_ENDPOINT=http://varnish:6081 \
-e HUB_TOKEN="<valid-jwt-token>" \
-e HUB_ENDPOINT=http://mercure-hub/hub \
-e HUB_ENDPOINT=http://mercure-hub/.well-known/mercure \
-p 6801:6801
jderusse/http-broadcast

Expand Down
2 changes: 1 addition & 1 deletion examples/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
environment:
SERVER_ADDR: :6083
AGENT_ENDPOINT: http://127.0.0.1:6082
HUB_ENDPOINT: http://mercure/hub
HUB_ENDPOINT: http://mercure/.well-known/mercure
HUB_TOKEN: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyIqIl0sInB1Ymxpc2giOlsiKiJdfX0.M1yJUov4a6oLrigTqBZQO_ohWUsg3Uz1bnLD4MIyWLo"
LOG_LEVEL: info
LOG_FORMAT: text
Expand Down
2 changes: 1 addition & 1 deletion examples/k8s/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
- name: AGENT_ENDPOINT
value: http://127.0.0.1:6082
- name: HUB_ENDPOINT
value: http://mercure/hub
value: http://mercure/.well-known/mercure
- name: HUB_TOKEN
value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyIqIl0sInB1Ymxpc2giOlsiKiJdfX0.M1yJUov4a6oLrigTqBZQO_ohWUsg3Uz1bnLD4MIyWLo"
- name: LOG_LEVEL
Expand Down

0 comments on commit 72d7f5a

Please sign in to comment.