mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
feat(be): support sqlite
This commit is contained in:
parent
eee34fb266
commit
d09fc1d26c
@ -19,7 +19,7 @@ func authentication(next http.Handler) http.Handler {
|
||||
|
||||
if authHeader := strings.ToLower(r.Header.Get("authorization")); len(authHeader) > 0 && strings.Contains(authHeader, "bearer") {
|
||||
var token db.APIToken
|
||||
if err := db.Mysql.SelectOne(&token, "select * from user__token where id=? and expired=0", strings.Replace(authHeader, "bearer ", "", 1)); err != nil {
|
||||
if err := db.Sql.SelectOne(&token, "select * from user__token where id=? and expired=0", strings.Replace(authHeader, "bearer ", "", 1)); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
@ -55,7 +55,7 @@ func authentication(next http.Handler) http.Handler {
|
||||
|
||||
// fetch session
|
||||
var session db.Session
|
||||
if err := db.Mysql.SelectOne(&session, "select * from session where id=? and user_id=? and expired=0", sessionID, userID); err != nil {
|
||||
if err := db.Sql.SelectOne(&session, "select * from session where id=? and user_id=? and expired=0", sessionID, userID); err != nil {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
@ -63,7 +63,7 @@ func authentication(next http.Handler) http.Handler {
|
||||
if time.Since(session.LastActive).Hours() > 7*24 {
|
||||
// more than week old unused session
|
||||
// destroy.
|
||||
if _, err := db.Mysql.Exec("update session set expired=1 where id=?", sessionID); err != nil {
|
||||
if _, err := db.Sql.Exec("update session set expired=1 where id=?", sessionID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ func authentication(next http.Handler) http.Handler {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update session set last_active=UTC_TIMESTAMP() where id=?", sessionID); err != nil {
|
||||
if _, err := db.Sql.Exec("update session set last_active=? where id=?", time.Now(), sessionID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func getEvents(w http.ResponseWriter, r *http.Request, limit uint64) {
|
||||
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
if _, err := db.Mysql.Select(&events, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&events, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ func getEvents(w http.ResponseWriter, r *http.Request, limit uint64) {
|
||||
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
name, err := db.Mysql.SelectNullStr(query, args...)
|
||||
name, err := db.Sql.SelectNullStr(query, args...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -140,11 +140,11 @@ func login(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
if err = db.Mysql.SelectOne(&user, query, args...); err != nil && err == sql.ErrNoRows {
|
||||
if err = db.Sql.SelectOne(&user, query, args...); err != nil && err == sql.ErrNoRows {
|
||||
if ldapUser != nil {
|
||||
// create new LDAP user
|
||||
user = *ldapUser
|
||||
if err = db.Mysql.Insert(&user); err != nil {
|
||||
if err = db.Sql.Insert(&user); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
@ -179,7 +179,7 @@ func login(w http.ResponseWriter, r *http.Request) {
|
||||
UserAgent: r.Header.Get("user-agent"),
|
||||
Expired: false,
|
||||
}
|
||||
if err = db.Mysql.Insert(&session); err != nil {
|
||||
if err = db.Sql.Insert(&session); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ func EnvironmentMiddleware(next http.Handler) http.Handler {
|
||||
util.LogWarning(err)
|
||||
|
||||
var env db.Environment
|
||||
if err := db.Mysql.SelectOne(&env, query, args...); err != nil {
|
||||
if err := db.Sql.SelectOne(&env, query, args...); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -76,7 +76,7 @@ func GetEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Select(&env, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&env, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ func UpdateEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__environment set name=?, json=? where id=?", env.Name, env.JSON, oldEnv.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__environment set name=?, json=? where id=?", env.Name, env.JSON, oldEnv.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ func AddEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := db.Mysql.Exec("insert into project__environment set project_id=?, name=?, json=?, password=?", project.ID, env.Name, env.JSON, env.Password)
|
||||
res, err := db.Sql.Exec("insert into project__environment (project_id, name, json, password) values (?, ?, ?, ?)", project.ID, env.Name, env.JSON, env.Password)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -150,7 +150,7 @@ func AddEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
func RemoveEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
env := context.Get(r, "environment").(db.Environment)
|
||||
|
||||
templatesC, err := db.Mysql.SelectInt("select count(1) from project__template where project_id=? and environment_id=?", env.ProjectID, env.ID)
|
||||
templatesC, err := db.Sql.SelectInt("select count(1) from project__template where project_id=? and environment_id=?", env.ProjectID, env.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -165,7 +165,7 @@ func RemoveEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__environment set removed=1 where id=?", env.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__environment set removed=1 where id=?", env.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ func RemoveEnvironment(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__environment where id=?", env.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__environment where id=?", env.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ func InventoryMiddleware(next http.Handler) http.Handler {
|
||||
util.LogWarning(err)
|
||||
|
||||
var inventory db.Inventory
|
||||
if err := db.Mysql.SelectOne(&inventory, query, args...); err != nil {
|
||||
if err := db.Sql.SelectOne(&inventory, query, args...); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -83,7 +83,7 @@ func GetInventory(w http.ResponseWriter, r *http.Request) {
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Select(&inv, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&inv, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ func AddInventory(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := db.Mysql.Exec("insert into project__inventory set project_id=?, name=?, type=?, key_id=?, ssh_key_id=?, inventory=?", project.ID, inventory.Name, inventory.Type, inventory.KeyID, inventory.SSHKeyID, inventory.Inventory)
|
||||
res, err := db.Sql.Exec("insert into project__inventory set project_id=?, name=?, type=?, key_id=?, ssh_key_id=?, inventory=?", project.ID, inventory.Name, inventory.Type, inventory.KeyID, inventory.SSHKeyID, inventory.Inventory)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -196,7 +196,7 @@ func UpdateInventory(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__inventory set name=?, type=?, key_id=?, ssh_key_id=?, inventory=? where id=?", inventory.Name, inventory.Type, inventory.KeyID, inventory.SSHKeyID, inventory.Inventory, oldInventory.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__inventory set name=?, type=?, key_id=?, ssh_key_id=?, inventory=? where id=?", inventory.Name, inventory.Type, inventory.KeyID, inventory.SSHKeyID, inventory.Inventory, oldInventory.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ func UpdateInventory(w http.ResponseWriter, r *http.Request) {
|
||||
func RemoveInventory(w http.ResponseWriter, r *http.Request) {
|
||||
inventory := context.Get(r, "inventory").(db.Inventory)
|
||||
|
||||
templatesC, err := db.Mysql.SelectInt("select count(1) from project__template where project_id=? and inventory_id=?", inventory.ProjectID, inventory.ID)
|
||||
templatesC, err := db.Sql.SelectInt("select count(1) from project__template where project_id=? and inventory_id=?", inventory.ProjectID, inventory.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -233,7 +233,7 @@ func RemoveInventory(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__inventory set removed=1 where id=?", inventory.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__inventory set removed=1 where id=?", inventory.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ func RemoveInventory(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__inventory where id=?", inventory.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__inventory where id=?", inventory.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ func KeyMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var key db.AccessKey
|
||||
if err := db.Mysql.SelectOne(&key, "select * from access_key where project_id=? and id=?", project.ID, keyID); err != nil {
|
||||
if err := db.Sql.SelectOne(&key, "select * from access_key where project_id=? and id=?", project.ID, keyID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -76,7 +76,7 @@ func GetKeys(w http.ResponseWriter, r *http.Request) {
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Select(&keys, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&keys, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ func AddKey(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
secret := *key.Secret + "\n"
|
||||
|
||||
res, err := db.Mysql.Exec("insert into access_key set name=?, type=?, project_id=?, `key`=?, secret=?", key.Name, key.Type, project.ID, key.Key, secret)
|
||||
res, err := db.Sql.Exec("insert into access_key (name, type, project_id, `key`, secret) values (?, ?, ?, ?, ?)", key.Name, key.Type, project.ID, key.Key, secret)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -169,7 +169,7 @@ func UpdateKey(w http.ResponseWriter, r *http.Request) {
|
||||
key.Secret = &secret
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update access_key set name=?, type=?, `key`=?, secret=? where id=?", key.Name, key.Type, key.Key, key.Secret, oldKey.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update access_key set name=?, type=?, `key`=?, secret=? where id=?", key.Name, key.Type, key.Key, key.Secret, oldKey.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -191,12 +191,12 @@ func UpdateKey(w http.ResponseWriter, r *http.Request) {
|
||||
func RemoveKey(w http.ResponseWriter, r *http.Request) {
|
||||
key := context.Get(r, "accessKey").(db.AccessKey)
|
||||
|
||||
templatesC, err := db.Mysql.SelectInt("select count(1) from project__template where project_id=? and ssh_key_id=?", *key.ProjectID, key.ID)
|
||||
templatesC, err := db.Sql.SelectInt("select count(1) from project__template where project_id=? and ssh_key_id=?", *key.ProjectID, key.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
inventoryC, err := db.Mysql.SelectInt("select count(1) from project__inventory where project_id=? and ssh_key_id=?", *key.ProjectID, key.ID)
|
||||
inventoryC, err := db.Sql.SelectInt("select count(1) from project__inventory where project_id=? and ssh_key_id=?", *key.ProjectID, key.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -211,7 +211,7 @@ func RemoveKey(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update access_key set removed=1 where id=?", key.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update access_key set removed=1 where id=?", key.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ func RemoveKey(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from access_key where id=?", key.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from access_key where id=?", key.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ func ProjectMiddleware(next http.Handler) http.Handler {
|
||||
util.LogWarning(err)
|
||||
|
||||
var project db.Project
|
||||
if err := db.Mysql.SelectOne(&project, query, args...); err != nil {
|
||||
if err := db.Sql.SelectOne(&project, query, args...); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -55,7 +55,7 @@ func MustBeAdmin(next http.Handler) http.Handler {
|
||||
project := context.Get(r, "project").(db.Project)
|
||||
user := context.Get(r, "user").(*db.User)
|
||||
|
||||
userC, err := db.Mysql.SelectInt("select count(1) from project__user as pu join user as u on pu.user_id=u.id where pu.user_id=? and pu.project_id=? and pu.admin=1", user.ID, project.ID)
|
||||
userC, err := db.Sql.SelectInt("select count(1) from project__user as pu join user as u on pu.user_id=u.id where pu.user_id=? and pu.project_id=? and pu.admin=1", user.ID, project.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -81,7 +81,7 @@ func UpdateProject(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project set name=?, alert=?, alert_chat=? where id=?", body.Name, body.Alert, body.AlertChat, project.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project set name=?, alert=?, alert_chat=? where id=?", body.Name, body.Alert, body.AlertChat, project.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -92,14 +92,14 @@ func UpdateProject(w http.ResponseWriter, r *http.Request) {
|
||||
func DeleteProject(w http.ResponseWriter, r *http.Request) {
|
||||
project := context.Get(r, "project").(db.Project)
|
||||
|
||||
tx, err := db.Mysql.Begin()
|
||||
tx, err := db.Sql.Begin()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
statements := []string{
|
||||
"delete tao from task__output as tao join task as t on t.id=tao.task_id join project__template as pt on pt.id=t.template_id where pt.project_id=?",
|
||||
"delete t from task as t join project__template as pt on pt.id=t.template_id where pt.project_id=?",
|
||||
//"delete tao from task__output as tao join task as t on t.id=tao.task_id join project__template as pt on pt.id=t.template_id where pt.project_id=?",
|
||||
//"delete t from task as t join project__template as pt on pt.id=t.template_id where pt.project_id=?",
|
||||
"delete from project__template where project_id=?",
|
||||
"delete from project__user where project_id=?",
|
||||
"delete from project__repository where project_id=?",
|
||||
|
@ -25,7 +25,7 @@ func GetProjects(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
util.LogWarning(err)
|
||||
var projects []db.Project
|
||||
if _, err := db.Mysql.Select(&projects, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&projects, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ func AddProject(w http.ResponseWriter, r *http.Request) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("insert into project__user set project_id=?, user_id=?, `admin`=1", body.ID, user.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("insert into project__user (project_id, user_id, `admin`) values (?, ?, 1)", body.ID, user.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ func RepositoryMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var repository db.Repository
|
||||
if err := db.Mysql.SelectOne(&repository, "select * from project__repository where project_id=? and id=?", project.ID, repositoryID); err != nil {
|
||||
if err := db.Sql.SelectOne(&repository, "select * from project__repository where project_id=? and id=?", project.ID, repositoryID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -88,7 +88,7 @@ func GetRepositories(w http.ResponseWriter, r *http.Request) {
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Select(&repos, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&repos, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func AddRepository(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := db.Mysql.Exec("insert into project__repository set project_id=?, git_url=?, ssh_key_id=?, name=?", project.ID, repository.GitURL, repository.SSHKeyID, repository.Name)
|
||||
res, err := db.Sql.Exec("insert into project__repository(project_id, git_url, ssh_key_id, name) values (?, ?, ?, ?)", project.ID, repository.GitURL, repository.SSHKeyID, repository.Name)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -143,7 +143,7 @@ func UpdateRepository(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__repository set name=?, git_url=?, ssh_key_id=? where id=?", repository.Name, repository.GitURL, repository.SSHKeyID, oldRepo.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__repository set name=?, git_url=?, ssh_key_id=? where id=?", repository.Name, repository.GitURL, repository.SSHKeyID, oldRepo.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ func UpdateRepository(w http.ResponseWriter, r *http.Request) {
|
||||
func RemoveRepository(w http.ResponseWriter, r *http.Request) {
|
||||
repository := context.Get(r, "repository").(db.Repository)
|
||||
|
||||
templatesC, err := db.Mysql.SelectInt("select count(1) from project__template where project_id=? and repository_id=?", repository.ProjectID, repository.ID)
|
||||
templatesC, err := db.Sql.SelectInt("select count(1) from project__template where project_id=? and repository_id=?", repository.ProjectID, repository.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -184,7 +184,7 @@ func RemoveRepository(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__repository set removed=1 where id=?", repository.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__repository set removed=1 where id=?", repository.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ func RemoveRepository(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__repository where id=?", repository.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__repository where id=?", repository.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ func TemplatesMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var template db.Template
|
||||
if err := db.Mysql.SelectOne(&template, "select * from project__template where project_id=? and id=?", project.ID, templateID); err != nil {
|
||||
if err := db.Sql.SelectOne(&template, "select * from project__template where project_id=? and id=?", project.ID, templateID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -94,7 +94,7 @@ func GetTemplates(w http.ResponseWriter, r *http.Request) {
|
||||
query, args, err := q.ToSql()
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Select(&templates, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&templates, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ func AddTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := db.Mysql.Exec("insert into project__template set ssh_key_id=?, project_id=?, inventory_id=?, repository_id=?, environment_id=?, alias=?, playbook=?, arguments=?, override_args=?", template.SSHKeyID, project.ID, template.InventoryID, template.RepositoryID, template.EnvironmentID, template.Alias, template.Playbook, template.Arguments, template.OverrideArguments)
|
||||
res, err := db.Sql.Exec("insert into project__template set ssh_key_id=?, project_id=?, inventory_id=?, repository_id=?, environment_id=?, alias=?, playbook=?, arguments=?, override_args=?", template.SSHKeyID, project.ID, template.InventoryID, template.RepositoryID, template.EnvironmentID, template.Alias, template.Playbook, template.Arguments, template.OverrideArguments)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -149,7 +149,7 @@ func UpdateTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
template.Arguments = nil
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__template set ssh_key_id=?, inventory_id=?, repository_id=?, environment_id=?, alias=?, playbook=?, arguments=?, override_args=? where id=?", template.SSHKeyID, template.InventoryID, template.RepositoryID, template.EnvironmentID, template.Alias, template.Playbook, template.Arguments, template.OverrideArguments, oldTemplate.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__template set ssh_key_id=?, inventory_id=?, repository_id=?, environment_id=?, alias=?, playbook=?, arguments=?, override_args=? where id=?", template.SSHKeyID, template.InventoryID, template.RepositoryID, template.EnvironmentID, template.Alias, template.Playbook, template.Arguments, template.OverrideArguments, oldTemplate.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ func UpdateTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
func RemoveTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
tpl := context.Get(r, "template").(db.Template)
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__template where id=?", tpl.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__template where id=?", tpl.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ func UserMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var user db.User
|
||||
if err := db.Mysql.SelectOne(&user, "select u.* from project__user as pu join user as u on pu.user_id=u.id where pu.user_id=? and pu.project_id=?", userID, project.ID); err != nil {
|
||||
if err := db.Sql.SelectOne(&user, "select u.* from project__user as pu join `user` as u on pu.user_id=u.id where pu.user_id=? and pu.project_id=?", userID, project.ID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -69,7 +69,7 @@ func GetUsers(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
query, args, _ := q.ToSql()
|
||||
|
||||
if _, err := db.Mysql.Select(&users, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&users, query, args...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ func AddUser(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
//TODO - check if user already exists
|
||||
if _, err := db.Mysql.Exec("insert into project__user set user_id=?, project_id=?, `admin`=?", user.UserID, project.ID, user.Admin); err != nil {
|
||||
if _, err := db.Sql.Exec("insert into project__user(user_id, project_id, `admin`) values (?, ?, ?)", user.UserID, project.ID, user.Admin); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ func RemoveUser(w http.ResponseWriter, r *http.Request) {
|
||||
project := context.Get(r, "project").(db.Project)
|
||||
user := context.Get(r, "projectUser").(db.User)
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__user where user_id=? and project_id=?", user.ID, project.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__user where user_id=? and project_id=?", user.ID, project.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ func MakeUserAdmin(w http.ResponseWriter, r *http.Request) {
|
||||
admin = 0
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update project__user set `admin`=? where user_id=? and project_id=?", admin, user.ID, project.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update project__user set `admin`=? where user_id=? and project_id=?", admin, user.ID, project.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ func AddTask(w http.ResponseWriter, r *http.Request) {
|
||||
taskObj.Status = "waiting"
|
||||
taskObj.UserID = &user.ID
|
||||
|
||||
if err := db.Mysql.Insert(&taskObj); err != nil {
|
||||
if err := db.Sql.Insert(&taskObj); err != nil {
|
||||
util.LogErrorWithFields(err, log.Fields{"error": "Bad request. Cannot create new task"})
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
@ -82,7 +82,7 @@ func GetTasksList(w http.ResponseWriter, r *http.Request, limit uint64) {
|
||||
TemplateAlias string `db:"tpl_alias" json:"tpl_alias"`
|
||||
UserName *string `db:"user_name" json:"user_name"`
|
||||
}
|
||||
if _, err := db.Mysql.Select(&tasks, query, args...); err != nil {
|
||||
if _, err := db.Sql.Select(&tasks, query, args...); err != nil {
|
||||
util.LogErrorWithFields(err, log.Fields{"error": "Bad request. Cannot get tasks list from database"})
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
@ -116,7 +116,7 @@ func GetTaskMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var task db.Task
|
||||
if err := db.Mysql.SelectOne(&task, "select * from task where id=?", taskID); err != nil {
|
||||
if err := db.Sql.SelectOne(&task, "select * from task where id=?", taskID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ func GetTaskOutput(w http.ResponseWriter, r *http.Request) {
|
||||
task := context.Get(r, taskTypeID).(db.Task)
|
||||
|
||||
var output []db.TaskOutput
|
||||
if _, err := db.Mysql.Select(&output, "select task_id, task, time, output from task__output where task_id=? order by time asc", task.ID); err != nil {
|
||||
if _, err := db.Sql.Select(&output, "select task_id, task, time, output from task__output where task_id=? order by time asc", task.ID); err != nil {
|
||||
util.LogErrorWithFields(err, log.Fields{"error": "Bad request. Cannot get task output from database"})
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
@ -156,7 +156,7 @@ func RemoveTask(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
for _, statement := range statements {
|
||||
_, err := db.Mysql.Exec(statement, task.ID)
|
||||
_, err := db.Sql.Exec(statement, task.ID)
|
||||
if err != nil {
|
||||
util.LogErrorWithFields(err, log.Fields{"error": "Bad request. Cannot delete task from database"})
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
@ -30,7 +30,7 @@ func (t *task) log(msg string) {
|
||||
}
|
||||
|
||||
go func() {
|
||||
_, err := db.Mysql.Exec("insert into task__output (task_id, task, output, time) VALUES (?, '', ?, ?)", t.task.ID, msg, now)
|
||||
_, err := db.Sql.Exec("insert into task__output (task_id, task, output, time) VALUES (?, '', ?, ?)", t.task.ID, msg, now)
|
||||
util.LogPanicWithFields(err, log.Fields{"error": "Failed to insert task output"})
|
||||
}()
|
||||
}
|
||||
@ -51,7 +51,7 @@ func (t *task) updateStatus() {
|
||||
sockets.Message(user, b)
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update task set status=?, start=?, end=? where id=?", t.task.Status, t.task.Start, t.task.End, t.task.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update task set status=?, start=?, end=? where id=?", t.task.Status, t.task.Start, t.task.End, t.task.ID); err != nil {
|
||||
t.panicOnError(err, "Failed to update task status")
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ func (t *task) run() {
|
||||
}
|
||||
|
||||
func (t *task) fetch(errMsg string, ptr interface{}, query string, args ...interface{}) error {
|
||||
err := db.Mysql.SelectOne(ptr, query, args...)
|
||||
err := db.Sql.SelectOne(ptr, query, args...)
|
||||
if err == sql.ErrNoRows {
|
||||
t.log(errMsg)
|
||||
return err
|
||||
@ -241,7 +241,7 @@ func (t *task) populateDetails() error {
|
||||
var users []struct {
|
||||
ID int `db:"id"`
|
||||
}
|
||||
if _, err := db.Mysql.Select(&users, "select user_id as id from project__user where project_id=?", t.template.ProjectID); err != nil {
|
||||
if _, err := db.Sql.Select(&users, "select user_id as id from project__user where project_id=?", t.template.ProjectID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ func getAPITokens(w http.ResponseWriter, r *http.Request) {
|
||||
user := context.Get(r, "user").(*db.User)
|
||||
|
||||
var tokens []db.APIToken
|
||||
if _, err := db.Mysql.Select(&tokens, "select * from user__token where user_id=?", user.ID); err != nil {
|
||||
if _, err := db.Sql.Select(&tokens, "select * from user__token where user_id=?", user.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ func createAPIToken(w http.ResponseWriter, r *http.Request) {
|
||||
Expired: false,
|
||||
}
|
||||
|
||||
if err := db.Mysql.Insert(&token); err != nil {
|
||||
if err := db.Sql.Insert(&token); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ func expireAPIToken(w http.ResponseWriter, r *http.Request) {
|
||||
user := context.Get(r, "user").(*db.User)
|
||||
|
||||
tokenID := mux.Vars(r)["token_id"]
|
||||
res, err := db.Mysql.Exec("update user__token set expired=1 where id=? and user_id=?", tokenID, user.ID)
|
||||
res, err := db.Sql.Exec("update user__token set expired=1 where id=? and user_id=?", tokenID, user.ID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
14
api/users.go
14
api/users.go
@ -15,7 +15,7 @@ import (
|
||||
|
||||
func getUsers(w http.ResponseWriter, r *http.Request) {
|
||||
var users []db.User
|
||||
if _, err := db.Mysql.Select(&users, "select * from user"); err != nil {
|
||||
if _, err := db.Sql.Select(&users, "select * from user"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ func addUser(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
user.Created = db.GetParsedTime(time.Now())
|
||||
|
||||
if err := db.Mysql.Insert(&user); err != nil {
|
||||
if err := db.Sql.Insert(&user); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ func getUserMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
var user db.User
|
||||
if err := db.Mysql.SelectOne(&user, "select * from user where id=?", userID); err != nil {
|
||||
if err := db.Sql.SelectOne(&user, "select * from `user` where id=?", userID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
@ -101,7 +101,7 @@ func updateUser(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("update user set name=?, username=?, email=?, alert=?, admin=? where id=?", user.Name, user.Username, user.Email, user.Alert, user.Admin, oldUser.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update user set name=?, username=?, email=?, alert=?, admin=? where id=?", user.Name, user.Username, user.Email, user.Alert, user.Admin, oldUser.ID); err != nil {
|
||||
log.Error(err.Error())
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
@ -136,7 +136,7 @@ func updateUserPassword(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
password, err := bcrypt.GenerateFromPassword([]byte(pwd.Pwd), 11)
|
||||
util.LogWarning(err)
|
||||
if _, err := db.Mysql.Exec("update user set password=? where id=?", string(password), user.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("update `user` set password=? where id=?", string(password), user.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -153,10 +153,10 @@ func deleteUser(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := db.Mysql.Exec("delete from project__user where user_id=?", user.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from project__user where user_id=?", user.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := db.Mysql.Exec("delete from user where id=?", user.ID); err != nil {
|
||||
if _, err := db.Sql.Exec("delete from `user` where id=?", user.ID); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
10
cli/main.go
10
cli/main.go
@ -168,7 +168,7 @@ func doSetup() int {
|
||||
user.Email = strings.ToLower(user.Email)
|
||||
|
||||
var existingUser db.User
|
||||
err = db.Mysql.SelectOne(&existingUser, "select * from user where email=? or username=?", user.Email, user.Username)
|
||||
err = db.Sql.SelectOne(&existingUser, "select * from `user` where email=? or username=?", user.Email, user.Username)
|
||||
util.LogWarning(err)
|
||||
|
||||
if existingUser.ID > 0 {
|
||||
@ -180,7 +180,13 @@ func doSetup() int {
|
||||
pwdHash, err := bcrypt.GenerateFromPassword([]byte(user.Password), 11)
|
||||
util.LogWarning(err)
|
||||
|
||||
if _, err := db.Mysql.Exec("insert into user set name=?, username=?, email=?, password=?, admin=1, created=UTC_TIMESTAMP()", user.Name, user.Username, user.Email, pwdHash); err != nil {
|
||||
if _, err := db.Sql.Exec(
|
||||
"insert into `user`(name, username, email, password, admin, created) values (?, ?, ?, ?, true, ?)",
|
||||
user.Name,
|
||||
user.Username,
|
||||
user.Email,
|
||||
pwdHash,
|
||||
time.Now()); err != nil {
|
||||
fmt.Printf(" Inserting user failed. If you already have a user, you can disregard this error.\n %v\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
@ -16,7 +16,13 @@ type Event struct {
|
||||
|
||||
// Insert writes the event to the database
|
||||
func (evt Event) Insert() error {
|
||||
_, err := Mysql.Exec("insert into event set project_id=?, object_id=?, object_type=?, description=?, created=UTC_TIMESTAMP(6)", evt.ProjectID, evt.ObjectID, evt.ObjectType, evt.Description)
|
||||
_, err := Sql.Exec(
|
||||
"insert into event(project_id, object_id, object_type, description, created) values (?, ?, ?, ?, ?)",
|
||||
evt.ProjectID,
|
||||
evt.ObjectID,
|
||||
evt.ObjectType,
|
||||
evt.Description,
|
||||
time.Now().Format("2006-01-02 15:04:05"))
|
||||
|
||||
return err
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ type Project struct {
|
||||
func (project *Project) CreateProject() error {
|
||||
project.Created = time.Now()
|
||||
|
||||
res, err := Mysql.Exec("insert into project set name=?, created=?", project.Name, project.Created)
|
||||
res, err := Sql.Exec("insert into project(name, created) values (?, ?)", project.Name, project.Created)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ type User struct {
|
||||
func FetchUser(userID int) (*User, error) {
|
||||
var user User
|
||||
|
||||
err := Mysql.SelectOne(&user, "select * from user where id=?", userID)
|
||||
err := Sql.SelectOne(&user, "select * from `user` where id=?", userID)
|
||||
return &user, err
|
||||
}
|
||||
|
@ -2,22 +2,32 @@ package db
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/lib/pq"
|
||||
"time"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/gobuffalo/packr"
|
||||
sqlite "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
var dbAssets = packr.NewBox("./migrations")
|
||||
|
||||
// CheckExists queries the database to see if a migration table with this version id exists already
|
||||
func (version *Version) CheckExists() (bool, error) {
|
||||
exists, err := Mysql.SelectInt("select count(1) as ex from migrations where version=?", version.VersionString())
|
||||
exists, err := Sql.SelectInt("select count(1) as ex from migrations where version=?", version.VersionString())
|
||||
|
||||
if err != nil {
|
||||
//nolint: gosimple
|
||||
//nolint: gosimples
|
||||
switch err.(type) {
|
||||
case sqlite.Error:
|
||||
fmt.Println("Creating migrations table")
|
||||
|
||||
if _, err = Sql.Exec(PrepareMigration(initialSQL)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return version.CheckExists()
|
||||
case *mysql.MySQLError:
|
||||
// 1146 is mysql table does not exist
|
||||
if err.(*mysql.MySQLError).Number != 1146 {
|
||||
@ -25,10 +35,20 @@ func (version *Version) CheckExists() (bool, error) {
|
||||
}
|
||||
|
||||
fmt.Println("Creating migrations table")
|
||||
if _, err = Mysql.Exec(initialSQL); err != nil {
|
||||
if _, err = Sql.Exec(initialSQL); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return version.CheckExists()
|
||||
case *pq.Error:
|
||||
if err.(*pq.Error).Code != "42P01" {
|
||||
return false, err
|
||||
}
|
||||
|
||||
fmt.Println("Creating migrations table")
|
||||
if _, err = Sql.Exec(PrepareMigration(initialSQL)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return version.CheckExists()
|
||||
default:
|
||||
return false, err
|
||||
@ -42,7 +62,7 @@ func (version *Version) CheckExists() (bool, error) {
|
||||
func (version *Version) Run() error {
|
||||
fmt.Printf("Executing migration %s (at %v)...\n", version.HumanoidVersion(), time.Now())
|
||||
|
||||
tx, err := Mysql.Begin()
|
||||
tx, err := Sql.Begin()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -55,14 +75,14 @@ func (version *Version) Run() error {
|
||||
continue
|
||||
}
|
||||
|
||||
if _, err := tx.Exec(query); err != nil {
|
||||
if _, err := tx.Exec(PrepareMigration(query)); err != nil {
|
||||
handleRollbackError(tx.Rollback())
|
||||
log.Warnf("\n ERR! Query: %v\n\n", query)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := tx.Exec("insert into migrations set version=?, upgraded_date=?", version.VersionString(), time.Now()); err != nil {
|
||||
if _, err := tx.Exec("insert into migrations(version, upgraded_date) values (?, ?)", version.VersionString(), time.Now()); err != nil {
|
||||
handleRollbackError(tx.Rollback())
|
||||
return err
|
||||
}
|
||||
@ -93,7 +113,7 @@ func (version *Version) TryRollback() {
|
||||
for _, query := range sql {
|
||||
fmt.Printf(" [ROLLBACK] > %v\n", query)
|
||||
|
||||
if _, err := Mysql.Exec(query); err != nil {
|
||||
if _, err := Sql.Exec(query); err != nil {
|
||||
fmt.Println(" [ROLLBACK] - Stopping")
|
||||
return
|
||||
}
|
||||
|
@ -1,112 +1,112 @@
|
||||
create table user (
|
||||
`id` int(11) not null auto_increment primary key,
|
||||
create table `user` (
|
||||
`id` integer primary key autoincrement,
|
||||
`created` datetime not null,
|
||||
`username` varchar(255) not null comment "Username, unique",
|
||||
`name` varchar(255) not null comment "Full name",
|
||||
`email` varchar(255) not null comment "Email, unique",
|
||||
`password` varchar(255) not null comment "Password",
|
||||
|
||||
unique key `username` (`username`),
|
||||
unique key `email` (`email`)
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
|
||||
create table project (
|
||||
`id` int(11) not null auto_increment primary key,
|
||||
`created` datetime not null comment "Created timestamp",
|
||||
`name` varchar(255) not null comment "Project name"
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
|
||||
create table project__user (
|
||||
`project_id` int(11) not null,
|
||||
`user_id` int (11) not null comment "User ID",
|
||||
`admin` tinyint (1) not null default 0 comment 'Gives user god-like privileges',
|
||||
|
||||
unique key `id` (`project_id`, `user_id`),
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade,
|
||||
foreign key (`user_id`) references user(`id`) on delete cascade
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
|
||||
create table access_key (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`username` varchar(255) not null,
|
||||
`name` varchar(255) not null,
|
||||
`type` varchar(255) not null comment 'aws/do/gcloud/ssh',
|
||||
`email` varchar(255) not null,
|
||||
`password` varchar(255) not null,
|
||||
|
||||
`project_id` int(11) null,
|
||||
unique (`username`),
|
||||
unique (`email`)
|
||||
);
|
||||
|
||||
create table `project` (
|
||||
`id` integer primary key autoincrement,
|
||||
`created` datetime not null,
|
||||
`name` varchar(255) not null
|
||||
);
|
||||
|
||||
create table `project__user` (
|
||||
`project_id` int not null,
|
||||
`user_id` int not null,
|
||||
`admin` tinyint not null default 0,
|
||||
|
||||
unique (`project_id`, `user_id`),
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade,
|
||||
foreign key (`user_id`) references `user`(`id`) on delete cascade
|
||||
);
|
||||
|
||||
create table `access_key` (
|
||||
`id` integer primary key autoincrement,
|
||||
`name` varchar(255) not null,
|
||||
`type` varchar(255) not null,
|
||||
|
||||
`project_id` int null,
|
||||
`key` text null,
|
||||
`secret` text null,
|
||||
|
||||
foreign key (`project_id`) references project(`id`) on delete set null
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table project__repository (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`project_id` int(11) not null,
|
||||
create table `project__repository` (
|
||||
`id` integer primary key autoincrement,
|
||||
`project_id` int not null,
|
||||
`git_url` text not null,
|
||||
`ssh_key_id` int(11) not null,
|
||||
`ssh_key_id` int not null,
|
||||
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade,
|
||||
foreign key (`ssh_key_id`) references access_key(`id`)
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table project__inventory (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`project_id` int(11) not null,
|
||||
`type` varchar(255) not null comment 'can be static/aws/do/gcloud',
|
||||
`key_id` int(11) null comment 'references keys to authenticate remote services',
|
||||
create table `project__inventory` (
|
||||
`id` integer primary key autoincrement,
|
||||
`project_id` int not null,
|
||||
`type` varchar(255) not null,
|
||||
`key_id` int null,
|
||||
`inventory` longtext not null,
|
||||
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade,
|
||||
foreign key (`key_id`) references access_key(`id`)
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table project__environment (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`project_id` int(11) not null,
|
||||
create table `project__environment` (
|
||||
`id` integer primary key autoincrement,
|
||||
`project_id` int not null,
|
||||
`password` varchar(255) null,
|
||||
`json` longtext not null,
|
||||
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table project__template (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`ssh_key_id` int(11) not null comment 'for accessing the inventory',
|
||||
`project_id` int(11) not null,
|
||||
`inventory_id` int(11) not null,
|
||||
`repository_id` int(11) not null,
|
||||
`environment_id` int(11) null,
|
||||
`playbook` varchar(255) not null comment 'playbook name (ansible.yml)',
|
||||
create table `project__template` (
|
||||
`id` integer primary key autoincrement,
|
||||
`ssh_key_id` int not null,
|
||||
`project_id` int not null,
|
||||
`inventory_id` int not null,
|
||||
`repository_id` int not null,
|
||||
`environment_id` int null,
|
||||
`playbook` varchar(255) not null,
|
||||
|
||||
foreign key (`project_id`) references project(`id`) on delete cascade,
|
||||
foreign key (`ssh_key_id`) references access_key(`id`),
|
||||
foreign key (`inventory_id`) references project__inventory(`id`),
|
||||
foreign key (`repository_id`) references project__repository(`id`),
|
||||
foreign key (`environment_id`) references project__environment(`id`)
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table project__template_schedule (
|
||||
`template_id` int(11) not null,
|
||||
create table `project__template_schedule` (
|
||||
`template_id` int primary key,
|
||||
`cron_format` varchar(255) not null,
|
||||
|
||||
foreign key (`template_id`) references project__template(`id`) on delete cascade
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
||||
create table task (
|
||||
`id` int(11) not null primary key auto_increment,
|
||||
`template_id` int(11) not null,
|
||||
create table `task` (
|
||||
`id` integer primary key autoincrement,
|
||||
`template_id` int not null,
|
||||
`status` varchar(255) not null,
|
||||
`playbook` varchar(255) not null comment 'override playbook name (ansible.yml)',
|
||||
`environment` longtext null comment 'override environment',
|
||||
`playbook` varchar(255) not null,
|
||||
`environment` longtext null,
|
||||
|
||||
foreign key (`template_id`) references project__template(`id`)
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
foreign key (`template_id`) references project__template(`id`) on delete cascade
|
||||
);
|
||||
|
||||
create table task__output (
|
||||
`task_id` int(11) not null,
|
||||
create table `task__output` (
|
||||
`task_id` int not null,
|
||||
`task` varchar(255) not null,
|
||||
`time` datetime not null,
|
||||
`output` longtext not null,
|
||||
|
||||
unique key `id` (`task_id`, `time`),
|
||||
unique (`task_id`, `time`),
|
||||
foreign key (`task_id`) references task(`id`) on delete cascade
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
);
|
||||
|
@ -1,7 +0,0 @@
|
||||
alter table user change `created` `created` datetime not null;
|
||||
alter table project change `created` `created` datetime not null comment 'Created timestamp';
|
||||
alter table task change `created` `created` datetime not null;
|
||||
alter table user__token change `created` `created` datetime not null;
|
||||
|
||||
alter table task drop foreign key `task_ibfk_1`;
|
||||
alter table task add constraint `task_ibfk_1` foreign key (`template_id`) references `project__template` (`id`) on delete cascade;
|
@ -1,12 +1,18 @@
|
||||
alter table task add `debug` tinyint(1) not null default 0;
|
||||
alter table task add `debug` tinyint not null default 0;
|
||||
|
||||
alter table project__template add `arguments` text null,
|
||||
add `override_args` tinyint(1) not null default 0;
|
||||
alter table `project__template` add `arguments` text null;
|
||||
alter table `project__template` add `override_args` tinyint not null default 0;
|
||||
alter table `project__inventory` add `ssh_key_id` int null references access_key(`id`);
|
||||
|
||||
alter table project__inventory add `ssh_key_id` int(11) not null,
|
||||
add foreign key (`ssh_key_id`) references access_key(`id`);
|
||||
|
||||
alter table task__output drop foreign key `task__output_ibfk_1`;
|
||||
alter table task__output drop index `id`;
|
||||
alter table task__output add key `task_id` (`task_id`);
|
||||
alter table task__output add foreign key (`task_id`) references task(`id`) on delete cascade;
|
||||
alter table `task__output` rename to `task__output_backup`;
|
||||
create table `task__output`
|
||||
(
|
||||
task_id int not null
|
||||
references task
|
||||
on delete cascade,
|
||||
task varchar(255) not null,
|
||||
time datetime not null,
|
||||
output longtext not null
|
||||
);
|
||||
insert into `task__output` select * from `task__output_backup`;
|
||||
drop table `task__output_backup`;
|
||||
|
@ -1,2 +0,0 @@
|
||||
/* update precision of output logs - also prevents confusion when sorting the table to guarantee it is in the same order */
|
||||
alter table task__output change `time` `time` datetime(6) not null;
|
@ -1,8 +1,8 @@
|
||||
create table `user__token` (
|
||||
`id` varchar(32) not null primary key,
|
||||
`created` datetime not null,
|
||||
`expired` tinyint(1) not null default 0,
|
||||
`user_id` int(11) not null,
|
||||
`expired` tinyint not null default 0,
|
||||
`user_id` int not null,
|
||||
|
||||
foreign key (`user_id`) references user(`id`) on delete cascade
|
||||
) ENGINE=InnoDB CHARSET=utf8;
|
||||
foreign key (`user_id`) references `user`(`id`) on delete cascade
|
||||
);
|
||||
|
@ -1,3 +1,3 @@
|
||||
alter table project__environment add `name` varchar(255) not null;
|
||||
alter table project__inventory add `name` varchar(255) not null;
|
||||
alter table project__repository add `name` varchar(255) not null;
|
||||
alter table project__environment add `name` varchar(255);
|
||||
alter table project__inventory add `name` varchar(255);
|
||||
alter table project__repository add `name` varchar(255);
|
||||
|
@ -1,14 +1,17 @@
|
||||
CREATE TABLE `event` (
|
||||
`project_id` int(11) DEFAULT NULL,
|
||||
`object_id` int(11) DEFAULT NULL,
|
||||
`project_id` int DEFAULT NULL,
|
||||
`object_id` int DEFAULT NULL,
|
||||
`object_type` varchar(20) DEFAULT '',
|
||||
`description` text,
|
||||
`created` datetime(6) NOT NULL,
|
||||
KEY `project_id` (`project_id`),
|
||||
KEY `object_id` (`object_id`),
|
||||
KEY `created` (`created`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
`created` datetime NOT NULL
|
||||
);
|
||||
|
||||
alter table task add `created` datetime not null,
|
||||
add `start` datetime null,
|
||||
add `end` datetime null;
|
||||
CREATE INDEX `project_id` ON `event`(`project_id`);
|
||||
|
||||
CREATE INDEX `object_id` ON `event`(`object_id`);
|
||||
|
||||
CREATE INDEX `created` ON `event`(`created`);
|
||||
|
||||
alter table `task` add `created` datetime null;
|
||||
alter table `task` add `start` datetime null;
|
||||
alter table `task` add `end` datetime null;
|
||||
|
@ -1,12 +1,13 @@
|
||||
CREATE TABLE `session` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`id` integer primary key autoincrement,
|
||||
`user_id` int NOT NULL,
|
||||
`created` datetime NOT NULL,
|
||||
`last_active` datetime NOT NULL,
|
||||
`ip` varchar(15) NOT NULL DEFAULT '',
|
||||
`user_agent` text NOT NULL,
|
||||
`expired` tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `expired` (`expired`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
`expired` tinyint NOT NULL DEFAULT '0'
|
||||
);
|
||||
|
||||
CREATE INDEX `user_id` ON `session`(`user_id`);
|
||||
|
||||
CREATE INDEX `expired` ON `session`(`expired`);
|
||||
|
@ -1,6 +1,4 @@
|
||||
# add deleted column
|
||||
|
||||
alter table project__environment add `removed` tinyint(1) default 0 comment 'marks as deleted';
|
||||
alter table project__inventory add `removed` tinyint(1) default 0 comment 'marks as deleted';
|
||||
alter table project__repository add `removed` tinyint(1) default 0 comment 'marks as deleted';
|
||||
alter table access_key add `removed` tinyint(1) default 0 comment 'marks as deleted';
|
||||
alter table project__environment add `removed` tinyint default 0;
|
||||
alter table project__inventory add `removed` tinyint default 0;
|
||||
alter table project__repository add `removed` tinyint default 0;
|
||||
alter table access_key add `removed` tinyint default 0;
|
||||
|
@ -1 +1 @@
|
||||
alter table task add user_id int after environment;
|
||||
alter table task add user_id int;
|
||||
|
@ -1 +1 @@
|
||||
ALTER TABLE task ADD dry_run tinyint(1) NOT NULL DEFAULT 0 AFTER debug;
|
||||
ALTER TABLE task ADD dry_run tinyint NOT NULL DEFAULT 0;
|
||||
|
@ -1 +1 @@
|
||||
ALTER TABLE project__template ADD alias varchar(100) NOT NULL AFTER environment_id;
|
||||
ALTER TABLE project__template ADD alias varchar(100);
|
||||
|
@ -1,3 +1,16 @@
|
||||
ALTER TABLE `project__template_schedule` ADD PRIMARY KEY(template_id);
|
||||
alter table task__output rename to task__output_backup;
|
||||
|
||||
ALTER TABLE `task__output` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
|
||||
create table task__output
|
||||
(
|
||||
id integer primary key autoincrement,
|
||||
task_id int not null
|
||||
references task
|
||||
on delete cascade,
|
||||
task varchar(255) not null,
|
||||
time datetime not null,
|
||||
output longtext not null
|
||||
);
|
||||
|
||||
insert into task__output(task_id, task, time, output) select * from task__output_backup;
|
||||
|
||||
drop table task__output_backup;
|
||||
|
@ -1,4 +1,4 @@
|
||||
ALTER TABLE user ADD alert BOOLEAN NOT NULL DEFAULT 0 AFTER password;
|
||||
ALTER TABLE project ADD alert BOOLEAN NOT NULL DEFAULT 0 AFTER name;
|
||||
ALTER TABLE `user` ADD `alert` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE `project` ADD `alert` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE user ADD external BOOLEAN NOT NULL DEFAULT 0 AFTER password;
|
||||
ALTER TABLE `user` ADD `external` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
@ -1 +1,25 @@
|
||||
alter table session change ip ip varchar(39) not null default '';
|
||||
-- alter table session change ip ip varchar(39) not null default '';
|
||||
|
||||
|
||||
alter table session rename to session_backup;
|
||||
|
||||
create table session
|
||||
(
|
||||
id integer primary key autoincrement,
|
||||
user_id int not null,
|
||||
created datetime not null,
|
||||
last_active datetime not null,
|
||||
ip varchar(39) default '' not null,
|
||||
user_agent text not null,
|
||||
expired tinyint default '0' not null
|
||||
);
|
||||
|
||||
insert into session select * from session_backup;
|
||||
|
||||
drop table session_backup;
|
||||
|
||||
create index expired
|
||||
on session (expired);
|
||||
|
||||
create index user_id
|
||||
on session (user_id);
|
||||
|
@ -1 +1,17 @@
|
||||
ALTER TABLE `user__token` CHANGE COLUMN `id` `id` VARCHAR(44) NOT NULL;
|
||||
-- ALTER TABLE `user__token` CHANGE COLUMN `id` `id` VARCHAR(44) NOT NULL;
|
||||
|
||||
alter table user__token rename to user__token_backup;
|
||||
|
||||
create table user__token
|
||||
(
|
||||
id varchar(44) not null primary key,
|
||||
created datetime not null,
|
||||
expired tinyint default 0 not null,
|
||||
user_id int not null
|
||||
references `user`
|
||||
on delete cascade
|
||||
);
|
||||
|
||||
insert into user__token select * from user__token_backup;
|
||||
|
||||
drop table user__token_backup;
|
||||
|
@ -1 +1 @@
|
||||
ALTER TABLE project ADD alert_chat varchar(10) DEFAULT '' AFTER alert;
|
||||
ALTER TABLE project ADD alert_chat varchar(10) DEFAULT '';
|
||||
|
@ -1 +1 @@
|
||||
ALTER TABLE user ADD admin BOOLEAN NOT NULL DEFAULT 1 AFTER password;
|
||||
ALTER TABLE `user` ADD `admin` BOOLEAN NOT NULL DEFAULT TRUE;
|
||||
|
@ -1 +1 @@
|
||||
alter table task add `arguments` text null;
|
||||
alter table `task` add `arguments` text null;
|
||||
|
24
db/models.go
24
db/models.go
@ -1,16 +1,16 @@
|
||||
package db
|
||||
|
||||
// SetupDBLink is called by main after initialization of the Mysql object to create or return an existing table map
|
||||
// SetupDBLink is called by main after initialization of the Sql object to create or return an existing table map
|
||||
func SetupDBLink() {
|
||||
Mysql.AddTableWithName(APIToken{}, "user__token").SetKeys(false, "id")
|
||||
Mysql.AddTableWithName(AccessKey{}, "access_key").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Environment{}, "project__environment").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Inventory{}, "project__inventory").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Project{}, "project").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Repository{}, "project__repository").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Task{}, "task").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(TaskOutput{}, "task__output").SetUniqueTogether("task_id", "time")
|
||||
Mysql.AddTableWithName(Template{}, "project__template").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(User{}, "user").SetKeys(true, "id")
|
||||
Mysql.AddTableWithName(Session{}, "session").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(APIToken{}, "user__token").SetKeys(false, "id")
|
||||
Sql.AddTableWithName(AccessKey{}, "access_key").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Environment{}, "project__environment").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Inventory{}, "project__inventory").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Project{}, "project").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Repository{}, "project__repository").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Task{}, "task").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(TaskOutput{}, "task__output").SetUniqueTogether("task_id", "time")
|
||||
Sql.AddTableWithName(Template{}, "project__template").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(User{}, "user").SetKeys(true, "id")
|
||||
Sql.AddTableWithName(Session{}, "session").SetKeys(true, "id")
|
||||
}
|
||||
|
@ -2,17 +2,19 @@ package db
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/ansible-semaphore/semaphore/util"
|
||||
_ "github.com/go-sql-driver/mysql" // imports mysql driver
|
||||
"gopkg.in/gorp.v1"
|
||||
"time"
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/ansible-semaphore/semaphore/util"
|
||||
"github.com/go-gorp/gorp/v3"
|
||||
_ "github.com/go-sql-driver/mysql" // imports mysql driver
|
||||
_ "github.com/lib/pq"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"regexp"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Mysql is the gorp database map
|
||||
// Sql is the gorp database map
|
||||
// db.Connect must be called to set this up correctly
|
||||
var Mysql *gorp.DbMap
|
||||
var Sql *gorp.DbMap
|
||||
|
||||
// DatabaseTimeFormat represents the format that dredd uses to validate the datetime.
|
||||
// This is not the same as the raw value we pass to a new object so
|
||||
@ -29,6 +31,7 @@ func GetParsedTime(t time.Time) time.Time {
|
||||
}
|
||||
return parsedTime
|
||||
}
|
||||
|
||||
// Connect ensures that the db is connected and mapped properly with gorp
|
||||
func Connect() error {
|
||||
db, err := connect()
|
||||
@ -51,38 +54,82 @@ func Connect() error {
|
||||
}
|
||||
}
|
||||
|
||||
Mysql = &gorp.DbMap{Db: db, Dialect: gorp.MySQLDialect{Engine: "InnoDB", Encoding: "UTF8"}}
|
||||
cfg, err := util.Config.GetDBConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var dialect gorp.Dialect
|
||||
|
||||
switch cfg.Dialect {
|
||||
case util.DbDriverMySQL:
|
||||
dialect = gorp.MySQLDialect{Engine: "InnoDB", Encoding: "UTF8"}
|
||||
case util.DbDriverSQLite:
|
||||
dialect = gorp.SqliteDialect{}
|
||||
}
|
||||
|
||||
Sql = &gorp.DbMap{Db: db, Dialect: dialect}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close closes the mysql connection and reports any errors
|
||||
// called from main with a defer
|
||||
func Close() {
|
||||
err := Mysql.Db.Close()
|
||||
err := Sql.Db.Close()
|
||||
if err != nil {
|
||||
log.Warn("Error closing database:" + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func createDb() error {
|
||||
cfg := util.Config.MySQL
|
||||
url := cfg.Username + ":" + cfg.Password + "@tcp(" + cfg.Hostname + ")/?parseTime=true&interpolateParams=true"
|
||||
|
||||
db, err := sql.Open("mysql", url)
|
||||
cfg, err := util.Config.GetDBConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := db.Exec("create database if not exists " + cfg.DbName); err != nil {
|
||||
if !cfg.HasSupportMultipleDatabases() {
|
||||
return nil
|
||||
}
|
||||
|
||||
connectionString, err := cfg.GetConnectionString(false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
db, err := sql.Open(cfg.Dialect.String(), connectionString)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
db.Exec("create database " + cfg.DbName)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func connect() (*sql.DB, error) {
|
||||
cfg := util.Config.MySQL
|
||||
url := cfg.Username + ":" + cfg.Password + "@tcp(" + cfg.Hostname + ")/" + cfg.DbName + "?parseTime=true&interpolateParams=true"
|
||||
cfg, err := util.Config.GetDBConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return sql.Open("mysql", url)
|
||||
connectionString, err := cfg.GetConnectionString(true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
return sql.Open(cfg.Dialect.String(), connectionString)
|
||||
}
|
||||
|
||||
|
||||
var (
|
||||
autoIncrementRE = regexp.MustCompile(`(?i)\bautoincrement\b`)
|
||||
)
|
||||
|
||||
func PrepareMigration(query string) string {
|
||||
switch Sql.Dialect.(type) {
|
||||
case gorp.MySQLDialect:
|
||||
query = autoIncrementRE.ReplaceAllString(query, "auto_increment")
|
||||
}
|
||||
return query
|
||||
}
|
@ -24,7 +24,7 @@ create table ` + "`migrations`" + ` (
|
||||
` + "`version`" + ` varchar(255) not null primary key,
|
||||
` + "`upgraded_date`" + ` datetime null,
|
||||
` + "`notes`" + ` text null
|
||||
) engine=innodb charset=utf8;
|
||||
);
|
||||
`
|
||||
|
||||
// VersionString returns a well formatted string of the current Version
|
||||
@ -66,12 +66,10 @@ func init() {
|
||||
Versions = []*Version{
|
||||
{},
|
||||
{Major: 1},
|
||||
{Major: 1, Minor: 1},
|
||||
{Major: 1, Minor: 2},
|
||||
{Major: 1, Minor: 3},
|
||||
{Major: 1, Minor: 4},
|
||||
{Major: 1, Minor: 5},
|
||||
{Minor: 1},
|
||||
{Major: 1, Minor: 6},
|
||||
{Major: 1, Minor: 7},
|
||||
{Major: 1, Minor: 8},
|
||||
|
10
go.mod
10
go.mod
@ -8,9 +8,10 @@ require (
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
||||
github.com/Sirupsen/logrus v1.0.4
|
||||
github.com/cespare/reflex v0.3.0 // indirect
|
||||
github.com/go-gorp/gorp/v3 v3.0.2
|
||||
github.com/go-openapi/loads v0.19.4
|
||||
github.com/go-openapi/spec v0.19.6
|
||||
github.com/go-sql-driver/mysql v1.3.0
|
||||
github.com/go-sql-driver/mysql v1.4.1
|
||||
github.com/go-swagger/go-swagger v0.22.0 // indirect
|
||||
github.com/go-task/task v2.2.0+incompatible // indirect
|
||||
github.com/gobuffalo/packr v1.10.4
|
||||
@ -27,10 +28,10 @@ require (
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/lann/builder v0.0.0-20180216234317-1b87b36280d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/lib/pq v1.3.0 // indirect
|
||||
github.com/lib/pq v1.8.0
|
||||
github.com/markbates/grift v1.5.0 // indirect
|
||||
github.com/masterminds/squirrel v0.0.0-20170825200431-a6b93000bd21
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.5
|
||||
github.com/mattn/go-zglob v0.0.1 // indirect
|
||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.1 // indirect
|
||||
@ -40,7 +41,7 @@ require (
|
||||
github.com/radovskyb/watcher v1.0.7 // indirect
|
||||
github.com/russross/blackfriday v1.5.2
|
||||
github.com/sirupsen/logrus v1.4.2 // indirect
|
||||
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
|
||||
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa // indirect
|
||||
github.com/spf13/cobra v0.0.5 // indirect
|
||||
github.com/ziutek/mymysql v1.5.4 // indirect
|
||||
golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340
|
||||
@ -49,7 +50,6 @@ require (
|
||||
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20170511165959-379148ca0225 // indirect
|
||||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
|
||||
gopkg.in/gorp.v1 v1.7.1
|
||||
gopkg.in/ldap.v2 v2.5.1
|
||||
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528 // indirect
|
||||
mvdan.cc/sh v2.6.4+incompatible // indirect
|
||||
|
136
go.sum
136
go.sum
@ -1,16 +1,10 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
|
||||
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
|
||||
github.com/Masterminds/vcs v1.13.1 h1:NL3G1X7/7xduQtA2sJLpVpfHTNBALVNSjob6KEjPXNQ=
|
||||
github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
|
||||
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
@ -19,29 +13,16 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko
|
||||
github.com/Sirupsen/logrus v1.0.4 h1:yilvuj073Hm7wwwz12E96GjrdivMNuTMJk9ddjde+D8=
|
||||
github.com/Sirupsen/logrus v1.0.4/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U=
|
||||
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
|
||||
github.com/alecthomas/gometalinter v3.0.0+incompatible h1:e9Zfvfytsw/e6Kd/PYd75wggK+/kX5Xn8IYDUKyc5fU=
|
||||
github.com/alecthomas/gometalinter v3.0.0+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
|
||||
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f h1:y2hSFdXeA1y5z5f0vfNO0Dg5qVY036qzlz3Pds0B92o=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0=
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/boltdb/bolt v1.1.0/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
|
||||
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/cespare/reflex v0.2.0 h1:6d9WpWJseKjJvZEevKP7Pk42nPx2+BUTqmhNk8wZPwM=
|
||||
github.com/cespare/reflex v0.2.0/go.mod h1:ooqOLJ4algvHP/oYvKWfWJ9tFUzCLDk5qkIJduMYrgI=
|
||||
github.com/cespare/reflex v0.3.0 h1:9q8ZXMh+oW4quohPBcLsT56TFl4/DeQsTjZASe4wgoY=
|
||||
github.com/cespare/reflex v0.3.0/go.mod h1:I+0Pnu2W693i7Hv6ZZG76qHTY0mgUa7uCIfCtikXojE=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
@ -55,12 +36,9 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
@ -71,11 +49,11 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/go-gorp/gorp/v3 v3.0.2 h1:ULqJXIekoqMx29FI5ekXXFoH1dT2Vc8UhnRzBg+Emz4=
|
||||
github.com/go-gorp/gorp/v3 v3.0.2/go.mod h1:BJ3q1ejpV8cVALtcXvXaXyTOlMmJhWDxTmncaR6rwBY=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-openapi/analysis v0.0.0-20180126163718-f59a71f0ece6 h1:52PeQi3V1whLu/QUj5yErwGzO3+qcxR7FgIe4B88Yas=
|
||||
github.com/go-openapi/analysis v0.0.0-20180126163718-f59a71f0ece6/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
||||
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
||||
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
||||
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
||||
@ -84,8 +62,6 @@ github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9sn
|
||||
github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
|
||||
github.com/go-openapi/analysis v0.19.7 h1:OcMMVVJBRiSsAkXQwSVL4sRrVaqeqPnOcy1Kw0JI47w=
|
||||
github.com/go-openapi/analysis v0.19.7/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
|
||||
github.com/go-openapi/errors v0.0.0-20171226161601-7bcb96a367ba h1:LiBJivCSkIa8fmEiRP/+qftG2ywqavn9M8H2bEOaeRU=
|
||||
github.com/go-openapi/errors v0.0.0-20171226161601-7bcb96a367ba/go.mod h1:La0D2x9HoXenv7MDEiAv6vWoe84CXFo0PQRk/jdQlww=
|
||||
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
|
||||
github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
|
||||
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
|
||||
@ -93,22 +69,16 @@ github.com/go-openapi/errors v0.19.3 h1:7MGZI1ibQDLasvAz8HuhvYk9eNJbJkCOXWsSjjMS
|
||||
github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
|
||||
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
|
||||
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
|
||||
github.com/go-openapi/jsonpointer v0.0.0-20180322222829-3a0015ad55fa h1:hr8WVDjg4JKtQptZpzyb196TmruCs7PIsdJz8KAOZp8=
|
||||
github.com/go-openapi/jsonpointer v0.0.0-20180322222829-3a0015ad55fa/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
|
||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
|
||||
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
|
||||
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||
github.com/go-openapi/jsonreference v0.0.0-20180322222742-3fb327e6747d h1:k3UQ7Z8yFYq0BNkYykKIheY0HlZBl1Hku+pO9HE9FNU=
|
||||
github.com/go-openapi/jsonreference v0.0.0-20180322222742-3fb327e6747d/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
|
||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
|
||||
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
|
||||
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
|
||||
github.com/go-openapi/loads v0.0.0-20171207192234-2a2b323bab96 h1:ErY3tAaYwmcVoQJOJMnIXw+d4BRjD4Y0BnjOvNMlaEk=
|
||||
github.com/go-openapi/loads v0.0.0-20171207192234-2a2b323bab96/go.mod h1:5qFWh9T8iTbMizjsoC/EHEN3onRy+cfNRw/wV1iX1Og=
|
||||
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
@ -116,23 +86,17 @@ github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix
|
||||
github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI=
|
||||
github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY=
|
||||
github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk=
|
||||
github.com/go-openapi/runtime v0.0.0-20180325232944-62281b694b39 h1:pw1tMLigauT6VKg0T02/Onmyr/cP3kGIMnE5JskZ/Ho=
|
||||
github.com/go-openapi/runtime v0.0.0-20180325232944-62281b694b39/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
|
||||
github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
|
||||
github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64=
|
||||
github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4=
|
||||
github.com/go-openapi/runtime v0.19.11 h1:6J11dQiIV+BOLlMbk2YmM8RvGaOU38syeqy62qhh3W8=
|
||||
github.com/go-openapi/runtime v0.19.11/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo=
|
||||
github.com/go-openapi/spec v0.0.0-20180406021525-370d9e047557 h1:Ei7di4gBu0PDPYNaXLNjLIhoM/Vs0ti7/bcEx2oktPQ=
|
||||
github.com/go-openapi/spec v0.0.0-20180406021525-370d9e047557/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
|
||||
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||
github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
|
||||
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
|
||||
github.com/go-openapi/spec v0.19.6 h1:rMMMj8cV38KVXK7SFc+I2MWClbEfbK705+j+dyqun5g=
|
||||
github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
|
||||
github.com/go-openapi/strfmt v0.0.0-20180407011102-481808443b00 h1:LpT8zb0lM93rm4LW+t7uLbXIrSzmIAtviiZKxM/Eqyc=
|
||||
github.com/go-openapi/strfmt v0.0.0-20180407011102-481808443b00/go.mod h1:/bCWipNKhC9QMhD8HRe2EGbU8G0D4Yvh0G6X4k1Xwvg=
|
||||
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
|
||||
github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
|
||||
github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
|
||||
@ -140,44 +104,35 @@ github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6
|
||||
github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
|
||||
github.com/go-openapi/strfmt v0.19.4 h1:eRvaqAhpL0IL6Trh5fDsGnGhiXndzHFuA05w6sXH6/g=
|
||||
github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
|
||||
github.com/go-openapi/swag v0.0.0-20180405201759-811b1089cde9 h1:+vsw187FKvA2QUGAcE+vQSfyxqLbUXixPYRRMAzwu04=
|
||||
github.com/go-openapi/swag v0.0.0-20180405201759-811b1089cde9/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
|
||||
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s=
|
||||
github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
|
||||
github.com/go-openapi/validate v0.0.0-20180222165948-180bba53b988 h1:Jy58Mmccfgw40J7sbKNPa7745zWz6eumts+j/3Fw2yU=
|
||||
github.com/go-openapi/validate v0.0.0-20180222165948-180bba53b988/go.mod h1:ve8xoSHgqBUifiKgaVbxLmOE0ckvH0oXfsJcnm6SIz0=
|
||||
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
|
||||
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
|
||||
github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo=
|
||||
github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0=
|
||||
github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
|
||||
github.com/go-sql-driver/mysql v1.3.0 h1:pgwjLi/dvffoP9aabwkT3AKpXQM93QARkjFhDDqC1UE=
|
||||
github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-swagger/go-swagger v0.22.0 h1:fmxYtQApxwihSPm7AgmbC9j+8TEHvo2qF9CCwd94tsY=
|
||||
github.com/go-swagger/go-swagger v0.22.0/go.mod h1:oxqE9wp02iY/dPItv6ILU8xSRplSOKO1bkyqJT7jYRE=
|
||||
github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0=
|
||||
github.com/go-task/task v2.2.0+incompatible h1:DZKXIQSQxtljkYs0c7eHnkIIW7vv21QP34JasqweDHQ=
|
||||
github.com/go-task/task v2.2.0+incompatible/go.mod h1:WyV7F6+y7wLkLi6A4PuKjvdgnvD9m4wtd42a2QK+Pik=
|
||||
github.com/gobuffalo/here v0.4.0/go.mod h1:bTNk/uKZgycuB358iR0D32dI9kHBClBGpXjW2HVHkNo=
|
||||
github.com/gobuffalo/packr v1.10.4 h1:k/aQq1+9UlSxfr9+QXz1sQ8vJVFTXqrEDdKgeonlt4Y=
|
||||
github.com/gobuffalo/packr v1.10.4/go.mod h1:rYwMLC6NXbAbkKb+9j3NTKbxSswkKLlelZYccr4HYVw=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/golang/dep v0.5.4 h1:WfV5qbGwsBNUDhk+pfI6emWm7SdDFsnSWkqCMNG3BRs=
|
||||
github.com/golang/dep v0.5.4/go.mod h1:6RZ2Wai7dSWk7qL55sDYk+8UPFqcW7all2KDBraPPFA=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
@ -187,25 +142,17 @@ github.com/google/go-github v15.0.0+incompatible h1:jlPg2Cpsxb/FyEV/MFiIE9tW/2RA
|
||||
github.com/google/go-github v15.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0=
|
||||
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f h1:9oNbS1z4rVpbnkHBdPZU4jo9bSmrLpII768arSyMFgk=
|
||||
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/handlers v1.3.0 h1:tsg9qP3mjt1h4Roxp+M1paRjrVBfPSOpBuVclh6YluI=
|
||||
github.com/gorilla/handlers v1.3.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
|
||||
github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
|
||||
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
|
||||
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
|
||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||
github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ=
|
||||
github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
@ -215,17 +162,12 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 h1:FdBGmSkD2QpQzRWup//SGObvWf2nq89zj9+ta9OvI3A=
|
||||
github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5/go.mod h1:0YZ2wQSuwviXXXGUiK6zXzskyBLAbLXhamxzcFHSLoM=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.3.0 h1:gvV6jG9dTgFEncxo+AF7PH6MZXi/vZl25owA/8Dg8Wo=
|
||||
github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
|
||||
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jmank88/nuts v0.4.0 h1:3rHp+7YcvtkTPohGBA++MwneB9OlX/rpORvleiRivMQ=
|
||||
github.com/jmank88/nuts v0.4.0/go.mod h1:TKOSbm0p73pdAzgQ7lcZheG2cinZiXqy60KM5ooL3j8=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
@ -233,30 +175,25 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=
|
||||
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
|
||||
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lann/builder v0.0.0-20180216234317-1b87b36280d0 h1:2KbkALbvz9OAr38ObGXxhv+RsCZqrM+9LnEnyP+7bqU=
|
||||
github.com/lann/builder v0.0.0-20180216234317-1b87b36280d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
|
||||
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg=
|
||||
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mailru/easyjson v0.0.0-20180323154445-8b799c424f57 h1:qhv1ir3dIyOFmFU+5KqG4dF3zSQTA4nn1DFhu2NQC44=
|
||||
github.com/mailru/easyjson v0.0.0-20180323154445-8b799c424f57/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
@ -267,46 +204,34 @@ github.com/markbates/grift v1.5.0 h1:CZyK0k+8BdhQMgbwzuKMysC12y4tf9H004jAs/FutX4
|
||||
github.com/markbates/grift v1.5.0/go.mod h1:1ssFm5gSGmzTkhi3Wfh/nqlU74J73TlAjoDMttQbpfY=
|
||||
github.com/masterminds/squirrel v0.0.0-20170825200431-a6b93000bd21 h1:w47+aNPtN+7t4e6gj+eUZSq6bqYNg9kL7cqD+qGuuk8=
|
||||
github.com/masterminds/squirrel v0.0.0-20170825200431-a6b93000bd21/go.mod h1:Fi8RAcr1PtWoCRbIbnhIaWym7iR0+AygGf/+VFYG7Jc=
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-zglob v0.0.1 h1:xsEx/XUoVlI6yXjqBK062zYhRTZltCNmYPx6v+8DNaY=
|
||||
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-sqlite3 v1.14.5 h1:1IdxlwTNazvbKJQSxoJ5/9ECbEeaTTyeU7sEAZ5KKTQ=
|
||||
github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
|
||||
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
|
||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 h1:+MZW2uvHgN8kYvksEN3f7eFL2wpzk0GxmlFsMybWc7E=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
|
||||
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE=
|
||||
github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/nicksnyder/go-i18n v2.0.3+incompatible h1:XCCaWsCoy4KlWkhOr+63dkv6oJmitJ573uJqDBAiFiQ=
|
||||
github.com/nightlyone/lockfile v0.0.0-20200124072040-edb130adc195 h1:7YfJY2KC0mYYfbonhhrWGufXX9m96DAOC8bRyZOBEr8=
|
||||
github.com/nightlyone/lockfile v0.0.0-20200124072040-edb130adc195/go.mod h1:JbxfV1Iifij2yhRjXai0oFrbpxszXHRx1E5RuM26o4Y=
|
||||
github.com/ogier/pflag v0.0.1 h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750=
|
||||
github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU=
|
||||
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
|
||||
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
|
||||
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=
|
||||
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
|
||||
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/poy/onpar v0.0.0-20190519213022-ee068f8ea4d1/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU=
|
||||
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
@ -317,18 +242,12 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/radovskyb/watcher v1.0.7 h1:AYePLih6dpmS32vlHfhCeli8127LzkIgwJGcwwe8tUE=
|
||||
github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/russross/blackfriday v1.5.1 h1:B8ZN6pD4PVofmlDCDUdELeYrbsVIDM/bpjW3v3zgcRc=
|
||||
github.com/russross/blackfriday v1.5.1/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353 h1:tnWWLf0nI2TI62Wd/ZOea4XYqE+y1sf2pdm+VItsc0c=
|
||||
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353/go.mod h1:5HStXbIikwtDAgAIqiQIqVgMn7mlvZa6PTpwiAVYGYg=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
@ -347,7 +266,6 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
@ -359,7 +277,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
@ -372,7 +289,6 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
|
||||
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
|
||||
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
@ -383,17 +299,13 @@ go.mongodb.org/mongo-driver v1.2.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
golang.org/x/crypto v0.0.0-20180308185624-c7dcf104e3a7 h1:c9Tyi4qyEZwEJ1+Zm6Fcqf+68wmUdMzfXYTp3s8Nzg8=
|
||||
golang.org/x/crypto v0.0.0-20180308185624-c7dcf104e3a7/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d h1:9FCpayM9Egr1baVnV1SX0H87m+XB0B8S0hAMi99X/3U=
|
||||
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340 h1:KOcEaR10tFr7gdJV2GCKw8Os5yED1u1aOqHjOAb6d2Y=
|
||||
golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -402,7 +314,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -418,15 +329,11 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@ -439,17 +346,12 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
@ -464,9 +366,6 @@ golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgw
|
||||
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20200131211209-ecb101ed6550 h1:3Kc3/T5DQ/majKzDmb+0NzmbXFhKLaeDTp3KqVPV5Eo=
|
||||
golang.org/x/tools v0.0.0-20200131211209-ecb101ed6550/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207224406-61798d64f025 h1:i84/3szN87uN9jFX/jRqUbszQto2oAsFlqPf6lbR8H4=
|
||||
golang.org/x/tools v0.0.0-20200207224406-61798d64f025/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
@ -475,41 +374,28 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo=
|
||||
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780 h1:CEBpW6C191eozfEuWdUmIAHn7lwlLxJ7HVdr2e2Tsrw=
|
||||
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20170511165959-379148ca0225 h1:JBwmEvLfCqgPcIq8MjVMQxsF3LVL4XG/HH0qiG0+IFY=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20170511165959-379148ca0225/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0=
|
||||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
|
||||
gopkg.in/gorp.v1 v1.7.1 h1:GBB9KrWRATQZh95HJyVGUZrWwOPswitEYEyqlK8JbAA=
|
||||
gopkg.in/gorp.v1 v1.7.1/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw=
|
||||
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.52.0 h1:j+Lt/M1oPPejkniCg1TkWE2J3Eh1oZTsHSXzMTzUXn4=
|
||||
gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU=
|
||||
gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk=
|
||||
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528 h1:/saqWwm73dLmuzbNhe92F0QsZ/KiFND+esHco2v1hiY=
|
||||
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
mvdan.cc/sh v2.6.4+incompatible h1:eD6tDeh0pw+/TOTI1BBEryZ02rD2nMcFsgcvde7jffM=
|
||||
mvdan.cc/sh v2.6.4+incompatible/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8=
|
||||
|
117
util/config.go
117
util/config.go
@ -3,6 +3,7 @@ package util
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
@ -37,11 +38,19 @@ const (
|
||||
shortPos = "y"
|
||||
)
|
||||
|
||||
type mySQLConfig struct {
|
||||
Hostname string `json:"host"`
|
||||
Username string `json:"user"`
|
||||
Password string `json:"pass"`
|
||||
DbName string `json:"name"`
|
||||
type DbDriver int
|
||||
|
||||
const (
|
||||
DbDriverMySQL DbDriver = iota
|
||||
DbDriverSQLite
|
||||
)
|
||||
|
||||
type DbConfig struct {
|
||||
Dialect DbDriver `json:"-"`
|
||||
Hostname string `json:"host"`
|
||||
Username string `json:"user"`
|
||||
Password string `json:"pass"`
|
||||
DbName string `json:"name"`
|
||||
}
|
||||
|
||||
type ldapMappings struct {
|
||||
@ -53,7 +62,9 @@ type ldapMappings struct {
|
||||
|
||||
//ConfigType mapping between Config and the json file that sets it
|
||||
type ConfigType struct {
|
||||
MySQL mySQLConfig `json:"mysql"`
|
||||
MySQL DbConfig `json:"mysql"`
|
||||
SQLite DbConfig `json:"sqlite"`
|
||||
|
||||
// Format `:port_num` eg, :3000
|
||||
// if : is missing it will be corrected
|
||||
Port string `json:"port"`
|
||||
@ -145,7 +156,7 @@ func ConfigInit() {
|
||||
|
||||
if printConfig {
|
||||
cfg := &ConfigType{
|
||||
MySQL: mySQLConfig{
|
||||
MySQL: DbConfig{
|
||||
Hostname: "127.0.0.1:3306",
|
||||
Username: "root",
|
||||
DbName: "semaphore",
|
||||
@ -246,6 +257,61 @@ func decodeConfig(file io.Reader) {
|
||||
}
|
||||
}
|
||||
|
||||
func (d DbDriver) String() string {
|
||||
return [...]string{"mysql", "sqlite3"}[d]
|
||||
}
|
||||
|
||||
func (d *DbConfig) isPresent() bool {
|
||||
return d.Hostname != ""
|
||||
}
|
||||
|
||||
func (d *DbConfig) HasSupportMultipleDatabases() bool {
|
||||
return d.Dialect != DbDriverSQLite
|
||||
}
|
||||
|
||||
func (d *DbConfig) GetConnectionString(includeDbName bool) (connectionString string, err error) {
|
||||
switch d.Dialect {
|
||||
case DbDriverMySQL:
|
||||
if includeDbName {
|
||||
connectionString = fmt.Sprintf(
|
||||
"%s:%s@tcp(%s)/%s?parseTime=true&interpolateParams=true",
|
||||
d.Username,
|
||||
d.Password,
|
||||
d.Hostname,
|
||||
d.DbName)
|
||||
} else {
|
||||
connectionString = fmt.Sprintf(
|
||||
"%s:%s@tcp(%s)?parseTime=true&interpolateParams=true",
|
||||
d.Username,
|
||||
d.Password,
|
||||
d.Hostname)
|
||||
}
|
||||
case DbDriverSQLite:
|
||||
if includeDbName {
|
||||
connectionString = fmt.Sprintf("file://%s?&cache=shared", d.Hostname)
|
||||
} else {
|
||||
err = errors.New("sqlite3 not support multiple databases and argument includeDbName can not be false")
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("unsupported database driver: %s", d.Dialect)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (conf *ConfigType) GetDBConfig() (dbConfig DbConfig, err error) {
|
||||
switch {
|
||||
case conf.MySQL.isPresent():
|
||||
dbConfig = conf.MySQL
|
||||
dbConfig.Dialect = DbDriverMySQL
|
||||
case conf.SQLite.isPresent():
|
||||
dbConfig = conf.SQLite
|
||||
dbConfig.Dialect = DbDriverSQLite
|
||||
default:
|
||||
err = errors.New("database configuration not found")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//GenerateCookieSecrets generates cookie secret during setup
|
||||
func (conf *ConfigType) GenerateCookieSecrets() {
|
||||
hash := securecookie.GenerateRandomKey(32)
|
||||
@ -255,8 +321,8 @@ func (conf *ConfigType) GenerateCookieSecrets() {
|
||||
conf.CookieEncryption = base64.StdEncoding.EncodeToString(encryption)
|
||||
}
|
||||
|
||||
//nolint: gocyclo
|
||||
func (conf *ConfigType) Scan() {
|
||||
func (conf *ConfigType) ScanMySQL() {
|
||||
|
||||
fmt.Print(" > DB Hostname (default 127.0.0.1:3306): ")
|
||||
ScanErrorChecker(fmt.Scanln(&conf.MySQL.Hostname))
|
||||
if len(conf.MySQL.Hostname) == 0 {
|
||||
@ -277,6 +343,39 @@ func (conf *ConfigType) Scan() {
|
||||
if len(conf.MySQL.DbName) == 0 {
|
||||
conf.MySQL.DbName = "semaphore"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func (conf *ConfigType) ScanSQLite() {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
|
||||
if err == nil {
|
||||
fmt.Print(" > DB file path (default " + homeDir + "/semaphore.sqlite): ")
|
||||
ScanErrorChecker(fmt.Scanln(&conf.SQLite.Hostname))
|
||||
if len(conf.SQLite.Hostname) == 0 {
|
||||
conf.SQLite.Hostname = homeDir + "/semaphore.sqlite"
|
||||
}
|
||||
} else {
|
||||
fmt.Print(" > DB file path (for example /path/to/the/file.sqlite): ")
|
||||
ScanErrorChecker(fmt.Scanln(&conf.SQLite.Hostname))
|
||||
}
|
||||
}
|
||||
|
||||
//nolint: gocyclo
|
||||
func (conf *ConfigType) Scan() {
|
||||
db := 1
|
||||
fmt.Println(" > DB")
|
||||
fmt.Println(" 1 - MySQL")
|
||||
fmt.Println(" 2 - SQLite")
|
||||
fmt.Print(" (default 1): ")
|
||||
ScanErrorChecker(fmt.Scanln(&db))
|
||||
|
||||
switch db {
|
||||
case 1:
|
||||
conf.ScanMySQL()
|
||||
case 2:
|
||||
conf.ScanSQLite()
|
||||
}
|
||||
|
||||
fmt.Print(" > Playbook path (default /tmp/semaphore): ")
|
||||
ScanErrorChecker(fmt.Scanln(&conf.TmpPath))
|
||||
|
@ -49,7 +49,7 @@ func GetIntParam(name string, w http.ResponseWriter, r *http.Request) (int, erro
|
||||
// and move on
|
||||
func ScanErrorChecker(n int, err error) {
|
||||
if err != nil {
|
||||
log.Warn("An input error occured:" + err.Error())
|
||||
log.Warn("An input error occurred:" + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,6 +543,7 @@ export default {
|
||||
color: 'error',
|
||||
text: getErrorMessage(err),
|
||||
});
|
||||
await this.signOut();
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user