Skip to content

Commit aecf0a5

Browse files
committed
Remove Rate-Topics
1 parent 1d2b759 commit aecf0a5

12 files changed

+1850
-818
lines changed

.github/workflows/build.yaml

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
name: build
2-
on: [push, pull_request]
2+
on: [ push, pull_request ]
33
jobs:
44
build:
55
runs-on: ubuntu-latest
66
steps:
7-
-
8-
name: Checkout code
7+
- name: Checkout code
98
uses: actions/checkout@v3
10-
-
11-
name: Install Go
9+
- name: Install Go
1210
uses: actions/setup-go@v4
1311
with:
14-
go-version: '1.21.x'
15-
-
16-
name: Install node
12+
go-version: '1.22.x'
13+
- name: Install node
1714
uses: actions/setup-node@v3
1815
with:
1916
node-version: '20'
2017
cache: 'npm'
2118
cache-dependency-path: './web/package-lock.json'
22-
-
23-
name: Install dependencies
19+
- name: Install dependencies
2420
run: make build-deps-ubuntu
25-
-
26-
name: Build all the things
21+
- name: Build all the things
2722
run: make build
28-
-
29-
name: Print build results and checksums
23+
- name: Print build results and checksums
3024
run: make cli-build-results

.github/workflows/release.yaml

+8-15
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,28 @@ jobs:
77
release:
88
runs-on: ubuntu-latest
99
steps:
10-
-
11-
name: Checkout code
10+
- name: Checkout code
1211
uses: actions/checkout@v3
13-
-
14-
name: Install Go
12+
- name: Install Go
1513
uses: actions/setup-go@v4
1614
with:
17-
go-version: '1.21.x'
18-
-
19-
name: Install node
15+
go-version: '1.22.x'
16+
- name: Install node
2017
uses: actions/setup-node@v3
2118
with:
2219
node-version: '20'
2320
cache: 'npm'
2421
cache-dependency-path: './web/package-lock.json'
25-
-
26-
name: Docker login
22+
- name: Docker login
2723
uses: docker/login-action@v2
2824
with:
2925
username: ${{ github.repository_owner }}
3026
password: ${{ secrets.DOCKER_HUB_TOKEN }}
31-
-
32-
name: Install dependencies
27+
- name: Install dependencies
3328
run: make build-deps-ubuntu
34-
-
35-
name: Build and publish
29+
- name: Build and publish
3630
run: make release
3731
env:
3832
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
-
40-
name: Print build results and checksums
33+
- name: Print build results and checksums
4134
run: make cli-build-results

.github/workflows/test.yaml

+11-20
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
name: test
2-
on: [push, pull_request]
2+
on: [ push, pull_request ]
33
jobs:
44
test:
55
runs-on: ubuntu-latest
66
steps:
7-
-
8-
name: Checkout code
7+
- name: Checkout code
98
uses: actions/checkout@v3
10-
-
11-
name: Install Go
9+
- name: Install Go
1210
uses: actions/setup-go@v4
1311
with:
14-
go-version: '1.21.x'
15-
-
16-
name: Install node
12+
go-version: '1.22.x'
13+
- name: Install node
1714
uses: actions/setup-node@v3
1815
with:
1916
node-version: '20'
2017
cache: 'npm'
2118
cache-dependency-path: './web/package-lock.json'
22-
-
23-
name: Install dependencies
19+
- name: Install dependencies
2420
run: make build-deps-ubuntu
25-
-
26-
name: Build docs (required for tests)
21+
- name: Build docs (required for tests)
2722
run: make docs
28-
-
29-
name: Build web app (required for tests)
23+
- name: Build web app (required for tests)
3024
run: make web
31-
-
32-
name: Run tests, formatting, vetting and linting
25+
- name: Run tests, formatting, vetting and linting
3326
run: make check
34-
-
35-
name: Run coverage
27+
- name: Run coverage
3628
run: make coverage
37-
-
38-
name: Upload coverage to codecov.io
29+
- name: Upload coverage to codecov.io
3930
run: make coverage-upload

docs/config.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -1078,20 +1078,23 @@ By default, ntfy puts almost all rate limits on the message publisher, e.g. numb
10781078
size are all based on the visitor who publishes a message. **Subscriber-based rate limiting is a way to use the rate limits
10791079
of a topic's subscriber, instead of the limits of the publisher.**
10801080

