diff --git a/internal/flags/activate.go b/internal/flags/activate.go index ec5a672a..4c1febca 100644 --- a/internal/flags/activate.go +++ b/internal/flags/activate.go @@ -29,7 +29,7 @@ func (f *Flags) handleActivateCommand() error { f.amtActivateCommand.BoolVar(&f.SkipIPRenew, "skipIPRenew", false, "skip DHCP renewal of the IP address if AMT becomes enabled") // for local activation in ACM mode need a few more items f.amtActivateCommand.StringVar(&f.configContent, "config", "", "specify a config file or smb: file share URL") - f.amtActivateCommand.StringVar(&f.configContent, "configv2", "", "specify a config file or smb: file share URL") + f.amtActivateCommand.StringVar(&f.configContentV2, "configv2", "", "specify a config file or smb: file share URL") f.amtActivateCommand.StringVar(&f.LocalConfig.ACMSettings.AMTPassword, "amtPassword", f.lookupEnvOrString("AMT_PASSWORD", ""), "amt password") f.amtActivateCommand.StringVar(&f.LocalConfig.ACMSettings.ProvisioningCert, "provisioningCert", f.lookupEnvOrString("PROVISIONING_CERT", ""), "provisioning certificate") f.amtActivateCommand.StringVar(&f.LocalConfig.ACMSettings.ProvisioningCertPwd, "provisioningCertPwd", f.lookupEnvOrString("PROVISIONING_CERT_PASSWORD", ""), "provisioning certificate password") diff --git a/internal/flags/flags.go b/internal/flags/flags.go index 66571dad..cda6cbaf 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -356,5 +356,7 @@ func (f *Flags) handleLocalConfigV2() error { return err } + fmt.Println(content) f.LocalConfigV2 = content + return nil } diff --git a/pkg/config/decrypt.go b/pkg/config/decrypt.go index 227becd9..1c5acef4 100644 --- a/pkg/config/decrypt.go +++ b/pkg/config/decrypt.go @@ -6,6 +6,7 @@ import ( "encoding/base64" "errors" "io/ioutil" + "fmt" "gopkg.in/yaml.v2" ) @@ -42,16 +43,17 @@ func Decrypt(cipherText string, key []byte) ([]byte, error) { // Read encrypted data from file and decrypt it func ReadAndDecryptFile(filePath string, key []byte) (Configuration, error) { + fmt.Println(filePath) encryptedData, err := ioutil.ReadFile(filePath) if err != nil { return Configuration{}, err } - + fmt.Println(encryptedData) decryptedData, err := Decrypt(string(encryptedData), key) if err != nil { return Configuration{}, err } - + fmt.Println(decryptedData) var configuration Configuration err = yaml.Unmarshal(decryptedData, &configuration) if err != nil {