Skip to content

Commit

Permalink
ci: prepare release (#453)
Browse files Browse the repository at this point in the history
* ci: prepare release

* docs: prepare release

* fix typo
  • Loading branch information
dunglas committed Jan 19, 2021
1 parent 283ca79 commit 2a2ba9c
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 133 deletions.
10 changes: 4 additions & 6 deletions .goreleaser.yml
Expand Up @@ -61,6 +61,8 @@ archives:
- COPYRIGHT
- LICENSE
- README.md
- Caddyfile
- Caddyfile.dev
- public/*
format_overrides:
- goos: windows
Expand All @@ -84,9 +86,7 @@ archives:
- goos: windows
format: zip
dockers:
- binaries:
- mercure
builds:
- ids:
- caddy
dockerfile: Dockerfile # See https://github.com/goreleaser/goreleaser/issues/1916
image_templates:
Expand All @@ -98,9 +98,7 @@ dockers:
- public/
- Caddyfile
- Caddyfile.dev
- binaries:
- mercure
builds:
- ids:
- legacy
dockerfile: Dockerfile.legacy
image_templates:
Expand Down
47 changes: 1 addition & 46 deletions caddy/go.mod
Expand Up @@ -5,54 +5,9 @@ go 1.15
replace github.com/dunglas/mercure => ../

require (
cloud.google.com/go v0.75.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.0 // indirect
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/alecthomas/colour v0.1.0 // indirect
github.com/alecthomas/repr v0.0.0-20201120212035-bb82daffcca2 // indirect
github.com/antlr/antlr4 v0.0.0-20210114010855-d34d2e1c271a // indirect
github.com/aws/aws-sdk-go v1.36.26 // indirect
github.com/caddyserver/caddy/v2 v2.3.0
github.com/dgraph-io/badger v1.6.2 // indirect
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/dunglas/mercure v0.11.0-rc.3
github.com/golang/snappy v0.0.2 // indirect
github.com/google/uuid v1.1.4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/klauspost/compress v1.11.7 // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
github.com/klauspost/cpuid/v2 v2.0.3 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mholt/acmez v0.1.2 // indirect
github.com/miekg/dns v1.1.35 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/nxadm/tail v1.4.6 // indirect
github.com/onsi/ginkgo v1.14.2 // indirect
github.com/onsi/gomega v1.10.4 // indirect
github.com/dunglas/mercure v0.11.0
github.com/prometheus/client_golang v1.9.0
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/smallstep/certificates v0.15.6 // indirect
github.com/smallstep/cli v0.15.3 // indirect
github.com/smallstep/nosql v0.3.2 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5 // indirect
github.com/yuin/goldmark v1.3.1 // indirect
go.step.sm/crypto v0.8.0 // indirect
go.uber.org/zap v1.16.0
golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 // indirect
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963 // indirect
google.golang.org/genproto v0.0.0-20210113195801-ae06605f4595 // indirect
google.golang.org/grpc v1.35.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
honnef.co/go/tools v0.1.0 // indirect
howett.net/plist v0.0.0-20201203080718-1454fab16a06 // indirect
)
3 changes: 1 addition & 2 deletions caddy/go.sum
Expand Up @@ -230,6 +230,7 @@ github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk
github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dunglas/mercure/caddy v0.0.0-20210118203145-496b5d4b0853/go.mod h1:ZRBC/rBW0xn4Nrr58xMGpPNrto9LBOQ/aYVddFUwIhs=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg=
Expand Down Expand Up @@ -924,8 +925,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
Expand Down
72 changes: 29 additions & 43 deletions docs/hub/cluster.md
Expand Up @@ -46,16 +46,14 @@ To purchase the On Premise version of the Mercure.rocks Hub, drop us a mail: [co
### Setting the License

A license key is provided when you purchase the High Availability version of the Mercure.rocks Hub.
This key must be set in a configuration parameter named `license`.
All configuration formats supported by the Mercure.rocks hub are supported (YAML, environment variables...).
This key must be set in an environment variable named `MERCURE_LICENSE`.

Ex:

```yaml
# mercure.yaml
license: '<my-license-key>'
# ...
```
MERCURE_LICENSE=snip \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

If you use the Helm chart, set the `license` value and change the Docker image to use the one provided.

Expand Down Expand Up @@ -83,16 +81,13 @@ Most Cloud Computing platforms also provide managed versions of Redis.
All the configuration parameters, and formats, supported by the free Mercure.rocks Hub are also available.
See https://mercure.rocks/docs/hub/config.

To use Redis, the `transport_url` configuration parameter must be set like in this example:
To use Redis, the `MERCURE_TRANSPORT_URL` environment variable must be set like in this example:

```yaml
# mercure.yaml
transport_url: redis://127.0.0.1:6379/mercure-ha
license: '...'
addr: :3001
jwt_key: '!ChangeMe!'
# ...
```
MERCURE_TRANSPORT_URL=redis://127.0.0.1:6379/mercure-ha \
MERCURE_LICENSE=snip \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

The following options can be passed as query parameters of the URL set in `transport_url`:

Expand Down Expand Up @@ -121,16 +116,13 @@ Most Cloud Computing platforms also provide managed versions of PostgreSQL.
All the configuration parameters, and formats, supported by the free Mercure.rocks Hub are also available.
See https://mercure.rocks/docs/hub/config.

To use PostgreSQL `LISTEN`/`NOTIFY`, the `transport_url` configuration parameter must be set like in this example:
To use PostgreSQL `LISTEN`/`NOTIFY`, the `MERCURE_TRANSPORT_URL` environment variable must be set like in this example:

```yaml
# mercure.yaml
transport_url: postgres://user:password@127.0.0.1/mercure-ha
license: '...'
addr: :3001
jwt_key: '!ChangeMe!'
# ...
```
MERCURE_TRANSPORT_URL=postgres://user:password@127.0.0.1/mercure-ha \
MERCURE_LICENSE=snip \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

The following options can be passed as query parameters of the URL set in `transport_url`: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

Expand Down Expand Up @@ -159,16 +151,13 @@ The Mercure.rocks hub has been tested with:
All the configuration parameters, and formats, supported by the free Mercure.rocks Hub are also available.
See https://mercure.rocks/docs/hub/config.

To use Kafka, the `transport_url` configuration parameter must be set like in this example:
To use Kafka, the `MERCURE_TRANSPORT_URL` environment variable must be set like in this example:

```yaml
# mercure.yaml
transport_url: kafka://kafka/?addr=localhost:9092&topic=mercure-ha
license: '...'
addr: :3001
jwt_key: '!ChangeMe!'
# ...
```
MERCURE_TRANSPORT_URL=kafka://kafka/?addr=localhost:9092&topic=mercure-ha \
MERCURE_LICENSE=snip \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

The following options can be passed as query parameters of the URL set in `transport_url`:

Expand Down Expand Up @@ -198,16 +187,13 @@ To install Apache Pulsar, [read the documentation](https://pulsar.apache.org/doc
All the configuration parameters, and formats, supported by the free Mercure.rocks Hub are also available.
See https://mercure.rocks/docs/hub/config.

To use Pulsar, the `transport_url` configuration parameter must be set like in this example:
To use Pulsar, the `MERCURE_TRANSPORT_URL` environment variable must be set like in this example:

```yaml
# mercure.yaml
transport_url: pulsar://localhost:6650?topic=mercure-ha&subscription_name=the-node-id
license: '...'
addr: :3001
jwt_key: '!ChangeMe!'
# ...
```
MERCURE_TRANSPORT_URL=pulsar://localhost:6650?topic=mercure-ha&subscription_name=the-node-id \
MERCURE_LICENSE=snip \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

The following options can be passed as query parameters of the URL set in `transport_url`:

Expand Down
21 changes: 11 additions & 10 deletions docs/hub/config.md
Expand Up @@ -52,16 +52,17 @@ See also [the list of built-in Caddyfile directives](https://caddyserver.com/doc

The provided `Caddyfile` and the Docker image provide convenient environment variables:

| Environment variable | Description | Default value |
|------------------------------|----------------------------------------------------------|---------------------|
| `DEBUG=debug` | enable the debug mode | |
| `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 | `!ChangeMe!` |
| `MERCURE_PUBLISHER_JWT_ALG` | the JWT algorithm to use for publishers | `HS256` |
| `MERCURE_SUBSCRIBER_JWT_KEY` | the JWT key to use for subscribers | `!ChangeMe!` |
| `MERCURE_SUBSCRIBER_JWT_ALG` | the JWT algorithm to use for subscribers | `HS256` |
| `MERCURE_EXTRA_DIRECTIVES` | a list of extra Mercure directives to pass, one per line | |
| Environment variable | Description | Default value |
|------------------------------|----------------------------------------------------------------------|---------------------|
| `DEBUG=debug` | enable the debug mode | |
| `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 | `!ChangeMe!` |
| `MERCURE_PUBLISHER_JWT_ALG` | the JWT algorithm to use for publishers | `HS256` |
| `MERCURE_SUBSCRIBER_JWT_KEY` | the JWT key to use for subscribers | `!ChangeMe!` |
| `MERCURE_SUBSCRIBER_JWT_ALG` | the JWT algorithm to use for subscribers | `HS256` |
| `MERCURE_EXTRA_DIRECTIVES` | a list of extra Mercure directives to pass, one per line | |
| `MERCURE_LICENSE` | the license to use ([only applicable for the HA version](cluster.md) | |

## JWT Verification

Expand Down
14 changes: 10 additions & 4 deletions docs/hub/install.md
Expand Up @@ -14,20 +14,26 @@ Note: Mac OS users must use the `Darwin` binary.

Then, on Linux and Mac OS X, run:

MERCURE_PUBLISHER_JWT_KEY="!ChangeMe!" \
MERCURE_SUBSCRIBER_JWT_KEY="!ChangeMe!" \
MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run -config Caddyfile.dev

On Windows, start PowerShell, go into the extracted directory and run:

$env:MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!'; $env:MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!'; .\mercure.exe run -config Caddyfile.dev

The Windows Defender Firewall will ask you if you want to allow `mercure.exe` to communicate through it.
Allow it for both public and private networks. If you use an antivirus, or another firewall software, be sure to whitelist `mercure.exe`.
Allow it for both public and private networks. If you use an antivirus, or another firewall software, be sure to whitelist `mercure.exe`.

The server is now available on `https://localhost`, with the demo mode enabled. Because the `allow_anonymous` directive is set in the provided configuration, anonymous subscribers are allowed.

To run the server in production, see [how to configure the Mercure.rocks hub](config.md).
To run the server in production, run this command:

MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' \
MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' \
./mercure run

[Learn how to configure the Mercure.rocks hub](config.md).

When the server is up and running, the following endpoints are available:

Expand Down
2 changes: 1 addition & 1 deletion docs/hub/license.md
@@ -1,4 +1,4 @@
## License and Copyright
# License and Copyright

tl;dr:

Expand Down
18 changes: 12 additions & 6 deletions go.mod
Expand Up @@ -3,42 +3,48 @@ module github.com/dunglas/mercure
go 1.15

require (
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/dgraph-io/ristretto v0.0.3
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gofrs/uuid v4.0.0+incompatible
github.com/google/go-cmp v0.5.2 // indirect
github.com/google/go-cmp v0.5.4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/kr/pretty v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.4 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/procfs v0.3.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
github.com/unrolled/secure v1.0.8
github.com/yosida95/uritemplate/v3 v3.0.1
go.etcd.io/bbolt v1.3.5
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.4.0 // indirect
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/tools v0.0.0-20201017001424-6003fad69a88 // indirect
golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
honnef.co/go/tools v0.1.0 // indirect
)

0 comments on commit 2a2ba9c

Please sign in to comment.