spec_v1_0.py 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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": {
  185. "description": "Database port",
  186. "type": "int"
  187. },
  188. "database_name": {
  189. "description": "Database name",
  190. "type": "str",
  191. },
  192. "database_user": {
  193. "description": "Database user",
  194. "type": "str",
  195. },
  196. "database_password": {
  197. "description": "Database password",
  198. "type": "str",
  199. "default": "",
  200. "sensitive": True,
  201. "autogenerated": True,
  202. },
  203. },
  204. },
  205. "email": {
  206. "title": "Email Server",
  207. "toggle": "email_enabled",
  208. "description": "Configure email server for notifications and user management.",
  209. "vars": {
  210. "email_enabled": {
  211. "description": "Enable email server configuration",
  212. "type": "bool",
  213. "default": False,
  214. },
  215. "email_host": {
  216. "description": "SMTP server hostname",
  217. "type": "str",
  218. },
  219. "email_port": {
  220. "description": "SMTP server port",
  221. "type": "int",
  222. "default": 587,
  223. },
  224. "email_username": {
  225. "description": "SMTP username",
  226. "type": "str",
  227. },
  228. "email_password": {
  229. "description": "SMTP password",
  230. "type": "str",
  231. "sensitive": True,
  232. },
  233. "email_from": {
  234. "description": "From email address",
  235. "type": "str",
  236. },
  237. "email_use_tls": {
  238. "description": "Use TLS encryption",
  239. "type": "bool",
  240. "default": True,
  241. },
  242. "email_use_ssl": {
  243. "description": "Use SSL encryption",
  244. "type": "bool",
  245. "default": False,
  246. }
  247. },
  248. },
  249. "authentik": {
  250. "title": "Authentik SSO",
  251. "toggle": "authentik_enabled",
  252. "description": "Integrate with Authentik for Single Sign-On authentication.",
  253. "vars": {
  254. "authentik_enabled": {
  255. "description": "Enable Authentik SSO integration",
  256. "type": "bool",
  257. "default": False,
  258. },
  259. "authentik_url": {
  260. "description": "Authentik base URL (e.g., https://auth.example.com)",
  261. "type": "str",
  262. },
  263. "authentik_slug": {
  264. "description": "Authentik application slug",
  265. "type": "str",
  266. },
  267. "authentik_client_id": {
  268. "description": "OAuth client ID from Authentik provider",
  269. "type": "str",
  270. },
  271. "authentik_client_secret": {
  272. "description": "OAuth client secret from Authentik provider",
  273. "type": "str",
  274. "sensitive": True,
  275. },
  276. },
  277. },
  278. }
  279. )