20 lines
461 B
Go
20 lines
461 B
Go
// Command keygen prints fresh VAPID keys for Web Push configuration.
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/SherClockHolmes/webpush-go"
|
|
)
|
|
|
|
func main() {
|
|
private, public, err := webpush.GenerateVAPIDKeys()
|
|
if err != nil {
|
|
fmt.Println("failed to generate keys:", err)
|
|
return
|
|
}
|
|
fmt.Println("MESSENGER_VAPID_PUBLIC_KEY=" + public)
|
|
fmt.Println("MESSENGER_VAPID_PRIVATE_KEY=" + private)
|
|
fmt.Println("MESSENGER_VAPID_SUBJECT=mailto:you@example.com")
|
|
}
|