Publish HTML quickly. https://html.house
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.2 KiB

  1. package htmlhouse
  2. import (
  3. "github.com/danryan/env"
  4. )
  5. type config struct {
  6. StaticDir string `env:"key=STATIC_DIR default=static"`
  7. DBName string `env:"key=DB_DB required=true"`
  8. DBUser string `env:"key=DB_USER required=true"`
  9. DBPassword string `env:"key=DB_PASSWORD required=true"`
  10. DBHost string `env:"key=DB_HOST default=localhost"`
  11. PrivateKey string `env:"key=PRIVATE_KEY require=true"`
  12. PublicKey string `env:"key=PUBLIC_KEY require=true"`
  13. HostName string `env:"key=HOST default=https://html.house"`
  14. ServerPort int `env:"key=PORT default=8080"`
  15. AutoApprove bool `env:"key=AUTO_APPROVE default=false"`
  16. PreviewsHost string `env:"key=PREVIEWS_HOST`
  17. AdminPass string `env:"key=ADMIN_PASS default=uhoh"`
  18. BrowseItems int `env:"key=BROWSE_ITEMS default=10"`
  19. // Twitter configuration
  20. TwitterConsumerKey string `env:"key=TWITTER_KEY default=notreal"`
  21. TwitterConsumerSecret string `env:"key=TWITTER_SECRET default=notreal"`
  22. TwitterToken string `env:"key=TWITTER_TOKEN default=notreal"`
  23. TwitterTokenSecret string `env:"key=TWITTER_TOKEN_SECRET default=notreal"`
  24. }
  25. func newConfig() (*config, error) {
  26. cfg := &config{}
  27. if err := env.Process(cfg); err != nil {
  28. return cfg, err
  29. }
  30. return cfg, nil
  31. }