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.

162 lines
4.3 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 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
6 years ago
Add WebAuthn as an alternative 2FA method (#14466) * feat: add possibility of adding WebAuthn security keys to use as 2FA This adds a basic UI for enabling WebAuthn 2FA. We did a little refactor to the Settings page for editing the 2FA methods – now it will list the methods that are available to the user (TOTP and WebAuthn) and from there they'll be able to add or remove any of them. Also, it's worth mentioning that for enabling WebAuthn it's required to have TOTP enabled, so the first time that you go to the 2FA Settings page, you'll be asked to set it up. This work was inspired by the one donde by Github in their platform, and despite it could be approached in different ways, we decided to go with this one given that we feel that this gives a great UX. Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com> * feat: add request for WebAuthn as second factor at login if enabled This commits adds the feature for using WebAuthn as a second factor for login when enabled. If users have WebAuthn enabled, now a page requesting for the use of a WebAuthn credential for log in will appear, although a link redirecting to the old page for logging in using a two-factor code will also be present. Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com> * feat: add possibility of deleting WebAuthn Credentials Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com> * feat: disable WebAuthn when an Admin disables 2FA for a user Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com> * feat: remove ability to disable TOTP leaving only WebAuthn as 2FA Following examples form other platforms like Github, we decided to make Webauthn 2FA secondary to 2FA with TOTP, so that we removed the possibility of removing TOTP authentication only, leaving users with just WEbAuthn as 2FA. Instead, users will have to click on 'Disable 2FA' in order to remove second factor auth. The reason for WebAuthn being secondary to TOPT is that in that way, users will still be able to log in using their code from their phone's application if they don't have their security keys with them – or maybe even lost them. * We had to change a little the flow for setting up TOTP, given that now it's possible to setting up again if you already had TOTP, in order to let users modify their authenticator app – given that now it's not possible for them to disable TOTP and set it up again with another authenticator app. So, basically, now instead of storing the new `otp_secret` in the user, we store it in the session until the process of set up is finished. This was because, as it was before, when users clicked on 'Edit' in the new two-factor methods lists page, but then went back without finishing the flow, their `otp_secret` had been changed therefore invalidating their previous authenticator app, making them unable to log in again using TOTP. Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com> * refactor: fix eslint errors The PR build was failing given that linting returning some errors. This commit attempts to fix them. * refactor: normalize i18n translations The build was failing given that i18n translations files were not normalized. This commits fixes that. * refactor: avoid having the webauthn gem locked to a specific version * refactor: use symbols for routes without '/' * refactor: avoid sending webauthn disabled email when 2FA is disabled When an admins disable 2FA for users, we were sending two mails to them, one notifying that 2FA was disabled and the other to notify that WebAuthn was disabled. As the second one is redundant since the first email includes it, we can remove it and send just one email to users. * refactor: avoid creating new env variable for webauthn_origin config * refactor: improve flash error messages for webauthn pages Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>
3 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. # frozen_string_literal: true
  2. source 'https://rubygems.org'
  3. ruby '>= 2.5.0', '< 3.0.0'
  4. gem 'pkg-config', '~> 1.4'
  5. gem 'puma', '~> 4.3'
  6. gem 'rails', '~> 5.2.4.3'
  7. gem 'sprockets', '~> 3.7.2'
  8. gem 'thor', '~> 0.20'
  9. gem 'rack', '~> 2.2.3'
  10. gem 'thwait', '~> 0.2.0'
  11. gem 'e2mmap', '~> 0.1.0'
  12. gem 'hamlit-rails', '~> 0.2'
  13. gem 'pg', '~> 1.2'
  14. gem 'makara', '~> 0.4'
  15. gem 'pghero', '~> 2.7'
  16. gem 'dotenv-rails', '~> 2.7'
  17. gem 'aws-sdk-s3', '~> 1.79', require: false
  18. gem 'fog-core', '<= 2.1.0'
  19. gem 'fog-openstack', '~> 0.3', require: false
  20. gem 'paperclip', '~> 6.0'
  21. gem 'paperclip-av-transcoder', '~> 0.6'
  22. gem 'streamio-ffmpeg', '~> 3.0'
  23. gem 'blurhash', '~> 0.1'
  24. gem 'active_model_serializers', '~> 0.10'
  25. gem 'addressable', '~> 2.7'
  26. gem 'bootsnap', '~> 1.4', require: false
  27. gem 'browser'
  28. gem 'charlock_holmes', '~> 0.7.7'
  29. gem 'iso-639'
  30. gem 'chewy', '~> 5.1'
  31. gem 'cld3', '~> 3.3.0'
  32. gem 'devise', '~> 4.7'
  33. gem 'devise-two-factor', '~> 3.1'
  34. group :pam_authentication, optional: true do
  35. gem 'devise_pam_authenticatable2', '~> 9.2'
  36. end
  37. gem 'net-ldap', '~> 0.16'
  38. gem 'omniauth-cas', '~> 1.1'
  39. gem 'omniauth-saml', '~> 1.10'
  40. gem 'omniauth', '~> 1.9'
  41. gem 'color_diff', '~> 0.1'
  42. gem 'discard', '~> 1.2'
  43. gem 'doorkeeper', '~> 5.4'
  44. gem 'ed25519', '~> 1.2'
  45. gem 'fast_blank', '~> 1.0'
  46. gem 'fastimage'
  47. gem 'goldfinger', '~> 2.1'
  48. gem 'hiredis', '~> 0.6'
  49. gem 'redis-namespace', '~> 1.8'
  50. gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
  51. gem 'htmlentities', '~> 4.3'
  52. gem 'http', '~> 4.4'
  53. gem 'http_accept_language', '~> 2.1'
  54. gem 'httplog', '~> 1.4.3'
  55. gem 'idn-ruby', require: 'idn'
  56. gem 'kaminari', '~> 1.2'
  57. gem 'link_header', '~> 0.0'
  58. gem 'mime-types', '~> 3.3.1', require: 'mime/types/columnar'
  59. gem 'nilsimsa', git: 'https://github.com/witgo/nilsimsa', ref: 'fd184883048b922b176939f851338d0a4971a532'
  60. gem 'nokogiri', '~> 1.10'
  61. gem 'nsa', '~> 0.2'
  62. gem 'oj', '~> 3.10'
  63. gem 'ox', '~> 2.13'
  64. gem 'parslet'
  65. gem 'parallel', '~> 1.19'
  66. gem 'posix-spawn'
  67. gem 'pundit', '~> 2.1'
  68. gem 'premailer-rails'
  69. gem 'rack-attack', '~> 6.3'
  70. gem 'rack-cors', '~> 1.1', require: 'rack/cors'
  71. gem 'rails-i18n', '~> 5.1'
  72. gem 'rails-settings-cached', '~> 0.6'
  73. gem 'redis', '~> 4.2', require: ['redis', 'redis/connection/hiredis']
  74. gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
  75. gem 'rqrcode', '~> 1.1'
  76. gem 'ruby-progressbar', '~> 1.10'
  77. gem 'sanitize', '~> 5.2'
  78. gem 'sidekiq', '~> 6.1'
  79. gem 'sidekiq-scheduler', '~> 3.0'
  80. gem 'sidekiq-unique-jobs', '~> 6.0'
  81. gem 'sidekiq-bulk', '~>0.2.0'
  82. gem 'simple-navigation', '~> 4.1'
  83. gem 'simple_form', '~> 5.0'
  84. gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie'
  85. gem 'stoplight', '~> 2.2.1'
  86. gem 'strong_migrations', '~> 0.7'
  87. gem 'tty-prompt', '~> 0.22', require: false
  88. gem 'twitter-text', '~> 1.14'
  89. gem 'tzinfo-data', '~> 1.2020'
  90. gem 'webpacker', '~> 5.2'
  91. gem 'webpush'
  92. gem 'webauthn', '~> 3.0.0.alpha1'
  93. gem 'json-ld'
  94. gem 'json-ld-preloaded', '~> 3.1'
  95. gem 'rdf-normalize', '~> 0.4'
  96. group :development, :test do
  97. gem 'fabrication', '~> 2.21'
  98. gem 'fuubar', '~> 2.5'
  99. gem 'i18n-tasks', '~> 0.9', require: false
  100. gem 'pry-byebug', '~> 3.9'
  101. gem 'pry-rails', '~> 0.3'
  102. gem 'rspec-rails', '~> 4.0'
  103. end
  104. group :production, :test do
  105. gem 'private_address_check', '~> 0.5'
  106. end
  107. group :test do
  108. gem 'capybara', '~> 3.33'
  109. gem 'climate_control', '~> 0.2'
  110. gem 'faker', '~> 2.13'
  111. gem 'microformats', '~> 4.2'
  112. gem 'rails-controller-testing', '~> 1.0'
  113. gem 'rspec-sidekiq', '~> 3.1'
  114. gem 'simplecov', '~> 0.19', require: false
  115. gem 'webmock', '~> 3.8'
  116. gem 'parallel_tests', '~> 3.2'
  117. gem 'rspec_junit_formatter', '~> 0.4'
  118. end
  119. group :development do
  120. gem 'active_record_query_trace', '~> 1.7'
  121. gem 'annotate', '~> 3.1'
  122. gem 'better_errors', '~> 2.7'
  123. gem 'binding_of_caller', '~> 0.7'
  124. gem 'bullet', '~> 6.1'
  125. gem 'letter_opener', '~> 1.7'
  126. gem 'letter_opener_web', '~> 1.4'
  127. gem 'memory_profiler'
  128. gem 'rubocop', '~> 0.88', require: false
  129. gem 'rubocop-rails', '~> 2.6', require: false
  130. gem 'brakeman', '~> 4.9', require: false
  131. gem 'bundler-audit', '~> 0.7', require: false
  132. gem 'capistrano', '~> 3.14'
  133. gem 'capistrano-rails', '~> 1.6'
  134. gem 'capistrano-rbenv', '~> 2.2'
  135. gem 'capistrano-yarn', '~> 2.0'
  136. gem 'stackprof'
  137. end
  138. group :production do
  139. gem 'lograge', '~> 0.11'
  140. gem 'redis-rails', '~> 5.0'
  141. end
  142. gem 'concurrent-ruby', require: false
  143. gem 'connection_pool', require: false