cert_stub.go 690 B

123456789101112131415161718192021222324252627
  1. // +build !cert
  2. // Copyright 2009 The Go Authors. All rights reserved.
  3. // Copyright 2014 The Gogs Authors. All rights reserved.
  4. // Use of this source code is governed by a MIT-style
  5. // license that can be found in the LICENSE file.
  6. package cmd
  7. import (
  8. "fmt"
  9. "os"
  10. "github.com/codegangsta/cli"
  11. )
  12. var CmdCert = cli.Command{
  13. Name: "cert",
  14. Usage: "Generate self-signed certificate",
  15. Description: `Generate a self-signed X.509 certificate for a TLS server.
  16. Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
  17. Action: runCert,
  18. }
  19. func runCert(ctx *cli.Context) {
  20. fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
  21. os.Exit(1)
  22. }