spec_v1_0.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. """Compose module schema version 1.0 - Original specification."""
  2. from collections import OrderedDict
  3. spec = OrderedDict(
  4. {
  5. "general": {
  6. "title": "General",
  7. "vars": {
  8. "service_name": {
  9. "description": "Service name",
  10. "type": "str",
  11. },
  12. "container_name": {
  13. "description": "Container name",
  14. "type": "str",
  15. },
  16. "container_hostname": {
  17. "description": "Container internal hostname",
  18. "type": "str",
  19. },
  20. "container_timezone": {
  21. "description": "Container timezone (e.g., Europe/Berlin)",
  22. "type": "str",
  23. "default": "UTC",
  24. },
  25. "user_uid": {
  26. "description": "User UID for container process",
  27. "type": "int",
  28. "default": 1000,
  29. },
  30. "user_gid": {
  31. "description": "User GID for container process",
  32. "type": "int",
  33. "default": 1000,
  34. },
  35. "container_loglevel": {
  36. "description": "Container log level",
  37. "type": "enum",
  38. "options": ["debug", "info", "warn", "error"],
  39. "default": "info",
  40. },
  41. "restart_policy": {
  42. "description": "Container restart policy",
  43. "type": "enum",
  44. "options": ["unless-stopped", "always", "on-failure", "no"],
  45. "default": "unless-stopped",
  46. },
  47. },
  48. },
  49. "network": {
  50. "title": "Network",
  51. "toggle": "network_enabled",
  52. "vars": {
  53. "network_enabled": {
  54. "description": "Enable custom network block",
  55. "type": "bool",
  56. "default": False,
  57. },
  58. "network_name": {
  59. "description": "Docker network name",
  60. "type": "str",
  61. "default": "bridge",
  62. },
  63. "network_external": {
  64. "description": "Use existing Docker network",
  65. "type": "bool",
  66. "default": True,
  67. },
  68. },
  69. },
  70. "ports": {
  71. "title": "Ports",
  72. "toggle": "ports_enabled",
  73. "vars": {
  74. "ports_enabled": {
  75. "description": "Expose ports via 'ports' mapping",
  76. "type": "bool",
  77. "default": True,
  78. }
  79. },
  80. },
  81. "traefik": {
  82. "title": "Traefik",
  83. "toggle": "traefik_enabled",
  84. "description": "Traefik routes external traffic to your service.",
  85. "vars": {
  86. "traefik_enabled": {
  87. "description": "Enable Traefik reverse proxy integration",
  88. "type": "bool",
  89. "default": False,
  90. },
  91. "traefik_network": {
  92. "description": "Traefik network name",
  93. "type": "str",
  94. "default": "traefik",
  95. },
  96. "traefik_host": {
  97. "description": "Domain name for your service (e.g., app.example.com)",
  98. "type": "str",
  99. },
  100. "traefik_entrypoint": {
  101. "description": "HTTP entrypoint (non-TLS)",
  102. "type": "str",
  103. "default": "web",
  104. },
  105. },
  106. },
  107. "traefik_tls": {
  108. "title": "Traefik TLS/SSL",
  109. "toggle": "traefik_tls_enabled",
  110. "needs": "traefik",
  111. "description": "Enable HTTPS/TLS for Traefik with certificate management.",
  112. "vars": {
  113. "traefik_tls_enabled": {
  114. "description": "Enable HTTPS/TLS",
  115. "type": "bool",
  116. "default": True,
  117. },
  118. "traefik_tls_entrypoint": {
  119. "description": "TLS entrypoint",
  120. "type": "str",
  121. "default": "websecure",
  122. },
  123. "traefik_tls_certresolver": {
  124. "description": "Traefik certificate resolver name",
  125. "type": "str",
  126. "default": "cloudflare",
  127. },
  128. },
  129. },
  130. "swarm": {
  131. "title": "Docker Swarm",
  132. "toggle": "swarm_enabled",
  133. "description": "Deploy service in Docker Swarm mode with replicas.",
  134. "vars": {
  135. "swarm_enabled": {
  136. "description": "Enable Docker Swarm mode",
  137. "type": "bool",
  138. "default": False,
  139. },
  140. "swarm_replicas": {
  141. "description": "Number of replicas in Swarm",
  142. "type": "int",
  143. "default": 1,
  144. },
  145. "swarm_placement_mode": {
  146. "description": "Swarm placement mode",
  147. "type": "enum",
  148. "options": ["global", "replicated"],
  149. "default": "replicated",
  150. },
  151. "swarm_placement_host": {
  152. "description": "Limit placement to specific node",
  153. "type": "str",
  154. },
  155. },
  156. },
  157. "database": {
  158. "title": "Database",
  159. "toggle": "database_enabled",
  160. "description": "Connect to external database (PostgreSQL or MySQL)",
  161. "vars": {
  162. "database_enabled": {
  163. "description": "Enable external database integration",
  164. "type": "bool",
  165. "default": False,
  166. },
  167. "database_type": {
  168. "description": "Database type",
  169. "type": "enum",
  170. "options": ["postgres", "mysql"],
  171. "default": "postgres",
  172. },
  173. "database_external": {
  174. "description": "Use an external database server?",
  175. "extra": "If 'no', a database container will be created in the compose project.",
  176. "type": "bool",
  177. "default": False,
  178. },
  179. "database_host": {
  180. "description": "Database host",
  181. "type": "str",
  182. "default": "database",
  183. },
  184. "database_port": {"description": "Database port", "type": "int"},
  185. "database_name": {
  186. "description": "Database name",
  187. "type": "str",
  188. },
  189. "database_user": {
  190. "description": "Database user",
  191. "type": "str",
  192. },
  193. "database_password": {
  194. "description": "Database password",
  195. "type": "str",
  196. "default": "",
  197. "sensitive": True,
  198. "autogenerated": True,
  199. },
  200. },
  201. },
  202. "email": {
  203. "title": "Email Server",
  204. "toggle": "email_enabled",
  205. "description": "Configure email server for notifications and user management.",
  206. "vars": {
  207. "email_enabled": {
  208. "description": "Enable email server configuration",
  209. "type": "bool",
  210. "default": False,
  211. },
  212. "email_host": {
  213. "description": "SMTP server hostname",
  214. "type": "str",
  215. },
  216. "email_port": {
  217. "description": "SMTP server port",
  218. "type": "int",
  219. "default": 587,
  220. },
  221. "email_username": {
  222. "description": "SMTP username",
  223. "type": "str",
  224. },
  225. "email_password": {
  226. "description": "SMTP password",
  227. "type": "str",
  228. "sensitive": True,
  229. },
  230. "email_from": {
  231. "description": "From email address",
  232. "type": "str",
  233. },
  234. "email_use_tls": {
  235. "description": "Use TLS encryption",
  236. "type": "bool",
  237. "default": True,
  238. },
  239. "email_use_ssl": {
  240. "description": "Use SSL encryption",
  241. "type": "bool",
  242. "default": False,
  243. },
  244. },
  245. },
  246. "authentik": {
  247. "title": "Authentik SSO",
  248. "toggle": "authentik_enabled",
  249. "description": "Integrate with Authentik for Single Sign-On authentication.",
  250. "vars": {
  251. "authentik_enabled": {
  252. "description": "Enable Authentik SSO integration",
  253. "type": "bool",
  254. "default": False,
  255. },
  256. "authentik_url": {
  257. "description": "Authentik base URL (e.g., https://auth.example.com)",
  258. "type": "str",
  259. },
  260. "authentik_slug": {
  261. "description": "Authentik application slug",
  262. "type": "str",
  263. },
  264. "authentik_client_id": {
  265. "description": "OAuth client ID from Authentik provider",
  266. "type": "str",
  267. },
  268. "authentik_client_secret": {
  269. "description": "OAuth client secret from Authentik provider",
  270. "type": "str",
  271. "sensitive": True,
  272. },
  273. },
  274. },
  275. }
  276. )