Add local-only flag and tweak makefile to support notarization.

Co-authored-by: tperfitt <tperfitt@twocanoes.com>
This commit is contained in:
tperfitt
2020-03-13 09:46:22 -05:00
committed by GitHub
parent e2acfb977e
commit e03e73c542
2 changed files with 9 additions and 0 deletions

View File

@@ -10,6 +10,9 @@ endif
export GO111MODULE=on
#Specify a minimum version for macos otherwise notarization will fail
CGO_LDFLAGS=-mmacosx-version-min=10.12
VERSION = $(shell git describe --tags --always --dirty)
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
REVISION = $(shell git rev-parse HEAD)

View File

@@ -169,6 +169,7 @@ func (cmd *mdmcertCommand) runPush(args []string) error {
flCN = flagset.String("cn", "micromdm-user", "CommonName for the CSR Subject.")
flPKeyPass = flagset.String("password", "", "Password to encrypt/read the RSA key.")
flKeyPath = flagset.String("private-key", filepath.Join(mdmcertdir, pushCertificatePrivateKeyFilename), "Path to the push certificate private key. A new RSA key will be created at this path.")
flLocalOnly= flagset.Bool("local-only",false,"No server configuration required.")
flCSRPath = flagset.String("out", filepath.Join(mdmcertdir, pushCSRFilename), "Path to save the MDM Push Certificate request.")
)
@@ -177,6 +178,11 @@ func (cmd *mdmcertCommand) runPush(args []string) error {
return err
}
if !*flLocalOnly {
if err := cmd.setup(); err != nil {
return err
}
}
if err := os.MkdirAll(filepath.Dir(*flCSRPath), 0755); err != nil {
errors.Wrapf(err, "create directory %s", filepath.Dir(*flCSRPath))
}