mirror of
https://github.com/gophish/gophish
synced 2024-11-15 00:37:14 +00:00
cb9c405f46
Fixed some typos leading to syntax errors TODO: Finish up gorm integration into templates
31 lines
571 B
Go
31 lines
571 B
Go
package config
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"io/ioutil"
|
|
)
|
|
|
|
type SMTPServer struct {
|
|
Host string `json:"host"`
|
|
User string `json:"user"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
// Config represents the configuration information.
|
|
type Config struct {
|
|
URL string `json:"url"`
|
|
SMTP SMTPServer `json:"smtp"`
|
|
DBPath string `json:"dbpath"`
|
|
}
|
|
|
|
var Conf Config
|
|
|
|
func init() {
|
|
// Get the config file
|
|
config_file, err := ioutil.ReadFile("./config.json")
|
|
if err != nil {
|
|
fmt.Printf("File error: %v\n", err)
|
|
}
|
|
json.Unmarshal(config_file, &Conf)
|
|
}
|