mirror of
https://github.com/its-a-feature/Mythic
synced 2026-06-08 14:55:38 +00:00
add some logs so users know Mirror is configured
This commit is contained in:
@@ -681,7 +681,7 @@ func GetConfigHelp(entries []string) map[string]string {
|
||||
} else if strings.HasSuffix(setting, "use_build_context") {
|
||||
output[setting] = `This setting determines if you use the pre-built image hosted on GitHub/DockerHub or if you use your local InstalledService/[agent]/Dockerfile to build a new local image for your container. If you're wanting to make changes to an agent or c2 profile (adding commands, updating code, etc), then you need to set this to 'true' and update your Dockerfile to copy in your modified code. If your container code is Golang, then you'll also need to make sure your modified Dockerfile rebuilds that Go code based on your changes (probably with a 'go build' or 'make build' command depending on the agent). If your container code is Python, then simply copying in the changes should be sufficient. Also make sure you change [agent]_use_volume to 'false' so that your changes don't get overwritten by an old volume. Alternatively, you could remove the old volume with './mythic-cli volume rm [agent]_volume' and then build your new container with './mythic-cli build [agent]'.`
|
||||
} else if strings.HasSuffix(setting, "remote_image") {
|
||||
output[setting] = `This setting configures the remote image to use if you have *_use_build_context set to false. This value should get automatically updated by the agent/c2 profile's repo as new releases are created. This value will also get updated each time you install an agent. So if you want to pull an agent's latest image, just re-install the agent (or manually update this value and restart the local container).`
|
||||
output[setting] = `This setting configures the remote image to use if you have *_use_build_context set to false. This value should get automatically updated by the agent/c2 profile's repo as new releases are created. This value will also get updated each time you install an agent. So if you want to pull an agent's latest image, just re-install the agent (or manually update this value and restart the local container). When mythic_docker_image_mirror is set, this value is kept as the upstream image URL but the image actually pulled is rewritten to come from the mirror; clear the mirror to pull from the URL shown here as-is.`
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ func InstallFolder(installPath string, overWrite bool, keepVolume bool, installU
|
||||
}
|
||||
}
|
||||
latestVersion := installConfig.GetStringMapString("remote_images")
|
||||
if mirror := config.GetMythicEnv().GetString("mythic_docker_image_mirror"); mirror != "" {
|
||||
log.Printf("[*] mythic_docker_image_mirror is set to %q; this service's image(s) will be pulled from there instead of their upstream registry\n", mirror)
|
||||
}
|
||||
for key, val := range latestVersion {
|
||||
config.SetNewConfigStrings(fmt.Sprintf("%s_remote_image", key), val)
|
||||
if !config.GetMythicEnv().InConfig(fmt.Sprintf("%s_use_volume", key)) {
|
||||
|
||||
@@ -65,6 +65,9 @@ func init() {
|
||||
}
|
||||
|
||||
func updateCheck(cmd *cobra.Command, args []string) {
|
||||
if mirror := config.GetMythicEnv().GetString("mythic_docker_image_mirror"); mirror != "" {
|
||||
log.Printf("[*] mythic_docker_image_mirror is set to %q; image URLs printed below are the upstream sources used for version checking, not the mirrored locations actually pulled by docker compose\n", mirror)
|
||||
}
|
||||
var tr = &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user