@omer-x/buttler 2.0.0-alpha.11 → 2.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/drizzle/20261126111122_silky_starhawk/migration.sql +20 -0
  2. package/drizzle/20261126111122_silky_starhawk/snapshot.json +868 -0
  3. package/package.json +3 -1
  4. package/ui/.next/BUILD_ID +1 -1
  5. package/ui/.next/build-manifest.json +3 -3
  6. package/ui/.next/prerender-manifest.json +12 -12
  7. package/ui/.next/server/app/[locale]/(auth)/install/page/server-reference-manifest.json +17 -17
  8. package/ui/.next/server/app/[locale]/(auth)/install/page.js +18 -17
  9. package/ui/.next/server/app/[locale]/(auth)/install/page.js.nft.json +1 -1
  10. package/ui/.next/server/app/[locale]/(auth)/install/page_client-reference-manifest.js +1 -1
  11. package/ui/.next/server/app/[locale]/(auth)/login/page.js +2 -2
  12. package/ui/.next/server/app/[locale]/(auth)/login/page.js.nft.json +1 -1
  13. package/ui/.next/server/app/[locale]/(auth)/login/page_client-reference-manifest.js +1 -1
  14. package/ui/.next/server/app/[locale]/(base)/page/server-reference-manifest.json +72 -2
  15. package/ui/.next/server/app/[locale]/(base)/page.js +16 -6
  16. package/ui/.next/server/app/[locale]/(base)/page.js.nft.json +1 -1
  17. package/ui/.next/server/app/[locale]/(base)/page_client-reference-manifest.js +1 -1
  18. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page/server-reference-manifest.json +71 -31
  19. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page.js +21 -19
  20. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page.js.nft.json +1 -1
  21. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page_client-reference-manifest.js +1 -1
  22. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/server-reference-manifest.json +117 -57
  23. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page.js +24 -22
  24. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page.js.nft.json +1 -1
  25. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page_client-reference-manifest.js +1 -1
  26. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page/server-reference-manifest.json +71 -31
  27. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page.js +21 -19
  28. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page.js.nft.json +1 -1
  29. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page_client-reference-manifest.js +1 -1
  30. package/ui/.next/server/app/[locale]/(base)/services/[id]/page/server-reference-manifest.json +71 -31
  31. package/ui/.next/server/app/[locale]/(base)/services/[id]/page.js +21 -19
  32. package/ui/.next/server/app/[locale]/(base)/services/[id]/page.js.nft.json +1 -1
  33. package/ui/.next/server/app/[locale]/(base)/services/[id]/page_client-reference-manifest.js +1 -1
  34. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page/server-reference-manifest.json +77 -37
  35. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page.js +21 -19
  36. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page.js.nft.json +1 -1
  37. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page_client-reference-manifest.js +1 -1
  38. package/ui/.next/server/app/[locale]/(base)/services/new/page/server-reference-manifest.json +28 -28
  39. package/ui/.next/server/app/[locale]/(base)/services/new/page.js +14 -12
  40. package/ui/.next/server/app/[locale]/(base)/services/new/page.js.nft.json +1 -1
  41. package/ui/.next/server/app/[locale]/(base)/services/new/page_client-reference-manifest.js +1 -1
  42. package/ui/.next/server/app/[locale]/(base)/services/page/server-reference-manifest.json +44 -4
  43. package/ui/.next/server/app/[locale]/(base)/services/page.js +15 -14
  44. package/ui/.next/server/app/[locale]/(base)/services/page.js.nft.json +1 -1
  45. package/ui/.next/server/app/[locale]/(base)/services/page_client-reference-manifest.js +1 -1
  46. package/ui/.next/server/app/[locale]/(base)/settings/page/server-reference-manifest.json +20 -20
  47. package/ui/.next/server/app/[locale]/(base)/settings/page.js +13 -12
  48. package/ui/.next/server/app/[locale]/(base)/settings/page.js.nft.json +1 -1
  49. package/ui/.next/server/app/[locale]/(base)/settings/page_client-reference-manifest.js +1 -1
  50. package/ui/.next/server/app/[locale]/install.meta +2 -2
  51. package/ui/.next/server/app/[locale]/install.segments/$d$locale/!KGF1dGgp/install/__PAGE__.segment.rsc +4 -4
  52. package/ui/.next/server/app/[locale]/install.segments/_full.segment.rsc +6 -6
  53. package/ui/.next/server/app/[locale]/install.segments/_tree.segment.rsc +2 -2
  54. package/ui/.next/server/app/[locale]/login.meta +2 -2
  55. package/ui/.next/server/app/[locale]/login.segments/$d$locale/!KGF1dGgp/login/__PAGE__.segment.rsc +3 -3
  56. package/ui/.next/server/app/[locale]/login.segments/_full.segment.rsc +4 -4
  57. package/ui/.next/server/app/[locale]/login.segments/_tree.segment.rsc +2 -2
  58. package/ui/.next/server/app/[locale]/services/[id]/builds.meta +2 -2
  59. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/$d$locale/!KGJhc2Up/services/$d$id/builds/__PAGE__.segment.rsc +5 -5
  60. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/_full.segment.rsc +6 -6
  61. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/_tree.segment.rsc +2 -2
  62. package/ui/.next/server/app/[locale]/services/[id]/links.meta +2 -2
  63. package/ui/.next/server/app/[locale]/services/[id]/links.segments/$d$locale/!KGJhc2Up/services/$d$id/links/__PAGE__.segment.rsc +6 -6
  64. package/ui/.next/server/app/[locale]/services/[id]/links.segments/_full.segment.rsc +6 -6
  65. package/ui/.next/server/app/[locale]/services/[id]/links.segments/_tree.segment.rsc +2 -2
  66. package/ui/.next/server/app/[locale]/services/[id]/logs.meta +2 -2
  67. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/$d$locale/!KGJhc2Up/services/$d$id/logs/__PAGE__.segment.rsc +5 -5
  68. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/_full.segment.rsc +6 -6
  69. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/_tree.segment.rsc +2 -2
  70. package/ui/.next/server/app/[locale]/services/[id]/settings.meta +2 -2
  71. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/$d$locale/!KGJhc2Up/services/$d$id/settings/__PAGE__.segment.rsc +5 -5
  72. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/_full.segment.rsc +5 -5
  73. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/_tree.segment.rsc +2 -2
  74. package/ui/.next/server/app/[locale]/services/[id].meta +2 -2
  75. package/ui/.next/server/app/[locale]/services/[id].segments/$d$locale/!KGJhc2Up/services/$d$id/__PAGE__.segment.rsc +5 -5
  76. package/ui/.next/server/app/[locale]/services/[id].segments/_full.segment.rsc +6 -6
  77. package/ui/.next/server/app/[locale]/services/[id].segments/_tree.segment.rsc +2 -2
  78. package/ui/.next/server/app/[locale]/services/new.meta +2 -2
  79. package/ui/.next/server/app/[locale]/services/new.segments/$d$locale/!KGJhc2Up/services/new/__PAGE__.segment.rsc +5 -5
  80. package/ui/.next/server/app/[locale]/services/new.segments/_full.segment.rsc +6 -6
  81. package/ui/.next/server/app/[locale]/services/new.segments/_tree.segment.rsc +2 -2
  82. package/ui/.next/server/app/[locale]/services.meta +2 -2
  83. package/ui/.next/server/app/[locale]/services.segments/$d$locale/!KGJhc2Up/services/__PAGE__.segment.rsc +5 -5
  84. package/ui/.next/server/app/[locale]/services.segments/_full.segment.rsc +6 -6
  85. package/ui/.next/server/app/[locale]/services.segments/_tree.segment.rsc +2 -2
  86. package/ui/.next/server/app/[locale]/settings.meta +2 -2
  87. package/ui/.next/server/app/[locale]/settings.segments/$d$locale/!KGJhc2Up/settings/__PAGE__.segment.rsc +5 -5
  88. package/ui/.next/server/app/[locale]/settings.segments/_full.segment.rsc +5 -5
  89. package/ui/.next/server/app/[locale]/settings.segments/_tree.segment.rsc +2 -2
  90. package/ui/.next/server/app/[locale].meta +2 -2
  91. package/ui/.next/server/app/[locale].segments/$d$locale/!KGJhc2Up/__PAGE__.segment.rsc +8 -8
  92. package/ui/.next/server/app/[locale].segments/_full.segment.rsc +8 -8
  93. package/ui/.next/server/app/[locale].segments/_tree.segment.rsc +2 -2
  94. package/ui/.next/server/app/_global-error.html +1 -1
  95. package/ui/.next/server/app/_global-error.rsc +1 -1
  96. package/ui/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  97. package/ui/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  99. package/ui/.next/server/app/_not-found.html +1 -1
  100. package/ui/.next/server/app/_not-found.rsc +1 -1
  101. package/ui/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  102. package/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  103. package/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  104. package/ui/.next/server/app/api/services/[id]/logs/stream/route/server-reference-manifest.json +43 -3
  105. package/ui/.next/server/app/api/services/[id]/logs/stream/route.js +11 -9
  106. package/ui/.next/server/app/api/services/[id]/logs/stream/route.js.nft.json +1 -1
  107. package/ui/.next/server/app/api/sources/dockerhub/tags/route.js +1 -1
  108. package/ui/.next/server/app/api/sources/dockerhub/tags/route.js.nft.json +1 -1
  109. package/ui/.next/server/app/api/sources/github/branches/route.js +1 -1
  110. package/ui/.next/server/app/api/sources/github/branches/route.js.nft.json +1 -1
  111. package/ui/.next/server/app/api/sources/github/repos/route.js +1 -1
  112. package/ui/.next/server/app/api/sources/github/repos/route.js.nft.json +1 -1
  113. package/ui/.next/server/app/auth/cloudflare/route.js +11 -11
  114. package/ui/.next/server/app/auth/cloudflare/route.js.nft.json +1 -1
  115. package/ui/.next/server/app/auth/github/route.js +1 -1
  116. package/ui/.next/server/app/auth/github/route.js.nft.json +1 -1
  117. package/ui/.next/server/app/auth/github-install/route.js +1 -1
  118. package/ui/.next/server/app/auth/github-install/route.js.nft.json +1 -1
  119. package/ui/.next/server/app/auth/instance/route.js +1 -1
  120. package/ui/.next/server/app/auth/instance/route.js.nft.json +1 -1
  121. package/ui/.next/server/app/auth/setup/route.js +1 -1
  122. package/ui/.next/server/app/auth/setup/route.js.nft.json +1 -1
  123. package/ui/.next/server/app/en/install.html +1 -1
  124. package/ui/.next/server/app/en/install.meta +1 -1
  125. package/ui/.next/server/app/en/install.segments/$d$locale/!KGF1dGgp/install/__PAGE__.segment.rsc +2 -2
  126. package/ui/.next/server/app/en/install.segments/$d$locale.segment.rsc +3 -3
  127. package/ui/.next/server/app/en/install.segments/_full.segment.rsc +5 -5
  128. package/ui/.next/server/app/en/install.segments/_tree.segment.rsc +2 -2
  129. package/ui/.next/server/app/en/login.html +1 -1
  130. package/ui/.next/server/app/en/login.meta +1 -1
  131. package/ui/.next/server/app/en/login.segments/$d$locale/!KGF1dGgp/login/__PAGE__.segment.rsc +1 -1
  132. package/ui/.next/server/app/en/login.segments/$d$locale.segment.rsc +3 -3
  133. package/ui/.next/server/app/en/login.segments/_full.segment.rsc +4 -4
  134. package/ui/.next/server/app/en/login.segments/_tree.segment.rsc +2 -2
  135. package/ui/.next/server/app/en/services/[id]/builds.html +1 -1
  136. package/ui/.next/server/app/en/services/[id]/builds.meta +1 -1
  137. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale/!KGJhc2Up/services/$d$id/builds/__PAGE__.segment.rsc +6 -6
  138. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale/!KGJhc2Up.segment.rsc +7 -7
  139. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale.segment.rsc +4 -4
  140. package/ui/.next/server/app/en/services/[id]/builds.segments/_full.segment.rsc +12 -12
  141. package/ui/.next/server/app/en/services/[id]/builds.segments/_tree.segment.rsc +2 -2
  142. package/ui/.next/server/app/en/services/[id]/links.html +1 -1
  143. package/ui/.next/server/app/en/services/[id]/links.meta +1 -1
  144. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale/!KGJhc2Up/services/$d$id/links/__PAGE__.segment.rsc +8 -8
  145. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale/!KGJhc2Up.segment.rsc +8 -8
  146. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale.segment.rsc +4 -4
  147. package/ui/.next/server/app/en/services/[id]/links.segments/_full.segment.rsc +14 -14
  148. package/ui/.next/server/app/en/services/[id]/links.segments/_tree.segment.rsc +2 -2
  149. package/ui/.next/server/app/en/services/[id]/logs.html +1 -1
  150. package/ui/.next/server/app/en/services/[id]/logs.meta +1 -1
  151. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale/!KGJhc2Up/services/$d$id/logs/__PAGE__.segment.rsc +6 -6
  152. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale/!KGJhc2Up.segment.rsc +7 -7
  153. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale.segment.rsc +4 -4
  154. package/ui/.next/server/app/en/services/[id]/logs.segments/_full.segment.rsc +12 -12
  155. package/ui/.next/server/app/en/services/[id]/logs.segments/_tree.segment.rsc +2 -2
  156. package/ui/.next/server/app/en/services/[id]/settings.html +1 -1
  157. package/ui/.next/server/app/en/services/[id]/settings.meta +1 -1
  158. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale/!KGJhc2Up/services/$d$id/settings/__PAGE__.segment.rsc +6 -6
  159. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale/!KGJhc2Up.segment.rsc +7 -7
  160. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale.segment.rsc +4 -4
  161. package/ui/.next/server/app/en/services/[id]/settings.segments/_full.segment.rsc +12 -12
  162. package/ui/.next/server/app/en/services/[id]/settings.segments/_tree.segment.rsc +2 -2
  163. package/ui/.next/server/app/en/services/[id].html +1 -1
  164. package/ui/.next/server/app/en/services/[id].meta +1 -1
  165. package/ui/.next/server/app/en/services/[id].segments/$d$locale/!KGJhc2Up/services/$d$id/__PAGE__.segment.rsc +6 -6
  166. package/ui/.next/server/app/en/services/[id].segments/$d$locale/!KGJhc2Up.segment.rsc +7 -7
  167. package/ui/.next/server/app/en/services/[id].segments/$d$locale.segment.rsc +4 -4
  168. package/ui/.next/server/app/en/services/[id].segments/_full.segment.rsc +12 -12
  169. package/ui/.next/server/app/en/services/[id].segments/_tree.segment.rsc +2 -2
  170. package/ui/.next/server/app/en/services/new.html +1 -1
  171. package/ui/.next/server/app/en/services/new.meta +1 -1
  172. package/ui/.next/server/app/en/services/new.segments/$d$locale/!KGJhc2Up/services/new/__PAGE__.segment.rsc +5 -5
  173. package/ui/.next/server/app/en/services/new.segments/$d$locale/!KGJhc2Up.segment.rsc +5 -5
  174. package/ui/.next/server/app/en/services/new.segments/$d$locale.segment.rsc +3 -3
  175. package/ui/.next/server/app/en/services/new.segments/_full.segment.rsc +11 -11
  176. package/ui/.next/server/app/en/services/new.segments/_tree.segment.rsc +2 -2
  177. package/ui/.next/server/app/en/services.html +1 -1
  178. package/ui/.next/server/app/en/services.meta +1 -1
  179. package/ui/.next/server/app/en/services.segments/$d$locale/!KGJhc2Up/services/__PAGE__.segment.rsc +2 -2
  180. package/ui/.next/server/app/en/services.segments/$d$locale/!KGJhc2Up.segment.rsc +3 -3
  181. package/ui/.next/server/app/en/services.segments/$d$locale.segment.rsc +3 -3
  182. package/ui/.next/server/app/en/services.segments/_full.segment.rsc +7 -7
  183. package/ui/.next/server/app/en/services.segments/_tree.segment.rsc +2 -2
  184. package/ui/.next/server/app/en/settings.html +1 -1
  185. package/ui/.next/server/app/en/settings.meta +1 -1
  186. package/ui/.next/server/app/en/settings.segments/$d$locale/!KGJhc2Up/settings/__PAGE__.segment.rsc +2 -2
  187. package/ui/.next/server/app/en/settings.segments/$d$locale/!KGJhc2Up.segment.rsc +5 -5
  188. package/ui/.next/server/app/en/settings.segments/$d$locale.segment.rsc +3 -3
  189. package/ui/.next/server/app/en/settings.segments/_full.segment.rsc +10 -10
  190. package/ui/.next/server/app/en/settings.segments/_tree.segment.rsc +2 -2
  191. package/ui/.next/server/app/en.html +1 -1
  192. package/ui/.next/server/app/en.meta +1 -1
  193. package/ui/.next/server/app/en.segments/$d$locale/!KGJhc2Up/__PAGE__.segment.rsc +2 -2
  194. package/ui/.next/server/app/en.segments/$d$locale/!KGJhc2Up.segment.rsc +21 -20
  195. package/ui/.next/server/app/en.segments/$d$locale.segment.rsc +3 -3
  196. package/ui/.next/server/app/en.segments/_full.segment.rsc +14 -14
  197. package/ui/.next/server/app/en.segments/_tree.segment.rsc +2 -2
  198. package/ui/.next/server/app/webhooks/github/route.js +11 -10
  199. package/ui/.next/server/app/webhooks/github/route.js.nft.json +1 -1
  200. package/ui/.next/server/chunks/[externals]_node_util_1l9f7p0seb412._.js +3 -0
  201. package/ui/.next/server/chunks/[root-of-the-server]__0kdxf9igxdiz_._.js +3 -0
  202. package/ui/.next/server/chunks/[root-of-the-server]__1gbt-fsno6iuj._.js +3 -0
  203. package/ui/.next/server/chunks/[root-of-the-server]__1gub2pr-0jhrc._.js +3 -0
  204. package/ui/.next/server/chunks/[root-of-the-server]__1k0-jj97l-jwv._.js +3 -0
  205. package/ui/.next/server/chunks/{[root-of-the-server]__0gh0uoxmttq-k._.js → [root-of-the-server]__1osdb7qotih20._.js} +1 -1
  206. package/ui/.next/server/chunks/{[root-of-the-server]__0axr0p9f9qjo3._.js → [root-of-the-server]__1rjpafn22pgbi._.js} +2 -2
  207. package/ui/.next/server/chunks/[root-of-the-server]__1w3vh-httwncf._.js +9 -9
  208. package/ui/.next/server/chunks/{[root-of-the-server]__0hgon_k2l_1kv._.js → [root-of-the-server]__1z14yq28n8svk._.js} +2 -2
  209. package/ui/.next/server/chunks/_0-08w0j6upuro._.js +5 -5
  210. package/ui/.next/server/chunks/_07bkzwu90t1m3._.js +3 -0
  211. package/ui/.next/server/chunks/_1ddptkvp76c-m._.js +5 -5
  212. package/ui/.next/server/chunks/_1nlr92m-cxatd._.js +1 -1
  213. package/ui/.next/server/chunks/_1ux2nt1zdyn0-._.js +5 -5
  214. package/ui/.next/server/chunks/node_modules_zod_v4_classic_external_1-ztpnfqj06yn.js +57 -0
  215. package/ui/.next/server/chunks/src_0o62sbxgy6bsy._.js +1 -1
  216. package/ui/.next/server/chunks/src_1wc3qafci1k3-._.js +1 -1
  217. package/ui/.next/server/chunks/src_1z80lrk153ij8._.js +1 -1
  218. package/ui/.next/server/chunks/src_core_0p--nc9a237bh._.js +3 -0
  219. package/ui/.next/server/chunks/src_core_0smdt0vapdn87._.js +3 -0
  220. package/ui/.next/server/chunks/src_core_14ewzjq1s3i9u._.js +3 -0
  221. package/ui/.next/server/chunks/src_core_1zk9qubn0lh0k._.js +3 -0
  222. package/ui/.next/server/chunks/src_core_cloudflare_tunnel_ts_089fv-f8qrsgc._.js +1 -1
  223. package/ui/.next/server/chunks/src_core_docker_ingress_ts_0k5y-exk0jujc._.js +1 -1
  224. package/ui/.next/server/chunks/src_core_nginx_ts_1bg68o99-jq87._.js +4 -4
  225. package/ui/.next/server/chunks/src_core_nginx_ts_1rvs3_6875ras._.js +4 -4
  226. package/ui/.next/server/chunks/{src_core_settings_ts_03r6mrmvaf3z9._.js → src_core_settings_ts_1ez8uge8n99xt._.js} +1 -1
  227. package/ui/.next/server/chunks/{src_core_settings_ts_06epzja3innn1._.js → src_core_settings_ts_1qb3t6_en2sxy._.js} +1 -1
  228. package/ui/.next/server/chunks/src_database_index_ts_1vzqbmlp-k92u._.js +5 -5
  229. package/ui/.next/server/chunks/src_operations_0gtmu6wk3ptqr._.js +3 -0
  230. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0_t9eetve-upz._.js +3 -0
  231. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0ar7m38kk_52p._.js +3 -0
  232. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__0cws_i6hecx8i._.js → [root-of-the-server]__0drv11-4w87e2._.js} +2 -2
  233. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0szkj2rz9gc4p._.js +3 -0
  234. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__0tnvefuofuctm._.js → [root-of-the-server]__0xfcoz21x009a._.js} +1 -1
  235. package/ui/.next/server/chunks/ssr/[root-of-the-server]__13wwqyskje2pf._.js +3 -0
  236. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__213i1nlxvmwk9._.js → [root-of-the-server]__14cindwks2ngq._.js} +2 -2
  237. package/ui/.next/server/chunks/ssr/[root-of-the-server]__191kc90-j0_jt._.js +3 -0
  238. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1f7gqom-c4pb-._.js +4 -0
  239. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1ofmltz04cbjw._.js +4 -0
  240. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1p7kc1g9qhyox._.js +3 -0
  241. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1po6dg9-61ces._.js +3 -0
  242. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1s-mrqde88fuf._.js +3 -0
  243. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1stgjqca236p0._.js +3 -0
  244. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1xhs3b7ujo053._.js +3 -0
  245. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__0lrw_bd_v-wq9._.js → [root-of-the-server]__1zk2u27f_4u90._.js} +1 -1
  246. package/ui/.next/server/chunks/ssr/{_1gxrg8g_1z61n._.js → _0-wf8z64gix8r._.js} +2 -2
  247. package/ui/.next/server/chunks/ssr/_01e3rinj2_l0i._.js +3 -0
  248. package/ui/.next/server/chunks/ssr/_02ryxn4m6hzdc._.js +3 -0
  249. package/ui/.next/server/chunks/ssr/_03mjbc5iu4-0t._.js +1 -1
  250. package/ui/.next/server/chunks/ssr/_045ukfxgkrnjs._.js +1 -1
  251. package/ui/.next/server/chunks/ssr/_0d9pkjivaskup._.js +3 -0
  252. package/ui/.next/server/chunks/ssr/_0mbw-qlug1nga._.js +3 -0
  253. package/ui/.next/server/chunks/ssr/{node_modules_@omer-x_tailwind-ui-kit_dist_components_form_index_1scnp-x6u_00i.js → _0nnq48ip-8ji-._.js} +2 -2
  254. package/ui/.next/server/chunks/ssr/_0pzz4guyxinji._.js +3 -0
  255. package/ui/.next/server/chunks/ssr/_0q_ty5-s_ojhi._.js +1 -1
  256. package/ui/.next/server/chunks/ssr/_0sid4-3pb734p._.js +1 -1
  257. package/ui/.next/server/chunks/ssr/{_0nm-73v3d_j3o._.js → _0uoudo7rk09-z._.js} +2 -2
  258. package/ui/.next/server/chunks/ssr/_0zdce9fv-8b8t._.js +16 -0
  259. package/ui/.next/server/chunks/ssr/_11wtwluve5yly._.js +16 -0
  260. package/ui/.next/server/chunks/ssr/_14pr8k-21_dud._.js +7 -7
  261. package/ui/.next/server/chunks/ssr/_15kyk81ereeyo._.js +3 -0
  262. package/ui/.next/server/chunks/ssr/_1975r9mjak44f._.js +1 -1
  263. package/ui/.next/server/chunks/ssr/{_0elrzkszc9mou._.js → _19w_0onn2cdmy._.js} +2 -2
  264. package/ui/.next/server/chunks/ssr/_1bjf_7jgwpf2s._.js +3 -0
  265. package/ui/.next/server/chunks/ssr/_1c9ja4120f5e7._.js +1 -1
  266. package/ui/.next/server/chunks/ssr/_1ejoo52e92zfh._.js +4 -0
  267. package/ui/.next/server/chunks/ssr/_1hg3jdepqyntc._.js +3 -0
  268. package/ui/.next/server/chunks/ssr/{_1t7wd5lbghpsq._.js → _1j5g-1pklmyv3._.js} +2 -2
  269. package/ui/.next/server/chunks/ssr/_1jvwyvy2mdunl._.js +1 -1
  270. package/ui/.next/server/chunks/ssr/_1rtp67myolpxl._.js +3 -0
  271. package/ui/.next/server/chunks/ssr/{_1l9hlfxdk4800._.js → _1u8kexnz9q33-._.js} +2 -2
  272. package/ui/.next/server/chunks/ssr/{_1v-gh-ppdzk54._.js → _1xae8y1jdr-yt._.js} +2 -2
  273. package/ui/.next/server/chunks/ssr/_next-internal_server_app_[locale]_(auth)_install_page_actions_0q608mh34etxn.js +1 -1
  274. package/ui/.next/server/chunks/ssr/dictionaries_en_json_[json]_cjs_1pkm_n6uii6ve._.js +1 -1
  275. package/ui/.next/server/chunks/ssr/node_modules_@fortawesome_1b8xftrps6-_7._.js +3 -0
  276. package/ui/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_1ndpkx9dx8w6x.js +60 -0
  277. package/ui/.next/server/chunks/ssr/src_011-o6ndequ7v._.js +3 -0
  278. package/ui/.next/server/chunks/ssr/src_05sh4p2uehbos._.js +1 -1
  279. package/ui/.next/server/chunks/ssr/src_0an88nxn4x76f._.js +3 -0
  280. package/ui/.next/server/chunks/ssr/src_0bb9793pg0rye._.js +3 -0
  281. package/ui/.next/server/chunks/ssr/src_1iyfq6dudriyk._.js +1 -1
  282. package/ui/.next/server/chunks/ssr/src_1spp4h7q0g3hj._.js +1 -1
  283. package/ui/.next/server/chunks/ssr/src_actions_cloudflare_ts_0fwbybngp80nf._.js +1 -1
  284. package/ui/.next/server/chunks/ssr/src_actions_link_ts_13hqd7ogc36j3._.js +1 -1
  285. package/ui/.next/server/chunks/ssr/src_actions_service_ts_0leald8wxwln3._.js +1 -1
  286. package/ui/.next/server/chunks/ssr/src_actions_setup_ts_1j3o9o1z2x8l-._.js +1 -1
  287. package/ui/.next/server/chunks/ssr/src_actions_user_ts_15o74nrxk2-dn._.js +1 -1
  288. package/ui/.next/server/chunks/ssr/src_app_[locale]_(base)_services_[id]_page_tsx_0hd62fq604aua._.js +1 -1
  289. package/ui/.next/server/chunks/ssr/src_components_0dw7q_n_p1894._.js +1 -1
  290. package/ui/.next/server/chunks/ssr/src_components_home_ServiceGraph_tsx_0558vajg-8d4p._.js +3 -0
  291. package/ui/.next/server/chunks/ssr/src_components_services_0o2ktko188779._.js +3 -0
  292. package/ui/.next/server/chunks/ssr/src_core_0ygdjnz173o86._.js +3 -0
  293. package/ui/.next/server/chunks/ssr/src_core_build_ts_137f9fwr3qgv8._.js +1 -1
  294. package/ui/.next/server/chunks/ssr/src_core_docker_ingress_ts_0v7q2dx4d_gfp._.js +1 -1
  295. package/ui/.next/server/chunks/ssr/src_core_nginx_ts_0mm1uzfna8wth._.js +59 -0
  296. package/ui/.next/server/middleware-build-manifest.js +3 -3
  297. package/ui/.next/server/pages/404.html +1 -1
  298. package/ui/.next/server/pages/500.html +1 -1
  299. package/ui/.next/server/preview-props.json +3 -3
  300. package/ui/.next/server/server-reference-manifest.js +1 -1
  301. package/ui/.next/server/server-reference-manifest.json +264 -80
  302. package/ui/.next/static/chunks/{0pmjaba_0rn_q.js → 00xismlj7p6qe.js} +1 -1
  303. package/ui/.next/static/chunks/{1hltxf3jfbf02.js → 08m3mlwdpjhqa.js} +1 -1
  304. package/ui/.next/static/chunks/0htsyc2_pv8pv.js +1 -0
  305. package/ui/.next/static/chunks/{0r6re9w59ezlu.js → 1n7hyxug-qmmf.js} +1 -1
  306. package/ui/.next/static/chunks/2q2scbq1qaa4s.js +1 -0
  307. package/ui/.next/static/chunks/2qkq9emwyxsvl.css +1 -0
  308. package/ui/.next/static/chunks/{3xkvxef3j7yvp.js → 2waox0exqlikj.js} +1 -1
  309. package/ui/.next/static/chunks/3htgsexlb92yb.js +1 -0
  310. package/ui/.next/static/chunks/{2-f5vue3n9x5a.js → 3q_nh670r4jc-.js} +1 -1
  311. package/ui/.next/static/chunks/{0lhpeq9mgbyjs.js → 3w1gjlvo31t29.js} +1 -1
  312. package/ui/.next/static/chunks/40_ph2cay5-4w.js +1 -0
  313. package/ui/drizzle/20261126111122_silky_starhawk/migration.sql +20 -0
  314. package/ui/drizzle/20261126111122_silky_starhawk/snapshot.json +868 -0
  315. package/ui/package.json +2 -0
  316. package/ui/src/core/docker/status.ts +6 -1
  317. package/ui/src/core/recreate.ts +43 -0
  318. package/ui/src/core/service-graph.test.ts +37 -0
  319. package/ui/src/core/service-graph.ts +90 -0
  320. package/ui/src/core/shared-variables.test.ts +83 -0
  321. package/ui/src/core/shared-variables.ts +80 -0
  322. package/ui/.next/server/chunks/[root-of-the-server]__0emx9mcq5bpjq._.js +0 -3
  323. package/ui/.next/server/chunks/[root-of-the-server]__0qe_mikj7agcq._.js +0 -3
  324. package/ui/.next/server/chunks/[root-of-the-server]__1007u-potejqr._.js +0 -3
  325. package/ui/.next/server/chunks/[root-of-the-server]__1ukr105klaen2._.js +0 -3
  326. package/ui/.next/server/chunks/_0etmci43pbufz._.js +0 -57
  327. package/ui/.next/server/chunks/_0nlsx2mvtyhai._.js +0 -3
  328. package/ui/.next/server/chunks/_0xa0_ovy64zj7._.js +0 -57
  329. package/ui/.next/server/chunks/_1s6yh1-j0stln._.js +0 -57
  330. package/ui/.next/server/chunks/_1xyz4i2jb2-s2._.js +0 -3
  331. package/ui/.next/server/chunks/src_1jcil3p45z5jf._.js +0 -3
  332. package/ui/.next/server/chunks/src_core_01hbgvb0ullx2._.js +0 -3
  333. package/ui/.next/server/chunks/src_core_storage_ts_1tmiqzjak_i1r._.js +0 -3
  334. package/ui/.next/server/chunks/ssr/[root-of-the-server]__034qjpl9j-0ci._.js +0 -3
  335. package/ui/.next/server/chunks/ssr/[root-of-the-server]__09xlfu5wytwkq._.js +0 -3
  336. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0rkkxjp0vxzob._.js +0 -3
  337. package/ui/.next/server/chunks/ssr/[root-of-the-server]__11f8nw5rjx5xy._.js +0 -3
  338. package/ui/.next/server/chunks/ssr/[root-of-the-server]__19k3qfyr4zw2t._.js +0 -4
  339. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1_2uw8tv9c80k._.js +0 -4
  340. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1el9cow-18yf7._.js +0 -3
  341. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1f2-_zy1hslsn._.js +0 -4
  342. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1nipqwqlhzrez._.js +0 -4
  343. package/ui/.next/server/chunks/ssr/_0257bgoti-zpl._.js +0 -3
  344. package/ui/.next/server/chunks/ssr/_043r3p4uyglt8._.js +0 -3
  345. package/ui/.next/server/chunks/ssr/_0_qywkd_6kzqc._.js +0 -16
  346. package/ui/.next/server/chunks/ssr/_0bw_5lgeb32vn._.js +0 -16
  347. package/ui/.next/server/chunks/ssr/_0gm20eaq31snn._.js +0 -3
  348. package/ui/.next/server/chunks/ssr/_0gthv16q_rqwx._.js +0 -3
  349. package/ui/.next/server/chunks/ssr/_11zzjiiyv_16p._.js +0 -3
  350. package/ui/.next/server/chunks/ssr/_12gl1cg0-6m84._.js +0 -3
  351. package/ui/.next/server/chunks/ssr/_18ge21re3r-uk._.js +0 -3
  352. package/ui/.next/server/chunks/ssr/_1cwumh2lem642._.js +0 -4
  353. package/ui/.next/server/chunks/ssr/_1g8x3co_2gk2e._.js +0 -3
  354. package/ui/.next/server/chunks/ssr/_1s61535w_i_lb._.js +0 -3
  355. package/ui/.next/server/chunks/ssr/_1vznrs2oqv125._.js +0 -3
  356. package/ui/.next/server/chunks/ssr/node_modules_@fortawesome_react-fontawesome_dist_index_0w8d9rk-bs6d1.js +0 -3
  357. package/ui/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0_adu4p2yg38n.js +0 -57
  358. package/ui/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0b6jkffik0qe3.js +0 -57
  359. package/ui/.next/server/chunks/ssr/src_0bnikiwqnj5ci._.js +0 -59
  360. package/ui/.next/server/chunks/ssr/src_0unk8-b7ur6o4._.js +0 -59
  361. package/ui/.next/server/chunks/ssr/src_1m2fl_nqj5nqs._.js +0 -3
  362. package/ui/.next/server/chunks/ssr/src_components_services_1xqd2ez36okp0._.js +0 -3
  363. package/ui/.next/server/chunks/ssr/src_core_02f6f7rscof07._.js +0 -3
  364. package/ui/.next/server/chunks/ssr/src_core_docker_1o4aldsy3-3_s._.js +0 -3
  365. package/ui/.next/static/chunks/239xg4smw97sy.js +0 -1
  366. package/ui/.next/static/chunks/2ev4g9-mfre-4.js +0 -1
  367. package/ui/.next/static/chunks/2y6dkbb_cpkcg.css +0 -1
  368. package/ui/.next/static/chunks/3pmo4svmlsjie.js +0 -1
  369. /package/ui/.next/static/{fvieogK7wa0plojcPyhrz → 8SAKCW91y6PAVRgcqTx-O}/_buildManifest.js +0 -0
  370. /package/ui/.next/static/{fvieogK7wa0plojcPyhrz → 8SAKCW91y6PAVRgcqTx-O}/_clientMiddlewareManifest.js +0 -0
  371. /package/ui/.next/static/{fvieogK7wa0plojcPyhrz → 8SAKCW91y6PAVRgcqTx-O}/_ssgManifest.js +0 -0
