cert_stub.go 665 B

12345678910111213141516171819202122232425262728
  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/urfave/cli"
  11. )
  12. var CmdCert = cli.Command{
  13. Name: "cert",
  14. Usage: "Generate self-signed certificate",
  15. Description: `Please use build tags "cert" to rebuild Gogs in order to have this ability`,
  16. Action: runCert,
  17. }
  18. func runCert(ctx *cli.Context) error {
  19. fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
  20. os.Exit(1)
  21. return nil
  22. }