mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-09 19:15:58 +08:00
Add local-only flag and tweak makefile to support notarization.
Co-authored-by: tperfitt <tperfitt@twocanoes.com>
This commit is contained in:
3
Makefile
3
Makefile
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user