1081-
If enabled, subscribers may opt to have published messages counted against their own rate limits, as opposed
1082-
to the publisher's rate limits. This is especially useful to increase the amount of messages that high-volume
1083-
publishers (e.g. Matrix/Mastodon servers) are allowed to send.
1081+
If subscriber-based rate limiting is enabled, **messages published on UnifiedPush topics** (topics starting with `up`, e.g. `up123456789012`)
1082+
will be counted towards the "rate visitor" of the topic. A "rate visitor" is the first subscriber to the topic.
10841083

1085-
Once enabled, a client may send a `Rate-Topics: <topic1>,<topic2>,...` header when subscribing to topics via
1086-
HTTP stream, or websockets, thereby registering itself as the "rate visitor", i.e. the visitor whose rate limits
1087-
to use when publishing on this topic. Note that setting the rate visitor requires **read-write permission** on the topic.
1084+
Once enabled, a client subscribing to UnifiedPush topics via HTTP stream, or websockets, will be automatically registered as
1085+
a "rate visitor", i.e. the visitor whose rate limits will be used when publishing on this topic. Note that setting the rate visitor
1086+
requires **read-write permission** on the topic.
10881087

1089-
UnifiedPush only: If this setting is enabled, publishing to UnifiedPush topics will lead to an `HTTP 507 Insufficient Storage`
1088+
If this setting is enabled, publishing to UnifiedPush topics will lead to an `HTTP 507 Insufficient Storage`
10901089
response if no "rate visitor" has been previously registered. This is to avoid burning the publisher's
10911090
`visitor-message-daily-limit`.
10921091

10931092
To enable subscriber-based rate limiting, set `visitor-subscriber-rate-limiting: true`.
10941093

1094+
!!! info
1095+
Due to a denial-of-service issue, support for the `Rate-Topics` header was removed entirely. This is unfortunate,
1096+
but subscriber-based rate limiting will still work for `up*` topics.
1097+
10951098
## Tuning for scale
10961099
If you're running ntfy for your home server, you probably don't need to worry about scale at all. In its default config,
10971100
if it's not behind a proxy, the ntfy server can keep about **as many connections as the open file limit allows**.

docs/deprecations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deprecation notices
1+
# Deprecations and breaking changes
22
This page is used to list deprecation notices for ntfy. Deprecated commands and options will be
33
**removed after 1-3 months** from the time they were deprecated. How long the feature is deprecated
44
before the behavior is changed depends on the severity of the change, and how prominent the feature is.

docs/releases.md

+6
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,12 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release
13131313

13141314
## Not released yet
13151315

