@omer-x/buttler 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (354) hide show
  1. package/drizzle/20261126045852_service_internet_access/migration.sql +1 -0
  2. package/drizzle/20261126045852_service_internet_access/snapshot.json +581 -0
  3. package/drizzle/20261126062036_service_links/migration.sql +11 -0
  4. package/drizzle/20261126062036_service_links/snapshot.json +688 -0
  5. package/package.json +1 -1
  6. package/ui/.next/BUILD_ID +1 -1
  7. package/ui/.next/app-path-routes-manifest.json +1 -0
  8. package/ui/.next/build-manifest.json +14 -3
  9. package/ui/.next/prerender-manifest.json +107 -3
  10. package/ui/.next/routes-manifest.json +38 -0
  11. package/ui/.next/server/app/[locale]/(auth)/install/page/server-reference-manifest.json +19 -19
  12. package/ui/.next/server/app/[locale]/(auth)/install/page.js +12 -11
  13. package/ui/.next/server/app/[locale]/(auth)/install/page.js.nft.json +1 -1
  14. package/ui/.next/server/app/[locale]/(auth)/install/page_client-reference-manifest.js +1 -1
  15. package/ui/.next/server/app/[locale]/(auth)/login/page.js.nft.json +1 -1
  16. package/ui/.next/server/app/[locale]/(auth)/login/page_client-reference-manifest.js +1 -1
  17. package/ui/.next/server/app/[locale]/(base)/page/server-reference-manifest.json +1 -1
  18. package/ui/.next/server/app/[locale]/(base)/page.js.nft.json +1 -1
  19. package/ui/.next/server/app/[locale]/(base)/page_client-reference-manifest.js +1 -1
  20. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page/server-reference-manifest.json +47 -27
  21. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page.js +16 -15
  22. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page.js.nft.json +1 -1
  23. package/ui/.next/server/app/[locale]/(base)/services/[id]/builds/page_client-reference-manifest.js +1 -1
  24. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/app-paths-manifest.json +3 -0
  25. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/build-manifest.json +22 -0
  26. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/next-font-manifest.json +6 -0
  27. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/react-loadable-manifest.json +1 -0
  28. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page/server-reference-manifest.json +225 -0
  29. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page.js +54 -0
  30. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page.js.map +5 -0
  31. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page.js.nft.json +1 -0
  32. package/ui/.next/server/app/[locale]/(base)/services/[id]/links/page_client-reference-manifest.js +3 -0
  33. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page/server-reference-manifest.json +47 -27
  34. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page.js +16 -15
  35. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page.js.nft.json +1 -1
  36. package/ui/.next/server/app/[locale]/(base)/services/[id]/logs/page_client-reference-manifest.js +1 -1
  37. package/ui/.next/server/app/[locale]/(base)/services/[id]/page/server-reference-manifest.json +47 -27
  38. package/ui/.next/server/app/[locale]/(base)/services/[id]/page.js +16 -15
  39. package/ui/.next/server/app/[locale]/(base)/services/[id]/page.js.nft.json +1 -1
  40. package/ui/.next/server/app/[locale]/(base)/services/[id]/page_client-reference-manifest.js +1 -1
  41. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page/server-reference-manifest.json +54 -34
  42. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page.js +17 -16
  43. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page.js.nft.json +1 -1
  44. package/ui/.next/server/app/[locale]/(base)/services/[id]/settings/page_client-reference-manifest.js +1 -1
  45. package/ui/.next/server/app/[locale]/(base)/services/new/page/server-reference-manifest.json +35 -25
  46. package/ui/.next/server/app/[locale]/(base)/services/new/page.js +12 -11
  47. package/ui/.next/server/app/[locale]/(base)/services/new/page.js.nft.json +1 -1
  48. package/ui/.next/server/app/[locale]/(base)/services/new/page_client-reference-manifest.js +1 -1
  49. package/ui/.next/server/app/[locale]/(base)/services/page/server-reference-manifest.json +13 -3
  50. package/ui/.next/server/app/[locale]/(base)/services/page.js +6 -6
  51. package/ui/.next/server/app/[locale]/(base)/services/page.js.nft.json +1 -1
  52. package/ui/.next/server/app/[locale]/(base)/services/page_client-reference-manifest.js +1 -1
  53. package/ui/.next/server/app/[locale]/(base)/settings/page/server-reference-manifest.json +22 -22
  54. package/ui/.next/server/app/[locale]/(base)/settings/page.js +11 -10
  55. package/ui/.next/server/app/[locale]/(base)/settings/page.js.nft.json +1 -1
  56. package/ui/.next/server/app/[locale]/(base)/settings/page_client-reference-manifest.js +1 -1
  57. package/ui/.next/server/app/[locale]/install.meta +2 -2
  58. package/ui/.next/server/app/[locale]/install.segments/$d$locale/!KGF1dGgp/install/__PAGE__.segment.rsc +4 -4
  59. package/ui/.next/server/app/[locale]/install.segments/_full.segment.rsc +5 -5
  60. package/ui/.next/server/app/[locale]/install.segments/_tree.segment.rsc +2 -2
  61. package/ui/.next/server/app/[locale]/login.meta +2 -2
  62. package/ui/.next/server/app/[locale]/login.segments/$d$locale/!KGF1dGgp/login/__PAGE__.segment.rsc +3 -3
  63. package/ui/.next/server/app/[locale]/login.segments/_full.segment.rsc +4 -4
  64. package/ui/.next/server/app/[locale]/login.segments/_tree.segment.rsc +2 -2
  65. package/ui/.next/server/app/[locale]/services/[id]/builds.meta +2 -2
  66. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/$d$locale/!KGJhc2Up/services/$d$id/builds/__PAGE__.segment.rsc +5 -5
  67. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/_full.segment.rsc +5 -5
  68. package/ui/.next/server/app/[locale]/services/[id]/builds.segments/_tree.segment.rsc +2 -2
  69. package/ui/.next/server/app/[locale]/services/[id]/links.html +0 -0
  70. package/ui/.next/server/app/[locale]/services/[id]/links.meta +57 -0
  71. package/ui/.next/server/app/[locale]/services/[id]/links.segments/$d$locale/!KGJhc2Up/services/$d$id/links/__PAGE__.segment.rsc +47 -0
  72. package/ui/.next/server/app/[locale]/services/[id]/links.segments/_full.segment.rsc +45 -0
  73. package/ui/.next/server/app/[locale]/services/[id]/links.segments/_tree.segment.rsc +9 -0
  74. package/ui/.next/server/app/[locale]/services/[id]/logs.meta +2 -2
  75. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/$d$locale/!KGJhc2Up/services/$d$id/logs/__PAGE__.segment.rsc +5 -5
  76. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/_full.segment.rsc +6 -6
  77. package/ui/.next/server/app/[locale]/services/[id]/logs.segments/_tree.segment.rsc +2 -2
  78. package/ui/.next/server/app/[locale]/services/[id]/settings.meta +2 -2
  79. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/$d$locale/!KGJhc2Up/services/$d$id/settings/__PAGE__.segment.rsc +6 -6
  80. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/_full.segment.rsc +7 -7
  81. package/ui/.next/server/app/[locale]/services/[id]/settings.segments/_tree.segment.rsc +2 -2
  82. package/ui/.next/server/app/[locale]/services/[id].meta +2 -2
  83. package/ui/.next/server/app/[locale]/services/[id].segments/$d$locale/!KGJhc2Up/services/$d$id/__PAGE__.segment.rsc +5 -5
  84. package/ui/.next/server/app/[locale]/services/[id].segments/_full.segment.rsc +5 -5
  85. package/ui/.next/server/app/[locale]/services/[id].segments/_tree.segment.rsc +2 -2
  86. package/ui/.next/server/app/[locale]/services/new.meta +2 -2
  87. package/ui/.next/server/app/[locale]/services/new.segments/$d$locale/!KGJhc2Up/services/new/__PAGE__.segment.rsc +5 -5
  88. package/ui/.next/server/app/[locale]/services/new.segments/_full.segment.rsc +6 -6
  89. package/ui/.next/server/app/[locale]/services/new.segments/_tree.segment.rsc +2 -2
  90. package/ui/.next/server/app/[locale]/services.meta +2 -2
  91. package/ui/.next/server/app/[locale]/services.segments/$d$locale/!KGJhc2Up/services/__PAGE__.segment.rsc +5 -5
  92. package/ui/.next/server/app/[locale]/services.segments/_full.segment.rsc +5 -5
  93. package/ui/.next/server/app/[locale]/services.segments/_tree.segment.rsc +2 -2
  94. package/ui/.next/server/app/[locale]/settings.meta +2 -2
  95. package/ui/.next/server/app/[locale]/settings.segments/$d$locale/!KGJhc2Up/settings/__PAGE__.segment.rsc +5 -5
  96. package/ui/.next/server/app/[locale]/settings.segments/_full.segment.rsc +5 -5
  97. package/ui/.next/server/app/[locale]/settings.segments/_tree.segment.rsc +2 -2
  98. package/ui/.next/server/app/[locale].meta +2 -2
  99. package/ui/.next/server/app/[locale].segments/$d$locale/!KGJhc2Up/__PAGE__.segment.rsc +4 -4
  100. package/ui/.next/server/app/[locale].segments/_full.segment.rsc +4 -4
  101. package/ui/.next/server/app/[locale].segments/_tree.segment.rsc +2 -2
  102. package/ui/.next/server/app/_global-error/page.js +1 -1
  103. package/ui/.next/server/app/_global-error/page.js.nft.json +1 -1
  104. package/ui/.next/server/app/_global-error.html +1 -1
  105. package/ui/.next/server/app/_global-error.rsc +1 -1
  106. package/ui/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  107. package/ui/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  108. package/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  109. package/ui/.next/server/app/_not-found.html +1 -1
  110. package/ui/.next/server/app/_not-found.rsc +1 -1
  111. package/ui/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  112. package/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  113. package/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  114. package/ui/.next/server/app/api/services/[id]/logs/stream/route/server-reference-manifest.json +12 -2
  115. package/ui/.next/server/app/api/services/[id]/logs/stream/route.js +5 -5
  116. package/ui/.next/server/app/api/services/[id]/logs/stream/route.js.nft.json +1 -1
  117. package/ui/.next/server/app/api/sources/dockerhub/tags/route.js.nft.json +1 -1
  118. package/ui/.next/server/app/api/sources/github/branches/route.js +1 -1
  119. package/ui/.next/server/app/api/sources/github/branches/route.js.nft.json +1 -1
  120. package/ui/.next/server/app/api/sources/github/repos/route.js +1 -1
  121. package/ui/.next/server/app/api/sources/github/repos/route.js.nft.json +1 -1
  122. package/ui/.next/server/app/auth/cloudflare/route.js.nft.json +1 -1
  123. package/ui/.next/server/app/auth/github/route.js.nft.json +1 -1
  124. package/ui/.next/server/app/auth/github-install/route.js.nft.json +1 -1
  125. package/ui/.next/server/app/auth/instance/route.js.nft.json +1 -1
  126. package/ui/.next/server/app/auth/setup/route.js.nft.json +1 -1
  127. package/ui/.next/server/app/en/install.html +1 -1
  128. package/ui/.next/server/app/en/install.meta +1 -1
  129. package/ui/.next/server/app/en/install.segments/$d$locale/!KGF1dGgp/install/__PAGE__.segment.rsc +2 -2
  130. package/ui/.next/server/app/en/install.segments/$d$locale.segment.rsc +3 -3
  131. package/ui/.next/server/app/en/install.segments/_full.segment.rsc +5 -5
  132. package/ui/.next/server/app/en/install.segments/_tree.segment.rsc +2 -2
  133. package/ui/.next/server/app/en/login.html +1 -1
  134. package/ui/.next/server/app/en/login.meta +1 -1
  135. package/ui/.next/server/app/en/login.segments/$d$locale/!KGF1dGgp/login/__PAGE__.segment.rsc +1 -1
  136. package/ui/.next/server/app/en/login.segments/$d$locale.segment.rsc +3 -3
  137. package/ui/.next/server/app/en/login.segments/_full.segment.rsc +4 -4
  138. package/ui/.next/server/app/en/login.segments/_tree.segment.rsc +2 -2
  139. package/ui/.next/server/app/en/services/[id]/builds.html +1 -1
  140. package/ui/.next/server/app/en/services/[id]/builds.meta +1 -1
  141. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale/!KGJhc2Up/services/$d$id/builds/__PAGE__.segment.rsc +6 -6
  142. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale/!KGJhc2Up.segment.rsc +6 -6
  143. package/ui/.next/server/app/en/services/[id]/builds.segments/$d$locale.segment.rsc +4 -4
  144. package/ui/.next/server/app/en/services/[id]/builds.segments/_full.segment.rsc +11 -11
  145. package/ui/.next/server/app/en/services/[id]/builds.segments/_tree.segment.rsc +2 -2
  146. package/ui/.next/server/app/en/services/[id]/links.html +1 -0
  147. package/ui/.next/server/app/en/services/[id]/links.meta +58 -0
  148. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale/!KGJhc2Up/services/$d$id/links/__PAGE__.segment.rsc +50 -0
  149. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale/!KGJhc2Up.segment.rsc +36 -0
  150. package/ui/.next/server/app/en/services/[id]/links.segments/$d$locale.segment.rsc +24 -0
  151. package/ui/.next/server/app/en/services/[id]/links.segments/_full.segment.rsc +77 -0
  152. package/ui/.next/server/app/en/services/[id]/links.segments/_tree.segment.rsc +9 -0
  153. package/ui/.next/server/app/en/services/[id]/logs.html +1 -1
  154. package/ui/.next/server/app/en/services/[id]/logs.meta +1 -1
  155. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale/!KGJhc2Up/services/$d$id/logs/__PAGE__.segment.rsc +6 -6
  156. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale/!KGJhc2Up.segment.rsc +6 -6
  157. package/ui/.next/server/app/en/services/[id]/logs.segments/$d$locale.segment.rsc +4 -4
  158. package/ui/.next/server/app/en/services/[id]/logs.segments/_full.segment.rsc +11 -11
  159. package/ui/.next/server/app/en/services/[id]/logs.segments/_tree.segment.rsc +2 -2
  160. package/ui/.next/server/app/en/services/[id]/settings.html +1 -1
  161. package/ui/.next/server/app/en/services/[id]/settings.meta +1 -1
  162. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale/!KGJhc2Up/services/$d$id/settings/__PAGE__.segment.rsc +8 -8
  163. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale/!KGJhc2Up.segment.rsc +7 -7
  164. package/ui/.next/server/app/en/services/[id]/settings.segments/$d$locale.segment.rsc +4 -4
  165. package/ui/.next/server/app/en/services/[id]/settings.segments/_full.segment.rsc +13 -13
  166. package/ui/.next/server/app/en/services/[id]/settings.segments/_tree.segment.rsc +2 -2
  167. package/ui/.next/server/app/en/services/[id].html +1 -1
  168. package/ui/.next/server/app/en/services/[id].meta +1 -1
  169. package/ui/.next/server/app/en/services/[id].segments/$d$locale/!KGJhc2Up/services/$d$id/__PAGE__.segment.rsc +6 -6
  170. package/ui/.next/server/app/en/services/[id].segments/$d$locale/!KGJhc2Up.segment.rsc +6 -6
  171. package/ui/.next/server/app/en/services/[id].segments/$d$locale.segment.rsc +4 -4
  172. package/ui/.next/server/app/en/services/[id].segments/_full.segment.rsc +11 -11
  173. package/ui/.next/server/app/en/services/[id].segments/_tree.segment.rsc +2 -2
  174. package/ui/.next/server/app/en/services/new.html +1 -1
  175. package/ui/.next/server/app/en/services/new.meta +1 -1
  176. package/ui/.next/server/app/en/services/new.segments/$d$locale/!KGJhc2Up/services/new/__PAGE__.segment.rsc +5 -5
  177. package/ui/.next/server/app/en/services/new.segments/$d$locale/!KGJhc2Up.segment.rsc +5 -5
  178. package/ui/.next/server/app/en/services/new.segments/$d$locale.segment.rsc +3 -3
  179. package/ui/.next/server/app/en/services/new.segments/_full.segment.rsc +10 -10
  180. package/ui/.next/server/app/en/services/new.segments/_tree.segment.rsc +2 -2
  181. package/ui/.next/server/app/en/services.html +1 -1
  182. package/ui/.next/server/app/en/services.meta +1 -1
  183. package/ui/.next/server/app/en/services.segments/$d$locale/!KGJhc2Up/services/__PAGE__.segment.rsc +2 -2
  184. package/ui/.next/server/app/en/services.segments/$d$locale/!KGJhc2Up.segment.rsc +3 -3
  185. package/ui/.next/server/app/en/services.segments/$d$locale.segment.rsc +3 -3
  186. package/ui/.next/server/app/en/services.segments/_full.segment.rsc +6 -6
  187. package/ui/.next/server/app/en/services.segments/_tree.segment.rsc +2 -2
  188. package/ui/.next/server/app/en/settings.html +1 -1
  189. package/ui/.next/server/app/en/settings.meta +1 -1
  190. package/ui/.next/server/app/en/settings.segments/$d$locale/!KGJhc2Up/settings/__PAGE__.segment.rsc +2 -2
  191. package/ui/.next/server/app/en/settings.segments/$d$locale/!KGJhc2Up.segment.rsc +5 -5
  192. package/ui/.next/server/app/en/settings.segments/$d$locale.segment.rsc +3 -3
  193. package/ui/.next/server/app/en/settings.segments/_full.segment.rsc +9 -9
  194. package/ui/.next/server/app/en/settings.segments/_tree.segment.rsc +2 -2
  195. package/ui/.next/server/app/en.html +1 -1
  196. package/ui/.next/server/app/en.meta +1 -1
  197. package/ui/.next/server/app/en.segments/$d$locale/!KGJhc2Up/__PAGE__.segment.rsc +1 -1
  198. package/ui/.next/server/app/en.segments/$d$locale/!KGJhc2Up.segment.rsc +3 -3
  199. package/ui/.next/server/app/en.segments/$d$locale.segment.rsc +3 -3
  200. package/ui/.next/server/app/en.segments/_full.segment.rsc +6 -6
  201. package/ui/.next/server/app/en.segments/_tree.segment.rsc +2 -2
  202. package/ui/.next/server/app/webhooks/github/route.js +8 -8
  203. package/ui/.next/server/app/webhooks/github/route.js.nft.json +1 -1
  204. package/ui/.next/server/app-paths-manifest.json +1 -0
  205. package/ui/.next/server/chunks/[root-of-the-server]__013tvh0fuqyka._.js +3 -0
  206. package/ui/.next/server/chunks/{[root-of-the-server]__1g9njz47vqbb2._.js → [root-of-the-server]__0axr0p9f9qjo3._.js} +1 -1
  207. package/ui/.next/server/chunks/{[root-of-the-server]__13axmhhz6grni._.js → [root-of-the-server]__0emx9mcq5bpjq._.js} +2 -2
  208. package/ui/.next/server/chunks/[root-of-the-server]__0qe_mikj7agcq._.js +1 -1
  209. package/ui/.next/server/chunks/{[root-of-the-server]__191v8a8_de7ne._.js → [root-of-the-server]__1007u-potejqr._.js} +1 -1
  210. package/ui/.next/server/chunks/[root-of-the-server]__1099j5oihunj4._.js +3 -0
  211. package/ui/.next/server/chunks/[root-of-the-server]__16b_5up45wd06._.js +3 -0
  212. package/ui/.next/server/chunks/[root-of-the-server]__1m9jomjwom7eb._.js +3 -0
  213. package/ui/.next/server/chunks/[root-of-the-server]__1w3vh-httwncf._.js +2 -2
  214. package/ui/.next/server/chunks/_0-08w0j6upuro._.js +4 -4
  215. package/ui/.next/server/chunks/_0fakz5bf_8pur._.js +1 -1
  216. package/ui/.next/server/chunks/{_205giqmll3u97._.js → _0iv1xrv5s4qth._.js} +2 -2
  217. package/ui/.next/server/chunks/_0nlsx2mvtyhai._.js +1 -1
  218. package/ui/.next/server/chunks/_1ddptkvp76c-m._.js +4 -4
  219. package/ui/.next/server/chunks/_1hom9geso8mh2._.js +1 -1
  220. package/ui/.next/server/chunks/_1ux2nt1zdyn0-._.js +4 -4
  221. package/ui/.next/server/chunks/_1xyz4i2jb2-s2._.js +1 -1
  222. package/ui/.next/server/chunks/src_0ehe0gc5xa4op._.js +3 -0
  223. package/ui/.next/server/chunks/src_1wc3qafci1k3-._.js +3 -0
  224. package/ui/.next/server/chunks/src_core_docker_links_ts_1xdvepbsz4gi1._.js +3 -0
  225. package/ui/.next/server/chunks/src_core_docker_tunnel_ts_0joxbsi21ggvm._.js +3 -0
  226. package/ui/.next/server/chunks/{src_core_settings_ts_1hcogi90bhvb7._.js → src_core_settings_ts_03r6mrmvaf3z9._.js} +1 -1
  227. package/ui/.next/server/chunks/{src_core_settings_ts_1mdt19mqp5pzi._.js → src_core_settings_ts_06epzja3innn1._.js} +1 -1
  228. package/ui/.next/server/chunks/src_database_index_ts_1vzqbmlp-k92u._.js +6 -6
  229. package/ui/.next/server/chunks/ssr/[root-of-the-server]__034qjpl9j-0ci._.js +3 -0
  230. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__0drv11-4w87e2._.js → [root-of-the-server]__0cws_i6hecx8i._.js} +2 -2
  231. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__1fhe1py6wekjw._.js → [root-of-the-server]__0lrw_bd_v-wq9._.js} +1 -1
  232. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0rkkxjp0vxzob._.js +3 -0
  233. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0tceu8thqwy0d._.js +3 -0
  234. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__0rn0qge5iuk1u._.js → [root-of-the-server]__0tnvefuofuctm._.js} +1 -1
  235. package/ui/.next/server/chunks/ssr/[root-of-the-server]__11f8nw5rjx5xy._.js +3 -0
  236. package/ui/.next/server/chunks/ssr/{[root-of-the-server]__1fz83aiqt1p_g._.js → [root-of-the-server]__15um_js0-44w5._.js} +1 -1
  237. package/ui/.next/server/chunks/ssr/[root-of-the-server]__19k3qfyr4zw2t._.js +4 -0
  238. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1_2uw8tv9c80k._.js +4 -0
  239. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1f2-_zy1hslsn._.js +4 -0
  240. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1nipqwqlhzrez._.js +4 -0
  241. package/ui/.next/server/chunks/ssr/_03mjbc5iu4-0t._.js +1 -1
  242. package/ui/.next/server/chunks/ssr/_043r3p4uyglt8._.js +3 -0
  243. package/ui/.next/server/chunks/ssr/_045ukfxgkrnjs._.js +1 -1
  244. package/ui/.next/server/chunks/ssr/{_20h3ngw2-pijn._.js → _04lfy3e4jplbm._.js} +2 -2
  245. package/ui/.next/server/chunks/ssr/{_1j5g-1pklmyv3._.js → _0elrzkszc9mou._.js} +2 -2
  246. package/ui/.next/server/chunks/ssr/_0gm20eaq31snn._.js +3 -0
  247. package/ui/.next/server/chunks/ssr/_0l5h_g6g26cch._.js +1 -1
  248. package/ui/.next/server/chunks/ssr/_0nm-73v3d_j3o._.js +3 -0
  249. package/ui/.next/server/chunks/ssr/_0q_ty5-s_ojhi._.js +1 -1
  250. package/ui/.next/server/chunks/ssr/_0sid4-3pb734p._.js +1 -1
  251. package/ui/.next/server/chunks/ssr/_11hffrysj8ccd._.js +1 -1
  252. package/ui/.next/server/chunks/ssr/_14pr8k-21_dud._.js +1 -1
  253. package/ui/.next/server/chunks/ssr/_1c9ja4120f5e7._.js +1 -1
  254. package/ui/.next/server/chunks/ssr/_1cwumh2lem642._.js +2 -2
  255. package/ui/.next/server/chunks/ssr/_1g8x3co_2gk2e._.js +3 -0
  256. package/ui/.next/server/chunks/ssr/_1gxrg8g_1z61n._.js +1 -1
  257. package/ui/.next/server/chunks/ssr/_1jvwyvy2mdunl._.js +1 -1
  258. package/ui/.next/server/chunks/ssr/_1l9hlfxdk4800._.js +3 -0
  259. package/ui/.next/server/chunks/ssr/{_1swm39zqwfbgz._.js → _1s61535w_i_lb._.js} +2 -2
  260. package/ui/.next/server/chunks/ssr/{_19w_0onn2cdmy._.js → _1t7wd5lbghpsq._.js} +2 -2
  261. package/ui/.next/server/chunks/ssr/_1v-gh-ppdzk54._.js +3 -0
  262. package/ui/.next/server/chunks/ssr/_1vznrs2oqv125._.js +3 -0
  263. package/ui/.next/server/chunks/ssr/_next-internal_server_app_[locale]_(auth)_install_page_actions_0q608mh34etxn.js +1 -1
  264. package/ui/.next/server/chunks/ssr/dictionaries_en_json_[json]_cjs_1pkm_n6uii6ve._.js +1 -1
  265. package/ui/.next/server/chunks/ssr/node_modules_09h9wf5os0vez._.js +2 -2
  266. package/ui/.next/server/chunks/ssr/node_modules_0bh4y86fdvx3u._.js +2 -2
  267. package/ui/.next/server/chunks/ssr/node_modules_0difw-6bio6t9._.js +1 -1
  268. package/ui/.next/server/chunks/ssr/node_modules_0m4futnh2n1n0._.js +2 -2
  269. package/ui/.next/server/chunks/ssr/{_0nnq48ip-8ji-._.js → node_modules_@omer-x_tailwind-ui-kit_dist_components_form_index_1scnp-x6u_00i.js} +2 -2
  270. package/ui/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1659ld6risgus.js +3 -0
  271. package/ui/.next/server/chunks/ssr/{_08r9mb2mbnczy._.js → node_modules_zod_v4_classic_external_0_adu4p2yg38n.js} +4 -4
  272. package/ui/.next/server/chunks/ssr/{_0ymxsb_ki8zel._.js → node_modules_zod_v4_classic_external_0b6jkffik0qe3.js} +4 -4
  273. package/ui/.next/server/chunks/ssr/src_05sh4p2uehbos._.js +1 -1
  274. package/ui/.next/server/chunks/ssr/src_10pz-333ne5s9._.js +3 -0
  275. package/ui/.next/server/chunks/ssr/src_1iyfq6dudriyk._.js +1 -1
  276. package/ui/.next/server/chunks/ssr/src_1m2fl_nqj5nqs._.js +3 -0
  277. package/ui/.next/server/chunks/ssr/src_actions_cloudflare_ts_0fwbybngp80nf._.js +1 -1
  278. package/ui/.next/server/chunks/ssr/src_actions_link_ts_13hqd7ogc36j3._.js +3 -0
  279. package/ui/.next/server/chunks/ssr/src_actions_service_ts_0leald8wxwln3._.js +1 -1
  280. package/ui/.next/server/chunks/ssr/src_actions_setup_ts_1j3o9o1z2x8l-._.js +1 -1
  281. package/ui/.next/server/chunks/ssr/src_actions_user_ts_15o74nrxk2-dn._.js +1 -1
  282. package/ui/.next/server/chunks/ssr/src_components_0dw7q_n_p1894._.js +1 -1
  283. package/ui/.next/server/chunks/ssr/{src_components_services_1ckwhi_x497s9._.js → src_components_services_0uvp3xb7qbmur._.js} +2 -2
  284. package/ui/.next/server/chunks/ssr/src_components_services_1xqd2ez36okp0._.js +3 -0
  285. package/ui/.next/server/chunks/ssr/src_components_services_InternetAccessChoice_tsx_1kgbpu0tzvndy._.js +3 -0
  286. package/ui/.next/server/chunks/ssr/src_core_04_5qe36g6q0g._.js +3 -0
  287. package/ui/.next/server/chunks/ssr/src_core_0nipraeusd7bv._.js +3 -0
  288. package/ui/.next/server/chunks/ssr/src_core_0w75t1-r5b57i._.js +3 -0
  289. package/ui/.next/server/chunks/ssr/src_core_cloudflare_domains_ts_1tx1rckprh9ks._.js +3 -0
  290. package/ui/.next/server/chunks/ssr/src_core_docker_1o4aldsy3-3_s._.js +3 -0
  291. package/ui/.next/server/instrumentation.js +1 -1
  292. package/ui/.next/server/middleware-build-manifest.js +14 -3
  293. package/ui/.next/server/pages/404.html +1 -1
  294. package/ui/.next/server/pages/500.html +1 -1
  295. package/ui/.next/server/prefetch-hints.json +34 -0
  296. package/ui/.next/server/preview-props.json +3 -3
  297. package/ui/.next/server/server-reference-manifest.js +1 -1
  298. package/ui/.next/server/server-reference-manifest.json +207 -51
  299. package/ui/.next/static/K1lgQgx5F1bXno5BXXk25/_ssgManifest.js +1 -0
  300. package/ui/.next/static/chunks/{1n7hyxug-qmmf.js → 0r6re9w59ezlu.js} +1 -1
  301. package/ui/.next/static/chunks/1_zs-121mlws0.js +1 -0
  302. package/ui/.next/static/chunks/{0zt2bp-gid_ha.js → 1bb88ubtg9zhx.js} +1 -1
  303. package/ui/.next/static/chunks/{08m3mlwdpjhqa.js → 1hltxf3jfbf02.js} +1 -1
  304. package/ui/.next/static/chunks/{1u0u336632rb0.js → 1yp2nbumffkk3.js} +1 -1
  305. package/ui/.next/static/chunks/{0om4m_06mlnre.js → 2cmsokab3261j.js} +1 -1
  306. package/ui/.next/static/chunks/2ev4g9-mfre-4.js +1 -0
  307. package/ui/.next/static/chunks/2y6dkbb_cpkcg.css +1 -0
  308. package/ui/.next/static/chunks/{1ptcfx203durp.js → 343grpm3nwbl0.js} +1 -1
  309. package/ui/.next/static/chunks/3dj_pr0f1ky5c.js +1 -0
  310. package/ui/.next/static/chunks/3pmo4svmlsjie.js +1 -0
  311. package/ui/drizzle/20261126045852_service_internet_access/migration.sql +1 -0
  312. package/ui/drizzle/20261126045852_service_internet_access/snapshot.json +581 -0
  313. package/ui/drizzle/20261126062036_service_links/migration.sql +11 -0
  314. package/ui/drizzle/20261126062036_service_links/snapshot.json +688 -0
  315. package/ui/src/core/build.test.ts +6 -0
  316. package/ui/src/core/cloudflare/domains.test.ts +1 -1
  317. package/ui/src/core/docker/ingress.ts +1 -1
  318. package/ui/src/core/docker/internet.test.ts +88 -0
  319. package/ui/src/core/docker/internet.ts +59 -0
  320. package/ui/src/core/docker/labels.ts +2 -0
  321. package/ui/src/core/docker/links.test.ts +164 -0
  322. package/ui/src/core/docker/links.ts +170 -0
  323. package/ui/src/core/docker/status.test.ts +74 -0
  324. package/ui/src/core/docker/status.ts +17 -2
  325. package/ui/.next/server/chunks/[root-of-the-server]__0q_y890--33_5._.js +0 -3
  326. package/ui/.next/server/chunks/[root-of-the-server]__156dfvjma1155._.js +0 -3
  327. package/ui/.next/server/chunks/[root-of-the-server]__1ft_94atr8caf._.js +0 -3
  328. package/ui/.next/server/chunks/src_1gxoul9hz0c2d._.js +0 -3
  329. package/ui/.next/server/chunks/src_core_docker_status_ts_0_sv17u6yx63t._.js +0 -3
  330. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0ktv4mwammozc._.js +0 -3
  331. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0ut6xzq29vzgm._.js +0 -3
  332. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0w741sbi5bld1._.js +0 -4
  333. package/ui/.next/server/chunks/ssr/[root-of-the-server]__0z8q72dki14gw._.js +0 -3
  334. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1ahhnj3wnei6e._.js +0 -4
  335. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1uwc7qo6i8tgd._.js +0 -3
  336. package/ui/.next/server/chunks/ssr/[root-of-the-server]__1w20lhl50jx-7._.js +0 -4
  337. package/ui/.next/server/chunks/ssr/[root-of-the-server]__20a05rk0-nb4g._.js +0 -3
  338. package/ui/.next/server/chunks/ssr/_01e3rinj2_l0i._.js +0 -3
  339. package/ui/.next/server/chunks/ssr/_02igs4en3q5ay._.js +0 -3
  340. package/ui/.next/server/chunks/ssr/_10di_vw2zn99-._.js +0 -4
  341. package/ui/.next/server/chunks/ssr/_1czfqaem07udj._.js +0 -57
  342. package/ui/.next/server/chunks/ssr/node_modules_@omer-x_next-form-actions_dist_index_mjs_1c5mg0xduv-_v._.js +0 -3
  343. package/ui/.next/server/chunks/ssr/src_09ctnfzfi7gev._.js +0 -3
  344. package/ui/.next/server/chunks/ssr/src_1oiyj5tki7jmf._.js +0 -3
  345. package/ui/.next/server/chunks/ssr/src_1rhxx_vix93j3._.js +0 -3
  346. package/ui/.next/server/chunks/ssr/src_core_02a21dtc1uaku._.js +0 -3
  347. package/ui/.next/server/chunks/ssr/src_core_docker_builds_ts_189l3irnv_2va._.js +0 -3
  348. package/ui/.next/static/chunks/10m4ed4sinix2.js +0 -1
  349. package/ui/.next/static/chunks/3htgsexlb92yb.js +0 -1
  350. package/ui/.next/static/chunks/3pvslh6kify3g.css +0 -1
  351. package/ui/.next/static/chunks/42c4ez0qh-4aq.js +0 -1
  352. package/ui/.next/static/jS0aVYApf7Gc7dPYRxehn/_ssgManifest.js +0 -1
  353. /package/ui/.next/static/{jS0aVYApf7Gc7dPYRxehn → K1lgQgx5F1bXno5BXXk25}/_buildManifest.js +0 -0
  354. /package/ui/.next/static/{jS0aVYApf7Gc7dPYRxehn → K1lgQgx5F1bXno5BXXk25}/_clientMiddlewareManifest.js +0 -0
