Skip to content

Commit

Permalink
mythic-cli fix for mythic_sync installs
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Feb 13, 2025
1 parent dddca77 commit 2f0c7d7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
6 changes: 6 additions & 0 deletions Mythic_CLI/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.3.12 - 2025-02-13

### Changed

- Fixed an issue with mythic_sync where it looped forever asking for input

## 0.3.11 - 2025-01-14

### Changed
Expand Down
16 changes: 4 additions & 12 deletions Mythic_CLI/src/cmd/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var MythicPossibleServices = []string{
"mythic_graphql",
"mythic_documentation",
"mythic_jupyter",
"mythic_sync",
"mythic_grafana",
"mythic_prometheus",
"mythic_postgres_exporter",
Expand Down Expand Up @@ -84,16 +83,6 @@ func GetIntendedMythicServiceNames() ([]string, error) {
if mythicEnv.GetBool("postgres_debug") {
containerList = append(containerList, service)
}
/*
case "mythic_sync":
if mythicSyncPath, err := filepath.Abs(filepath.Join(utils.GetCwdFromExe(), InstalledServicesFolder, "mythic_sync")); err != nil {
fmt.Printf("[-] Failed to get the absolute path to mythic_sync: %v\n", err)
} else if _, err = os.Stat(mythicSyncPath); !os.IsNotExist(err) {
// this means that the mythic_sync folder _does_ exist
containerList = append(containerList, service)
}
*/
}
}
return containerList, nil
Expand Down Expand Up @@ -673,7 +662,7 @@ func AskConfirm(prompt string) bool {
input, err := reader.ReadString('\n')
if err != nil {
fmt.Printf("[-] Failed to read user input\n")
return false
continue
}
input = strings.ToLower(strings.TrimSpace(input))
if input == "y" || input == "yes" {
Expand All @@ -692,10 +681,13 @@ func AskVariable(prompt string, environmentVariable string) {
input, err := reader.ReadString('\n')
if err != nil {
fmt.Printf("[-] Failed to read user input\n")
continue
}
input = strings.TrimSpace(input)
mythicEnv.SetDefault(environmentVariable, input)
mythicEnv.Set(environmentVariable, input)
writeMythicEnvironmentVariables()
return
}
}
func Initialize() {
Expand Down
2 changes: 1 addition & 1 deletion Mythic_CLI/src/cmd/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package config

var (
// Version Mythic CLI version
Version = "v0.3.11"
Version = "v0.3.12"
)
2 changes: 1 addition & 1 deletion Mythic_CLI/src/cmd/manager/dockerComposeManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (d *DockerComposeManager) IsServiceRunning(service string) bool {
}
if len(containers) > 0 {
for _, c := range containers {
if c.Labels["name"] == strings.ToLower(service) {
if c.Labels["name"] == strings.ToLower(service) && c.State == "running" {
return true
}
}
Expand Down

0 comments on commit 2f0c7d7

Please sign in to comment.