package/ui/package.json CHANGED
@@ -69,6 +69,7 @@
69
69
  "@omer-x/tailwind-ui-kit": "^1.0.0-alpha.18",
70
70
  "clsx": "^2.1.1",
71
71
  "commander": "^14.0.2",
72
+ "d3-force": "^3.0.1",
72
73
  "dockerode": "^4.0.9",
73
74
  "drizzle-orm": "1.0.0-rc.5",
74
75
  "drizzle-zod-shared-refinements": "^3.0.0-alpha.1",
@@ -90,6 +91,7 @@
90
91
  "@omer-x/next-admin-panel-generator": "^1.2.2",
91
92
  "@omer-x/next-openapi-scaffold-generator": "^0.3.0",
92
93
  "@tailwindcss/postcss": "^4.3.5",
94
+ "@types/d3-force": "^3.0.10",
93
95
  "@types/dockerode": "^3.3.47",
94
96
  "@types/node": "^25.0.2",
95
97
  "@types/react": "^19.3.0",
@@ -220,6 +220,8 @@ export type ServiceRef = ServiceIdentity & {
220
220
  branch?: string | null,
221
221
  ports?: { external: number, internal: number }[],
222
222
  environmentVariables?: ServiceEnvironmentVariable[],
223
+ /** Variables from the links of the service, resolved when it's loaded */
224
+ inheritedVariables?: Record<string, string>,
223
225
  volumes?: { name: string, containerPath: string }[],
224
226
  };
