Beispiel #1
0
func main() {
	adaptflag.Adapt()
	cmd := kingpin.Parse()
	hooks.DefaultPath = *hooksFlag
	acmeapi.UserAgent = "acmetool"
	xlogconfig.Init()

	if *batchFlag {
		interaction.NonInteractive = true
	}

	if *stdioFlag {
		interaction.NoDialog = true
	}

	if *responseFileFlag == "" {
		p := filepath.Join(*stateFlag, "conf/responses")
		if _, err := os.Stat(p); err == nil {
			*responseFileFlag = p
		}
	}

	if *responseFileFlag != "" {
		err := loadResponseFile(*responseFileFlag)
		log.Errore(err, "cannot load response file, continuing anyway")
	}

	switch cmd {
	case "reconcile":
		cmdReconcile()
	case "cull":
		cmdCull()
	case "status":
		cmdStatus()
	case "account-thumbprint":
		cmdAccountThumbprint()
	case "want":
		cmdWant()
		if *wantReconcile {
			cmdReconcile()
		}
	case "unwant":
		cmdUnwant()
	case "quickstart":
		cmdQuickstart()
	case "redirector":
		cmdRunRedirector()
	case "test-notify":
		cmdRunTestNotify()
	case "import-key":
		cmdImportKey()
	case "import-jwk-account":
		cmdImportJWKAccount()
	case "import-le":
		cmdImportLE()
		cmdReconcile()
	case "revoke":
		cmdRevoke()
	}
}
Beispiel #2
0
func main() {
	cfg := server.Config{}
	config := easyconfig.Configurator{
		ProgramName: "ctmon",
	}
	config.ParseFatal(&cfg)

	xlogconfig.Init()

	service.Main(&service.Info{
		Description:   "certificate transparency monitoring daemon",
		DefaultChroot: service.EmptyChrootPath,
		NewFunc: func() (service.Runnable, error) {
			return server.New(cfg)
		},
	})
}