cert_stub.go 679 B

1234567891011121314151617181920212223242526272829
  1. //go:build !cert
  2. // +build !cert
  3. // Copyright 2009 The Go Authors. All rights reserved.
  4. // Copyright 2014 The Gogs Authors. All rights reserved.
  5. // Use of this source code is governed by a MIT-style
  6. // license that can be found in the LICENSE file.
  7. package cmd
  8. import (
  9. "fmt"
  10. "os"
  11. "github.com/urfave/cli"
  12. )
  13. var Cert = cli.Command{
  14. Name: "cert",
  15. Usage: "Generate self-signed certificate",
  16. Description: `Please use build tags "cert" to rebuild Gogs in order to have this ability`,
  17. Action: runCert,
  18. }
  19. func runCert(ctx *cli.Context) error {
  20. fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
  21. os.Exit(1)
  22. return nil
  23. }