1316+
### ntfy server v2.9.0
1317+
1318+
**Bug fixes + maintenance:**
1319+
1320+
* Remove `Rate-Topics` header due to DoS security issue if `visitor-subscriber-rate-limiting: true` ([#1048](https://github.com/binwiederhier/ntfy/issues/1048))
1321+
13161322
### ntfy Android app v1.16.1 (UNRELEASED)
13171323

13181324
**Features:**

go.mod

+30-32
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ go 1.21
55
toolchain go1.21.3
66

77
require (
8-
cloud.google.com/go/firestore v1.14.0 // indirect
9-
cloud.google.com/go/storage v1.36.0 // indirect
8+
cloud.google.com/go/firestore v1.15.0 // indirect
9+
cloud.google.com/go/storage v1.39.0 // indirect
1010
github.com/BurntSushi/toml v1.3.2 // indirect
1111
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
1212
github.com/emersion/go-smtp v0.18.0
1313
github.com/gabriel-vasile/mimetype v1.4.3
1414
github.com/gorilla/websocket v1.5.1
15-
github.com/mattn/go-sqlite3 v1.14.19
15+
github.com/mattn/go-sqlite3 v1.14.22
1616
github.com/olebedev/when v1.0.0
1717
github.com/stretchr/testify v1.8.4
1818
github.com/urfave/cli/v2 v2.27.1
19-
golang.org/x/crypto v0.18.0
20-
golang.org/x/oauth2 v0.16.0 // indirect
19+
golang.org/x/crypto v0.21.0
20+
golang.org/x/oauth2 v0.18.0 // indirect
2121
golang.org/x/sync v0.6.0
22-
golang.org/x/term v0.16.0
22+
golang.org/x/term v0.18.0
2323
golang.org/x/time v0.5.0
24-
google.golang.org/api v0.157.0
24+
google.golang.org/api v0.168.0
2525
gopkg.in/yaml.v2 v2.4.0
2626
)
2727

@@ -33,16 +33,16 @@ require (
3333
firebase.google.com/go/v4 v4.13.0
3434
github.com/SherClockHolmes/webpush-go v1.3.0
3535
github.com/microcosm-cc/bluemonday v1.0.26
36-
github.com/prometheus/client_golang v1.18.0
36+
github.com/prometheus/client_golang v1.19.0
3737
github.com/stripe/stripe-go/v74 v74.30.0
3838
)
3939

4040
require (
41-
cloud.google.com/go v0.112.0 // indirect
42-
cloud.google.com/go/compute v1.23.3 // indirect
41+
cloud.google.com/go v0.112.1 // indirect
42+
cloud.google.com/go/compute v1.25.0 // indirect
4343
cloud.google.com/go/compute/metadata v0.2.3 // indirect
44-
cloud.google.com/go/iam v1.1.5 // indirect
45-
cloud.google.com/go/longrunning v0.5.4 // indirect
44+
cloud.google.com/go/iam v1.1.6 // indirect
45+
cloud.google.com/go/longrunning v0.5.5 // indirect
4646
github.com/AlekSi/pointer v1.2.0 // indirect
4747
github.com/MicahParks/keyfunc v1.9.0 // indirect
4848
github.com/aymerick/douceur v0.2.0 // indirect
@@ -56,37 +56,35 @@ require (
5656
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
5757
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
5858
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
59-
github.com/golang/protobuf v1.5.3 // indirect
59+
github.com/golang/protobuf v1.5.4 // indirect
6060
github.com/google/s2a-go v0.1.7 // indirect
61-
github.com/google/uuid v1.5.0 // indirect
61+
github.com/google/uuid v1.6.0 // indirect
6262
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
63-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
63+
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
6464
github.com/gorilla/css v1.0.1 // indirect
6565
github.com/kr/text v0.2.0 // indirect
66-
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
6766
github.com/pmezard/go-difflib v1.0.0 // indirect
68-
github.com/prometheus/client_model v0.5.0 // indirect
69-
github.com/prometheus/common v0.46.0 // indirect
70-
github.com/prometheus/procfs v0.12.0 // indirect
67+
github.com/prometheus/client_model v0.6.0 // indirect
68+
github.com/prometheus/common v0.50.0 // indirect
69+
github.com/prometheus/procfs v0.13.0 // indirect
7170
github.com/russross/blackfriday/v2 v2.1.0 // indirect
7271
github.com/stretchr/objx v0.5.0 // indirect
7372
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
7473
go.opencensus.io v0.24.0 // indirect
75-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
76-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
77-
go.opentelemetry.io/otel v1.22.0 // indirect
78-
go.opentelemetry.io/otel/metric v1.22.0 // indirect
79-
go.opentelemetry.io/otel/trace v1.22.0 // indirect
80-
golang.org/x/net v0.20.0 // indirect
81-
golang.org/x/sys v0.16.0 // indirect
74+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
75+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
76+
go.opentelemetry.io/otel v1.24.0 // indirect
77+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
78+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
79+
golang.org/x/net v0.22.0 // indirect
80+
golang.org/x/sys v0.18.0 // indirect
8281
golang.org/x/text v0.14.0 // indirect
83-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
8482
google.golang.org/appengine v1.6.8 // indirect
8583
google.golang.org/appengine/v2 v2.0.5 // indirect
86-
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
87-
google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect
88-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
89-
google.golang.org/grpc v1.60.1 // indirect
90-
google.golang.org/protobuf v1.32.0 // indirect
84+
google.golang.org/genproto v0.0.0-20240304212257-790db918fca8 // indirect
85+
google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect
86+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect
87+
google.golang.org/grpc v1.62.1 // indirect
88+
google.golang.org/protobuf v1.33.0 // indirect
9189
gopkg.in/yaml.v3 v3.0.1 // indirect
9290
)

0 commit comments

Comments
 (0)