diff --git a/config/config.go b/config/config.go
index 2d3db1c..cfa9e68 100644
--- a/config/config.go
+++ b/config/config.go
@@ -14,36 +14,41 @@ const (
DefaultManagerInterval = time.Minute
)
-// Defines the max number of requests, here:
-// 50 requests bucket, replenished at a rate of 1 per second
+// Defines all the limits
+// - request limit: max number of PUT/GET/.. requests (here: 50 requests bucket, replenished at a rate of 1 per second)
+// - global topic limit: max number of topics overall
+// - subscription limit: max number of subscriptions (active HTTP connections) per per-visitor/IP
var (
- defaultRequestLimit = rate.Every(time.Second)
- defaultRequestLimitBurst = 50
- defaultSubscriptionLimit = 30 // per visitor
+ defaultGlobalTopicLimit = 5000
+ defaultVisitorRequestLimit = rate.Every(time.Second)
+ defaultVisitorRequestLimitBurst = 50
+ defaultVisitorSubscriptionLimit = 30
)
// Config is the main config struct for the application. Use New to instantiate a default config struct.
type Config struct {
- ListenHTTP string
- FirebaseKeyFile string
- MessageBufferDuration time.Duration
- KeepaliveInterval time.Duration
- ManagerInterval time.Duration
- RequestLimit rate.Limit
- RequestLimitBurst int
- SubscriptionLimit int
+ ListenHTTP string
+ FirebaseKeyFile string
+ MessageBufferDuration time.Duration
+ KeepaliveInterval time.Duration
+ ManagerInterval time.Duration
+ GlobalTopicLimit int
+ VisitorRequestLimit rate.Limit
+ VisitorRequestLimitBurst int
+ VisitorSubscriptionLimit int
}
// New instantiates a default new config
func New(listenHTTP string) *Config {
return &Config{
- ListenHTTP: listenHTTP,
- FirebaseKeyFile: "",
- MessageBufferDuration: DefaultMessageBufferDuration,
- KeepaliveInterval: DefaultKeepaliveInterval,
- ManagerInterval: DefaultManagerInterval,
- RequestLimit: defaultRequestLimit,
- RequestLimitBurst: defaultRequestLimitBurst,
- SubscriptionLimit: defaultSubscriptionLimit,
+ ListenHTTP: listenHTTP,
+ FirebaseKeyFile: "",
+ MessageBufferDuration: DefaultMessageBufferDuration,
+ KeepaliveInterval: DefaultKeepaliveInterval,
+ ManagerInterval: DefaultManagerInterval,
+ GlobalTopicLimit: defaultGlobalTopicLimit,
+ VisitorRequestLimit: defaultVisitorRequestLimit,
+ VisitorRequestLimitBurst: defaultVisitorRequestLimitBurst,
+ VisitorSubscriptionLimit: defaultVisitorSubscriptionLimit,
}
}
diff --git a/server/index.html b/server/index.html
index b41afd7..551670c 100644
--- a/server/index.html
+++ b/server/index.html
@@ -81,6 +81,12 @@
+
Subscribe via phone
+
+ Once it's approved, you can use the Ntfy Android App to receive notifications directly on your phone. Just like
+ the server, this app is also open source.
+
+
Subscribe via your app, or via the CLI
Using EventSource in JS, you can consume
@@ -142,6 +148,7 @@
$ curl -s "ntfy.sh/mytopic/json?poll=1&since=10m"
# Returns messages from up to 10 minutes ago and ends the connection
+
FAQ
Isn't this like ...?
@@ -165,6 +172,28 @@
That said, the logs do not contain any topic names or other details about you. Check the code if you don't believe me.
+
+ Why is Firebase used?
+ In addition to caching messages locally and delivering them to long-polling subscribers, all messages are also
+ published to Firebase Cloud Messaging (FCM) (if FirebaseKeyFile is set, which it is on ntfy.sh). This
+ is to facilitate instant notifications on Android. I tried really, really hard to avoid using FCM, but newer
+ versions of Android made it impossible to implement background services>.
+ I'm sorry.
+
+
+
Privacy policy
+
+ Neither the server nor the app record any personal information, or share any of the messages and topics with
+ any outside service. All data is exclusively used to make the service function properly. The notable exception
+ is the Firebase Cloud Messaging (FCM) service, which is required to provide instant Android notifications (see
+ FAQ for details).
+
+
+
+ The web server does not log or otherwise store request paths, remote IP addresses or even topics or messages,
+ aside from a short on-disk cache (up to a day) to support the since= feature and service restarts.
+