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.8KB

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