generar las llaves VAPID

This commit is contained in:
fauno 2019-08-03 14:51:35 -03:00
parent 4854465bcc
commit e8e38da190
No known key found for this signature in database
GPG key ID: 456032D717A4CD9C
4 changed files with 23 additions and 1 deletions

View file

@ -19,6 +19,7 @@ gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7' gem 'bcrypt', '~> 3.1.7'
gem 'validate_url' gem 'validate_url'
gem 'webpush'
# Use ActiveStorage variant # Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8' # gem 'mini_magick', '~> 4.8'

View file

@ -61,12 +61,14 @@ GEM
ffi (1.10.0) ffi (1.10.0)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
hkdf (0.3.0)
i18n (1.6.0) i18n (1.6.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jaro_winkler (1.5.2) jaro_winkler (1.5.2)
jbuilder (2.8.0) jbuilder (2.8.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
multi_json (>= 1.2) multi_json (>= 1.2)
jwt (2.2.1)
listen (3.1.5) listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
@ -161,6 +163,9 @@ GEM
validate_url (1.0.8) validate_url (1.0.8)
activemodel (>= 3.0.0) activemodel (>= 3.0.0)
public_suffix public_suffix
webpush (0.3.8)
hkdf (~> 0.2)
jwt (~> 2.0)
websocket-driver (0.7.0) websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3) websocket-extensions (0.1.3)
@ -185,6 +190,7 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0.0) spring-watcher-listen (~> 2.0.0)
sqlite3 sqlite3
validate_url validate_url
webpush
yard yard
RUBY VERSION RUBY VERSION

View file

@ -1 +1 @@
oAs+MprI5eBtNeeC+76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L3VrN8tw=--p17cT1Xv6vQyo5ES--dIpGtyQMXy3DY8iG1SThQA==

15
lib/tasks/webpush.rake Normal file
View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
namespace :webpush do
desc 'Genera las llaves VAPID'
task vapid: :environment do
vapid = Webpush.generate_key
puts 'Agrega lo siguiente en `rails credentials:edit`:'
puts 'vapid:'
puts " public_key: #{vapid.public_key}"
puts " private_key: #{vapid.private_key}"
exit 0
end
end