server.yml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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. # Public facing base URL of the service (e.g. https://ntfy.sh or https://ntfy.example.com)
  6. #
  7. # This setting is required for any of the following features:
  8. # - attachments (to return a download URL)
  9. # - e-mail sending (for the topic URL in the email footer)
  10. # - iOS push notifications for self-hosted servers (to calculate the Firebase poll_request topic)
  11. # - Matrix Push Gateway (to validate that the pushkey is correct)
  12. #
  13. # base-url:
  14. # Listen address for the HTTP & HTTPS web server. If "listen-https" is set, you must also
  15. # set "key-file" and "cert-file". Format: [<ip>]:<port>, e.g. "1.2.3.4:8080".
  16. #
  17. # To listen on all interfaces, you may omit the IP address, e.g. ":443".
  18. # To disable HTTP, set "listen-http" to "-".
  19. #
  20. # listen-http: ":80"
  21. # listen-https:
  22. # Listen on a Unix socket, e.g. /var/lib/ntfy/ntfy.sock
  23. # This can be useful to avoid port issues on local systems, and to simplify permissions.
  24. #
  25. # listen-unix: <socket-path>
  26. # listen-unix-mode: <linux permissions, e.g. 0700>
  27. # Path to the private key & cert file for the HTTPS web server. Not used if "listen-https" is not set.
  28. #
  29. # key-file: <filename>
  30. # cert-file: <filename>
  31. # If set, also publish messages to a Firebase Cloud Messaging (FCM) topic for your app.
  32. # This is optional and only required to save battery when using the Android app.
  33. #
  34. # firebase-key-file: <filename>
  35. # Enable web push
  36. #
  37. # Run "ntfy web-push generate-keys" to generate the keys
  38. #
  39. # web-push-enabled: false
  40. # web-push-public-key:
  41. # web-push-private-key:
  42. # web-push-subscriptions-file:
  43. # web-push-email-address:
  44. # web-push-expiry-warning-duration: 168h
  45. # web-push-expiry-duration: 192h
  46. # If "cache-file" is set, messages are cached in a local SQLite database instead of only in-memory.
  47. # This allows for service restarts without losing messages in support of the since= parameter.
  48. #
  49. # The "cache-duration" parameter defines the duration for which messages will be buffered
  50. # before they are deleted. This is required to support the "since=..." and "poll=1" parameter.
  51. # To disable the cache entirely (on-disk/in-memory), set "cache-duration" to 0.
  52. # The cache file is created automatically, provided that the correct permissions are set.
  53. #
  54. # The "cache-startup-queries" parameter allows you to run commands when the database is initialized,
  55. # e.g. to enable WAL mode (see https://phiresky.github.io/blog/2020/sqlite-performance-tuning/)).
  56. # Example:
  57. # cache-startup-queries: |
  58. # pragma journal_mode = WAL;
  59. # pragma synchronous = normal;
  60. # pragma temp_store = memory;
  61. # pragma busy_timeout = 15000;
  62. # vacuum;
  63. #
  64. # The "cache-batch-size" and "cache-batch-timeout" parameter allow enabling async batch writing
  65. # of messages. If set, messages will be queued and written to the database in batches of the given
  66. # size, or after the given timeout. This is only required for high volume servers.
  67. #
  68. # Debian/RPM package users:
  69. # Use /var/cache/ntfy/cache.db as cache file to avoid permission issues. The package
  70. # creates this folder for you.
  71. #
  72. # Check your permissions:
  73. # If you are running ntfy with systemd, make sure this cache file is owned by the
  74. # ntfy user and group by running: chown ntfy.ntfy <filename>.
  75. #
  76. # cache-file: <filename>
  77. # cache-duration: "12h"
  78. # cache-startup-queries:
  79. # cache-batch-size: 0
  80. # cache-batch-timeout: "0ms"
  81. # If set, access to the ntfy server and API can be controlled on a granular level using
  82. # the 'ntfy user' and 'ntfy access' commands. See the --help pages for details, or check the docs.
  83. #
  84. # - auth-file is the SQLite user/access database; it is created automatically if it doesn't already exist
  85. # - auth-default-access defines the default/fallback access if no access control entry is found; it can be
  86. # set to "read-write" (default), "read-only", "write-only" or "deny-all".
  87. # - auth-startup-queries allows you to run commands when the database is initialized, e.g. to enable
  88. # WAL mode. This is similar to cache-startup-queries. See above for details.
  89. #
  90. # Debian/RPM package users:
  91. # Use /var/lib/ntfy/user.db as user database to avoid permission issues. The package
  92. # creates this folder for you.
  93. #
  94. # Check your permissions:
  95. # If you are running ntfy with systemd, make sure this user database file is owned by the
  96. # ntfy user and group by running: chown ntfy.ntfy <filename>.
  97. #
  98. # auth-file: <filename>
  99. # auth-default-access: "read-write"
  100. # auth-startup-queries:
  101. # If set, the X-Forwarded-For header is used to determine the visitor IP address
  102. # instead of the remote address of the connection.
  103. #
  104. # WARNING: If you are behind a proxy, you must set this, otherwise all visitors are rate limited
  105. # as if they are one.
  106. #
  107. # behind-proxy: false
  108. # If enabled, clients can attach files to notifications as attachments. Minimum settings to enable attachments
  109. # are "attachment-cache-dir" and "base-url".
  110. #
  111. # - attachment-cache-dir is the cache directory for attached files
  112. # - attachment-total-size-limit is the limit of the on-disk attachment cache directory (total size)
  113. # - attachment-file-size-limit is the per-file attachment size limit (e.g. 300k, 2M, 100M)
  114. # - attachment-expiry-duration is the duration after which uploaded attachments will be deleted (e.g. 3h, 20h)
  115. #
  116. # attachment-cache-dir:
  117. # attachment-total-size-limit: "5G"
  118. # attachment-file-size-limit: "15M"
  119. # attachment-expiry-duration: "3h"
  120. # If enabled, allow outgoing e-mail notifications via the 'X-Email' header. If this header is set,
  121. # messages will additionally be sent out as e-mail using an external SMTP server.
  122. #
  123. # As of today, only SMTP servers with plain text auth (or no auth at all), and STARTLS are supported.
  124. # Please also refer to the rate limiting settings below (visitor-email-limit-burst & visitor-email-limit-burst).
  125. #
  126. # - smtp-sender-addr is the hostname:port of the SMTP server
  127. # - smtp-sender-from is the e-mail address of the sender
  128. # - smtp-sender-user/smtp-sender-pass are the username and password of the SMTP user (leave blank for no auth)
  129. #
  130. # smtp-sender-addr:
  131. # smtp-sender-from:
  132. # smtp-sender-user:
  133. # smtp-sender-pass:
  134. # If enabled, ntfy will launch a lightweight SMTP server for incoming messages. Once configured, users can send
  135. # emails to a topic e-mail address to publish messages to a topic.
  136. #
  137. # - smtp-server-listen defines the IP address and port the SMTP server will listen on, e.g. :25 or 1.2.3.4:25
  138. # - smtp-server-domain is the e-mail domain, e.g. ntfy.sh
  139. # - smtp-server-addr-prefix is an optional prefix for the e-mail addresses to prevent spam. If set to "ntfy-",
  140. # for instance, only e-mails to ntfy-$topic@ntfy.sh will be accepted. If this is not set, all emails to
  141. # $topic@ntfy.sh will be accepted (which may obviously be a spam problem).
  142. #
  143. # smtp-server-listen:
  144. # smtp-server-domain:
  145. # smtp-server-addr-prefix:
  146. # If enabled, ntfy can perform voice calls via Twilio via the "X-Call" header.
  147. #
  148. # - twilio-account is the Twilio account SID, e.g. AC12345beefbeef67890beefbeef122586
  149. # - twilio-auth-token is the Twilio auth token, e.g. affebeef258625862586258625862586
  150. # - twilio-phone-number is the outgoing phone number you purchased, e.g. +18775132586
  151. # - twilio-verify-service is the Twilio Verify service SID, e.g. VA12345beefbeef67890beefbeef122586
  152. #
  153. # twilio-account:
  154. # twilio-auth-token:
  155. # twilio-phone-number:
  156. # twilio-verify-service:
  157. # Interval in which keepalive messages are sent to the client. This is to prevent
  158. # intermediaries closing the connection for inactivity.
  159. #
  160. # Note that the Android app has a hardcoded timeout at 77s, so it should be less than that.
  161. #
  162. # keepalive-interval: "45s"
  163. # Interval in which the manager prunes old messages, deletes topics
  164. # and prints the stats.
  165. #
  166. # manager-interval: "1m"
  167. # Defines topic names that are not allowed, because they are otherwise used. There are a few default topics
  168. # that cannot be used (e.g. app, account, settings, ...). To extend the default list, define them here.
  169. #
  170. # Example:
  171. # disallowed-topics:
  172. # - about
  173. # - pricing
  174. # - contact
  175. #
  176. # disallowed-topics:
  177. # Defines the root path of the web app, or disables the web app entirely.
  178. #
  179. # Can be any simple path, e.g. "/", "/app", or "/ntfy". For backwards-compatibility reasons,
  180. # the values "app" (maps to "/"), "home" (maps to "/app"), or "disable" (maps to "") to disable
  181. # the web app entirely.
  182. #
  183. # web-root: /
  184. # Various feature flags used to control the web app, and API access, mainly around user and
  185. # account management.
  186. #
  187. # - enable-signup allows users to sign up via the web app, or API
  188. # - enable-login allows users to log in via the web app, or API
  189. # - enable-reservations allows users to reserve topics (if their tier allows it)
  190. #
  191. # enable-signup: false
  192. # enable-login: false
  193. # enable-reservations: false
  194. # Server URL of a Firebase/APNS-connected ntfy server (likely "https://ntfy.sh").
  195. #
  196. # iOS users:
  197. # If you use the iOS ntfy app, you MUST configure this to receive timely notifications. You'll like want this:
  198. # upstream-base-url: "https://ntfy.sh"
  199. #
  200. # If set, all incoming messages will publish a "poll_request" message to the configured upstream server, containing
  201. # the message ID of the original message, instructing the iOS app to poll this server for the actual message contents.
  202. # This is to prevent the upstream server and Firebase/APNS from being able to read the message.
  203. #
  204. # - upstream-base-url is the base URL of the upstream server. Should be "https://ntfy.sh".
  205. # - upstream-access-token is the token used to authenticate with the upstream server. This is only required
  206. # if you exceed the upstream rate limits, or the uptream server requires authentication.
  207. #
  208. # upstream-base-url:
  209. # upstream-access-token:
  210. # Rate limiting: Total number of topics before the server rejects new topics.
  211. #
  212. # global-topic-limit: 15000
  213. # Rate limiting: Number of subscriptions per visitor (IP address)
  214. #
  215. # visitor-subscription-limit: 30
  216. # Rate limiting: Allowed GET/PUT/POST requests per second, per visitor:
  217. # - visitor-request-limit-burst is the initial bucket of requests each visitor has
  218. # - visitor-request-limit-replenish is the rate at which the bucket is refilled
  219. # - visitor-request-limit-exempt-hosts is a comma-separated list of hostnames, IPs or CIDRs to be
  220. # exempt from request rate limiting. Hostnames are resolved at the time the server is started.
  221. # Example: "1.2.3.4,ntfy.example.com,8.7.6.0/24"
  222. #
  223. # visitor-request-limit-burst: 60
  224. # visitor-request-limit-replenish: "5s"
  225. # visitor-request-limit-exempt-hosts: ""
  226. # Rate limiting: Hard daily limit of messages per visitor and day. The limit is reset
  227. # every day at midnight UTC. If the limit is not set (or set to zero), the request
  228. # limit (see above) governs the upper limit.
  229. #
  230. # visitor-message-daily-limit: 0
  231. # Rate limiting: Allowed emails per visitor:
  232. # - visitor-email-limit-burst is the initial bucket of emails each visitor has
  233. # - visitor-email-limit-replenish is the rate at which the bucket is refilled
  234. #
  235. # visitor-email-limit-burst: 16
  236. # visitor-email-limit-replenish: "1h"
  237. # Rate limiting: Attachment size and bandwidth limits per visitor:
  238. # - visitor-attachment-total-size-limit is the total storage limit used for attachments per visitor
  239. # - visitor-attachment-daily-bandwidth-limit is the total daily attachment download/upload traffic limit per visitor
  240. #
  241. # visitor-attachment-total-size-limit: "100M"
  242. # visitor-attachment-daily-bandwidth-limit: "500M"
  243. # Rate limiting: Enable subscriber-based rate limiting (mostly used for UnifiedPush)
  244. #
  245. # If enabled, subscribers may opt to have published messages counted against their own rate limits, as opposed
  246. # to the publisher's rate limits. This is especially useful to increase the amount of messages that high-volume
  247. # publishers (e.g. Matrix/Mastodon servers) are allowed to send.
  248. #
  249. # Once enabled, a client may send a "Rate-Topics: <topic1>,<topic2>,..." header when subscribing to topics via
  250. # HTTP stream, or websockets, thereby registering itself as the "rate visitor", i.e. the visitor whose rate limits
  251. # to use when publishing on this topic. Note: Setting the rate visitor requires READ-WRITE permission on the topic.
  252. #
  253. # UnifiedPush only: If this setting is enabled, publishing to UnifiedPush topics will lead to a HTTP 507 response if
  254. # no "rate visitor" has been previously registered. This is to avoid burning the publisher's "visitor-message-daily-limit".
  255. #
  256. # visitor-subscriber-rate-limiting: false
  257. # Payments integration via Stripe
  258. #
  259. # - stripe-secret-key is the key used for the Stripe API communication. Setting this values
  260. # enables payments in the ntfy web app (e.g. Upgrade dialog). See https://dashboard.stripe.com/apikeys.
  261. # - stripe-webhook-key is the key required to validate the authenticity of incoming webhooks from Stripe.
  262. # Webhooks are essential up keep the local database in sync with the payment provider. See https://dashboard.stripe.com/webhooks.
  263. # - billing-contact is an email address or website displayed in the "Upgrade tier" dialog to let people reach
  264. # out with billing questions. If unset, nothing will be displayed.
  265. #
  266. # stripe-secret-key:
  267. # stripe-webhook-key:
  268. # billing-contact:
  269. # Metrics
  270. #
  271. # ntfy can expose Prometheus-style metrics via a /metrics endpoint, or on a dedicated listen IP/port.
  272. # Metrics may be considered sensitive information, so before you enable them, be sure you know what you are
  273. # doing, and/or secure access to the endpoint in your reverse proxy.
  274. #
  275. # - enable-metrics enables the /metrics endpoint for the default ntfy server (i.e. HTTP, HTTPS and/or Unix socket)
  276. # - metrics-listen-http exposes the metrics endpoint via a dedicated [IP]:port. If set, this option implicitly
  277. # enables metrics as well, e.g. "10.0.1.1:9090" or ":9090"
  278. #
  279. # enable-metrics: false
  280. # metrics-listen-http:
  281. # Profiling
  282. #
  283. # ntfy can expose Go's net/http/pprof endpoints to support profiling of the ntfy server. If enabled, ntfy will listen
  284. # on a dedicated listen IP/port, which can be accessed via the web browser on http://<ip>:<port>/debug/pprof/.
  285. # This can be helpful to expose bottlenecks, and visualize call flows. See https://pkg.go.dev/net/http/pprof for details.
  286. #
  287. # profile-listen-http:
  288. # Logging options
  289. #
  290. # By default, ntfy logs to the console (stderr), with an "info" log level, and in a human-readable text format.
  291. # ntfy supports five different log levels, can also write to a file, log as JSON, and even supports granular
  292. # log level overrides for easier debugging. Some options (log-level and log-level-overrides) can be hot reloaded
  293. # by calling "kill -HUP $pid" or "systemctl reload ntfy".
  294. #
  295. # - log-format defines the output format, can be "text" (default) or "json"
  296. # - log-file is a filename to write logs to. If this is not set, ntfy logs to stderr.
  297. # - log-level defines the default log level, can be one of "trace", "debug", "info" (default), "warn" or "error".
  298. # Be aware that "debug" (and particularly "trace") can be VERY CHATTY. Only turn them on briefly for debugging purposes.
  299. # - log-level-overrides lets you override the log level if certain fields match. This is incredibly powerful
  300. # for debugging certain parts of the system (e.g. only the account management, or only a certain visitor).
  301. # This is an array of strings in the format:
  302. # - "field=value -> level" to match a value exactly, e.g. "tag=manager -> trace"
  303. # - "field -> level" to match any value, e.g. "time_taken_ms -> debug"
  304. # Warning: Using log-level-overrides has a performance penalty. Only use it for temporary debugging.
  305. #
  306. # Example (good for production):
  307. # log-level: info
  308. # log-format: json
  309. # log-file: /var/log/ntfy.log
  310. #
  311. # Example level overrides (for debugging, only use temporarily):
  312. # log-level-overrides:
  313. # - "tag=manager -> trace"
  314. # - "visitor_ip=1.2.3.4 -> debug"
  315. # - "time_taken_ms -> debug"
  316. #
  317. # log-level: info
  318. # log-level-overrides:
  319. # log-format: text
  320. # log-file: