mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-01-19 00:27:25 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5948f39a53 | ||
|
|
eef85c0955 | ||
|
|
60cbf23bcc |
@@ -4,11 +4,9 @@ before:
|
||||
builds:
|
||||
- binary: ntfy
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
- CGO_ENABLED=1 # required for go-sqlite3
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
nfpms:
|
||||
|
||||
1
Makefile
1
Makefile
@@ -94,6 +94,7 @@ build-snapshot:
|
||||
|
||||
build-simple: clean
|
||||
mkdir -p dist/ntfy_linux_amd64
|
||||
export CGO_ENABLED=1
|
||||
$(GO) build \
|
||||
-o dist/ntfy_linux_amd64/ntfy \
|
||||
-ldflags \
|
||||
|
||||
@@ -15,12 +15,12 @@ const (
|
||||
)
|
||||
|
||||
// Defines all the limits
|
||||
// - request limit: max number of PUT/GET/.. requests (here: 50 requests bucket, replenished at a rate of 1 per second)
|
||||
// - request limit: max number of PUT/GET/.. requests (here: 50 requests bucket, replenished at a rate of one per 10 seconds)
|
||||
// - global topic limit: max number of topics overall
|
||||
// - subscription limit: max number of subscriptions (active HTTP connections) per per-visitor/IP
|
||||
var (
|
||||
defaultGlobalTopicLimit = 5000
|
||||
defaultVisitorRequestLimit = rate.Every(time.Second)
|
||||
defaultVisitorRequestLimit = rate.Every(10 * time.Second)
|
||||
defaultVisitorRequestLimitBurst = 50
|
||||
defaultVisitorSubscriptionLimit = 30
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ func (e errHTTP) Error() string {
|
||||
}
|
||||
|
||||
const (
|
||||
messageLimit = 1024
|
||||
messageLimit = 512
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -86,6 +86,11 @@ func New(conf *config.Config) (*Server, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, t := range topics {
|
||||
if firebaseSubscriber != nil {
|
||||
t.Subscribe(firebaseSubscriber)
|
||||
}
|
||||
}
|
||||
return &Server{
|
||||
config: conf,
|
||||
cache: cache,
|
||||
|
||||
Reference in New Issue
Block a user