🎣 Open-Source Phishing Toolkit
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.

51 lines
1.3 KiB

  1. package config
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "io/ioutil"
  6. )
  7. // SMTPServer represents the SMTP configuration details
  8. type SMTPServer struct {
  9. Host string `json:"host"`
  10. User string `json:"user"`
  11. Password string `json:"password"`
  12. }
  13. // AdminServer represents the Admin server configuration details
  14. type AdminServer struct {
  15. ListenURL string `json:"listen_url"`
  16. UseTLS bool `json:"use_tls"`
  17. CertPath string `json:"cert_path"`
  18. KeyPath string `json:"key_path"`
  19. }
  20. // PhishServer represents the Phish server configuration details
  21. type PhishServer struct {
  22. ListenURL string `json:"listen_url"`
  23. UseTLS bool `json:"use_tls"`
  24. CertPath string `json:"cert_path"`
  25. KeyPath string `json:"key_path"`
  26. }
  27. // Config represents the configuration information.
  28. type Config struct {
  29. AdminConf AdminServer `json:"admin_server"`
  30. PhishConf PhishServer `json:"phish_server"`
  31. SMTPConf SMTPServer `json:"smtp"`
  32. DBPath string `json:"db_path"`
  33. MigrationsPath string `json:"migrations_path"`
  34. }
  35. // Conf contains the initialized configuration struct
  36. var Conf Config
  37. func init() {
  38. // Get the config file
  39. config_file, err := ioutil.ReadFile("./config.json")
  40. if err != nil {
  41. fmt.Printf("File error: %v\n", err)
  42. }
  43. json.Unmarshal(config_file, &Conf)
  44. }