| 1 |
# ntfy server config file |
| 2 |
# |
| 3 |
# Please refer to the documentation at https://ntfy.sh/docs/config/ for details. |
| 4 |
# All options also support underscores (_) instead of dashes (-) to comply with the YAML spec. |
| 5 |
|
| 6 |
# Public facing base URL of the service (e.g. https://ntfy.sh or https://ntfy.example.com) |
| 7 |
# |
| 8 |
# This setting is required for any of the following features: |
| 9 |
# - attachments (to return a download URL) |
| 10 |
# - e-mail sending (for the topic URL in the email footer) |
| 11 |
# - iOS push notifications for self-hosted servers (to calculate the Firebase poll_request topic) |
| 12 |
# - Matrix Push Gateway (to validate that the pushkey is correct) |
| 13 |
# |
| 14 |
# base-url: |
| 15 |
|
| 16 |
# Listen address for the HTTP & HTTPS web server. If "listen-https" is set, you must also |
| 17 |
# set "key-file" and "cert-file". Format: [<ip>]:<port>, e.g. "1.2.3.4:8080". |
| 18 |
# |
| 19 |
# To listen on all interfaces, you may omit the IP address, e.g. ":443". |
| 20 |
# To disable HTTP, set "listen-http" to "-". |
| 21 |
# |
| 22 |
# listen-http: ":80" |
| 23 |
# listen-https: |
| 24 |
|
| 25 |
# Listen on a Unix socket, e.g. /var/lib/ntfy/ntfy.sock |
| 26 |
# This can be useful to avoid port issues on local systems, and to simplify permissions. |
| 27 |
# |
| 28 |
# listen-unix: <socket-path> |
| 29 |
# listen-unix-mode: <linux permissions, e.g. 0700> |
| 30 |
|
| 31 |
# Path to the private key & cert file for the HTTPS web server. Not used if "listen-https" is not set. |
| 32 |
# |
| 33 |
# key-file: <filename> |
| 34 |
# cert-file: <filename> |
| 35 |
|
| 36 |
# If set, also publish messages to a Firebase Cloud Messaging (FCM) topic for your app. |
| 37 |
# This is optional and only required to save battery when using the Android app. |
| 38 |
# |
| 39 |
# firebase-key-file: <filename> |
| 40 |
|
| 41 |
# If "database-url" is set, ntfy will use PostgreSQL for all database-backed stores (message cache, |
| 42 |
# user manager, and web push subscriptions) instead of SQLite. When set, the "cache-file", |
| 43 |
# "auth-file", and "web-push-file" options must not be set. |
| 44 |
# |
| 45 |
# Note: Setting "database-url" implicitly enables authentication and access control. |
| 46 |
# The default access is "read-write" (see "auth-default-access"). |
| 47 |
# |
| 48 |
# The URL supports standard PostgreSQL parameters (sslmode, connect_timeout, sslcert, etc.), |
| 49 |
# as well as ntfy-specific connection pool parameters: |
| 50 |
# pool_max_conns=10 - Maximum number of open connections (default: 10) |
| 51 |
# pool_max_idle_conns=N - Maximum number of idle connections |
| 52 |
# pool_conn_max_lifetime=5m - Maximum lifetime of a connection (Go duration) |
| 53 |
# pool_conn_max_idle_time=1m - Maximum idle time of a connection (Go duration) |
| 54 |
# |
| 55 |
# See https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS |
| 56 |
# for the full list of supported PostgreSQL connection parameters. |
| 57 |
# |
| 58 |
# Examples: |
| 59 |
# database-url: "postgres://user:pass@host:5432/ntfy" |
| 60 |
# database-url: "postgres://user:pass@host:5432/ntfy?sslmode=require&pool_max_conns=50" |
| 61 |
# |
| 62 |
# database-url: <connection-string> |
| 63 |
|
| 64 |
# If "cache-file" is set, messages are cached in a local SQLite database instead of only in-memory. |
| 65 |
# This allows for service restarts without losing messages in support of the since= parameter. |
| 66 |
# Not required if "database-url" is set (messages are stored in PostgreSQL instead). |
| 67 |
# |
| 68 |
# The "cache-duration" parameter defines the duration for which messages will be buffered |
| 69 |
# before they are deleted. This is required to support the "since=..." and "poll=1" parameter. |
| 70 |
# To disable the cache entirely (on-disk/in-memory), set "cache-duration" to 0. |
| 71 |
# The cache file is created automatically, provided that the correct permissions are set. |
| 72 |
# |
| 73 |
# The "cache-startup-queries" parameter allows you to run commands when the database is initialized, |
| 74 |
# e.g. to enable WAL mode (see https://phiresky.github.io/blog/2020/sqlite-performance-tuning/)). |
| 75 |
# Example: |
| 76 |
# cache-startup-queries: | |
| 77 |
# pragma journal_mode = WAL; |
| 78 |
# pragma synchronous = normal; |
| 79 |
# pragma temp_store = memory; |
| 80 |
# pragma busy_timeout = 15000; |
| 81 |
# vacuum; |
| 82 |
# |
| 83 |
# The "cache-batch-size" and "cache-batch-timeout" parameter allow enabling async batch writing |
| 84 |
# of messages. If set, messages will be queued and written to the database in batches of the given |
| 85 |
# size, or after the given timeout. This is only required for high volume servers. |
| 86 |
# |
| 87 |
# Debian/RPM package users: |
| 88 |
# Use /var/cache/ntfy/cache.db as cache file to avoid permission issues. The package |
| 89 |
# creates this folder for you. |
| 90 |
# |
| 91 |
# Check your permissions: |
| 92 |
# If you are running ntfy with systemd, make sure this cache file is owned by the |
| 93 |
# ntfy user and group by running: chown ntfy.ntfy <filename>. |
| 94 |
# |
| 95 |
# cache-file: <filename> |
| 96 |
# cache-duration: "12h" |
| 97 |
# cache-startup-queries: |
| 98 |
# cache-batch-size: 0 |
| 99 |
# cache-batch-timeout: "0ms" |
| 100 |
|
| 101 |
# If set, access to the ntfy server and API can be controlled on a granular level using |
| 102 |
# the 'ntfy user' and 'ntfy access' commands. See the --help pages for details, or check the docs. |
| 103 |
# |
| 104 |
# Note: If "database-url" is set, auth is implicitly enabled and "auth-file" must not be set. |
| 105 |
# |
| 106 |
# - auth-file is the SQLite user/access database; it is created automatically if it doesn't already exist |
| 107 |
# - auth-default-access defines the default/fallback access if no access control entry is found; it can be |
| 108 |
# set to "read-write" (default), "read-only", "write-only" or "deny-all". |
| 109 |
# - auth-startup-queries allows you to run commands when the database is initialized, e.g. to enable |
| 110 |
# WAL mode. This is similar to cache-startup-queries. See above for details. |
| 111 |
# - auth-users is a list of users that are automatically created when the server starts. |
| 112 |
# Each entry is in the format "<username>:<password-hash>:<role>", e.g. "phil:$2a$10$YLiO8U21sX1uhZamTLJXHuxgVC0Z/GKISibrKCLohPgtG7yIxSk4C:user" |
| 113 |
# Use 'ntfy user hash' to generate the password hash from a password. |
| 114 |
# - auth-access is a list of access control entries that are automatically created when the server starts. |
| 115 |
# Each entry is in the format "<username>:<topic-pattern>:<access>", e.g. "phil:mytopic:rw" or "phil:phil-*:rw". |
| 116 |
# - auth-tokens is a list of access tokens that are automatically created when the server starts. |
| 117 |
# Each entry is in the format "<username>:<token>[:<label>]", e.g. "phil:tk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef:My token". |
| 118 |
# Use 'ntfy token generate' to generate a new access token. |
| 119 |
# - auth-access-cache enables an in-memory snapshot of the access control table that authorizes every |
| 120 |
# request without a database round-trip. |
| 121 |
# |
| 122 |
# Debian/RPM package users: |
| 123 |
# Use /var/lib/ntfy/user.db as user database to avoid permission issues. The package |
| 124 |
# creates this folder for you. |
| 125 |
# |
| 126 |
# Check your permissions: |
| 127 |
# If you are running ntfy with systemd, make sure this user database file is owned by the |
| 128 |
# ntfy user and group by running: chown ntfy.ntfy <filename>. |
| 129 |
# |
| 130 |
# auth-file: <filename> |
| 131 |
# auth-default-access: "read-write" |
| 132 |
# auth-startup-queries: |
| 133 |
# auth-users: |
| 134 |
# auth-access: |
| 135 |
# auth-tokens: |
| 136 |
# auth-access-cache: false |
| 137 |
|
| 138 |
# If set, the X-Forwarded-For header (or whatever is configured in proxy-forwarded-header) is used to determine |
| 139 |
# the visitor IP address instead of the remote address of the connection. |
| 140 |
# |
| 141 |
# WARNING: If you are behind a proxy, you must set this, otherwise all visitors are rate-limited |
| 142 |
# as if they are one. |
| 143 |
# |
| 144 |
# - behind-proxy makes it so that the real visitor IP address is extracted from the header defined in |
| 145 |
# proxy-forwarded-header. Without this, the remote address of the incoming connection is used. |
| 146 |
# - proxy-forwarded-header is the header to use to identify visitors. It may be a single IP address (e.g. 1.2.3.4), |
| 147 |
# a comma-separated list of IP addresses (e.g. "1.2.3.4, 5.6.7.8"), or an RFC 7239-style header (e.g. "for=1.2.3.4;by=proxy.example.com, for=5.6.7.8"). |
| 148 |
# - proxy-trusted-hosts is a comma-separated list of IP addresses, hostnames or CIDRs that are removed from the forwarded header |
| 149 |
# to determine the real IP address. This is only useful if there are multiple proxies involved that add themselves to |
| 150 |
# the forwarded header. |
| 151 |
# |
| 152 |
# behind-proxy: false |
| 153 |
# proxy-forwarded-header: "X-Forwarded-For" |
| 154 |
# proxy-trusted-hosts: |
| 155 |
|
| 156 |
# If enabled, clients can attach files to notifications as attachments. Minimum settings to enable attachments |
| 157 |
# are "attachment-cache-dir" and "base-url". |
| 158 |
# |
| 159 |
# - attachment-cache-dir is the cache directory for attached files, or an S3 URL for object storage |
| 160 |
# e.g. /var/cache/ntfy/attachments, or s3://ACCESS_KEY:SECRET_KEY@bucket/prefix?region=us-east-1&endpoint=https://... |
| 161 |
# - attachment-total-size-limit is the limit of the on-disk attachment cache directory (total size) |
| 162 |
# - attachment-file-size-limit is the per-file attachment size limit (e.g. 300k, 2M, 100M) |
| 163 |
# - attachment-expiry-duration is the duration after which uploaded attachments will be deleted (e.g. 3h, 20h) |
| 164 |
# |
| 165 |
# attachment-cache-dir: |
| 166 |
# attachment-total-size-limit: "5G" |
| 167 |
# attachment-file-size-limit: "15M" |
| 168 |
# attachment-expiry-duration: "3h" |
| 169 |
|
| 170 |
# Template directory for message templates. |
| 171 |
# |
| 172 |
# When "X-Template: <name>" (aliases: "Template: <name>", "Tpl: <name>") or "?template=<name>" is set, transform the message |
| 173 |
# based on one of the built-in pre-defined templates, or on a template defined in the "template-dir" directory. |
| 174 |
# |
| 175 |
# Template files must have the ".yml" extension and must be formatted as YAML. They may contain "title" and "message" keys, |
| 176 |
# which are interpreted as Go templates. |
| 177 |
# |
| 178 |
# Example template file (e.g. /etc/ntfy/templates/grafana.yml): |
| 179 |
# title: | |
| 180 |
# {{- if eq .status "firing" }} |
| 181 |
# {{ .title | default "Alert firing" }} |
| 182 |
# {{- else if eq .status "resolved" }} |
| 183 |
# {{ .title | default "Alert resolved" }} |
| 184 |
# {{- end }} |
| 185 |
# message: | |
| 186 |
# {{ .message | trunc 2000 }} |
| 187 |
# |
| 188 |
# template-dir: "/etc/ntfy/templates" |
| 189 |
|
| 190 |
# If enabled, allow outgoing e-mail notifications via the 'X-Email' header. If this header is set, |
| 191 |
# messages will additionally be sent out as e-mail using an external SMTP server. |
| 192 |
# |
| 193 |
# As of today, only SMTP servers with plain text auth (or no auth at all), and STARTTLS are supported. |
| 194 |
# Please also refer to the rate limiting settings below (visitor-email-limit-burst & visitor-email-limit-burst). |
| 195 |
# |
| 196 |
# - smtp-sender-addr is the hostname:port of the SMTP server |
| 197 |
# - smtp-sender-from is the e-mail address of the sender |
| 198 |
# - smtp-sender-user/smtp-sender-pass are the username and password of the SMTP user (leave blank for no auth) |
| 199 |
# - smtp-sender-verify is a flag that forces email recipient verification when enabled. If set to true, |
| 200 |
# only verified email recipients can be used in the X-Email header. |
| 201 |
# |
| 202 |
# smtp-sender-addr: |
| 203 |
# smtp-sender-from: |
| 204 |
# smtp-sender-user: |
| 205 |
# smtp-sender-pass: |
| 206 |
# smtp-sender-verify: false |
| 207 |
|
| 208 |
# If enabled, ntfy will launch a lightweight SMTP server for incoming messages. Once configured, users can send |
| 209 |
# emails to a topic e-mail address to publish messages to a topic. |
| 210 |
# |
| 211 |
# - smtp-server-listen defines the IP address and port the SMTP server will listen on, e.g. :25 or 1.2.3.4:25 |
| 212 |
# - smtp-server-domain is the e-mail domain, e.g. ntfy.sh |
| 213 |
# - smtp-server-addr-prefix is an optional prefix for the e-mail addresses to prevent spam. If set to "ntfy-", |
| 214 |
# for instance, only e-mails to [email protected] will be accepted. If this is not set, all emails to |
| 215 |
# [email protected] will be accepted (which may be a spam problem). |
| 216 |
# |
| 217 |
# smtp-server-listen: |
| 218 |
# smtp-server-domain: |
| 219 |
# smtp-server-addr-prefix: |
| 220 |
|
| 221 |
# Web Push support (background notifications for browsers) |
| 222 |
# |
| 223 |
# If enabled, allows the ntfy web app to receive push notifications, even when the web app is closed. When enabled, users |
| 224 |
# can enable background notifications in the web app. Once enabled, ntfy will forward published messages to the push |
| 225 |
# endpoint, which will then forward it to the browser. |
| 226 |
# |
| 227 |
# You must configure web-push-public/private key, web-push-file, and web-push-email-address below to enable Web Push. |
| 228 |
# Run "ntfy webpush keys" to generate the keys. |
| 229 |
# |
| 230 |
# - web-push-public-key is the generated VAPID public key, e.g. AA1234BBCCddvveekaabcdfqwertyuiopasdfghjklzxcvbnm1234567890 |
| 231 |
# - web-push-private-key is the generated VAPID private key, e.g. AA2BB1234567890abcdefzxcvbnm1234567890 |
| 232 |
# - web-push-file is a database file to keep track of browser subscription endpoints, e.g. /var/cache/ntfy/webpush.db |
| 233 |
# Not required if "database-url" is set (subscriptions are stored in PostgreSQL instead). |
| 234 |
# - web-push-email-address is the admin email address send to the push provider, e.g. [email protected] |
| 235 |
# - web-push-startup-queries is an optional list of queries to run on startup |
| 236 |
# - web-push-expiry-warning-duration defines the duration after which unused subscriptions are sent a warning (default is 55d) |
| 237 |
# - web-push-expiry-duration defines the duration after which unused subscriptions will expire (default is 60d) |
| 238 |
# |
| 239 |
# web-push-public-key: |
| 240 |
# web-push-private-key: |
| 241 |
# web-push-file: |
| 242 |
# web-push-email-address: |
| 243 |
# web-push-startup-queries: |
| 244 |
# web-push-expiry-warning-duration: "55d" |
| 245 |
# web-push-expiry-duration: "60d" |
| 246 |
|
| 247 |
# If enabled, ntfy can perform voice calls via Twilio via the "X-Call" header. |
| 248 |
# |
| 249 |
# - twilio-account is the Twilio account SID, e.g. AC12345beefbeef67890beefbeef122586 |
| 250 |
# - twilio-auth-token is the Twilio auth token, e.g. affebeef258625862586258625862586 |
| 251 |
# - twilio-phone-number is the outgoing phone number you purchased, e.g. +18775132586 |
| 252 |
# - twilio-verify-service is the Twilio Verify service SID, e.g. VA12345beefbeef67890beefbeef122586 |
| 253 |
# - twilio-call-format is the custom TwiML send to the Call API (optional, see https://www.twilio.com/docs/voice/twiml) |
| 254 |
# |
| 255 |
# twilio-account: |
| 256 |
# twilio-auth-token: |
| 257 |
# twilio-phone-number: |
| 258 |
# twilio-verify-service: |
| 259 |
# twilio-call-format: |
| 260 |
|
| 261 |
# Interval in which keepalive messages are sent to the client. This is to prevent |
| 262 |
# intermediaries closing the connection for inactivity. |
| 263 |
# |
| 264 |
# Note that the Android app has a hardcoded timeout at 77s, so it should be less than that. |
| 265 |
# |
| 266 |
# keepalive-interval: "45s" |
| 267 |
|
| 268 |
# Interval in which the manager prunes old messages, deletes topics |
| 269 |
# and prints the stats. |
| 270 |
# |
| 271 |
# manager-interval: "1m" |
| 272 |
|
| 273 |
# Defines topic names that are not allowed, because they are otherwise used. There are a few default topics |
| 274 |
# that cannot be used (e.g. app, account, settings, ...). To extend the default list, define them here. |
| 275 |
# |
| 276 |
# Example: |
| 277 |
# disallowed-topics: |
| 278 |
# - about |
| 279 |
# - pricing |
| 280 |
# - contact |
| 281 |
# |
| 282 |
# disallowed-topics: |
| 283 |
|
| 284 |
# Defines the root path of the web app, or disables the web app entirely. |
| 285 |
# |
| 286 |
# Can be any simple path, e.g. "/", "/app", or "/ntfy". For backwards-compatibility reasons, |
| 287 |
# the values "app" (maps to "/"), "home" (maps to "/app"), or "disable" (maps to "") to disable |
| 288 |
# the web app entirely. |
| 289 |
# |
| 290 |
# web-root: / |
| 291 |
|
| 292 |
# Various feature flags used to control the web app, and API access, mainly around user and |
| 293 |
# account management. |
| 294 |
# |
| 295 |
# - enable-signup allows users to sign up via the web app, or API |
| 296 |
# - enable-login allows users to log in via the web app, or API |
| 297 |
# - require-login redirects users to the login page if they are not logged in (disallows web app access without login) |
| 298 |
# - enable-reservations allows users to reserve topics (if their tier allows it) |
| 299 |
# |
| 300 |
# enable-signup: false |
| 301 |
# require-login: false |
| 302 |
# enable-login: false |
| 303 |
# enable-reservations: false |
| 304 |
|
| 305 |
# Server URL of a Firebase/APNS-connected ntfy server (likely "https://ntfy.sh"). |
| 306 |
# |
| 307 |
# iOS users: |
| 308 |
# If you use the iOS ntfy app, you MUST configure this to receive timely notifications. You'll like want this: |
| 309 |
# upstream-base-url: "https://ntfy.sh" |
| 310 |
# |
| 311 |
# If set, all incoming messages will publish a "poll_request" message to the configured upstream server, containing |
| 312 |
# the message ID of the original message, instructing the iOS app to poll this server for the actual message contents. |
| 313 |
# This is to prevent the upstream server and Firebase/APNS from being able to read the message. |
| 314 |
# |
| 315 |
# - upstream-base-url is the base URL of the upstream server. Should be "https://ntfy.sh". |
| 316 |
# - upstream-access-token is the token used to authenticate with the upstream server. This is only required |
| 317 |
# if you exceed the upstream rate limits, or the upstream server requires authentication. |
| 318 |
# |
| 319 |
# upstream-base-url: |
| 320 |
# upstream-access-token: |
| 321 |
|
| 322 |
# Configures message-specific limits |
| 323 |
# |
| 324 |
# - message-size-limit defines the max size of a message body. Please note message sizes >4K are NOT RECOMMENDED, |
| 325 |
# and largely untested. If FCM and/or APNS is used, the limit should stay 4K, because their limits are around that size. |
| 326 |
# If you increase this size limit regardless, FCM and APNS will NOT work for large messages. |
| 327 |
# - message-delay-limit defines the max delay of a message when using the "Delay" header. |
| 328 |
# |
| 329 |
# message-size-limit: "4k" |
| 330 |
# message-delay-limit: "3d" |
| 331 |
|
| 332 |
# Rate limiting: Total number of topics before the server rejects new topics. |
| 333 |
# |
| 334 |
# global-topic-limit: 15000 |
| 335 |
|
| 336 |
# Rate limiting: Number of subscriptions per visitor (IP address) |
| 337 |
# |
| 338 |
# visitor-subscription-limit: 30 |
| 339 |
|
| 340 |
# Rate limiting: Allowed GET/PUT/POST requests per second, per visitor: |
| 341 |
# - visitor-request-limit-burst is the initial bucket of requests each visitor has |
| 342 |
# - visitor-request-limit-replenish is the rate at which the bucket is refilled |
| 343 |
# - visitor-request-limit-exempt-hosts is a comma-separated list of hostnames, IPs or CIDRs to be |
| 344 |
# exempt from request rate limiting. Hostnames are resolved at the time the server is started. |
| 345 |
# Example: "1.2.3.4,ntfy.example.com,8.7.6.0/24" |
| 346 |
# |
| 347 |
# visitor-request-limit-burst: 60 |
| 348 |
# visitor-request-limit-replenish: "5s" |
| 349 |
# visitor-request-limit-exempt-hosts: "" |
| 350 |
|
| 351 |
# Rate limiting: Hard daily limit of messages per visitor and day. The limit is reset |
| 352 |
# every day at midnight UTC. If the limit is not set (or set to zero), the request |
| 353 |
# limit (see above) governs the upper limit. |
| 354 |
# |
| 355 |
# visitor-message-daily-limit: 0 |
| 356 |
|
| 357 |
# Rate limiting: Allowed emails per visitor: |
| 358 |
# - visitor-email-limit-burst is the initial bucket of emails each visitor has |
| 359 |
# - visitor-email-limit-replenish is the rate at which the bucket is refilled |
| 360 |
# |
| 361 |
# visitor-email-limit-burst: 16 |
| 362 |
# visitor-email-limit-replenish: "1h" |
| 363 |
|
| 364 |
# Rate limiting: Allowed new topic creations per visitor. A "creation" is when a request |
| 365 |
# causes a previously-unknown topic ID to be added to the in-memory topic map. Touches of |
| 366 |
# existing topics do not consume tokens. Mitigates topic-enumeration / squatting attacks. |
| 367 |
# - visitor-topic-creation-limit-burst is the initial bucket of new-topic tokens (0 = disabled) |
| 368 |
# - visitor-topic-creation-limit-replenish is the rate at which the bucket is refilled |
| 369 |
# |
| 370 |
# visitor-topic-creation-limit-burst: 100 |
| 371 |
# visitor-topic-creation-limit-replenish: "1m" |
| 372 |
|
| 373 |
# Abuse ban-feed: Count HTTP response statuses per visitor and append abusive IPs to a file that |
| 374 |
# fail2ban (or similar) can tail and ban on sight. This captures ntfy-layer rejections (e.g. ACL |
| 375 |
# 403s and ntfy's own 429s), so fail2ban does not have to regex-parse the full access log. |
| 376 |
# - ban-file is the file abusive IPs are appended to; leave empty to disable the feature. Its |
| 377 |
# directory must exist and be writable by ntfy. Rotate it (e.g. logrotate, copytruncate) so it |
| 378 |
# cannot grow unbounded. |
| 379 |
# - ban-window is the rolling window over which weighted strikes are counted, per visitor. |
| 380 |
# - ban-threshold is the number of weighted strikes per window before a visitor is banned. Each |
| 381 |
# visitor has ONE strike budget; rejections draw it down, so there is no way to game it by mixing |
| 382 |
# codes. |
| 383 |
# - ban-weights assigns a strike weight to a matcher KEY (KEY:WEIGHT). A KEY is an exact ntfy code |
| 384 |
# ("42909"), a prefix family ("429*"), a bare HTTP status ("403", shorthand for "403*"), or "*". |
| 385 |
# Longest match wins. A weight of 0 exempts a code (never contributes to a ban), so the legit quota |
| 386 |
# 429s can be carved out from a "*" catch-all. Heavier weights ban faster (auth-failure floods). |
| 387 |
# |
| 388 |
# Each appended line has the exact format |
| 389 |
# "<RFC3339-UTC-timestamp> <ip> <prefix> <http-code> <ntfy-code>", for example: |
| 390 |
# 2026-07-17T20:56:32Z 1.2.3.4 1.2.3.4/32 429 42901 |
| 391 |
# 2026-07-17T20:56:32Z 2001:db8::abcd 2001:db8::/64 429 42909 |
| 392 |
# <prefix> is <ip> masked to the rate-limiting prefix (visitor-prefix-bits-ipv4/ipv6); that is the |
| 393 |
# unit a fail2ban jail should ban, so a whole IPv6 subnet is banned as one. |
| 394 |
# |
| 395 |
# ban-file: "/var/log/ntfy-ban.log" |
| 396 |
# ban-window: "1m" |
| 397 |
# ban-threshold: 100 |
| 398 |
# ban-weights: |
| 399 |
# - "42909:10" # auth-failure flood: bans in ~10 |
| 400 |
# - "42908:0" # daily message quota reached -> legit, never counts |
| 401 |
# - "42903:0" # subscription limit -> legit |
| 402 |
# - "42905:0" # daily bandwidth reached -> legit |
| 403 |
# - "42910:0" # daily phone call quota reached -> legit |
| 404 |
# - "*:1" # everything else 4xx/5xx |
| 405 |
|
| 406 |
# Rate limiting: IPv4/IPv6 address prefix bits used for rate limiting |
| 407 |
# - visitor-prefix-bits-ipv4: number of bits of the IPv4 address to use for rate limiting (default: 32, full address) |
| 408 |
# - visitor-prefix-bits-ipv6: number of bits of the IPv6 address to use for rate limiting (default: 64, /64 subnet) |
| 409 |
# |
| 410 |
# This is used to group visitors by their IP address or subnet. For example, if you set visitor-prefix-bits-ipv4 to 24, |
| 411 |
# all visitors in the 1.2.3.0/24 network are treated as one. |
| 412 |
# |
| 413 |
# By default, ntfy uses the full IPv4 address (32 bits) and the /64 subnet of the IPv6 address (64 bits). |
| 414 |
# |
| 415 |
# visitor-prefix-bits-ipv4: 32 |
| 416 |
# visitor-prefix-bits-ipv6: 64 |
| 417 |
|
| 418 |
# Rate limiting: Attachment size and bandwidth limits per visitor: |
| 419 |
# - visitor-attachment-total-size-limit is the total storage limit used for attachments per visitor |
| 420 |
# - visitor-attachment-daily-bandwidth-limit is the total daily attachment download/upload traffic limit per visitor |
| 421 |
# |
| 422 |
# visitor-attachment-total-size-limit: "100M" |
| 423 |
# visitor-attachment-daily-bandwidth-limit: "500M" |
| 424 |
|
| 425 |
# Rate limiting: Enable subscriber-based rate limiting (mostly used for UnifiedPush) |
| 426 |
# |
| 427 |
# If subscriber-based rate limiting is enabled, messages published on UnifiedPush topics** (topics starting with "up") |
| 428 |
# will be counted towards the "rate visitor" of the topic. A "rate visitor" is the first subscriber to the topic. |
| 429 |
# |
| 430 |
# Once enabled, a client subscribing to UnifiedPush topics via HTTP stream, or websockets, will be automatically registered as |
| 431 |
# a "rate visitor", i.e. the visitor whose rate limits will be used when publishing on this topic. Note that setting the rate visitor |
| 432 |
# requires **read-write permission** on the topic. |
| 433 |
# |
| 434 |
# If this setting is enabled, publishing to UnifiedPush topics will lead to a HTTP 507 response if |
| 435 |
# no "rate visitor" has been previously registered. This is to avoid burning the publisher's "visitor-message-daily-limit". |
| 436 |
# |
| 437 |
# visitor-subscriber-rate-limiting: false |
| 438 |
|
| 439 |
# Payments integration via Stripe |
| 440 |
# |
| 441 |
# - stripe-secret-key is the key used for the Stripe API communication. Setting this values |
| 442 |
# enables payments in the ntfy web app (e.g. Upgrade dialog). See https://dashboard.stripe.com/apikeys. |
| 443 |
# - stripe-webhook-key is the key required to validate the authenticity of incoming webhooks from Stripe. |
| 444 |
# Webhooks are essential up keep the local database in sync with the payment provider. See https://dashboard.stripe.com/webhooks. |
| 445 |
# - billing-contact is an email address or website displayed in the "Upgrade tier" dialog to let people reach |
| 446 |
# out with billing questions. If unset, nothing will be displayed. |
| 447 |
# |
| 448 |
# stripe-secret-key: |
| 449 |
# stripe-webhook-key: |
| 450 |
# billing-contact: |
| 451 |
|
| 452 |
# Metrics |
| 453 |
# |
| 454 |
# ntfy can expose Prometheus-style metrics via a /metrics endpoint, or on a dedicated listen IP/port. |
| 455 |
# Metrics may be considered sensitive information, so before you enable them, be sure you know what you are |
| 456 |
# doing, and/or secure access to the endpoint in your reverse proxy. |
| 457 |
# |
| 458 |
# - enable-metrics enables the /metrics endpoint for the default ntfy server (i.e. HTTP, HTTPS and/or Unix socket) |
| 459 |
# - metrics-listen-http moves the metrics endpoint to a dedicated [IP]:port, e.g. "10.0.1.1:9090" or ":9090". |
| 460 |
# It implicitly enables metrics. If set, the metrics are served only on that dedicated port, and the default |
| 461 |
# ntfy server does not serve /metrics, even if enable-metrics is also set. |
| 462 |
# |
| 463 |
# enable-metrics: false |
| 464 |
# metrics-listen-http: |
| 465 |
|
| 466 |
# Profiling |
| 467 |
# |
| 468 |
# ntfy can expose Go's net/http/pprof endpoints to support profiling of the ntfy server. If enabled, ntfy will listen |
| 469 |
# on a dedicated listen IP/port, which can be accessed via the web browser on http://<ip>:<port>/debug/pprof/. |
| 470 |
# This can be helpful to expose bottlenecks, and visualize call flows. See https://pkg.go.dev/net/http/pprof for details. |
| 471 |
# |
| 472 |
# profile-listen-http: |
| 473 |
|
| 474 |
# Logging options |
| 475 |
# |
| 476 |
# By default, ntfy logs to the console (stderr), with an "info" log level, and in a human-readable text format. |
| 477 |
# ntfy supports five different log levels, can also write to a file, log as JSON, and even supports granular |
| 478 |
# log level overrides for easier debugging. Some options (log-level and log-level-overrides) can be hot reloaded |
| 479 |
# by calling "kill -HUP $pid" or "systemctl reload ntfy". |
| 480 |
# |
| 481 |
# - log-format defines the output format, can be "text" (default) or "json" |
| 482 |
# - log-file is a filename to write logs to. If this is not set, ntfy logs to stderr. |
| 483 |
# - log-level defines the default log level, can be one of "trace", "debug", "info" (default), "warn" or "error". |
| 484 |
# Be aware that "debug" (and particularly "trace") can be VERY CHATTY. Only turn them on briefly for debugging purposes. |
| 485 |
# - log-level-overrides lets you override the log level if certain fields match. This is incredibly powerful |
| 486 |
# for debugging certain parts of the system (e.g. only the account management, or only a certain visitor). |
| 487 |
# This is an array of strings in the format: |
| 488 |
# - "field=value -> level" to match a value exactly, e.g. "tag=manager -> trace" |
| 489 |
# - "field -> level" to match any value, e.g. "time_taken_ms -> debug" |
| 490 |
# Warning: Using log-level-overrides has a performance penalty. Only use it for temporary debugging. |
| 491 |
# |
| 492 |
# Check your permissions: |
| 493 |
# If you are running ntfy with systemd, make sure this log file is owned by the |
| 494 |
# ntfy user and group by running: chown ntfy.ntfy <filename>. |
| 495 |
# |
| 496 |
# Example (good for production): |
| 497 |
# log-level: info |
| 498 |
# log-format: json |
| 499 |
# log-file: /var/log/ntfy.log |
| 500 |
# |
| 501 |
# Example level overrides (for debugging, only use temporarily): |
| 502 |
# log-level-overrides: |
| 503 |
# - "tag=manager -> trace" |
| 504 |
# - "visitor_ip=1.2.3.4 -> debug" |
| 505 |
# - "time_taken_ms -> debug" |
| 506 |
# |
| 507 |
# log-level: info |
| 508 |
# log-level-overrides: |
| 509 |
# log-format: text |
| 510 |
# log-file: |