diff --git a/.goreleaser.yaml b/.goreleaser.yaml index bafc299..24419e5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -62,7 +62,7 @@ nfpms: - archlinux maintainer: "David J. Allen " description: "Magellan is a discovery tool for BMCs." - homepage: "https://www.openchami.org" + homepage: "https://www.davidallendj.org" license: MIT section: utils priority: optional @@ -75,9 +75,9 @@ nfpms: dockers: - image_templates: - - &amd64_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64 + - &amd64_linux_image ghcr.io/davidallendj/{{.ProjectName}}:{{ .Tag }}-amd64 + - ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}-amd64 + - ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64 use: buildx build_flag_templates: - "--pull" @@ -93,9 +93,9 @@ dockers: - CHANGELOG.md - README.md - image_templates: - - &arm64v8_linux_image ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64 - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64 + - &arm64v8_linux_image ghcr.io/davidallendj/{{.ProjectName}}:{{ .Tag }}-arm64 + - ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}-arm64 + - ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64 use: buildx build_flag_templates: - "--pull" @@ -111,22 +111,22 @@ dockers: goarch: arm64 docker_manifests: - - name_template: "ghcr.io/openchami/{{.ProjectName}}:latest" + - name_template: "ghcr.io/davidallendj/{{.ProjectName}}:latest" image_templates: - *amd64_linux_image - *arm64v8_linux_image - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}" + - name_template: "ghcr.io/davidallendj/{{.ProjectName}}:{{ .Tag }}" image_templates: - *amd64_linux_image - *arm64v8_linux_image - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}" + - name_template: "ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}" image_templates: - *amd64_linux_image - *arm64v8_linux_image - - name_template: "ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}" + - name_template: "ghcr.io/davidallendj/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}" image_templates: - *amd64_linux_image - *arm64v8_linux_image diff --git a/CHANGELOG.md b/CHANGELOG.md index bb3abf0..56ba184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Miscellaneous - * Merge pull request #55 from OpenCHAMI/cacert-hotfix + * Merge pull request #55 from davidallendj/cacert-hotfix ## [0.1.4] @@ -43,11 +43,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Miscellaneous * Merge branch 'main' into minor-changes - * Merge pull request #50 from OpenCHAMI/container-build - * Merge pull request #51 from OpenCHAMI/minor-changes - * Merge pull request #52 from OpenCHAMI/minor-changes - * Merge pull request #53 from OpenCHAMI/minor-changes - * Merge pull request #54 from OpenCHAMI/update-readme + * Merge pull request #50 from davidallendj/container-build + * Merge pull request #51 from davidallendj/minor-changes + * Merge pull request #52 from davidallendj/minor-changes + * Merge pull request #53 from davidallendj/minor-changes + * Merge pull request #54 from davidallendj/update-readme * Rearranged collect error to only show when not force updating * Updated README.md and fixed outdated info * magellan.sh: remove unused build helper function @@ -82,7 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Miscellaneous - * Merge pull request #49 from OpenCHAMI/add-types + * Merge pull request #49 from davidallendj/add-types ## [0.1.0] @@ -263,7 +263,7 @@ Tidied up CLI flag names ### Added * Adding dev container to standardize Linux build - * Merge pull request #1 from OpenCHAMI/rehome + * Merge pull request #1 from davidallendj/rehome ## [0.0.5] - 2023-11-02 diff --git a/README.md b/README.md index bcbc566..369f38f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The `magellan` tool comes packed with a handleful of features for doing discover - Simple network scanning - Redfish-based inventory collection - Redfish-based firmware updating -- Integration with OpenCHAMI SMD +- Integration with davidallendj SMD - Write inventory data to JSON See the [TODO](#todo) section for a list of soon-ish goals planned. @@ -164,7 +164,7 @@ This will print a list of host information needed for the `collect` step. Set th --timeout 5 \ --username $USERNAME \ --password $PASSWORD \ - --host https://example.openchami.cluster:8443 \ + --host https://example.davidallendj.cluster:8443 \ --output logs/ --cacert cacert.pem ``` @@ -205,7 +205,7 @@ The `magellan` tool has a `login` subcommand that works with the [`opaal`](https export ACCESS_TOKEN=eyJhbGciOiJIUzI1NiIs... ``` -Alternatively, if you are running the OpenCHAMI quickstart in the [deployment recipes](https://github.com/davidallendj/deployment-recipes), you can run the provided script to generate a token and set the environment variable that way. +Alternatively, if you are running the davidallendj quickstart in the [deployment recipes](https://github.com/davidallendj/deployment-recipes), you can run the provided script to generate a token and set the environment variable that way. ```bash quickstart_dir=path/to/deployment/recipes/quickstart @@ -224,7 +224,7 @@ docker pull ghcr.io/davidallendj/magellan:latest Then, run either with the helper script found in `bin/magellan.sh` or the binary in the container: ```bash -docker run ghcr.io/openchami/magellan:latest /magellan.sh --scan "--subnet 172.16.0.0 --port 443 --timeout 3" --collect "--user admin --pass password --host http://vm01 --port 27779" +docker run ghcr.io/davidallendj/magellan:latest /magellan.sh --scan "--subnet 172.16.0.0 --port 443 --timeout 3" --collect "--user admin --pass password --host http://vm01 --port 27779" # ... or .. docker ghcr.io/openhami/magellan:latest /magellan scan --subnet 172.16.0.0 --subnet-mask 255.255.255.0 ``` diff --git a/cmd/cache.go b/cmd/cache.go index ef605a9..11c87a5 100644 --- a/cmd/cache.go +++ b/cmd/cache.go @@ -6,8 +6,8 @@ import ( "os" "strconv" - magellan "github.com/OpenCHAMI/magellan/internal" - "github.com/OpenCHAMI/magellan/internal/cache/sqlite" + magellan "github.com/davidallendj/magellan/internal" + "github.com/davidallendj/magellan/internal/cache/sqlite" "github.com/rs/zerolog/log" "github.com/spf13/cobra" ) diff --git a/cmd/collect.go b/cmd/collect.go index ed33dd4..53807c3 100644 --- a/cmd/collect.go +++ b/cmd/collect.go @@ -17,7 +17,7 @@ import ( // The `collect` command fetches data from a collection of BMC nodes. // This command should be ran after the `scan` to find available hosts // on a subnet. -var collectCmd = &cobra.Command{ +var CollectCmd = &cobra.Command{ Use: "collect", Short: "Collect system information by interrogating BMC node", Long: "Send request(s) to a collection of hosts running Redfish services found stored from the 'scan' in cache.\n" + @@ -75,28 +75,28 @@ var collectCmd = &cobra.Command{ func init() { currentUser, _ = user.Current() - collectCmd.PersistentFlags().StringVar(&host, "host", "", "Set the URI to the SMD root endpoint") - collectCmd.PersistentFlags().StringVar(&username, "username", "", "Set the BMC user") - collectCmd.PersistentFlags().StringVar(&password, "password", "", "Set the BMC password") - collectCmd.PersistentFlags().StringVar(&scheme, "scheme", "https", "Set the scheme used to query") - collectCmd.PersistentFlags().StringVar(&protocol, "protocol", "tcp", "Set the protocol used to query") - collectCmd.PersistentFlags().StringVarP(&outputPath, "output", "o", fmt.Sprintf("/tmp/%smagellan/inventory/", currentUser.Username+"/"), "Set the path to store collection data") - collectCmd.PersistentFlags().BoolVar(&forceUpdate, "force-update", false, "Set flag to force update data sent to SMD") - collectCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "Path to CA cert. (defaults to system CAs)") + CollectCmd.PersistentFlags().StringVar(&host, "host", "", "Set the URI to the SMD root endpoint") + CollectCmd.PersistentFlags().StringVar(&username, "username", "", "Set the BMC user") + CollectCmd.PersistentFlags().StringVar(&password, "password", "", "Set the BMC password") + CollectCmd.PersistentFlags().StringVar(&scheme, "scheme", "https", "Set the scheme used to query") + CollectCmd.PersistentFlags().StringVar(&protocol, "protocol", "tcp", "Set the protocol used to query") + CollectCmd.PersistentFlags().StringVarP(&outputPath, "output", "o", fmt.Sprintf("/tmp/%smagellan/inventory/", currentUser.Username+"/"), "Set the path to store collection data") + CollectCmd.PersistentFlags().BoolVar(&forceUpdate, "force-update", false, "Set flag to force update data sent to SMD") + CollectCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "Path to CA cert. (defaults to system CAs)") // set flags to only be used together - collectCmd.MarkFlagsRequiredTogether("username", "password") + CollectCmd.MarkFlagsRequiredTogether("username", "password") // bind flags to config properties - checkBindFlagError(viper.BindPFlag("collect.host", collectCmd.Flags().Lookup("host"))) - checkBindFlagError(viper.BindPFlag("collect.username", collectCmd.Flags().Lookup("username"))) - checkBindFlagError(viper.BindPFlag("collect.password", collectCmd.Flags().Lookup("password"))) - checkBindFlagError(viper.BindPFlag("collect.scheme", collectCmd.Flags().Lookup("scheme"))) - checkBindFlagError(viper.BindPFlag("collect.protocol", collectCmd.Flags().Lookup("protocol"))) - checkBindFlagError(viper.BindPFlag("collect.output", collectCmd.Flags().Lookup("output"))) - checkBindFlagError(viper.BindPFlag("collect.force-update", collectCmd.Flags().Lookup("force-update"))) - checkBindFlagError(viper.BindPFlag("collect.cacert", collectCmd.Flags().Lookup("cacert"))) - checkBindFlagError(viper.BindPFlags(collectCmd.Flags())) + checkBindFlagError(viper.BindPFlag("collect.host", CollectCmd.Flags().Lookup("host"))) + checkBindFlagError(viper.BindPFlag("collect.username", CollectCmd.Flags().Lookup("username"))) + checkBindFlagError(viper.BindPFlag("collect.password", CollectCmd.Flags().Lookup("password"))) + checkBindFlagError(viper.BindPFlag("collect.scheme", CollectCmd.Flags().Lookup("scheme"))) + checkBindFlagError(viper.BindPFlag("collect.protocol", CollectCmd.Flags().Lookup("protocol"))) + checkBindFlagError(viper.BindPFlag("collect.output", CollectCmd.Flags().Lookup("output"))) + checkBindFlagError(viper.BindPFlag("collect.force-update", CollectCmd.Flags().Lookup("force-update"))) + checkBindFlagError(viper.BindPFlag("collect.cacert", CollectCmd.Flags().Lookup("cacert"))) + checkBindFlagError(viper.BindPFlags(CollectCmd.Flags())) - rootCmd.AddCommand(collectCmd) + rootCmd.AddCommand(CollectCmd) } diff --git a/cmd/scan.go b/cmd/scan.go index 70b636c..d2cbaf8 100644 --- a/cmd/scan.go +++ b/cmd/scan.go @@ -32,7 +32,7 @@ var ( // // See the `ScanForAssets()` function in 'internal/scan.go' for details // related to the implementation. -var scanCmd = &cobra.Command{ +var ScanCmd = &cobra.Command{ Use: "scan urls...", Short: "Scan to discover BMC nodes on a network", Long: "Perform a net scan by attempting to connect to each host and port specified and getting a response.\n" + @@ -174,24 +174,24 @@ var scanCmd = &cobra.Command{ } func init() { - // scanCmd.Flags().StringSliceVar(&hosts, "host", []string{}, "set additional hosts to scan") - scanCmd.Flags().StringSliceVar(&hosts, "host", nil, "Add individual hosts to scan. (example: https://my.bmc.com:5000; same as using positional args)") - scanCmd.Flags().IntSliceVar(&ports, "port", nil, "Adds additional ports to scan for each host with unspecified ports.") - scanCmd.Flags().StringVar(&scheme, "scheme", "https", "Set the default scheme to use if not specified in host URI. (default is 'https')") - scanCmd.Flags().StringVar(&protocol, "protocol", "tcp", "Set the default protocol to use in scan. (default is 'tcp')") - scanCmd.Flags().StringSliceVar(&subnets, "subnet", nil, "Add additional hosts from specified subnets to scan.") - scanCmd.Flags().IPMaskVar(&subnetMask, "subnet-mask", net.IPv4Mask(255, 255, 255, 0), "Set the default subnet mask to use for with all subnets not using CIDR notation.") - scanCmd.Flags().BoolVar(&disableProbing, "disable-probing", false, "Disable probing found assets for Redfish service(s) running on BMC nodes") - scanCmd.Flags().BoolVar(&disableCache, "disable-cache", false, "Disable saving found assets to a cache database specified with 'cache' flag") + // ScanCmd.Flags().StringSliceVar(&hosts, "host", []string{}, "set additional hosts to scan") + ScanCmd.Flags().StringSliceVar(&hosts, "host", nil, "Add individual hosts to scan. (example: https://my.bmc.com:5000; same as using positional args)") + ScanCmd.Flags().IntSliceVar(&ports, "port", nil, "Adds additional ports to scan for each host with unspecified ports.") + ScanCmd.Flags().StringVar(&scheme, "scheme", "https", "Set the default scheme to use if not specified in host URI. (default is 'https')") + ScanCmd.Flags().StringVar(&protocol, "protocol", "tcp", "Set the default protocol to use in scan. (default is 'tcp')") + ScanCmd.Flags().StringSliceVar(&subnets, "subnet", nil, "Add additional hosts from specified subnets to scan.") + ScanCmd.Flags().IPMaskVar(&subnetMask, "subnet-mask", net.IPv4Mask(255, 255, 255, 0), "Set the default subnet mask to use for with all subnets not using CIDR notation.") + ScanCmd.Flags().BoolVar(&disableProbing, "disable-probing", false, "Disable probing found assets for Redfish service(s) running on BMC nodes") + ScanCmd.Flags().BoolVar(&disableCache, "disable-cache", false, "Disable saving found assets to a cache database specified with 'cache' flag") - checkBindFlagError(viper.BindPFlag("scan.hosts", scanCmd.Flags().Lookup("host"))) - checkBindFlagError(viper.BindPFlag("scan.ports", scanCmd.Flags().Lookup("port"))) - checkBindFlagError(viper.BindPFlag("scan.scheme", scanCmd.Flags().Lookup("scheme"))) - checkBindFlagError(viper.BindPFlag("scan.protocol", scanCmd.Flags().Lookup("protocol"))) - checkBindFlagError(viper.BindPFlag("scan.subnets", scanCmd.Flags().Lookup("subnet"))) - checkBindFlagError(viper.BindPFlag("scan.subnet-masks", scanCmd.Flags().Lookup("subnet-mask"))) - checkBindFlagError(viper.BindPFlag("scan.disable-probing", scanCmd.Flags().Lookup("disable-probing"))) - checkBindFlagError(viper.BindPFlag("scan.disable-cache", scanCmd.Flags().Lookup("disable-cache"))) + checkBindFlagError(viper.BindPFlag("scan.hosts", ScanCmd.Flags().Lookup("host"))) + checkBindFlagError(viper.BindPFlag("scan.ports", ScanCmd.Flags().Lookup("port"))) + checkBindFlagError(viper.BindPFlag("scan.scheme", ScanCmd.Flags().Lookup("scheme"))) + checkBindFlagError(viper.BindPFlag("scan.protocol", ScanCmd.Flags().Lookup("protocol"))) + checkBindFlagError(viper.BindPFlag("scan.subnets", ScanCmd.Flags().Lookup("subnet"))) + checkBindFlagError(viper.BindPFlag("scan.subnet-masks", ScanCmd.Flags().Lookup("subnet-mask"))) + checkBindFlagError(viper.BindPFlag("scan.disable-probing", ScanCmd.Flags().Lookup("disable-probing"))) + checkBindFlagError(viper.BindPFlag("scan.disable-cache", ScanCmd.Flags().Lookup("disable-cache"))) - rootCmd.AddCommand(scanCmd) + rootCmd.AddCommand(ScanCmd) } diff --git a/emulator/rf-emulator.yml b/emulator/rf-emulator.yml index 39281a8..eec8191 100644 --- a/emulator/rf-emulator.yml +++ b/emulator/rf-emulator.yml @@ -6,7 +6,7 @@ volumes: services: emulator: - image: openchami-rie:latest + image: davidallendj-rie:latest container_name: rf-emulator environment: BMC_PORT: 5000 diff --git a/emulator/setup.sh b/emulator/setup.sh index 8ca9580..291cb60 100755 --- a/emulator/setup.sh +++ b/emulator/setup.sh @@ -8,5 +8,5 @@ if [ ! -d ${script_dir}/rf-emulator ]; then fi # build docker image and run with docker compose -docker build -t openchami-rie:latest -f ${script_dir}/Dockerfile ${script_dir}/rf-emulator +docker build -t davidallendj-rie:latest -f ${script_dir}/Dockerfile ${script_dir}/rf-emulator docker compose -f ${script_dir}/rf-emulator.yml up