cert.ts 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { AcmeUser } from '@/api/acme_user'
  2. import type { ModelBase } from '@/api/curd'
  3. import type { DnsCredential } from '@/api/dns_credential'
  4. import type { PrivateKeyType } from '@/constants'
  5. import Curd from '@/api/curd'
  6. export interface Cert extends ModelBase {
  7. name: string
  8. domains: string[]
  9. filename: string
  10. ssl_certificate_path: string
  11. ssl_certificate: string
  12. ssl_certificate_key_path: string
  13. ssl_certificate_key: string
  14. auto_cert: number
  15. challenge_method: string
  16. dns_credential_id: number
  17. dns_credential?: DnsCredential
  18. acme_user_id: number
  19. acme_user?: AcmeUser
  20. key_type: string
  21. log: string
  22. certificate_info: CertificateInfo
  23. sync_node_ids: number[]
  24. }
  25. export interface CertificateInfo {
  26. subject_name: string
  27. issuer_name: string
  28. not_after: string
  29. not_before: string
  30. }
  31. export interface CertificateResult {
  32. ssl_certificate: string
  33. ssl_certificate_key: string
  34. key_type: PrivateKeyType
  35. }
  36. const cert: Curd<Cert> = new Curd('/cert')
  37. export default cert