Skip to content
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

Sync with main repository #3

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
916f4c6
chore(deps): bump google.golang.org/grpc from 1.64.0 to 1.64.1 in /caddy
dependabot[bot] Jul 9, 2024
37f91f2
feat(helm): allow passing existing secret in helm chart values (#809)
Julian-Louis Jul 9, 2024
a29710b
fix: use log_skip instead of the deprecated skip_log directive
dunglas Aug 14, 2024
d8b640d
ci: upgrade to super-linter 6 (#930)
dunglas Aug 14, 2024
07a4733
ci: generate SLSA attestations for binaries (#928)
dunglas Aug 14, 2024
bb859e1
feat: compile with Go 1.23 (#933)
dunglas Aug 14, 2024
8c76275
chore: bump deps
dunglas Aug 18, 2024
6196fa0
chore: prepare release 0.16.3
dunglas Aug 18, 2024
f0deae7
chore: add Docker labels
dunglas Aug 18, 2024
4e2e253
docs: use wget instead of curl for Docker healthcheck (#941)
dallegoet Aug 21, 2024
c76003d
docs: fix typos in Mercure
dunglas Aug 26, 2024
a9545aa
spec: remove redundant sentence
dunglas Aug 28, 2024
55664bc
feat: use Caddy modules for transports
dunglas Aug 19, 2024
62b6f20
feat: add backward compatibility layer
dunglas Aug 19, 2024
ab445d3
perf!: use topic selector store in subscriber (#944)
dunglas Aug 30, 2024
849c7b3
feat(helm): add support for metrics in the chart (#924)
coibib Sep 9, 2024
2ccc32f
docs: recommend using Microsoft's fetch-event-source
dunglas Sep 5, 2024
95d332d
feat: support ECDSA and Ed25519 JWT public keys
erkia Sep 13, 2024
f54b2b5
test: refactor authorization tests
erkia Sep 14, 2024
546eb35
test: add ECDSA and Ed25519 authentication tests
erkia Sep 14, 2024
31d0dfb
spec!: make payloads topic-specific (#946)
dunglas Sep 16, 2024
fb42dfa
feat: payload for a specific topic (#945)
dunglas Sep 16, 2024
a2a5750
docs: fix Traefik example - curl is not installed (#954)
gander Sep 27, 2024
e5878c1
docs: replace curl with wget in healthcheck example
damienfern Sep 30, 2024
aade3fb
chore: bump deps (#960)
dunglas Oct 22, 2024
bf5e08d
ci: better GoReleaser config for tags
dunglas Oct 22, 2024
6c511ee
Make the nodePort configurable in case NodePort is used as a service.
bebehei Oct 22, 2024
04030c1
ci: bump super-linter (#961)
dunglas Oct 23, 2024
7857d78
chore: revert payloads-related changes (#964)
dunglas Oct 23, 2024
eee809a
chore: various cleanups (#965)
dunglas Oct 25, 2024
9c8e000
fix(helm): support autoscaling/v2 (#967)
xip-niekneuij Nov 4, 2024
5474a23
fix(helm): support autoscaling/v2 formatting (#968)
xip-niekneuij Nov 5, 2024
d98b77c
refactor!: simplify filenames, remove dead code and bump deps
dunglas Nov 5, 2024
7b7ccb9
refactor!: remove legacy Ristretto cache
dunglas Nov 5, 2024
7d42cd1
refactor: rename topiselector file
dunglas Nov 5, 2024
473d5f4
feat: allow passing the topic selector store to the transport
dunglas Nov 5, 2024
fbd473b
refactor!: split subscribers and local subscribers
dunglas Nov 6, 2024
05e5ef2
ci: build for single target
dunglas Nov 9, 2024
0a6bd9f
refactor: better infrastructure for transports as Caddy modules (#975)
dunglas Nov 10, 2024
59c8e6c
ci: build deb, rpm and apk packages (#973)
erseco Nov 10, 2024
255e63b
chore: fix Caddyfile indentation
dunglas Nov 10, 2024
cbec56f
chore: prepare release 0.17.0
dunglas Nov 10, 2024
3a6558f
docs: improve upgrade instructions for 0.17 (#979)
dunglas Nov 11, 2024
d764b97
chore: fix golangci-lint
dunglas Nov 11, 2024
f931535
ci: use GitHub's native changelog generator
dunglas Nov 11, 2024
e5d342d
chore: bump deps and downgrade Ristretto
dunglas Nov 11, 2024
0e9cc02
chore: prepare release 0.17.1
dunglas Nov 11, 2024
d8e07b2
fix: log messages for subscribers
dunglas Nov 25, 2024
0019f6f
docs: mention dev.Caddyfile file change in docs (#993)
paulinevos Dec 26, 2024
9a8d154
docs: fix Stackhero docs link (#995)
welcoMattic Dec 29, 2024
540cdb4
ci: bump actions/attest-build-provenance from 1 to 2
dependabot[bot] Dec 9, 2024
02ce65f
feat: upgrade to Caddy 2.9
dunglas Jan 8, 2025
b170b9e
ci: fix linter
dunglas Jan 8, 2025
f46d76f
ci: bump Playwright version
dunglas Jan 8, 2025
14b89c8
chore: prepare release 0.18.0
dunglas Jan 8, 2025
2d9089e
chore: upgrade to Caddy 2.9.1
dunglas Jan 8, 2025
baba61c
chore: prepare release 0.18.1
dunglas Jan 8, 2025
617e827
docs: fix typo in README (#998)
michaelmior Jan 9, 2025
7695d27
chore(deps): bump github.com/MicahParks/jwkset in /caddy
dependabot[bot] Jan 9, 2025
d781993
chore: bump deps
dunglas Jan 27, 2025
1b58398
chore: prepare release 0.18.2
dunglas Jan 27, 2025
6c2d07d
docs: updated docs for Mercure On Premise (#1002)
dunglas Jan 30, 2025
107e6b8
fix: missing metrics with Caddy 2.9 (#1007)
IndraGunawan Feb 12, 2025
53f2d85
Fixed the ssl error on proxied nginx (#1005)
erseco Feb 17, 2025
a2c0f38
chore: upgrade to Go 1.24 (#1008)
dunglas Feb 17, 2025
a2f9831
test: run tests in parallel (#1009)
dunglas Feb 17, 2025
52d3bac
feat: automatically set GOMEMLIMIT (#1010)
dunglas Feb 17, 2025
4a15944
test: fix race condition in memory sink (#1011)
dunglas Feb 17, 2025
bf2555a
chore: prepare release 0.18.3
dunglas Feb 17, 2025
7d65b32
fix: duplicate metrics collector registration attempted panic
dunglas Feb 19, 2025
b508d1b
chore: prepare release 0.18.4
dunglas Feb 19, 2025
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
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: 2
updates:
-
package-ecosystem: github-actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
Expand Down
14 changes: 7 additions & 7 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
###############
# Rules by id #
###############
MD004: false # Unordered list style
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
indent: 2 # Unordered list indentation
MD010:
ignore_code_languages: [caddyfile]
MD013: false
MD026:
punctuation: ".,;:!。,;:" # List of not allowed
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD036: false # Emphasis used instead of a heading
punctuation: ".,;:!。,;:" # List of not allowed
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD036: false # Emphasis used instead of a heading

#################
# Rules by tags #
#################
blank_lines: false # Error on blank lines
blank_lines: false # Error on blank lines
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Examples:
docs: Add docs for X

spec: Z disambiguation
-->
-->
2 changes: 1 addition & 1 deletion .github/workflows/cd-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Chart
on:
push:
tags:
- 'v*'
- "v*"

jobs:
release:
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:

permissions:
contents: write
id-token: write
attestations: write

env:
GOTOOLCHAIN: local

jobs:
release:
Expand All @@ -27,7 +32,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.24"
check-latest: true
cache-dependency-path: |
go.sum
caddy/go.sum
Expand Down Expand Up @@ -57,11 +63,17 @@ jobs:
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean --timeout 60m ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot --skip=sign' || '' }}
args: ${{ startsWith(github.ref, 'refs/tags/v') && 'release' || 'build --single-target --snapshot' }} --clean --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ startsWith(github.ref, 'refs/tags/v') && steps.import_gpg.outputs.fingerprint || '' }}

- name: Attest
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/attest-build-provenance@v2
with:
subject-path: "${{ github.workspace }}/dist/**/mercure"

- name: Display version
run: dist/caddy_linux_amd64_v1/mercure version

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

- name: Set up chart-testing
uses: helm/chart-testing-action@v2
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- v*.*.*

env:
GO111MODULE: 'on'
GOTOOLCHAIN: local

jobs:
golangci:
Expand All @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.24"
cache-dependency-path: |
go.sum
caddy/go.sum
Expand All @@ -37,13 +37,10 @@ jobs:
test:
strategy:
matrix:
go: [ '1.21', '1.22' ]
go: ["1.23", "1.24"]
fail-fast: false
name: Test
runs-on: ubuntu-latest
env:
# Temporary workaround for https://github.com/golang/go/issues/65653
GOEXPERIMENT: nocoverageredesign
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -65,7 +62,7 @@ jobs:
- name: Test Caddy module
working-directory: caddy/
run: |
go test -timeout 1m -race -covermode atomic -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./...
go test -timeout 1m -race -covermode atomic -tags=nobadger,nomysql,nopgx -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./...
sed '1d' profile.cov >> ../profile.cov

- name: Upload coverage results
Expand All @@ -76,12 +73,12 @@ 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 ../../dev.Caddyfile
run: sudo MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run -tags=nobadger,nomysql,nopgx main.go start --config ../../dev.Caddyfile

- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
node-version: "latest"
cache: "npm"
cache-dependency-path: conformance-tests/package-lock.json

- name: Install Playwrigth dependencies
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
tags:
- v*.*.*

permissions:
contents: read
packages: read
statuses: write

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -18,14 +23,18 @@ jobs:
with:
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter/slim@v5
uses: super-linter/super-linter/slim@v6
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_CHECKOV: false
VALIDATE_GITLEAKS: false
VALIDATE_GO: false
VALIDATE_GO_MODULES: false
VALIDATE_GO_RELEASER: false
VALIDATE_PHP_PHPCS: false
VALIDATE_KUBERNETES_KUBECONFORM: false
VALIDATE_KUBERNETES_KUBEVAL: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_TYPESCRIPT_STANDARD: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_PYTHON_PYLINT: false
16 changes: 3 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ linters:
- errcheck
- lll
- wsl
- gomnd
- testpackage
- exhaustruct
- paralleltest
Expand All @@ -23,22 +22,13 @@ linters:
- depguard
- mnd

# Go 1.22+
- intrange

# weird issues
- nolintlint
- canonicalheader

# deprecated
- interfacer
- maligned
- scopelint
- golint
- exhaustivestruct
- varcheck
- ifshort
- deadcode
- nosnakecase
- structcheck

issues:
exclude-rules:
- path: _test\.go
Expand Down
38 changes: 26 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
version: 2
before:
hooks:
- go mod tidy
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
- "^build:"
- "^chore:"
- "^Merge"
use: github-native
release:
prerelease: auto
draft: true
env:
- CGO_ENABLED=0
builds:
- id: caddy
dir: caddy/mercure
ldflags:
- -X 'github.com/caddyserver/caddy/v2.CustomVersion=Mercure.rocks {{ .Version }} Caddy'
tags:
- nobadger
- nomysql
- nopgx
goos:
- linux
- darwin
Expand Down Expand Up @@ -73,7 +71,7 @@ archives:
- dev.Caddyfile
format_overrides:
- goos: windows
format: zip
formats: [ zip ]
- id: legacy
builds:
- legacy
Expand All @@ -90,7 +88,7 @@ archives:
- README.md
format_overrides:
- goos: windows
format: zip
formats: [ zip ]
dockers:
- ids:
- caddy
Expand Down Expand Up @@ -147,6 +145,22 @@ docker_manifests:
image_templates:
- dunglas/mercure:latest-amd64
- dunglas/mercure:latest-arm64v8
nfpms:
- id: linux_packages
package_name: mercure
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}.{{ .Format }}"
builds:
- caddy
formats:
- apk
- deb
- rpm
maintainer: "Kévin Dunglas <[email protected]>"
description: "An open, easy, fast, reliable and battery-efficient solution for real-time communications."
license: "AGPL-3.0-or-later"
vendor: "Dunglas Services SAS"
homepage: "https://mercure.rocks"
bindir: /usr/bin
signs:
- artifacts: checksum
args:
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The spec is in the IETF flavor of Markdown
spec/mercure.md

# Ignore Kubernetes templates
**/charts/**/*.yaml
**/chart/**/*.yaml
charts/mercure/README.md

*cache
38 changes: 19 additions & 19 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch the hub",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/caddy/mercure",
"env": {
"MERCURE_PUBLISHER_JWT_KEY": "!ChangeThisMercureHubJWTSecretKey!",
"MERCURE_SUBSCRIBER_JWT_KEY": "!ChangeThisMercureHubJWTSecretKey!",
"MERCURE_EXTRA_DIRECTIVES": "anonymous\nwrite_timeout 10s",
"GLOBAL_OPTIONS": "debug",
"SERVER_NAME": "localhost, host.docker.internal",
"CADDY_SERVER_EXTRA_DIRECTIVES": "tls internal"
},
"args": ["run", "--config", "../../dev.Caddyfile"]
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Launch the hub",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/caddy/mercure",
"env": {
"MERCURE_PUBLISHER_JWT_KEY": "!ChangeThisMercureHubJWTSecretKey!",
"MERCURE_SUBSCRIBER_JWT_KEY": "!ChangeThisMercureHubJWTSecretKey!",
"MERCURE_EXTRA_DIRECTIVES": "anonymous\nwrite_timeout 10s",
"GLOBAL_OPTIONS": "debug",
"SERVER_NAME": "localhost, host.docker.internal",
"CADDY_SERVER_EXTRA_DIRECTIVES": "tls internal"
},
"args": ["run", "--config", "../../dev.Caddyfile"]
}
]
}
Loading