@@ -41,7 +41,7 @@ async function createIngressNetwork(serviceId: string): Promise<IngressNetwork>
41
41
  const network = await createButtlerNetwork({
42
42
  Name: name,
43
43
  Driver: "bridge",
44
- // The containers keep reaching the outside through their other networks
44
+ // Only the internet network of a service reaches the outside
45
45
  Internal: true,
46
46
  Labels: {
47
47
  "com.docker.compose.project": "buttler",
@@ -0,0 +1,88 @@
1
+ import os from "node:os";
2
+ import { beforeEach, describe, expect, it, vi } from "vitest";
3
+ import { ensureInternetNetwork, removeInternetNetwork } from "./internet";
4
+
5
+ type FakeNetwork = { Id: string, Name: string, Internal?: boolean, Labels?: Record<string, string> };
6
+
7
+ const mocks = vi.hoisted(() => ({
8
+ listNetworks: vi.fn(),
9
+ createNetwork: vi.fn(),
10
+ disconnect: vi.fn(),
11
+ remove: vi.fn(),
12
+ }));
13
+
14
+ vi.mock("~/core/docker", () => ({
15
+ docker: {
16
+ listNetworks: mocks.listNetworks,
17
+ createNetwork: mocks.createNetwork,
18
+ getNetwork: (id: string) => ({
19
+ disconnect: (options: unknown) => mocks.disconnect(id, options) as unknown,
20
+ remove: () => mocks.remove(id) as unknown,
21
+ }),
22
+ },
23
+ }));
24
+
25
+ const dockerError = (statusCode: number) => Object.assign(new Error(`status ${statusCode}`), { statusCode });
26
+
27
+ let networks: FakeNetwork[] = [];
28
+
29
+ beforeEach(() => {
30
+ vi.resetAllMocks();
31
+ networks = [];
32
+ vi.spyOn(os, "networkInterfaces").mockReturnValue({});
33
+ mocks.listNetworks.mockImplementation((options?: { filters: { label: string[] } }) => {
34
+ return Promise.resolve(networks.filter(network => (options?.filters.label ?? []).every(label => {
35
+ const [key, value] = label.split("=");
36
+ return network.Labels?.[key] === value;
37
+ })));
38
+ });
39
+ mocks.createNetwork.mockImplementation((options: FakeNetwork) => {
40
+ const network = { ...options, Id: `id-${options.Name}` };
41
+ networks.push(network);
42
+ return Promise.resolve({ id: network.Id });
43
+ });
44
+ });
45
+
46
+ describe("ensureInternetNetwork", () => {
47
+ it("creates a network that reaches the outside for the service", async () => {
48
+ await expect(ensureInternetNetwork("a")).resolves.toBe("buttler-internet-a");
49
+ expect(mocks.createNetwork).toHaveBeenCalledWith(expect.objectContaining({
50
+ Name: "buttler-internet-a",
51
+ Driver: "bridge",
52
+ Labels: expect.objectContaining({ "buttler.network": "internet", "buttler.service-id": "a" }),
53
+ }));
54
+ expect(networks[0].Internal).toBeUndefined();
55
+ });
56
+
57
+ it("reuses the network of the service", async () => {
58
+ await Promise.all([ensureInternetNetwork("a"), ensureInternetNetwork("a")]);
59
+ expect(mocks.createNetwork).toHaveBeenCalledTimes(1);
60
+ });
61
+
62
+ it("never uses a network that isn't labelled by Buttler", async () => {
63
+ networks.push({ Id: "foreign", Name: "buttler-internet-a" });
64
+ await ensureInternetNetwork("a");
65
+ expect(mocks.createNetwork).toHaveBeenCalledTimes(1);
66
+ });
67
+ });
68
+
69
+ describe("removeInternetNetwork", () => {
70
+ it("disconnects the container and removes the network", async () => {
71
+ await ensureInternetNetwork("a");
72
+ await removeInternetNetwork("a", "container");
73
+ expect(mocks.disconnect).toHaveBeenCalledWith("id-buttler-internet-a", { Container: "container", Force: true });
74
+ expect(mocks.remove).toHaveBeenCalledWith("id-buttler-internet-a");
75
+ });
76
+
77
+ it("keeps a network that is still in use", async () => {
78
+ await ensureInternetNetwork("a");
79
+ mocks.remove.mockRejectedValue(dockerError(403));
80
+ await expect(removeInternetNetwork("a")).resolves.toBeUndefined();
81
+ expect(mocks.disconnect).not.toHaveBeenCalled();
82
+ });
83
+
84
+ it("does nothing without a network", async () => {
85
+ await removeInternetNetwork("a", "container");
86
+ expect(mocks.remove).not.toHaveBeenCalled();
87
+ });
88
+ });
@@ -0,0 +1,59 @@
1
+ import { docker } from "~/core/docker";
2
+ import { createQueue } from "~/core/queue";
3
+ import { FORBIDDEN, NOT_FOUND, ignoreStatus } from "./errors";
4
+ import { BUTTLER_NETWORK_LABEL, BUTTLER_SERVICE_LABEL } from "./labels";
5
+ import { createButtlerNetwork } from "./networks";
6
+
7
+ const INTERNET_NETWORK = "internet";
8
+
9
+ /** Two deploys of the same service must not create two networks */
10
+ const enqueue = createQueue("internet-queue");
11
+
12
+ export function getInternetNetworkName(serviceId: string) {
13
+ return `buttler-internet-${serviceId}`;
14
+ }
15
+
16
+ /** Only returns the networks that are created by Buttler */
17
+ function listInternetNetworks(serviceId: string) {
18
+ return docker.listNetworks({
19
+ filters: {
20
+ label: [
21
+ `${BUTTLER_NETWORK_LABEL}=${INTERNET_NETWORK}`,
22
+ `${BUTTLER_SERVICE_LABEL}=${serviceId}`,
23
+ ],
24
+ },
25
+ });
26
+ }
27
+
28
+ /** Returns the network that only the service is on and that reaches the outside, it's created if it's missing */
29
+ export function ensureInternetNetwork(serviceId: string): Promise<string> {
30
+ return enqueue(async () => {
31
+ const network = (await listInternetNetworks(serviceId)).at(0);
32
+ if (network) return network.Name;
33
+ const name = getInternetNetworkName(serviceId);
34
+ await createButtlerNetwork({
35
+ Name: name,
36
+ Driver: "bridge",
37
+ Labels: {
38
+ "com.docker.compose.project": "buttler",
39
+ [BUTTLER_NETWORK_LABEL]: INTERNET_NETWORK,
40
+ [BUTTLER_SERVICE_LABEL]: serviceId,
41
+ },
42
+ });
43
+ return name;
44
+ });
45
+ }
46
+
47
+ /** Disconnects the given container from the internet network of the service, and removes the network */
48
+ export function removeInternetNetwork(serviceId: string, containerId?: string): Promise<void> {
49
+ return enqueue(async () => {
50
+ for (const networkInfo of await listInternetNetworks(serviceId)) {
51
+ const network = docker.getNetwork(networkInfo.Id);
52
+ if (containerId) {
53
+ await ignoreStatus(network.disconnect({ Container: containerId, Force: true }), NOT_FOUND);
54
+ }
55
+ // Networks that are still used by a container are kept
56
+ await ignoreStatus(network.remove(), NOT_FOUND, FORBIDDEN);
57
+ }
58
+ });
59
+ }
@@ -6,3 +6,5 @@ export const BUTTLER_BUILT_AT_LABEL = "buttler.built-at";
6
6
  export const BUTTLER_NETWORK_LABEL = "buttler.network";
7
7
  /** The tunnel that a cloudflared container runs */
8
8
  export const BUTTLER_TUNNEL_LABEL = "buttler.tunnel-id";
9
+ /** The link that a network belongs to */
10
+ export const BUTTLER_LINK_LABEL = "buttler.link-id";
@@ -0,0 +1,164 @@
1
+ import os from "node:os";
2
+ import { beforeEach, describe, expect, it, vi } from "vitest";
3
+ import { connectLinkNetworks, removeLinkNetworks, syncLinkNetwork, syncLinkNetworks } from "./links";
4
+
5
+ type FakeNetwork = { Id: string, Name: string, Internal?: boolean, Labels?: Record<string, string> };
6
+ type FakeLink = { id: string, serviceAId: string, serviceBId: string };
7
+
8
+ const mocks = vi.hoisted(() => ({
9
+ listNetworks: vi.fn(),
10
+ createNetwork: vi.fn(),
11
+ listContainers: vi.fn(),
12
+ connect: vi.fn(),
13
+ disconnect: vi.fn(),
14
+ remove: vi.fn(),
15
+ getServiceLinks: vi.fn(),
16
+ }));
17
+
18
+ vi.mock("~/database", () => ({ default: {} }));
19
+ vi.mock("~/operations/getServiceLinks", () => ({ default: mocks.getServiceLinks }));
20
+ vi.mock("~/core/docker", () => ({
21
+ docker: {
22
+ listNetworks: mocks.listNetworks,
23
+ createNetwork: mocks.createNetwork,
24
+ listContainers: mocks.listContainers,
25
+ getNetwork: (id: string) => ({
26
+ connect: (options: unknown) => mocks.connect(id, options) as unknown,
27
+ disconnect: (options: unknown) => mocks.disconnect(id, options) as unknown,
28
+ remove: () => mocks.remove(id) as unknown,
29
+ }),
30
+ },
31
+ }));
32
+
33
+ const dockerError = (statusCode: number) => Object.assign(new Error(`status ${statusCode}`), { statusCode });
34
+
35
+ function container(id: string, serviceId: string | null, networkNames: string[] = []) {
36
+ return {
37
+ Id: id,
38
+ Names: [`/${id}`],
39
+ State: "running",
40
+ Labels: serviceId ? { "buttler.service-id": serviceId } : {},
41
+ NetworkSettings: {
42
+ Networks: Object.fromEntries(networkNames.map(name => [name, { NetworkID: `id-${name}` }])),
43
+ },
44
+ };
45
+ }
46
+
47
+ function linkNetwork(linkId: string): FakeNetwork {
48
+ const name = `buttler-link-${linkId}`;
49
+ return { Id: `id-${name}`, Name: name, Labels: { "buttler.network": "link", "buttler.link-id": linkId } };
50
+ }
51
+
52
+ let networks: FakeNetwork[] = [];
53
+ let links: FakeLink[] = [];
54
+
55
+ beforeEach(() => {
56
+ vi.resetAllMocks();
57
+ networks = [];
58
+ links = [];
59
+ vi.spyOn(os, "networkInterfaces").mockReturnValue({});
60
+ mocks.listContainers.mockResolvedValue([]);
61
+ mocks.getServiceLinks.mockImplementation((_db: unknown, serviceId?: string) => {
62
+ return Promise.resolve(links.filter(link => !serviceId || [link.serviceAId, link.serviceBId].includes(serviceId)));
63
+ });
64
+ mocks.listNetworks.mockImplementation((options?: { filters: { label: string[] } }) => {
65
+ return Promise.resolve(networks.filter(network => (options?.filters.label ?? []).every(label => {
66
+ const [key, value] = label.split("=");
67
+ return network.Labels?.[key] === value;
68
+ })));
69
+ });
70
+ mocks.createNetwork.mockImplementation((options: FakeNetwork) => {
71
+ const network = { ...options, Id: `id-${options.Name}` };
72
+ networks.push(network);
73
+ return Promise.resolve({ id: network.Id });
74
+ });
75
+ });
76
+
77
+ describe("syncLinkNetwork", () => {
78
+ it("creates an internal network and connects the containers of both services", async () => {
79
+ links = [{ id: "l1", serviceAId: "a", serviceBId: "b" }];
80
+ mocks.listContainers.mockResolvedValue([container("ca", "a"), container("cb", "b"), container("cc", "c")]);
81
+ await syncLinkNetwork("l1");
82
+ expect(mocks.createNetwork).toHaveBeenCalledWith(expect.objectContaining({
83
+ Name: "buttler-link-l1",
84
+ Internal: true,
85
+ Labels: expect.objectContaining({ "buttler.network": "link", "buttler.link-id": "l1" }),
86
+ }));
87
+ expect(mocks.connect.mock.calls).toEqual([
88
+ ["id-buttler-link-l1", { Container: "ca" }],
89
+ ["id-buttler-link-l1", { Container: "cb" }],
90
+ ]);
91
+ });
92
+
93
+ it("doesn't connect the containers again", async () => {
94
+ links = [{ id: "l1", serviceAId: "a", serviceBId: "b" }];
95
+ networks = [linkNetwork("l1")];
96
+ mocks.listContainers.mockResolvedValue([container("ca", "a", ["buttler-link-l1"])]);
97
+ await syncLinkNetwork("l1");
98
+ expect(mocks.createNetwork).not.toHaveBeenCalled();
99
+ expect(mocks.connect).not.toHaveBeenCalled();
100
+ });
101
+
102
+ it("ignores a container that is replaced in the meantime", async () => {
103
+ links = [{ id: "l1", serviceAId: "a", serviceBId: "b" }];
104
+ mocks.listContainers.mockResolvedValue([container("ca", "a")]);
105
+ mocks.connect.mockRejectedValue(dockerError(404));
106
+ await expect(syncLinkNetwork("l1")).resolves.toBeUndefined();
107
+ });
108
+
109
+ it("removes the network of a link that is gone, and only disconnects the services", async () => {
110
+ networks = [linkNetwork("l1")];
111
+ mocks.listContainers.mockResolvedValue([
112
+ container("ca", "a", ["buttler-link-l1"]),
113
+ container("outside", null, ["buttler-link-l1"]),
114
+ ]);
115
+ mocks.remove.mockRejectedValue(dockerError(403));
116
+ await expect(syncLinkNetwork("l1")).resolves.toBeUndefined();
117
+ expect(mocks.disconnect.mock.calls).toEqual([["id-buttler-link-l1", { Container: "ca", Force: true }]]);
118
+ expect(mocks.remove).toHaveBeenCalledWith("id-buttler-link-l1");
119
+ });
120
+ });
121
+
122
+ describe("connectLinkNetworks", () => {
123
+ it("connects the container of a service to all of its links", async () => {
124
+ links = [
125
+ { id: "l1", serviceAId: "a", serviceBId: "b" },
126
+ { id: "l2", serviceAId: "a", serviceBId: "c" },
127
+ { id: "l3", serviceAId: "b", serviceBId: "c" },
128
+ ];
129
+ mocks.listContainers.mockResolvedValue([container("ca", "a")]);
130
+ await connectLinkNetworks("a");
131
+ expect(networks.map(network => network.Name)).toEqual(["buttler-link-l1", "buttler-link-l2"]);
132
+ expect(mocks.connect.mock.calls).toEqual([
133
+ ["id-buttler-link-l1", { Container: "ca" }],
134
+ ["id-buttler-link-l2", { Container: "ca" }],
135
+ ]);
136
+ });
137
+ });
138
+
139
+ describe("removeLinkNetworks", () => {
140
+ it("removes the networks of the links of a service", async () => {
141
+ links = [{ id: "l1", serviceAId: "a", serviceBId: "b" }, { id: "l2", serviceAId: "b", serviceBId: "c" }];
142
+ networks = [linkNetwork("l1"), linkNetwork("l2")];
143
+ mocks.listContainers.mockResolvedValue([container("cb", "b", ["buttler-link-l1", "buttler-link-l2"])]);
144
+ await removeLinkNetworks("a");
145
+ expect(mocks.disconnect.mock.calls).toEqual([["id-buttler-link-l1", { Container: "cb", Force: true }]]);
146
+ expect(mocks.remove.mock.calls).toEqual([["id-buttler-link-l1"]]);
147
+ });
148
+ });
149
+
150
+ describe("syncLinkNetworks", () => {
151
+ it("connects every link and removes the leftovers, a failure doesn't stop the others", async () => {
152
+ links = [{ id: "l1", serviceAId: "a", serviceBId: "b" }, { id: "l2", serviceAId: "b", serviceBId: "c" }];
153
+ networks = [linkNetwork("gone")];
154
+ mocks.listContainers.mockResolvedValue([container("ca", "a"), container("cc", "c")]);
155
+ mocks.connect.mockRejectedValueOnce(new Error("boom"));
156
+ vi.spyOn(console, "error").mockImplementation(() => undefined);
157
+ await syncLinkNetworks();
158
+ expect(mocks.connect.mock.calls).toEqual([
159
+ ["id-buttler-link-l1", { Container: "ca" }],
160
+ ["id-buttler-link-l2", { Container: "cc" }],
161
+ ]);
162
+ expect(mocks.remove).toHaveBeenCalledWith("id-buttler-link-gone");
163
+ });
164
+ });
@@ -0,0 +1,170 @@
1
+ import { docker } from "~/core/docker";
2
+ import { createQueue } from "~/core/queue";
3
+ import db from "~/database";
4
+ import type { ServiceLinkDTO } from "~/models/service-link";
5
+ import getServiceLinks from "~/operations/getServiceLinks";
6
+ import { isOwnContainer } from "./containers";
7
+ import { FORBIDDEN, NOT_FOUND, ignoreStatus } from "./errors";
8
+ import { BUTTLER_LINK_LABEL, BUTTLER_NETWORK_LABEL, BUTTLER_SERVICE_LABEL } from "./labels";
9
+ import { createButtlerNetwork } from "./networks";
10
+ import type Docker from "dockerode";
11
+
12
+ const LINK_NETWORK = "link";
13
+
14
+ type LinkNetwork = Pick<Docker.NetworkInspectInfo, "Id" | "Name">;
15
+
16
+ type Link = Pick<ServiceLinkDTO, "id" | "serviceAId" | "serviceBId">;
17
+
18
+ /** Changes never overlap, otherwise they could undo each other */
19
+ const enqueue = createQueue("link-queue");
20
+
21
+ export function getLinkNetworkName(linkId: string) {
22
+ return `buttler-link-${linkId}`;
23
+ }
24
+
25
+ /** Only returns the networks that are created by Buttler */
26
+ function listLinkNetworks(linkId?: string) {
27
+ return docker.listNetworks({
28
+ filters: {
29
+ label: [
30
+ `${BUTTLER_NETWORK_LABEL}=${LINK_NETWORK}`,
31
+ ...linkId ? [`${BUTTLER_LINK_LABEL}=${linkId}`] : [],
32
+ ],
33
+ },
34
+ });
35
+ }
36
+
37
+ async function createLinkNetwork(linkId: string): Promise<LinkNetwork> {
38
+ const name = getLinkNetworkName(linkId);
39
+ const network = await createButtlerNetwork({
40
+ Name: name,
41
+ Driver: "bridge",
42
+ // Only the internet network of a service reaches the outside
43
+ Internal: true,
44
+ Labels: {
45
+ "com.docker.compose.project": "buttler",
46
+ [BUTTLER_NETWORK_LABEL]: LINK_NETWORK,
47
+ [BUTTLER_LINK_LABEL]: linkId,
48
+ },
49
+ });
50
+ return { Id: network.id, Name: name };
51
+ }
52
+
53
+ function getEndpoint(container: Docker.ContainerInfo, network: LinkNetwork) {
54
+ return container.NetworkSettings.Networks[network.Name] as Docker.EndpointSettings | undefined;
55
+ }
56
+
57
+ function listContainers() {
58
+ return docker.listContainers({ all: true }).then(containers => {
59
+ return containers.filter(container => container.State !== "removing");
60
+ });
61
+ }
62
+
63
+ /** Services reach each other by the name of the container, so they need no alias */
64
+ async function connectContainer(network: LinkNetwork, container: Docker.ContainerInfo) {
65
+ if (getEndpoint(container, network)?.NetworkID === network.Id) return;
66
+ // The container may be replaced in the meantime, the new one is connected by its own deployment
67
+ await ignoreStatus(docker.getNetwork(network.Id).connect({ Container: container.Id }), NOT_FOUND);
68
+ }
69
+
70
+ async function connect(link: Link, containers: Docker.ContainerInfo[]) {
71
+ const network = (await listLinkNetworks(link.id)).at(0) ?? await createLinkNetwork(link.id);
72
+ const members = containers.filter(container => {
73
+ return isOwnContainer(container, link.serviceAId) || isOwnContainer(container, link.serviceBId);
74
+ });
75
+ for (const container of members) {
76
+ await connectContainer(network, container);
77
+ }
78
+ }
79
+
80
+ /** Only the containers of services are disconnected, the network is kept if others still use it */
81
+ async function removeNetworks(networks: LinkNetwork[], containers: Docker.ContainerInfo[]) {
82
+ for (const networkInfo of networks) {
83
+ const network = docker.getNetwork(networkInfo.Id);
84
+ for (const container of containers) {
85
+ if (!getEndpoint(container, networkInfo) || !container.Labels[BUTTLER_SERVICE_LABEL]) continue;
86
+ await ignoreStatus(network.disconnect({ Container: container.Id, Force: true }), NOT_FOUND);
87
+ }
88
+ await ignoreStatus(network.remove(), NOT_FOUND, FORBIDDEN);
89
+ }
90
+ }
91
+
92
+ async function sync(linkId: string, links: Link[], containers: Docker.ContainerInfo[]) {
93
+ const link = links.find(({ id }) => id === linkId);
94
+ if (link) {
95
+ await connect(link, containers);
96
+ } else {
97
+ await removeNetworks(await listLinkNetworks(linkId), containers);
98
+ }
99
+ }
100
+
101
+ /** Connects the containers of a link if it's in SQLite, otherwise removes its network */
102
+ export function syncLinkNetwork(linkId: string): Promise<void> {
103
+ return enqueue(async () => {
104
+ // The link may have changed while waiting for other changes
105
+ const [
106
+ links,
107
+ containers,
108
+ ] = await Promise.all([
109
+ getServiceLinks(db),
110
+ listContainers(),
111
+ ]);
112
+ await sync(linkId, links, containers);
113
+ });
114
+ }
115
+
116
+ /** Connects the containers of a service to the networks of all of its links */
117
+ export function connectLinkNetworks(serviceId: string): Promise<void> {
118
+ return enqueue(async () => {
119
+ const [
120
+ links,
121
+ containers,
122
+ ] = await Promise.all([
123
+ getServiceLinks(db, serviceId),
124
+ listContainers(),
125
+ ]);
126
+ for (const link of links) {
127
+ await connect(link, containers);
128
+ }
129
+ });
130
+ }
131
+
132
+ /** Removes the networks of the links of a service that is about to be deleted with its links */
133
+ export function removeLinkNetworks(serviceId: string): Promise<void> {
134
+ return enqueue(async () => {
135
+ const [
136
+ links,
137
+ containers,
138
+ ] = await Promise.all([
139
+ getServiceLinks(db, serviceId),
140
+ listContainers(),
141
+ ]);
142
+ for (const link of links) {
143
+ await removeNetworks(await listLinkNetworks(link.id), containers);
144
+ }
145
+ });
146
+ }
147
+
148
+ /** Syncs the networks of all links, and removes the leftovers. A link that fails doesn't affect the others. */
149
+ export function syncLinkNetworks(): Promise<void> {
150
+ return enqueue(async () => {
151
+ const [
152
+ links,
153
+ networks,
154
+ containers,
155
+ ] = await Promise.all([
156
+ getServiceLinks(db),
157
+ listLinkNetworks(),
158
+ listContainers(),
159
+ ]);
160
+ const networkLinkIds = networks.flatMap(network => network.Labels?.[BUTTLER_LINK_LABEL] ?? []);
161
+ for (const linkId of new Set([...links.map(({ id }) => id), ...networkLinkIds])) {
162
+ try {
163
+ await sync(linkId, links, containers);
164
+ } catch (error) {
165
+ // eslint-disable-next-line no-console
166
+ console.error(`Failed to sync the network of link ${linkId}:`, error);
167
+ }
168
+ }
169
+ });
170
+ }
@@ -27,6 +27,7 @@ import {
27
27
  import type Docker from "dockerode";
28
28
 
29
29
  const mockContainer = {
30
+ id: "new-container",
30
31
  start: vi.fn(),
31
32
  stop: vi.fn(),
32
33
  restart: vi.fn(),
@@ -51,6 +52,10 @@ const mockProvisionReverseProxy = vi.fn();
51
52
  const mockStartGitHubService = vi.fn();
52
53
  const mockGetBuildingServiceIds = vi.fn();
53
54
  const mockSyncIngressNetwork = vi.fn();
55
+ const mockEnsureInternetNetwork = vi.fn();
56
+ const mockRemoveInternetNetwork = vi.fn();
57
+ const mockConnectLinkNetworks = vi.fn();
58
+ const mockHasInternetAccess = vi.fn();
54
59
 
55
60
  vi.mock("~/core/docker", () => ({
56
61
  docker: {
@@ -67,6 +72,20 @@ vi.mock("./ingress", () => ({
67
72
  syncIngressNetwork: (...args: unknown[]) => mockSyncIngressNetwork(...args),
68
73
  }));
69
74
 
75
+ vi.mock("./links", () => ({
76
+ connectLinkNetworks: (...args: unknown[]) => mockConnectLinkNetworks(...args),
77
+ }));
78
+
79
+ vi.mock("./internet", () => ({
80
+ ensureInternetNetwork: (...args: unknown[]) => mockEnsureInternetNetwork(...args),
81
+ removeInternetNetwork: (...args: unknown[]) => mockRemoveInternetNetwork(...args),
82
+ }));
83
+
84
+ vi.mock("~/database", () => ({ default: {} }));
85
+ vi.mock("~/operations/hasInternetAccess", () => ({
86
+ default: (...args: unknown[]) => mockHasInternetAccess(...args),
87
+ }));
88
+
70
89
  vi.mock("./builds", () => ({
71
90
  getBuildingServiceIds: () => mockGetBuildingServiceIds(),
72
91
  }));
@@ -86,6 +105,8 @@ vi.mock("~/core/nginx", () => ({
86
105
  describe("Docker status aggregator", () => {
87
106
  beforeEach(() => {
88
107
  vi.clearAllMocks();
108
+ mockEnsureInternetNetwork.mockImplementation((id: string) => Promise.resolve(`buttler-internet-${id}`));
109
+ mockHasInternetAccess.mockResolvedValue(true);
89
110
  markServiceBuilding("srv-building", false);
90
111
  markServiceBuilding("srv-b", false);
91
112
  markServicePulling("srv-pulling", false);
@@ -480,6 +501,59 @@ describe("Docker status aggregator", () => {
480
501
  expect(connection).toBeLessThan(start);
481
502
  });
482
503
 
504
+ it("startServiceContainer creates the container on its internet network instead of the default bridge", async () => {
505
+ mockDocker.listContainers.mockResolvedValue([]);
506
+ mockImage.inspect.mockResolvedValue({});
507
+ await startServiceContainer({ id: "srv-dh", type: "dockerhub", repository: "redis", branch: "alpine" });
508
+ expect(mockDocker.createContainer).toHaveBeenCalledWith(expect.objectContaining({
509
+ HostConfig: expect.objectContaining({ NetworkMode: "buttler-internet-srv-dh" }),
510
+ NetworkingConfig: { EndpointsConfig: { "buttler-internet-srv-dh": {} } },
511
+ }));
512
+ expect(mockRemoveInternetNetwork).not.toHaveBeenCalled();
513
+ });
514
+
515
+ it("startServiceContainer takes a container without internet access off its network before it's started", async () => {
516
+ mockDocker.listContainers.mockResolvedValue([]);
517
+ mockImage.inspect.mockResolvedValue({});
518
+ mockHasInternetAccess.mockResolvedValue(false);
519
+ await startServiceContainer({ id: "srv-dh", type: "dockerhub", repository: "redis", branch: "alpine" });
520
+ expect(mockRemoveInternetNetwork).toHaveBeenCalledWith("srv-dh", "new-container");
521
+ const [removal] = mockRemoveInternetNetwork.mock.invocationCallOrder;
522
+ const [start] = mockContainer.start.mock.invocationCallOrder;
523
+ expect(removal).toBeLessThan(start);
524
+ });
525
+
526
+ it("startServiceContainer connects the new container to its links before it's started", async () => {
527
+ mockDocker.listContainers.mockResolvedValue([]);
528
+ mockImage.inspect.mockResolvedValue({});
529
+ await startServiceContainer({ id: "srv-dh", type: "dockerhub", repository: "redis", branch: "alpine" });
530
+ expect(mockConnectLinkNetworks).toHaveBeenCalledWith("srv-dh");
531
+ const [, connection] = mockConnectLinkNetworks.mock.invocationCallOrder;
532
+ const [creation] = mockDocker.createContainer.mock.invocationCallOrder;
533
+ const [start] = mockContainer.start.mock.invocationCallOrder;
534
+ expect(connection).toBeGreaterThan(creation);
535
+ expect(connection).toBeLessThan(start);
536
+ });
537
+
538
+ it("startServiceContainer keeps the old container if a link network can't be created", async () => {
539
+ mockDocker.listContainers.mockResolvedValue([]);
540
+ mockImage.inspect.mockResolvedValue({});
541
+ mockConnectLinkNetworks.mockRejectedValueOnce(new Error("no subnet"));
542
+ await expect(startServiceContainer({ id: "srv-dh", type: "dockerhub", repository: "redis", branch: "alpine" }))
543
+ .rejects.toThrow("no subnet");
544
+ expect(mockDocker.createContainer).not.toHaveBeenCalled();
545
+ });
546
+
547
+ it("startServiceContainer keeps the old container if the internet network can't be created", async () => {
548
+ mockDocker.listContainers.mockResolvedValue([]);
549
+ mockImage.inspect.mockResolvedValue({});
550
+ mockEnsureInternetNetwork.mockRejectedValueOnce(new Error("no subnet"));
551
+ await expect(startServiceContainer({ id: "srv-dh", type: "dockerhub", repository: "redis", branch: "alpine" }))
552
+ .rejects.toThrow("no subnet");
553
+ expect(mockContainer.remove).not.toHaveBeenCalled();
554
+ expect(mockDocker.createContainer).not.toHaveBeenCalled();
555
+ });
556
+
483
557
  it("startServiceContainer keeps the old container if the ingress network can't be created", async () => {
484
558
  mockDocker.listContainers.mockResolvedValue([]);
485
559
  mockImage.inspect.mockResolvedValue({});
@@ -2,11 +2,15 @@ import { docker } from "~/core/docker";
2
2
  import { getServiceImageTag } from "~/core/dockerhub";
3
3
  import { type ServiceEnvironmentVariable, getRuntimeVariables } from "~/core/environment-variables";
4
4
  import { getSharedState } from "~/core/shared-state";
5
+ import db from "~/database";
5
6
  import { TUNNEL_SERVICE_NAME } from "~/operations/getTunnelService";
7
+ import hasInternetAccess from "~/operations/hasInternetAccess";
6
8
  import { getBuildingServiceIds } from "./builds";
7
9
  import { REVERSE_PROXY_CONTAINER_NAME, isOwnContainer } from "./containers";
8
10
  import { syncIngressNetwork } from "./ingress";
11
+ import { ensureInternetNetwork, removeInternetNetwork } from "./internet";
9
12
  import { BUTTLER_SERVICE_LABEL } from "./labels";
13
+ import { connectLinkNetworks } from "./links";
10
14
  import type Docker from "dockerode";
11
15
 
12
16
  export type ContainerRuntimeStatus = "running" | "stopped" | "exited" | "building" | "pulling" | "restarting";
@@ -364,8 +368,11 @@ export async function deployServiceContainer(service: ServiceRef, image: string)
364
368
  }
365
369
 
366
370
  async function replaceServiceContainer(service: ServiceRef, image: string) {
367
- // If the network can't be created, the old container keeps running
371
+ // If the networks can't be created, the old container keeps running
368
372
  await syncIngressNetwork(service.id);
373
+ await connectLinkNetworks(service.id);
374
+ // A network given at creation replaces the default bridge network, where every container could reach the others
375
+ const internetNetwork = await ensureInternetNetwork(service.id);
369
376
 
370
377
  const existingContainer = await findServiceContainer(service);
371
378
  if (existingContainer) {
@@ -423,13 +430,21 @@ async function replaceServiceContainer(service: ServiceRef, image: string) {
423
430
  RestartPolicy: {
424
431
  Name: "always",
425
432
  },
433
+ NetworkMode: internetNetwork,
434
+ },
435
+ NetworkingConfig: {
436
+ EndpointsConfig: { [internetNetwork]: {} },
426
437
  },
427
438
  ExposedPorts: exposedPorts,
428
439
  Tty: false,
429
440
  });
430
441
 
431
- // Joins the network of the new container. Networks that are given at creation would replace the default one.
432
442
  await syncIngressNetwork(service.id);
443
+ await connectLinkNetworks(service.id);
444
+ // With NetworkMode "none" it could never join a network later, so it leaves the internet network before it starts
445
+ if (!await hasInternetAccess(db, service.id)) {
446
+ await removeInternetNetwork(service.id, container.id);
447
+ }
433
448
  await container.start();
434
449
  }
435
450
 
@@ -1,3 +0,0 @@
1
- module.exports=[59870,(e,r,t)=>{r.exports=e.x("@grpc/grpc-js-a3bed6b460f5f8b6",()=>require("@grpc/grpc-js-a3bed6b460f5f8b6"))},75760,(e,r,t)=>{r.exports=e.x("dockerode-bcad4ae286499104",()=>require("dockerode-bcad4ae286499104"))},27699,(e,r,t)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},66680,(e,r,t)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},12714,(e,r,t)=>{r.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},61095,(e,r,t)=>{r.exports=e.x("node:net",()=>require("node:net"))},60526,(e,r,t)=>{r.exports=e.x("node:os",()=>require("node:os"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},14565,96608,87949,39167,e=>{"use strict";let r="buttler.service-id";function t(e,r){let t=Symbol.for(`buttler.${e}`),n=globalThis;return n[t]??=r()}e.s(["B",0,"buttler.network","v",0,r,"r",0,"buttler.tunnel-id"],96608),e.s(["A",0,"buttler-nginx","G",0,function(e,t){return e.Labels[r]===t||e.Names.includes(`/buttler-service-${t}`)}],14565),e.s(["f",0,t],87949),e.s(["f",0,function(e){let r=t(e,()=>({tail:Promise.resolve()}));return e=>{let t=r.tail.then(e);return r.tail=t.then(()=>void 0,()=>void 0),t}}],39167)},53016,e=>{"use strict";var r=e.i(12714),t=e.i(60526),n=e.i(50227);function s(){return process.env.BUTTLER_HOME||n.default.resolve((0,t.homedir)(),".buttler")}function o(e,r){return n.default.resolve(s(),e,r)}async function u(e,t){try{return await r.default.readFile(o(e,t),"utf8")}catch{return null}}async function i(e,t,o){let u=n.default.resolve(s(),e);await r.default.mkdir(u,{recursive:!0});let i=n.default.resolve(u,t);return await r.default.writeFile(i,o,"utf-8"),i}async function a(e,t){await r.default.unlink(o(e,t))}e.s(["Q",0,o,"J",0,u,"M",0,a,"v",0,i])},85132,55597,e=>{"use strict";async function r(e){let r=await e.query.settings.findFirst({where:{key:"dashboard_domain"}});return r?.value??null}e.s(["f",0,r],85132),e.s(["f",0,function(e){return e.query.domains.findMany({orderBy:{hostname:"asc"}})}],55597)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0q_y890--33_5._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},14565,96608,87949,39167,e=>{"use strict";let t="buttler.service-id";function r(e,t){let r=Symbol.for(`buttler.${e}`),n=globalThis;return n[r]??=t()}e.s(["B",0,"buttler.network","v",0,t,"r",0,"buttler.tunnel-id"],96608),e.s(["A",0,"buttler-nginx","G",0,function(e,r){return e.Labels[t]===r||e.Names.includes(`/buttler-service-${r}`)}],14565),e.s(["f",0,r],87949),e.s(["f",0,function(e){let t=r(e,()=>({tail:Promise.resolve()}));return e=>{let r=t.tail.then(e);return t.tail=r.then(()=>void 0,()=>void 0),r}}],39167)},53016,e=>{"use strict";var t=e.i(12714),r=e.i(60526),n=e.i(50227);function u(){return process.env.BUTTLER_HOME||n.default.resolve((0,r.homedir)(),".buttler")}function s(e,t){return n.default.resolve(u(),e,t)}async function i(e,r){try{return await t.default.readFile(s(e,r),"utf8")}catch{return null}}async function o(e,r,s){let i=n.default.resolve(u(),e);await t.default.mkdir(i,{recursive:!0});let o=n.default.resolve(i,r);return await t.default.writeFile(o,s,"utf-8"),o}async function l(e,r){await t.default.unlink(s(e,r))}e.s(["Q",0,s,"J",0,i,"M",0,l,"v",0,o])},85132,55597,e=>{"use strict";async function t(e){let t=await e.query.settings.findFirst({where:{key:"dashboard_domain"}});return t?.value??null}e.s(["f",0,t],85132),e.s(["f",0,function(e){return e.query.domains.findMany({orderBy:{hostname:"asc"}})}],55597)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__156dfvjma1155._.js.map