Docker template generator
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.

model.go 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package model
  2. import "time"
  3. // CertActions define what will be done with a certificate
  4. type CertActions uint8
  5. // constants defining CertActions
  6. const (
  7. // COMBINE the full chain and private key into one file
  8. COMBINE CertActions = 1 << iota
  9. // FLATTEN the directory structure so all files are in one dir
  10. FLATTEN
  11. // CHMOD the files so they are world readable (potentially dangerous!)
  12. CHMOD
  13. )
  14. // Container models a docker container that is running on the system.
  15. type Container struct {
  16. Id string
  17. Name string
  18. Labels map[string]string
  19. }
  20. // LabelConfig describes the labels used for various properties.
  21. type LabelConfig struct {
  22. Hostnames string
  23. RequireAuth string
  24. }
  25. // Hostname describes a DNS name used for proxying, retrieving certificates, etc.
  26. type Hostname struct {
  27. Name string
  28. Alternatives map[string]bool
  29. Containers []Container
  30. CertActions CertActions
  31. CertDestination string
  32. RequiresAuth bool
  33. AuthGroup string
  34. }
  35. // Config is the user-definable configuration for Dotege.
  36. type Config struct {
  37. Templates []TemplateConfig
  38. Labels LabelConfig
  39. DefaultCertActions CertActions
  40. DefaultCertDestination string
  41. }
  42. // TemplateConfig configures a single template for the generator.
  43. type TemplateConfig struct {
  44. Source string
  45. Destination string
  46. }
  47. // FoundCertificate describes a certificate we've located on disk.
  48. type FoundCertificate struct {
  49. Hostname string
  50. Cert string
  51. Chain string
  52. FullChain string
  53. PrivateKey string
  54. ModTime time.Time
  55. }