From 86b5768882e02b28cf24a9a7aa70efad2c74617f Mon Sep 17 00:00:00 2001 From: David Robertsson Date: Sun, 9 Jun 2024 23:44:06 +0200 Subject: [PATCH] Fixed VAPID keygen task --- lib/mix/tasks/web_push_gen_keypair.ex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/mix/tasks/web_push_gen_keypair.ex b/lib/mix/tasks/web_push_gen_keypair.ex index 254bc46..6c534c6 100644 --- a/lib/mix/tasks/web_push_gen_keypair.ex +++ b/lib/mix/tasks/web_push_gen_keypair.ex @@ -1,4 +1,18 @@ defmodule Mix.Tasks.WebPush.Gen.Keypair do + @moduledoc """ + Generate VAPID supplied config. + + It will output something like this; + + config :web_push_encryption, :vapid_details, + subject: \"mailto:administrator@example.com\", + public_key: \"BPFoGQXYu4LgQvn_EXAMPLE_RgXSkYAEXkJO_SUP74cLsduMRd_zHd-CY7ACYQ\" , + private_key: \"CJ4dlX4WIm_EXAMPLE_lZevqDPKwAyxs9k\" + """ + @shortdoc "VAPID generator" + + use Mix.Task + def run(_) do {public, private} = :crypto.generate_key(:ecdh, :prime256v1)