pull/429/head
hunterlong 2020-02-25 22:59:56 -08:00
parent f4b11f0d17
commit 51a03bd574
4 changed files with 5 additions and 5 deletions

View File

@ -269,7 +269,7 @@ clean:
find . -name "*.out" -type f -delete find . -name "*.out" -type f -delete
find . -name "*.cpu" -type f -delete find . -name "*.cpu" -type f -delete
find . -name "*.mem" -type f -delete find . -name "*.mem" -type f -delete
rm -rf build rm -rf {build,tmp}
# tag version using git # tag version using git
tag: tag:

View File

@ -110,7 +110,7 @@ func LoadUsingEnv() (*DbConfig, error) {
} }
// defaultPort accepts a database type and returns its default port // defaultPort accepts a database type and returns its default port
func defaultPort(db string) int64 { func defaultPort(db string) int {
switch db { switch db {
case "mysql": case "mysql":
return 3306 return 3306
@ -132,7 +132,7 @@ func EnvToConfig() (*DbConfig, error) {
dbUser := utils.Getenv("DB_USER", "").(string) dbUser := utils.Getenv("DB_USER", "").(string)
dbPass := utils.Getenv("DB_PASS", "").(string) dbPass := utils.Getenv("DB_PASS", "").(string)
dbData := utils.Getenv("DB_DATABASE", "").(string) dbData := utils.Getenv("DB_DATABASE", "").(string)
dbPort := utils.Getenv("DB_PORT", defaultPort(dbConn)).(int64) dbPort := utils.Getenv("DB_PORT", defaultPort(dbConn)).(int)
name := utils.Getenv("NAME", "Statping").(string) name := utils.Getenv("NAME", "Statping").(string)
desc := utils.Getenv("DESCRIPTION", "Statping Monitoring Sample Data").(string) desc := utils.Getenv("DESCRIPTION", "Statping Monitoring Sample Data").(string)
user := utils.Getenv("ADMIN_USER", "admin").(string) user := utils.Getenv("ADMIN_USER", "admin").(string)

View File

@ -58,7 +58,7 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
DbUser: dbUser, DbUser: dbUser,
DbPass: dbPass, DbPass: dbPass,
DbData: dbDatabase, DbData: dbDatabase,
DbPort: dbPort, DbPort: int(dbPort),
Project: project, Project: project,
Description: description, Description: description,
Domain: domain, Domain: domain,

View File

@ -43,7 +43,7 @@ type DbConfig struct {
DbUser string `yaml:"user" json:"-"` DbUser string `yaml:"user" json:"-"`
DbPass string `yaml:"password" json:"-"` DbPass string `yaml:"password" json:"-"`
DbData string `yaml:"database" json:"-"` DbData string `yaml:"database" json:"-"`
DbPort int64 `yaml:"port" json:"-"` DbPort int `yaml:"port" json:"-"`
ApiKey string `yaml:"api_key" json:"-"` ApiKey string `yaml:"api_key" json:"-"`
ApiSecret string `yaml:"api_secret" json:"-"` ApiSecret string `yaml:"api_secret" json:"-"`
Project string `yaml:"-" json:"-"` Project string `yaml:"-" json:"-"`