A simple application to send CSP violation reports to an email address
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.
 
 

27 lines
561 B

  1. package main
  2. import (
  3. "github.com/BurntSushi/toml"
  4. "log"
  5. )
  6. type configuration struct {
  7. SenderEmail string `toml:"sender_email"`
  8. ReceiverEmail string `toml:"receiver_email"`
  9. SmtpAddress string `toml:"smtp_address"`
  10. SmtpUsername string `toml:"smtp_username"`
  11. SmtpPassword string `toml:"smtp_password"`
  12. RateLimit int `toml:"rate_limit"`
  13. BindTo string `toml:"bind_to"`
  14. ConfigPath string
  15. }
  16. var Config configuration
  17. func readConfig() {
  18. _, err := toml.DecodeFile(Config.ConfigPath, &Config)
  19. if err != nil {
  20. log.Fatal(err)
  21. }
  22. }