225
227
 
@@ -413,7 +415,10 @@ async function replaceServiceContainer(service: ServiceRef, image: string) {
413
415
  exposedPorts[`${p.internal}/tcp`] = {};
414
416
  }
415
417
 
416
- const env = Object.entries(getRuntimeVariables(service.environmentVariables)).map(([key, value]) => `${key}=${value}`);
418
+ const env = Object.entries({
419
+ ...service.inheritedVariables,
420
+ ...getRuntimeVariables(service.environmentVariables),
421
+ }).map(([key, value]) => `${key}=${value}`);
417
422
  const binds = (service.volumes ?? []).map(v => `${v.name}:${v.containerPath}`);
418
423
 
419
424
  const container = await docker.createContainer({
@@ -0,0 +1,43 @@
1
+ import "server-only";
2
+ import {
3
+ getServiceRuntimeState,
4
+ isServiceBuilding,
5
+ isServiceDeleting,
6
+ isServiceDeploying,
7
+ isServicePulling,
8
+ restartServiceContainer,
9
+ } from "~/core/docker/status";
10
+ import db from "~/database";
11
+ import getDeployableService from "~/operations/getDeployableService";
12
+
13
+ /** A build, a pull or a deploy would create the service again while it's deleted */
14
+ export function isServiceBusy(serviceId: string) {
15
+ return isServiceBuilding(serviceId) ||
16
+ isServicePulling(serviceId) ||
17
+ isServiceDeploying(serviceId) ||
18
+ isServiceDeleting(serviceId);
19
+ }
20
+
21
+ /**
22
+ * Creates the containers of the running services again, so they get their new variables.
23
+ * Stopped services get them when they are started. Returns the services that couldn't be recreated.
24
+ */
25
+ export async function recreateRunningServices(serviceIds: string[]) {
26
+ const failed: string[] = [];
27
+ for (const serviceId of serviceIds) {
28
+ const service = await getDeployableService(db, serviceId);
29
+ if (!service) continue;
30
+ try {
31
+ const { status } = await getServiceRuntimeState(service);
32
+ if (status !== "running") continue;
33
+ // The container is replaced anyway, and replacing it at the same time would fail
34
+ if (isServiceBusy(serviceId)) throw new Error("The service is busy");
35
+ await restartServiceContainer(service);
36
+ } catch (error) {
37
+ // eslint-disable-next-line no-console
38
+ console.error(`Failed to recreate the container of service ${serviceId}:`, error);
39
+ failed.push(serviceId);
40
+ }
41
+ }
42
+ return failed;
43
+ }
@@ -0,0 +1,37 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { type GraphService, buildServiceGraph } from "./service-graph";
3
+
4
+ const services: GraphService[] = [
5
+ { id: "nginx", name: "Reverse Proxy Server", type: "system" },
6
+ { id: "tunnel", name: "Cloudflare Tunnel", type: "system" },
7
+ { id: "app", name: "App", type: "github" },
8
+ { id: "db", name: "Postgres", type: "dockerhub" },
9
+ ];
10
+
11
+ const edgeIds = (graph: ReturnType<typeof buildServiceGraph>) => graph.edges.map(edge => [edge.sourceId, edge.targetId]);
12
+
13
+ describe("buildServiceGraph", () => {
14
+ it("should leave out the system services other than nginx", () => {
15
+ const graph = buildServiceGraph(services, [], "nginx", []);
16
+ expect(graph.nodes.map(node => node.id)).toEqual(["nginx", "app", "db"]);
17
+ expect(graph.nodes.find(node => node.id === "nginx")?.isReverseProxy).toBe(true);
18
+ });
19
+
20
+ it("should connect the links and nginx to the services with a domain", () => {
21
+ const graph = buildServiceGraph(services, [{ serviceAId: "app", serviceBId: "db" }], "nginx", ["app"]);
22
+ expect(edgeIds(graph)).toEqual([["app", "db"], ["nginx", "app"]]);
23
+ });
24
+
25
+ it("should skip the edges of services that aren't shown", () => {
26
+ const graph = buildServiceGraph(services, [{ serviceAId: "tunnel", serviceBId: "app" }], null, ["app"]);
27
+ expect(graph.nodes.map(node => node.id)).toEqual(["app", "db"]);
28
+ expect(graph.edges).toEqual([]);
29
+ });
30
+
31
+ it("should give the same layout for the same data", () => {
32
+ const first = buildServiceGraph(services, [{ serviceAId: "app", serviceBId: "db" }], "nginx", ["app"]);
33
+ const second = buildServiceGraph(services, [{ serviceAId: "app", serviceBId: "db" }], "nginx", ["app"]);
34
+ expect(second.nodes).toEqual(first.nodes);
35
+ expect(new Set(first.nodes.map(node => `${node.x},${node.y}`)).size).toBe(3);
36
+ });
37
+ });
@@ -0,0 +1,90 @@
1
+ import {
2
+ type SimulationLinkDatum,
3
+ type SimulationNodeDatum,
4
+ forceCenter,
5
+ forceCollide,
6
+ forceLink,
7
+ forceManyBody,
8
+ forceSimulation,
9
+ } from "d3-force";
10
+
11
+ export type GraphService = {
12
+ id: string,
13
+ name: string,
14
+ type: "github" | "dockerhub" | "system",
15
+ };
16
+
17
+ export type GraphLink = {
18
+ serviceAId: string,
19
+ serviceBId: string,
20
+ };
21
+
22
+ export type GraphNode = {
23
+ id: string,
24
+ name: string,
25
+ isReverseProxy: boolean,
26
+ x: number,
27
+ y: number,
28
+ };
29
+
30
+ export type GraphEdge = {
31
+ id: string,
32
+ sourceId: string,
33
+ targetId: string,
34
+ };
35
+
36
+ export type ServiceGraph = {
37
+ nodes: GraphNode[],
38
+ edges: GraphEdge[],
39
+ };
40
+
41
+ type SimulationNode = SimulationNodeDatum & Omit<GraphNode, "x" | "y">;
42
+
43
+ /**
44
+ * Lays out the services and nginx with their links.
45
+ * nginx is connected to the services that have a domain, the other system services are left out.
46
+ * The simulation starts from the same positions every time, so the layout only changes with the data.
47
+ */
48
+ export function buildServiceGraph(
49
+ services: GraphService[],
50
+ links: GraphLink[],
51
+ reverseProxyId: string | null,
52
+ servicesWithDomains: string[],
53
+ ): ServiceGraph {
54
+ const nodes: SimulationNode[] = services
55
+ .filter(service => service.type !== "system" || service.id === reverseProxyId)
56
+ .map(service => ({ id: service.id, name: service.name, isReverseProxy: service.id === reverseProxyId }));
57
+ const nodeIds = new Set(nodes.map(node => node.id));
58
+
59
+ const pairs = links.map(link => [link.serviceAId, link.serviceBId] as const);
60
+ if (reverseProxyId && nodeIds.has(reverseProxyId)) {
61
+ pairs.push(...servicesWithDomains.map(serviceId => [reverseProxyId, serviceId] as const));
62
+ }
63
+ type SimulationLink = SimulationLinkDatum<SimulationNode> & { id: string };
64
+ const simulationLinks: SimulationLink[] = pairs
65
+ .filter(([a, b]) => a !== b && nodeIds.has(a) && nodeIds.has(b))
66
+ .map(([a, b]) => ({ id: `${a}:${b}`, source: a, target: b }));
67
+
68
+ forceSimulation(nodes)
69
+ .force("link", forceLink<SimulationNode, SimulationLink>(simulationLinks).id(node => node.id).distance(140))
70
+ .force("charge", forceManyBody().strength(-600))
71
+ .force("collide", forceCollide(56))
72
+ .force("center", forceCenter(0, 0))
73
+ .stop()
74
+ .tick(300);
75
+
76
+ return {
77
+ nodes: nodes.map(node => ({
78
+ id: node.id,
79
+ name: node.name,
80
+ isReverseProxy: node.isReverseProxy,
81
+ x: Math.round(node.x ?? 0),
82
+ y: Math.round(node.y ?? 0),
83
+ })),
84
+ edges: simulationLinks.map(link => ({
85
+ id: link.id,
86
+ sourceId: (link.source as SimulationNode).id,
87
+ targetId: (link.target as SimulationNode).id,
88
+ })),
89
+ };
90
+ }
@@ -0,0 +1,83 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ type SharedVariableSource,
4
+ getServiceHost,
5
+ getTemplateReferences,
6
+ getUnknownPlaceholders,
7
+ resolveTemplate,
8
+ } from "./shared-variables";
9
+
10
+ const source: SharedVariableSource = {
11
+ host: getServiceHost("db"),
12
+ variables: [
13
+ { key: "POSTGRES_USER", value: "admin", scope: "runtime", isSecret: false },
14
+ { key: "POSTGRES_PASSWORD", value: "hunter2", scope: "both", isSecret: true },
15
+ { key: "EMPTY", value: "", scope: "runtime", isSecret: false },
16
+ { key: "BUILD_ONLY", value: "x", scope: "build", isSecret: false },
17
+ ],
18
+ };
19
+
20
+ describe("shared variable templates", () => {
21
+ it("should resolve the host and the runtime variables", () => {
22
+ expect(resolveTemplate("postgres://{env.POSTGRES_USER}@{host}:5432", source)).toEqual({
23
+ value: "postgres://admin@buttler-service-db:5432",
24
+ isSecret: false,
25
+ unset: [],
26
+ });
27
+ });
28
+
29
+ it("should keep plain values as they are", () => {
30
+ expect(resolveTemplate("5432", source)).toEqual({ value: "5432", isSecret: false, unset: [] });
31
+ });
32
+
33
+ it("should mark values that are built from a secret as secret", () => {
34
+ expect(resolveTemplate("{env.POSTGRES_PASSWORD}", source)).toEqual({
35
+ value: "hunter2",
36
+ isSecret: true,
37
+ unset: [],
38
+ });
39
+ });
40
+
41
+ it("should mask secrets that can't be read", () => {
42
+ const masked: SharedVariableSource = {
43
+ ...source,
44
+ variables: source.variables.map(variable => (variable.isSecret ? { ...variable, value: null } : variable)),
45
+ };
46
+ expect(resolveTemplate("{env.POSTGRES_PASSWORD:-none}", masked, "••••")).toEqual({
47
+ value: "••••",
48
+ isSecret: true,
49
+ unset: [],
50
+ });
51
+ });
52
+
53
+ it("should resolve unset variables to an empty string and report them", () => {
54
+ expect(resolveTemplate("{env.MISSING}-{env.BUILD_ONLY}-{env.MISSING}", source)).toEqual({
55
+ value: "--",
56
+ isSecret: false,
57
+ unset: ["MISSING", "BUILD_ONLY"],
58
+ });
59
+ });
60
+
61
+ it("should use the fallback when a variable isn't set or empty", () => {
62
+ expect(resolveTemplate("{env.MISSING:-app}/{env.EMPTY:-}/{env.POSTGRES_USER:-x}", source)).toEqual({
63
+ value: "app//admin",
64
+ isSecret: false,
65
+ unset: [],
66
+ });
67
+ });
68
+
69
+ it("should keep unknown placeholders as they are", () => {
70
+ expect(resolveTemplate("{hots}{env.}{env.A-B}", source).value).toBe("{hots}{env.}{env.A-B}");
71
+ });
72
+
73
+ it("should list the referenced variables", () => {
74
+ expect(getTemplateReferences("{host}{env.A}{env.B:-b}")).toEqual([
75
+ { name: "A", hasFallback: false },
76
+ { name: "B", hasFallback: true },
77
+ ]);
78
+ });
79
+
80
+ it("should list the unknown placeholders", () => {
81
+ expect(getUnknownPlaceholders("{host}{hots}{env.A:-x}{env.}")).toEqual(["{hots}", "{env.}"]);
82
+ });
83
+ });
@@ -0,0 +1,80 @@
1
+ import type { ServiceEnvironmentVariable } from "./environment-variables";
2
+
3
+ /**
4
+ * A shared variable is a template that refers to the service that shares it:
5
+ * - `{host}`: its container name
6
+ * - `{env.NAME}`: one of its runtime variables, an empty string when it isn't set
7
+ * - `{env.NAME:-fallback}`: the same, with a fallback when it isn't set or empty
8
+ * Anything else is kept as it is.
9
+ */
10
+ const placeholderPattern = /\{(?:host|env\.([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?)\}/g;
11
+
12
+ const bracePattern = /\{[^{}]*\}/g;
13
+
14
+ export type SharedVariableSource = {
15
+ host: string,
16
+ /** `null` values are secrets that can't be read, e.g. in a preview */
17
+ variables: (Pick<ServiceEnvironmentVariable, "key" | "scope" | "isSecret"> & { value: string | null })[],
18
+ };
19
+
20
+ export type ResolvedTemplate = {
21
+ value: string,
22
+ /** A value that is built from a secret is a secret too */
23
+ isSecret: boolean,
24
+ /** Referenced variables that aren't set and have no fallback */
25
+ unset: string[],
26
+ };
27
+
28
+ export type TemplateReference = {
29
+ name: string,
30
+ hasFallback: boolean,
31
+ };
32
+
33
+ /** The container name of a service, which its linked services can reach */
34
+ export function getServiceHost(serviceId: string) {
35
+ return `buttler-service-${serviceId}`;
36
+ }
37
+
38
+ /** Variables of the service that are referred to with `{env.NAME}` */
39
+ export function getTemplateReferences(template: string): TemplateReference[] {
40
+ return Array.from(template.matchAll(placeholderPattern)).flatMap(match => {
41
+ // Groups that don't take part in the match are undefined
42
+ const [, name, fallback] = match as (string | undefined)[];
43
+ return name ? [{ name, hasFallback: fallback !== undefined }] : [];
44
+ });
45
+ }
46
+
47
+ /** Braces that look like placeholders but aren't one, e.g. a typo like `{hots}` */
48
+ export function getUnknownPlaceholders(template: string) {
49
+ return Array.from(template.matchAll(bracePattern), ([match]) => match)
50
+ .filter(match => !new RegExp(`^${placeholderPattern.source}$`).test(match));
51
+ }
52
+
53
+ /**
54
+ * Resolves a template with the runtime variables of the service that shares it.
55
+ * Secrets with a `null` value are replaced with `mask`.
56
+ */
57
+ export function resolveTemplate(template: string, source: SharedVariableSource, mask = ""): ResolvedTemplate {
58
+ const runtimeVariables = new Map(source.variables
59
+ .filter(({ scope }) => scope === "runtime" || scope === "both")
60
+ .map(variable => [variable.key, variable]));
61
+ const unset = new Set<string>();
62
+ let isSecret = false;
63
+ const value = template.replace(placeholderPattern, (match, name: string | undefined, fallback: string | undefined) => {
64
+ if (!name) return source.host;
65
+ const variable = runtimeVariables.get(name);
66
+ if (!variable) {
67
+ if (fallback !== undefined) return fallback;
68
+ unset.add(name);
69
+ return "";
70
+ }
71
+ if (variable.value === null) {
72
+ isSecret = true;
73
+ return mask;
74
+ }
75
+ if (!variable.value && fallback !== undefined) return fallback;
76
+ if (variable.isSecret) isSecret = true;
77
+ return variable.value;
78
+ });
79
+ return { value, isSecret, unset: Array.from(unset) };
80
+ }
@@ -1,3 +0,0 @@
1
- module.exports=[59870,(e,r,s)=>{r.exports=e.x("@grpc/grpc-js-a3bed6b460f5f8b6",()=>require("@grpc/grpc-js-a3bed6b460f5f8b6"))},54799,(e,r,s)=>{r.exports=e.x("crypto",()=>require("crypto"))},75760,(e,r,s)=>{r.exports=e.x("dockerode-bcad4ae286499104",()=>require("dockerode-bcad4ae286499104"))},27699,(e,r,s)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,s)=>{r.exports=e.x("fs",()=>require("fs"))},70406,(e,r,s)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,r,s)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},34270,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/module-loading/track-module-loading.external.js",()=>require("next/dist/server/app-render/module-loading/track-module-loading.external.js"))},56704,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,s)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},51187,(e,r,s)=>{r.exports=e.x("next/dist/server/lib/incremental-cache/tags-manifest.external.js",()=>require("next/dist/server/lib/incremental-cache/tags-manifest.external.js"))},59043,(e,r,s)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},66680,(e,r,s)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,r,s)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},12714,(e,r,s)=>{r.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},46479,(e,r,s)=>{r.exports=e.x("node:http2",()=>require("node:http2"))},61095,(e,r,s)=>{r.exports=e.x("node:net",()=>require("node:net"))},60526,(e,r,s)=>{r.exports=e.x("node:os",()=>require("node:os"))},50227,(e,r,s)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,s)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},14747,(e,r,s)=>{r.exports=e.x("path",()=>require("path"))},24361,(e,r,s)=>{r.exports=e.x("util",()=>require("util"))},60362,e=>{"use strict";var r=e.i(16660);e.S([r,"80086e5768b4d443b86d288e24aa341665c1eb4104,k,c026a6744c7220cc5e41fac1510afc179a35755f12,_,c0d45ce64a69d75800e5428cb99d8e876a575f34ba,C"],60362)},80365,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__1007u-potejqr._.js","server/chunks/src_core_github_app_ts_1-ye9_ml2tj8-._.js","server/chunks/node_modules_next_1lo724y0ayaf6._.js","server/chunks/src_core_build_ts_1w4o1q_gv2fnz._.js","server/chunks/src_core_01hbgvb0ullx2._.js"].map(r=>e.l(r))).then(()=>r(43060)))},29301,e=>{e.v(r=>Promise.all(["server/chunks/src_core_storage_ts_1tmiqzjak_i1r._.js","server/chunks/src_core_docker_tunnel_ts_0a1cq4o2gv4cz._.js","server/chunks/_0etmci43pbufz._.js","server/chunks/_0fakz5bf_8pur._.js"].map(r=>e.l(r))).then(()=>r(62630)))},74953,e=>{e.v(e=>Promise.resolve().then(()=>e(63400)))},23099,e=>{e.v(r=>Promise.all(["server/chunks/src_1jcil3p45z5jf._.js","server/chunks/src_core_nginx_ts_1rvs3_6875ras._.js","server/chunks/src_core_docker_tunnel_ts_0a1cq4o2gv4cz._.js"].map(r=>e.l(r))).then(()=>r(14205)))}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0emx9mcq5bpjq._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[93695,(t,e,r)=>{e.exports=t.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},37571,50273,t=>{"use strict";let e="buttler.service-id";t.s(["P",0,"buttler.branch","Q",0,"buttler.built-at","C",0,"buttler.commit","N",0,"buttler.link-id","B",0,"buttler.network","v",0,e,"r",0,"buttler.tunnel-id"],50273),t.s(["A",0,"buttler-nginx","G",0,function(t,r){return t.Labels[e]===r||t.Names.includes(`/buttler-service-${r}`)}],37571)},48701,t=>{"use strict";async function e(t,...r){try{await t}catch(e){let{statusCode:t}=e;if(!t||!r.includes(t))throw e}}t.s(["y",0,403,"g",0,404,"r",0,304,"W",0,e])},49158,t=>{"use strict";var e=t.i(60526),r=t.i(63400),n=t.i(16497),i=t.i(61095);function l(t){let[e,r]=t.split("/");if(!(0,i.isIPv4)(e))return null;let n=2**(32-Number(r)),l=e.split(".").reduce((t,e)=>256*t+Number(e),0),u=l-l%n;return{first:u,last:u+n-1}}let u="10.213.0.0/16",s=(0,n.f)("network-subnet-queue");async function a(){let t=await r.docker.listNetworks(),n=Object.values(e.default.networkInterfaces()).flatMap(t=>t??[]);return[...t.flatMap(t=>t.IPAM?.Config??[]).map(t=>t.Subnet),...n.map(t=>t.cidr)].filter(t=>"string"==typeof t)}t.s(["f",0,function(t){return s(async()=>{let e=function(t,e){let r=l(t);if(!r)return null;let n=e.map(l).filter(t=>null!==t);for(let t=r.first;t+8-1<=r.last;t+=8){let e=t+8-1;if(!n.some(r=>r.first<=e&&r.last>=t))return`${function(t){return[24,16,8,0].map(e=>Math.floor(t/2**e)%256).join(".")}(t)}/29`}return null}(u,await a());if(!e)throw Error(`No free subnet left in ${u} for ${t.Name}`);return r.docker.createNetwork({...t,IPAM:{Driver:"default",Config:[{Subnet:e}]}})})}],49158)},16497,t=>{"use strict";var e=t.i(81988);t.s(["f",0,function(t){let r=(0,e.f)(t,()=>({tail:Promise.resolve()}));return t=>{let e=r.tail.then(t);return r.tail=e.then(()=>void 0,()=>void 0),e}}])},56743,t=>{"use strict";var e=t.i(82291),r=t.i(57156);async function n(t){let r=await e.f.query.settings.findFirst({where:{key:t}});return r?.value??null}async function i(t,n){await e.f.insert(r.settings).values({key:t,value:n}).onConflictDoUpdate({target:r.settings.key,set:{value:n}})}async function l(){return"true"===await n("installed")}t.s(["getSetting",0,n,"isInstalled",0,l,"setSetting",0,i])},81988,t=>{"use strict";t.s(["f",0,function(t,e){let r=Symbol.for(`buttler.${t}`),n=globalThis;return n[r]??=e()}])},73119,t=>{"use strict";var e=t.i(12714),r=t.i(60526),n=t.i(50227);function i(){return process.env.BUTTLER_HOME||n.default.resolve((0,r.homedir)(),".buttler")}function l(t,e){return n.default.resolve(i(),t,e)}async function u(t,r){try{return await e.default.readFile(l(t,r),"utf8")}catch{return null}}async function s(t,r,l){let u=n.default.resolve(i(),t);await e.default.mkdir(u,{recursive:!0});let s=n.default.resolve(u,r);return await e.default.writeFile(s,l,"utf-8"),s}async function a(t,r){await e.default.unlink(l(t,r))}t.s(["Q",0,l,"J",0,u,"M",0,a,"v",0,s])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0qe_mikj7agcq._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[74533,(e,s,o)=>{s.exports=e.x("node:child_process",()=>require("node:child_process"))},12057,(e,s,o)=>{s.exports=e.x("node:util",()=>require("node:util"))},40084,e=>{e.v(s=>Promise.all(["server/chunks/src_core_settings_ts_0tp-oc1884iob._.js"].map(s=>e.l(s))).then(()=>s(56743)))}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1007u-potejqr._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[12057,(i,n,t)=>{n.exports=i.x("node:util",()=>require("node:util"))},38251,i=>{"use strict";i.i(51783);var n=i.i(79509),t=i.i(89171),a=i.i(47540),e=i.i(45138),r=i.i(10997),o=i.i(56743),u=i.i(96177);let c=(0,a.cache)(async()=>{await (0,t.connection)();let{userId:i,user:n}=await (0,r.f)();return{id:i,role:await (0,e.f)(i),profile:n??null}});async function d(){let{id:i,role:t,profile:a}=await c();return void 0===i&&(0,n.unauthorized)(),t||(0,n.forbidden)(),{id:i,role:t,profile:a}}async function l(){let i=await d();return"admin"!==i.role&&(0,n.forbidden)(),i}async function s(){return await (0,u.f)()&&!await (0,o.isInstalled)()}async function f(){await s()||(0,n.forbidden)()}async function w(){await s()||await l()}i.s(["x",0,f,"s",0,w,"f",0,d])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1ukr105klaen2._.js.map