diff --git a/Dockerfile b/Dockerfile index c898c9f..f16dda0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,9 @@ -FROM ubuntu - -RUN apt-get update -y; apt-get install golang git -y; go get -u github.com/jaeles-project/jaeles; /root/go/bin/jaeles config -a init - -WORKDIR /root/go/bin/ - -VOLUME /root/go/bin/out -VOLUME /root/.jaeles/ +FROM golang:1.14.4-buster as builder +RUN GO111MODULE=on GOOS=linux go get -v -ldflags "-linkmode external -extldflags -static" github.com/jaeles-project/jaeles +FROM alpine:latest +WORKDIR / +COPY --from=builder /go/bin/jaeles /bin/jaeles +RUN jaeles config init EXPOSE 5000 - -CMD [ "/root/go/bin/jaeles", "server", "--host", "0.0.0.0" ] +ENTRYPOINT ["/bin/jaeles"] diff --git a/cmd/config.go b/cmd/config.go index 9e8c753..d630a87 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -87,15 +87,20 @@ func runConfig(cmd *cobra.Command, args []string) error { reloadSignature(options.SignFolder, options.Config.SkipMics) break case "update": - // only ask if use default Repo - if utils.FolderExists(options.RootFolder) && options.Config.Repo == "" { - mess := fmt.Sprintf("Looks like you already have signatures in %s\nDo you want to to override it?", options.RootFolder) - c := utils.PromptConfirm(mess) - if c { - utils.InforF("Cleaning root folder") - os.RemoveAll(options.RootFolder) + if options.Config.Forced { + os.RemoveAll(options.RootFolder) + } else { + // only ask if use default Repo + if utils.FolderExists(options.RootFolder) && options.Config.Repo == "" { + mess := fmt.Sprintf("Looks like you already have signatures in %s\nDo you want to to override it?", options.RootFolder) + c := utils.PromptConfirm(mess) + if c { + utils.InforF("Cleaning root folder") + os.RemoveAll(options.RootFolder) + } } } + core.UpdatePlugins(options) core.UpdateSignature(options) reloadSignature(path.Join(options.RootFolder, "base-signatures"), options.Config.SkipMics) @@ -331,7 +336,6 @@ func ScanHelp(cmd *cobra.Command, _ []string) { fmt.Println(libs.Banner()) fmt.Println(cmd.UsageString()) ScanMessage() - fmt.Printf("Official Documentation can be found here: %s\n", color.GreenString(libs.DOCS)) } // ScanMessage print help message