server.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package settings
  2. import (
  3. "github.com/go-acme/lego/v4/lego"
  4. )
  5. type Server struct {
  6. HttpHost string `json:"http_host" protected:"true"`
  7. HttpPort string `json:"http_port" protected:"true"`
  8. RunMode string `json:"run_mode" protected:"true"`
  9. JwtSecret string `json:"jwt_secret" protected:"true"`
  10. NodeSecret string `json:"node_secret" protected:"true"`
  11. HTTPChallengePort string `json:"http_challenge_port"`
  12. Email string `json:"email" protected:"true"`
  13. Database string `json:"database" protected:"true"`
  14. StartCmd string `json:"start_cmd" protected:"true"`
  15. CADir string `json:"ca_dir" binding:"omitempty,url"`
  16. Demo bool `json:"demo" protected:"true"`
  17. PageSize int `json:"page_size" protected:"true"`
  18. GithubProxy string `json:"github_proxy" binding:"omitempty,url"`
  19. }
  20. func (s *Server) GetCADir() string {
  21. if s.Demo {
  22. return lego.LEDirectoryStaging
  23. }
  24. if s.CADir != "" {
  25. return s.CADir
  26. }
  27. return lego.LEDirectoryProduction
  28. }
  29. var ServerSettings = Server{
  30. HttpHost: "0.0.0.0",
  31. HttpPort: "9000",
  32. RunMode: "debug",
  33. HTTPChallengePort: "9180",
  34. Database: "database",
  35. StartCmd: "login",
  36. Demo: false,
  37. PageSize: 10,
  38. CADir: "",
  39. GithubProxy: "",
  40. }