server.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. # If "cache-file" is set, messages are cached in a local SQLite database instead of only in-memory.
  36. # This allows for service restarts without losing messages in support of the since= parameter.
  37. #
  38. # The "cache-duration" parameter defines the duration for which messages will be buffered
  39. # before they are deleted. This is required to support the "since=..." and "poll=1" parameter.
  40. # To disable the cache entirely (on-disk/in-memory), set "cache-duration" to 0.
  41. # The cache file is created automatically, provided that the correct permissions are set.
  42. #
  43. # The "cache-startup-queries" parameter allows you to run commands when the database is initialized,
  44. # e.g. to enable WAL mode (see https://phiresky.github.io/blog/2020/sqlite-performance-tuning/)).
  45. # Example:
  46. # cache-startup-queries: |
  47. # pragma journal_mode = WAL;
  48. # pragma synchronous = normal;
  49. # pragma temp_store = memory;
  50. # pragma busy_timeout = 15000;
  51. # vacuum;
  52. #
  53. # The "cache-batch-size" and "cache-batch-timeout" parameter allow enabling async batch writing
  54. # of messages. If set, messages will be queued and written to the database in batches of the given
  55. # size, or after the given timeout. This is only required for high volume servers.
  56. #
  57. # Debian/RPM package users:
  58. # Use /var/cache/ntfy/cache.db as cache file to avoid permission issues. The package
  59. # creates this folder for you.
  60. #
  61. # Check your permissions:
  62. # If you are running ntfy with systemd, make sure this cache file is owned by the
  63. # ntfy user and group by running: chown ntfy.ntfy <filename>.
  64. #
  65. # cache-file: <filename>
  66. # cache-duration: "12h"
  67. # cache-startup-queries:
  68. # cache-batch-size: 0
  69. # cache-batch-timeout: "0ms"
  70. # If set, access to the ntfy server and API can be controlled on a granular level using
  71. # the 'ntfy user' and 'ntfy access' commands. See the --help pages for details, or check the docs.
  72. #
  73. # - auth-file is the SQLite user/access database; it is created automatically if it doesn't already exist
  74. # - auth-default-access defines the default/fallback access if no access control entry is found; it can be
  75. # set to "read-write" (default), "read-only", "write-only" or "deny-all".
  76. #
  77. # Debian/RPM package users:
  78. # Use /var/lib/ntfy/user.db as user database to avoid permission issues. The package
  79. # creates this folder for you.
  80. #
  81. # Check your permissions:
  82. # If you are running ntfy with systemd, make sure this user database file is owned by the
  83. # ntfy user and group by running: chown ntfy.ntfy <filename>.
  84. #
  85. # auth-file: <filename>
  86. # auth-default-access: "read-write"
  87. # If set, the X-Forwarded-For header is used to determine the visitor IP address
  88. # instead of the remote address of the connection.
  89. #
  90. # WARNING: If you are behind a proxy, you must set this, otherwise all visitors are rate limited
  91. # as if they are one.
  92. #
  93. # behind-proxy: false
  94. # If enabled, clients can attach files to notifications as attachments. Minimum settings to enable attachments
  95. # are "attachment-cache-dir" and "base-url".
  96. #
  97. # - attachment-cache-dir is the cache directory for attached files
  98. # - attachment-total-size-limit is the limit of the on-disk attachment cache directory (total size)
  99. # - attachment-file-size-limit is the per-file attachment size limit (e.g. 300k, 2M, 100M)
  100. # - attachment-expiry-duration is the duration after which uploaded attachments will be deleted (e.g. 3h, 20h)
  101. #
  102. # attachment-cache-dir:
  103. # attachment-total-size-limit: "5G"
  104. # attachment-file-size-limit: "15M"
  105. # attachment-expiry-duration: "3h"
  106. # If enabled, allow outgoing e-mail notifications via the 'X-Email' header. If this header is set,
  107. # messages will additionally be sent out as e-mail using an external SMTP server. As of today, only
  108. # SMTP servers with plain text auth and STARTLS are supported. Please also refer to the rate limiting settings
  109. # below (visitor-email-limit-burst & visitor-email-limit-burst).
  110. #
  111. # - smtp-sender-addr is the hostname:port of the SMTP server
  112. # - smtp-sender-user/smtp-sender-pass are the username and password of the SMTP user
  113. # - smtp-sender-from is the e-mail address of the sender
  114. #
  115. # smtp-sender-addr:
  116. # smtp-sender-user:
  117. # smtp-sender-pass:
  118. # smtp-sender-from:
  119. # If enabled, ntfy will launch a lightweight SMTP server for incoming messages. Once configured, users can send
  120. # emails to a topic e-mail address to publish messages to a topic.
  121. #
  122. # - smtp-server-listen defines the IP address and port the SMTP server will listen on, e.g. :25 or 1.2.3.4:25
  123. # - smtp-server-domain is the e-mail domain, e.g. ntfy.sh
  124. # - smtp-server-addr-prefix is an optional prefix for the e-mail addresses to prevent spam. If set to "ntfy-",
  125. # for instance, only e-mails to ntfy-$topic@ntfy.sh will be accepted. If this is not set, all emails to
  126. # $topic@ntfy.sh will be accepted (which may obviously be a spam problem).
  127. #
  128. # smtp-server-listen:
  129. # smtp-server-domain:
  130. # smtp-server-addr-prefix:
  131. # Interval in which keepalive messages are sent to the client. This is to prevent
  132. # intermediaries closing the connection for inactivity.
  133. #
  134. # Note that the Android app has a hardcoded timeout at 77s, so it should be less than that.
  135. #
  136. # keepalive-interval: "45s"
  137. # Interval in which the manager prunes old messages, deletes topics
  138. # and prints the stats.
  139. #
  140. # manager-interval: "1m"
  141. # Defines if the root route (/) is pointing to the landing page (as on ntfy.sh) or the
  142. # web app. If you self-host, you don't want to change this.
  143. # Can be "app" (default), "home" or "disable" to disable the web app entirely.
  144. #
  145. # web-root: app
  146. # Various feature flags used to control the web app, and API access, mainly around user and
  147. # account management.
  148. #
  149. # - enable-signup allows users to sign up via the web app, or API
  150. # - enable-login allows users to log in via the web app, or API
  151. # - enable-reservations allows users to reserve topics (if their tier allows it)
  152. #
  153. # enable-signup: false
  154. # enable-login: false
  155. # enable-reservations: false
  156. # Server URL of a Firebase/APNS-connected ntfy server (likely "https://ntfy.sh").
  157. #
  158. # iOS users:
  159. # If you use the iOS ntfy app, you MUST configure this to receive timely notifications. You'll like want this:
  160. # upstream-base-url: "https://ntfy.sh"
  161. #
  162. # If set, all incoming messages will publish a "poll_request" message to the configured upstream server, containing
  163. # the message ID of the original message, instructing the iOS app to poll this server for the actual message contents.
  164. # This is to prevent the upstream server and Firebase/APNS from being able to read the message.
  165. #
  166. # upstream-base-url:
  167. # Rate limiting: Total number of topics before the server rejects new topics.
  168. #
  169. # global-topic-limit: 15000
  170. # Rate limiting: Number of subscriptions per visitor (IP address)
  171. #
  172. # visitor-subscription-limit: 30
  173. # Rate limiting: Allowed GET/PUT/POST requests per second, per visitor:
  174. # - visitor-request-limit-burst is the initial bucket of requests each visitor has
  175. # - visitor-request-limit-replenish is the rate at which the bucket is refilled
  176. # - visitor-request-limit-exempt-hosts is a comma-separated list of hostnames, IPs or CIDRs to be
  177. # exempt from request rate limiting. Hostnames are resolved at the time the server is started.
  178. # Example: "1.2.3.4,ntfy.example.com,8.7.6.0/24"
  179. #
  180. # visitor-request-limit-burst: 60
  181. # visitor-request-limit-replenish: "5s"
  182. # visitor-request-limit-exempt-hosts: ""
  183. # Rate limiting: Allowed emails per visitor:
  184. # - visitor-email-limit-burst is the initial bucket of emails each visitor has
  185. # - visitor-email-limit-replenish is the rate at which the bucket is refilled
  186. #
  187. # visitor-email-limit-burst: 16
  188. # visitor-email-limit-replenish: "1h"
  189. # Rate limiting: Attachment size and bandwidth limits per visitor:
  190. # - visitor-attachment-total-size-limit is the total storage limit used for attachments per visitor
  191. # - visitor-attachment-daily-bandwidth-limit is the total daily attachment download/upload traffic limit per visitor
  192. #
  193. # visitor-attachment-total-size-limit: "100M"
  194. # visitor-attachment-daily-bandwidth-limit: "500M"
  195. # Payments integration via Stripe
  196. #
  197. # - stripe-secret-key is the key used for the Stripe API communication. Setting this values
  198. # enables payments in the ntfy web app (e.g. Upgrade dialog). See https://dashboard.stripe.com/apikeys.
  199. # - stripe-webhook-key is the key required to validate the authenticity of incoming webhooks from Stripe.
  200. # Webhooks are essential up keep the local database in sync with the payment provider. See https://dashboard.stripe.com/webhooks.
  201. #
  202. # stripe-secret-key:
  203. # stripe-webhook-key:
  204. # Log level, can be TRACE, DEBUG, INFO, WARN or ERROR
  205. # This option can be hot-reloaded by calling "kill -HUP $pid" or "systemctl reload ntfy".
  206. #
  207. # Be aware that DEBUG (and particularly TRACE) can be VERY CHATTY. Only turn them on for
  208. # debugging purposes, or your disk will fill up quickly.
  209. #
  210. # log-level: INFO