闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.2 KiB

Web Push Notifications (#3243) * feat: Register push subscription * feat: Notify when mentioned * feat: Boost, favourite, reply, follow, follow request * feat: Notification interaction * feat: Handle change of public key * feat: Unsubscribe if things go wrong * feat: Do not send normal notifications if push is enabled * feat: Focus client if open * refactor: Move push logic to WebPushSubscription * feat: Better title and body * feat: Localize messages * chore: Fix lint errors * feat: Settings * refactor: Lazy load * fix: Check if push settings exist * feat: Device-based preferences * refactor: Simplify logic * refactor: Pull request feedback * refactor: Pull request feedback * refactor: Create /api/web/push_subscriptions endpoint * feat: Spec PushSubscriptionController * refactor: WebPushSubscription => Web::PushSubscription * feat: Spec Web::PushSubscription * feat: Display first media attachment * feat: Support direction * fix: Stuff broken while rebasing * refactor: Integration with session activations * refactor: Cleanup * refactor: Simplify implementation * feat: Set VAPID keys via environment * chore: Comments * fix: Crash when no alerts * fix: Set VAPID keys in testing environment * fix: Follow link * feat: Notification actions * fix: Delete previous subscription * chore: Temporary logs * refactor: Move migration to a later date * fix: Fetch the correct session activation and misc bugs * refactor: Move migration to a later date * fix: Remove follow request (no notifications) * feat: Send administrator contact to push service * feat: Set time-to-live * fix: Do not show sensitive images * fix: Reducer crash in error handling * feat: Add badge * chore: Fix lint error * fix: Checkbox label overlap * fix: Check for payload support * fix: Rename action "type" (crash in latest Chrome) * feat: Action to expand notification * fix: Lint errors * fix: Unescape notification body * fix: Do not allow boosting if the status is hidden * feat: Add VAPID keys to the production sample environment * fix: Strip HTML tags from status * refactor: Better error messages * refactor: Handle browser not implementing the VAPID protocol (Samsung Internet) * fix: Error when target_status is nil * fix: Handle lack of image * fix: Delete reference to invalid subscriptions * feat: Better error handling * fix: Unescape HTML characters after tags are striped * refactor: Simpify code * fix: Modify to work with #4091 * Sort strings alphabetically * i18n: Updated Polish translation it annoys me that it's not fully localized :P * refactor: Use current_session in PushSubscriptionController * fix: Rebase mistake * fix: Set cacheName to mastodon * refactor: Pull request feedback * refactor: Remove logging statements * chore(yarn): Fix conflicts with master * chore(yarn): Copy latest from master * chore(yarn): Readd offline-plugin * refactor: Use save! and update! * refactor: Send notifications async * fix: Allow retry when push fails * fix: Save track for failed pushes * fix: Minify sw.js * fix: Remove account_id from fabricator
7 years ago
Web Push Notifications (#3243) * feat: Register push subscription * feat: Notify when mentioned * feat: Boost, favourite, reply, follow, follow request * feat: Notification interaction * feat: Handle change of public key * feat: Unsubscribe if things go wrong * feat: Do not send normal notifications if push is enabled * feat: Focus client if open * refactor: Move push logic to WebPushSubscription * feat: Better title and body * feat: Localize messages * chore: Fix lint errors * feat: Settings * refactor: Lazy load * fix: Check if push settings exist * feat: Device-based preferences * refactor: Simplify logic * refactor: Pull request feedback * refactor: Pull request feedback * refactor: Create /api/web/push_subscriptions endpoint * feat: Spec PushSubscriptionController * refactor: WebPushSubscription => Web::PushSubscription * feat: Spec Web::PushSubscription * feat: Display first media attachment * feat: Support direction * fix: Stuff broken while rebasing * refactor: Integration with session activations * refactor: Cleanup * refactor: Simplify implementation * feat: Set VAPID keys via environment * chore: Comments * fix: Crash when no alerts * fix: Set VAPID keys in testing environment * fix: Follow link * feat: Notification actions * fix: Delete previous subscription * chore: Temporary logs * refactor: Move migration to a later date * fix: Fetch the correct session activation and misc bugs * refactor: Move migration to a later date * fix: Remove follow request (no notifications) * feat: Send administrator contact to push service * feat: Set time-to-live * fix: Do not show sensitive images * fix: Reducer crash in error handling * feat: Add badge * chore: Fix lint error * fix: Checkbox label overlap * fix: Check for payload support * fix: Rename action "type" (crash in latest Chrome) * feat: Action to expand notification * fix: Lint errors * fix: Unescape notification body * fix: Do not allow boosting if the status is hidden * feat: Add VAPID keys to the production sample environment * fix: Strip HTML tags from status * refactor: Better error messages * refactor: Handle browser not implementing the VAPID protocol (Samsung Internet) * fix: Error when target_status is nil * fix: Handle lack of image * fix: Delete reference to invalid subscriptions * feat: Better error handling * fix: Unescape HTML characters after tags are striped * refactor: Simpify code * fix: Modify to work with #4091 * Sort strings alphabetically * i18n: Updated Polish translation it annoys me that it's not fully localized :P * refactor: Use current_session in PushSubscriptionController * fix: Rebase mistake * fix: Set cacheName to mastodon * refactor: Pull request feedback * refactor: Remove logging statements * chore(yarn): Fix conflicts with master * chore(yarn): Copy latest from master * chore(yarn): Readd offline-plugin * refactor: Use save! and update! * refactor: Send notifications async * fix: Allow retry when push fails * fix: Save track for failed pushes * fix: Minify sw.js * fix: Remove account_id from fabricator
7 years ago
  1. # Service dependencies
  2. # You may set REDIS_URL instead for more advanced options
  3. REDIS_HOST=redis
  4. REDIS_PORT=6379
  5. # You may set DATABASE_URL instead for more advanced options
  6. DB_HOST=db
  7. DB_USER=postgres
  8. DB_NAME=postgres
  9. DB_PASS=
  10. DB_PORT=5432
  11. # Federation
  12. # Note: Changing LOCAL_DOMAIN or LOCAL_HTTPS at a later time will cause unwanted side effects.
  13. # LOCAL_DOMAIN should *NOT* contain the protocol part of the domain e.g https://example.com.
  14. LOCAL_DOMAIN=example.com
  15. LOCAL_HTTPS=true
  16. # Use this only if you need to run mastodon on a different domain than the one used for federation.
  17. # You can read more about this option on https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md
  18. # DO *NOT* USE THIS UNLESS YOU KNOW *EXACTLY* WHAT YOU ARE DOING.
  19. # WEB_DOMAIN=mastodon.example.com
  20. # Use this if you want to have several aliases handler@example1.com
  21. # handler@example2.com etc. for the same user. LOCAL_DOMAIN should not
  22. # be added. Comma separated values
  23. # ALTERNATE_DOMAINS=example1.com,example2.com
  24. # Application secrets
  25. # Generate each with the `rake secret` task (`docker-compose run --rm web rake secret` if you use docker compose)
  26. PAPERCLIP_SECRET=
  27. SECRET_KEY_BASE=
  28. OTP_SECRET=
  29. # VAPID keys (used for push notifications
  30. # You can generate the keys using the following command (first is the private key, second is the public one)
  31. # You should only generate this once per instance. If you later decide to change it, all push subscription will
  32. # be invalidated, requiring the users to access the website again to resubscribe.
  33. #
  34. # Generate with `rake mastodon:webpush:generate_vapid_key` task (`docker-compose run --rm web rake mastodon:webpush:generate_vapid_key` if you use docker compose)
  35. #
  36. # For more information visit https://rossta.net/blog/using-the-web-push-api-with-vapid.html
  37. VAPID_PRIVATE_KEY=
  38. VAPID_PUBLIC_KEY=
  39. # Registrations
  40. # Single user mode will disable registrations and redirect frontpage to the first profile
  41. # SINGLE_USER_MODE=true
  42. # Prevent registrations with following e-mail domains
  43. # EMAIL_DOMAIN_BLACKLIST=example1.com|example2.de|etc
  44. # Only allow registrations with the following e-mail domains
  45. # EMAIL_DOMAIN_WHITELIST=example1.com|example2.de|etc
  46. # Optionally change default language
  47. # DEFAULT_LOCALE=de
  48. # E-mail configuration
  49. # Note: Mailgun and SparkPost (https://sparkpo.st/smtp) each have good free tiers
  50. # If you want to use an SMTP server without authentication (e.g local Postfix relay)
  51. # then set SMTP_AUTH_METHOD and SMTP_OPENSSL_VERIFY_MODE to 'none' and
  52. # *comment* SMTP_LOGIN and SMTP_PASSWORD (leaving them blank is not enough).
  53. SMTP_SERVER=smtp.mailgun.org
  54. SMTP_PORT=587
  55. SMTP_LOGIN=
  56. SMTP_PASSWORD=
  57. SMTP_FROM_ADDRESS=notifications@example.com
  58. #SMTP_DOMAIN= # defaults to LOCAL_DOMAIN
  59. #SMTP_DELIVERY_METHOD=smtp # delivery method can also be sendmail
  60. #SMTP_AUTH_METHOD=plain
  61. #SMTP_CA_FILE=/etc/ssl/certs/ca-certificates.crt
  62. #SMTP_OPENSSL_VERIFY_MODE=peer
  63. #SMTP_ENABLE_STARTTLS_AUTO=true
  64. # Optional user upload path and URL (images, avatars). Default is :rails_root/public/system. If you set this variable, you are responsible for making your HTTP server (eg. nginx) serve these files.
  65. # PAPERCLIP_ROOT_PATH=/var/lib/mastodon/public-system
  66. # PAPERCLIP_ROOT_URL=/system
  67. # Optional asset host for multi-server setups
  68. # CDN_HOST=https://assets.example.com
  69. # S3 (optional)
  70. # S3_ENABLED=true
  71. # S3_BUCKET=
  72. # AWS_ACCESS_KEY_ID=
  73. # AWS_SECRET_ACCESS_KEY=
  74. # S3_REGION=
  75. # S3_PROTOCOL=http
  76. # S3_HOSTNAME=192.168.1.123:9000
  77. # S3 (Minio Config (optional) Please check Minio instance for details)
  78. # S3_ENABLED=true
  79. # S3_BUCKET=
  80. # AWS_ACCESS_KEY_ID=
  81. # AWS_SECRET_ACCESS_KEY=
  82. # S3_REGION=
  83. # S3_PROTOCOL=https
  84. # S3_HOSTNAME=
  85. # S3_ENDPOINT=
  86. # S3_SIGNATURE_VERSION=
  87. # Optional alias for S3 if you want to use Cloudfront or Cloudflare in front
  88. # S3_CLOUDFRONT_HOST=
  89. # Streaming API integration
  90. # STREAMING_API_BASE_URL=
  91. # Advanced settings
  92. # If you need to use pgBouncer, you need to disable prepared statements:
  93. # PREPARED_STATEMENTS=false
  94. # Cluster number setting for streaming API server.
  95. # If you comment out following line, cluster number will be `numOfCpuCores - 1`.
  96. STREAMING_CLUSTER_NUM=1
  97. # Docker mastodon user
  98. # If you use Docker, you may want to assign UID/GID manually.
  99. # UID=1000
  100. # GID=1000