From ed7c2d2c77d42b93f270ab28a22c5a11038e2c13 Mon Sep 17 00:00:00 2001 From: blacktop Date: Mon, 15 May 2017 19:48:18 -0600 Subject: [PATCH] fix config updater --- .release/RELEASE.md | 1 + .release/VERSION | 2 +- config/bindata.go | 4 ++-- config/config.toml | 3 +-- config/load.go | 5 +---- plugins/bindata.go | 24 ++++++++++++------------ 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.release/RELEASE.md b/.release/RELEASE.md index ba58afbc..80ee4c34 100644 --- a/.release/RELEASE.md +++ b/.release/RELEASE.md @@ -13,6 +13,7 @@ Changelog - [x] monitor logs to output important info as to why it might not start (not enough RAM etc) - [x] add `~/.malice/logs/elastic.log` to catch ES errors - [x] fix `plugin update --all` to only update **enabled** plugins +- [x] fix config.toml updater Plugin list ----------- diff --git a/.release/VERSION b/.release/VERSION index 600e6fd3..f54b2430 100644 --- a/.release/VERSION +++ b/.release/VERSION @@ -1 +1 @@ -v0.3.3 +v0.3.4 diff --git a/config/bindata.go b/config/bindata.go index 1c3e1820..585607ce 100644 --- a/config/bindata.go +++ b/config/bindata.go @@ -68,7 +68,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _configConfigToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x93\x4f\x6f\xdb\x3c\x0c\xc6\xef\xfa\x14\x84\x73\x79\x5f\x60\x75\x1c\xbb\x5d\x3a\x03\x39\x14\x45\x0f\x1d\xd6\x0d\x68\x8f\x41\x31\xd0\x36\x63\x0b\x91\x44\x43\x92\xd3\x3f\x9f\x7e\xa0\x92\xb6\x0b\xd6\xc3\x06\xd4\x39\x28\xd2\x43\xf2\xf9\x91\xb2\x67\x70\xc9\xe3\x93\xd7\xfd\x10\xe1\xbf\xf6\x7f\x28\x8b\x45\x05\x27\xb2\x2c\xa1\x31\xd8\x6e\x23\x8f\xf0\x95\xc3\x30\x21\xdc\xa0\x76\xf4\x09\x2e\x8c\x81\x5b\x49\x08\x70\x4b\x81\xfc\x8e\xba\x5c\xcd\xe0\x8e\x08\xbe\x5d\x5f\x5e\x7d\xbf\xbb\x82\x0d\x7b\x30\xba\x25\x17\x08\xb4\xdb\xb0\xb7\x18\x35\xbb\x5c\xa9\xd9\xc7\x3c\x6a\x06\x37\x17\xe2\x06\x97\xec\x36\xba\x9f\x7c\x32\x80\x7f\xaf\xf3\x41\x3c\x2a\xea\x68\x08\x56\x90\xdd\xa0\x74\x0e\xb7\x93\x8b\xda\xd2\x31\x5f\xa6\x76\xe4\x83\x80\xae\x20\xdb\x15\x79\x95\x97\x99\x52\x6b\x9c\xe2\xc0\xfe\x5e\x01\x38\xb4\xa9\xc8\xcb\xe8\x33\x05\xc0\xbe\x47\xa7\x9f\xf7\x0d\xbe\x1a\x5c\xff\x90\xcc\x07\x6a\x24\x6d\xf2\x46\x94\x22\x4f\xbf\xfa\xbc\x90\x3c\xec\xac\x76\x3f\x0f\xd2\xa2\x5c\x26\x71\x51\x57\x55\x55\x49\x2a\x59\xd4\x46\x92\x07\x0e\x51\x42\x82\x8d\x63\x4e\x8f\x68\x47\x43\x79\xcb\x56\x6a\x8c\xec\x45\x2b\xcf\xc4\x24\x90\x97\x38\x59\x85\x33\xe9\x18\x82\x9c\xc9\xfa\xc0\xbe\x93\xc2\x1d\x46\x6c\x30\xd0\xef\xfd\xd8\xc4\x7c\x42\x06\x43\xd4\xad\x64\x6a\x8b\xfd\x51\xab\xf3\x83\x18\x08\x7d\x3b\xd4\x67\x79\x25\x61\xe9\xfd\x4a\xb6\x86\x5b\x34\xc2\xfa\xc2\x25\xc6\xeb\x2f\x65\x51\x88\x91\xcc\x9a\xa7\xc4\x5a\x28\x00\x72\xd8\x18\xea\x60\x05\xd1\x4f\xa4\xd4\x7a\xd2\xef\xe0\x6c\x75\x83\x0e\xdf\xa7\xd9\x6b\xf5\x3e\xf2\x6f\x48\x4e\x4f\xab\xfb\xf7\x9c\xc9\xed\xb4\x67\x67\xc9\x45\xd1\xfd\x94\x2e\xb1\xa3\x1d\x19\x1e\xe5\x34\xcd\x8c\xdb\x2d\xa5\x37\xc0\x62\x3b\x68\x47\x27\xc7\xa8\x59\xaa\xdc\x8d\xac\x5d\xba\xab\xd8\x8e\xf5\x7c\xfe\x0a\x52\x97\xd5\xf2\x73\x76\x34\x86\x45\x9a\x43\xa3\x5d\x17\xde\xca\xd4\x73\x8b\xe6\x01\x3d\xd5\x9e\x25\xdc\x68\xb7\x0d\x7f\xde\x4f\x7d\x74\x15\x12\xd8\x8e\x13\xac\xe0\xac\x38\x3c\xc2\x49\x96\xfd\x93\x1c\x96\xa7\xe5\xf9\xb9\x1c\xaa\xb5\xe1\xbe\xdf\xb7\xb1\xd1\x86\x8e\x5b\xc8\x0d\xf7\x59\x6a\xf0\x31\xe8\x67\x11\x16\xc5\x7e\xbb\x1f\x7d\x75\xd8\x35\xd8\x6e\xa7\x51\xa8\x96\x42\x28\x2d\xa6\x0f\x69\x05\x1b\x34\x41\x26\x3a\x7a\x7e\x7c\x7a\x9b\xf5\xab\x02\x30\xc4\x38\x8a\x63\x76\xf8\x1f\x5e\x36\xbf\x02\x00\x00\xff\xff\x00\x99\xc5\x5b\xe7\x04\x00\x00") +var _configConfigToml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x93\x4d\x6f\xdb\x3c\x0c\xc7\xef\xfa\x14\x84\x73\x79\x1e\x60\x75\x1c\x3b\x5d\x3a\x03\x39\x14\x45\x0f\x1d\xd6\x0d\x68\x8f\x41\x31\xd0\x36\x63\x0b\xd1\x1b\x24\x39\x7d\xf9\xf4\x03\xe5\xb4\x5d\xb0\x1c\x36\xa0\xce\x41\x91\xfe\x24\xff\x3f\x52\xf6\x0c\xae\xac\x7b\xf6\xb2\x1f\x22\xfc\xd7\xfe\x0f\x65\xb1\xa8\xe0\x8c\x97\x15\x34\x0a\xdb\x5d\xb4\x0e\xbe\xda\x30\x8c\x08\xb7\x28\x0d\x7d\x82\x4b\xa5\xe0\x8e\x13\x02\xdc\x51\x20\xbf\xa7\x2e\x17\x33\xb8\x27\x82\x6f\x37\x57\xd7\xdf\xef\xaf\x61\x6b\x3d\x28\xd9\x92\x09\x04\xd2\x6c\xad\xd7\x18\xa5\x35\xb9\x10\xb3\x8f\x79\xc4\x0c\x6e\x2f\xd9\x0d\xae\xac\xd9\xca\x7e\xf4\xc9\x00\xfe\xbd\xce\x07\xf1\x88\x28\xa3\x22\x58\x43\x76\x8b\xdc\x39\xdc\x8d\x26\x4a\x4d\xc7\x7c\x99\xd8\x93\x0f\x0c\xba\x86\x6c\x5f\xe4\x55\xbe\xcc\x84\xd8\xe0\x18\x07\xeb\x1f\x04\x80\x41\x9d\x8a\xbc\x8e\x3e\x13\x00\xd6\xf7\x68\xe4\xcb\xd4\xe0\x9b\xc1\xcd\x0f\xce\x7c\xa4\x86\xd3\x46\xaf\x58\x29\xf2\xf4\xab\x2f\x0a\xce\xc3\x4e\x4b\xf3\xf3\x20\x2d\xca\x55\x12\x17\x75\x55\x55\x15\xa7\x92\x46\xa9\x38\x79\xb0\x21\x72\x48\xd0\xd1\xe5\xf4\x84\xda\x29\xca\x5b\xab\xb9\x86\xb3\x9e\xb5\xf2\x9c\x4d\x02\x79\x8e\xe3\x95\x39\x93\x8e\x21\xf0\x19\xaf\x8f\xd6\x77\x5c\xb8\xc3\x88\x0d\x06\xfa\xbd\x1f\x9d\x98\xcf\x48\x61\x88\xb2\xe5\x4c\xa9\xb1\x3f\x6a\x75\x7e\x10\x03\xa1\x6f\x87\xfa\x3c\xaf\x38\x2c\xbd\x5f\xc9\x56\xd9\x16\x15\xb3\xbe\x72\xb1\xf1\xe6\x4b\x59\x14\x6c\xc4\xb3\xb6\x63\x62\x2d\x04\x00\x19\x6c\x14\x75\xb0\x86\xe8\x47\x12\x62\x33\xca\x13\x38\x3b\xd9\xa0\xc1\xd3\x34\x93\x56\x4f\x91\x7f\x43\xb2\x5c\x56\x0f\xa7\x9c\xc9\xec\xa5\xb7\x46\x93\x89\xac\xfb\x31\x5d\x62\x47\x7b\x52\xd6\xf1\x69\x9a\x99\x6d\x77\x94\xde\x00\x8d\xed\x20\x0d\x9d\x1d\xa3\x66\xa9\x72\xe7\xac\x34\xe9\xae\x62\xeb\xea\xf9\xfc\x0d\xa4\x2e\xab\xd5\xe7\xec\x68\x0c\x8b\x34\x87\x46\x9a\x2e\xbc\x97\xa9\xe7\x1a\xd5\x23\x7a\xaa\xbd\xe5\x70\x25\xcd\x2e\xfc\x79\x3f\xf5\xd1\x55\x70\x60\xeb\x46\x58\xc3\x79\x71\x78\x98\x93\xb4\xf5\xcf\x7c\x58\x2e\xcb\x8b\x0b\x3e\x14\x1b\x65\xfb\x7e\x6a\x63\x2b\x15\x1d\xb7\x90\x2b\xdb\x67\xa9\xc1\xa7\x20\x5f\x58\x58\x14\xd3\x76\x1a\x7d\x75\xd8\x35\xd8\xee\x46\xc7\x54\x2b\x26\xe4\x16\xd3\x87\xb4\x86\x2d\xaa\xc0\x13\x75\xde\x3e\x3d\xbf\xcf\xfa\x4d\x01\x18\x62\x74\xec\x98\x1d\xfe\x87\x69\xf3\x2b\x00\x00\xff\xff\x13\x66\x6a\x77\xe5\x04\x00\x00") func configConfigTomlBytes() ([]byte, error) { return bindataRead( @@ -83,7 +83,7 @@ func configConfigToml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/config.toml", size: 1255, mode: os.FileMode(420), modTime: time.Unix(1492820498, 0)} + info := bindataFileInfo{name: "config/config.toml", size: 1253, mode: os.FileMode(420), modTime: time.Unix(1494899155, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/config/config.toml b/config/config.toml index b6065274..8d6eccaa 100644 --- a/config/config.toml +++ b/config/config.toml @@ -6,7 +6,7 @@ ####################################################################### title = "Malice Runtime Configuration" -version = "v0.3.2" +version = "v0.3.4" [author] name = "blacktop" @@ -60,4 +60,3 @@ version = "v0.3.2" enable = false http = "" https = "" - \ No newline at end of file diff --git a/config/load.go b/config/load.go index d6a4ff8b..6927b898 100644 --- a/config/load.go +++ b/config/load.go @@ -123,15 +123,12 @@ func loadFromToml(configPath, version string) { log.Debugf("config.toml version: %s, malice version: %s", Conf.Version, version) if version != "dev" && !strings.EqualFold(Conf.Version, version) { // Prompt user to update malice config.toml? - log.Info("Newer version of malice config.toml available: ", version) + log.Infof("Newer version of malice config.toml available: %s, you currently have %s", version, Conf.Version) fmt.Println("Would you like to update now? (yes/no)") if utils.AskForConfirmation() { log.Debug("Updating config: ", configPath) er.CheckError(UpdateConfig()) } - log.Info("Newer version of malice config available: ", version) - log.Debug("Updating config: ", configPath) - er.CheckError(UpdateConfig()) } } diff --git a/plugins/bindata.go b/plugins/bindata.go index 08f8f7f0..de3bb557 100644 --- a/plugins/bindata.go +++ b/plugins/bindata.go @@ -94,7 +94,7 @@ func pluginsPluginsToml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/plugins.toml", size: 6479, mode: os.FileMode(420), modTime: time.Unix(1492320514, 0)} + info := bindataFileInfo{name: "plugins/plugins.toml", size: 6479, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -114,7 +114,7 @@ func pluginsTemplatesPythonDockerignore() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/.dockerignore", size: 106, mode: os.FileMode(420), modTime: time.Unix(1475951558, 0)} + info := bindataFileInfo{name: "plugins/templates/python/.dockerignore", size: 106, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -134,7 +134,7 @@ func pluginsTemplatesPythonGitignoreTemplate() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/.gitignore.template", size: 712, mode: os.FileMode(493), modTime: time.Unix(1475952964, 0)} + info := bindataFileInfo{name: "plugins/templates/python/.gitignore.template", size: 712, mode: os.FileMode(493), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -154,7 +154,7 @@ func pluginsTemplatesPythonChangelogMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/CHANGELOG.md", size: 65, mode: os.FileMode(493), modTime: time.Unix(1473195758, 0)} + info := bindataFileInfo{name: "plugins/templates/python/CHANGELOG.md", size: 65, mode: os.FileMode(493), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -174,7 +174,7 @@ func pluginsTemplatesPythonDockerfile() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/Dockerfile", size: 517, mode: os.FileMode(420), modTime: time.Unix(1475953290, 0)} + info := bindataFileInfo{name: "plugins/templates/python/Dockerfile", size: 517, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -194,7 +194,7 @@ func pluginsTemplatesPythonLicenseMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/LICENSE.md", size: 1071, mode: os.FileMode(493), modTime: time.Unix(1475964853, 0)} + info := bindataFileInfo{name: "plugins/templates/python/LICENSE.md", size: 1071, mode: os.FileMode(493), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -214,7 +214,7 @@ func pluginsTemplatesPythonReadmeShortTxt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/README-short.txt", size: 24, mode: os.FileMode(420), modTime: time.Unix(1475958868, 0)} + info := bindataFileInfo{name: "plugins/templates/python/README-short.txt", size: 24, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -234,7 +234,7 @@ func pluginsTemplatesPythonReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/README.md", size: 183, mode: os.FileMode(493), modTime: time.Unix(1475954829, 0)} + info := bindataFileInfo{name: "plugins/templates/python/README.md", size: 183, mode: os.FileMode(493), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -254,7 +254,7 @@ func pluginsTemplatesPythonCircleYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/circle.yml", size: 600, mode: os.FileMode(420), modTime: time.Unix(1475953367, 0)} + info := bindataFileInfo{name: "plugins/templates/python/circle.yml", size: 600, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -274,7 +274,7 @@ func pluginsTemplatesPythonPluginToml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/plugin.toml", size: 837, mode: os.FileMode(420), modTime: time.Unix(1475953976, 0)} + info := bindataFileInfo{name: "plugins/templates/python/plugin.toml", size: 837, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -294,7 +294,7 @@ func pluginsTemplatesPythonRequirementsTxt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/requirements.txt", size: 33, mode: os.FileMode(420), modTime: time.Unix(1475951657, 0)} + info := bindataFileInfo{name: "plugins/templates/python/requirements.txt", size: 33, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -314,7 +314,7 @@ func pluginsTemplatesPythonScanPy() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugins/templates/python/scan.py", size: 690, mode: os.FileMode(420), modTime: time.Unix(1475952110, 0)} + info := bindataFileInfo{name: "plugins/templates/python/scan.py", size: 690, mode: os.FileMode(420), modTime: time.Unix(1494894197, 0)} a := &asset{bytes: bytes, info: info} return a, nil }