openship 0.4.5 → 0.4.6

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 (314) hide show
  1. package/README.md +2 -24
  2. package/dist/bare-2HYDXQEH.js +23 -0
  3. package/dist/{bowser-L6PVH37V.js → bowser-O3AEA6AN.js} +3 -1
  4. package/dist/{chunk-R74UB4X4.js → chunk-2ZLR7ULL.js} +253 -65
  5. package/dist/{chunk-E3ZPCNPU.js → chunk-3JQTL4R4.js} +234 -99
  6. package/dist/{chunk-YFLQGDN2.js → chunk-4TJC4JZQ.js} +18 -9
  7. package/dist/{chunk-JXQCFTDV.js → chunk-4Z5QO7N6.js} +4 -2
  8. package/dist/{chunk-7EYFCKZX.js → chunk-5FNIWBFI.js} +8 -6
  9. package/dist/{chunk-JJVSOE4I.js → chunk-5MZ624VX.js} +2 -0
  10. package/dist/{chunk-TDFK6ISF.js → chunk-6APIPIJY.js} +6 -4
  11. package/dist/{chunk-3LCRNQ2C.js → chunk-6APULWSU.js} +151 -133
  12. package/dist/{chunk-FTBXJ2VA.js → chunk-6B5YCFFV.js} +6 -4
  13. package/dist/{chunk-MDFYN2QH.js → chunk-AVIB7CT7.js} +3 -1
  14. package/dist/{chunk-VJTXRCTT.js → chunk-C5OHTYEF.js} +10 -6
  15. package/dist/{chunk-W7KGHYLV.js → chunk-DYPH4HCI.js} +2 -0
  16. package/dist/{chunk-5WI7ZXOC.js → chunk-EI575GHN.js} +4 -2
  17. package/dist/{chunk-Z6EKX6CX.js → chunk-FPRHYBY2.js} +2 -0
  18. package/dist/chunk-FQGJZ2HS.js +248 -0
  19. package/dist/{chunk-FZJX6XP7.js → chunk-FRNAR33O.js} +4 -2
  20. package/dist/{chunk-XRWV5ZNR.js → chunk-FXTBHTWY.js} +360 -42
  21. package/dist/chunk-ILFETZOM.js +131 -0
  22. package/dist/{chunk-PARRPUXN.js → chunk-IXCHURVK.js} +5 -3
  23. package/dist/{chunk-YJAS5RQX.js → chunk-JYGD5WSN.js} +2 -0
  24. package/dist/{chunk-JWBXYO24.js → chunk-KI2EY3WB.js} +2 -0
  25. package/dist/{chunk-YVXF6GGR.js → chunk-L2VOGB2X.js} +5 -104
  26. package/dist/{chunk-K5OH5U7N.js → chunk-MZ2WEHHY.js} +5 -3
  27. package/dist/{chunk-SJBR527P.js → chunk-O6ZZF52V.js} +3 -1
  28. package/dist/{chunk-VLPJLXXB.js → chunk-OWED2GRM.js} +3 -1
  29. package/dist/{chunk-C4FOQJ63.js → chunk-OXWDY22G.js} +4 -2
  30. package/dist/{chunk-NPVJYR7M.js → chunk-Q2CIRAOK.js} +2 -0
  31. package/dist/{chunk-JYAGTMSJ.js → chunk-RPHRPFEH.js} +2 -0
  32. package/dist/{chunk-UMYQALBH.js → chunk-SQ77DZOI.js} +1726 -1484
  33. package/dist/{chunk-HYL4QYZM.js → chunk-TGIINPVM.js} +13 -2
  34. package/dist/{chunk-SYCZE6FQ.js → chunk-TYVME3XD.js} +7 -1
  35. package/dist/{chunk-HDV4NSA3.js → chunk-V6AN6XLZ.js} +16 -6
  36. package/dist/{chunk-3YCMJRDZ.js → chunk-VDMQJHPI.js} +36 -15
  37. package/dist/{chunk-RZPDJC2J.js → chunk-VFINNTUL.js} +20 -1
  38. package/dist/{chunk-65KKUJBR.js → chunk-VWPEKOH6.js} +4 -2
  39. package/dist/{chunk-GHXGCANU.js → chunk-W73X43R7.js} +4 -2
  40. package/dist/{cloud-7IGG45CF.js → cloud-7QYOGF7F.js} +4 -2
  41. package/dist/cloud-ZSKOS4GY.js +30 -0
  42. package/dist/detect-SH4FHFBI.js +36 -0
  43. package/dist/{dist-NQB6QGX3.js → dist-IQJ6H6UZ.js} +4 -2
  44. package/dist/{dist-es-DCR6UJMP.js → dist-es-5DY7K32L.js} +7 -5
  45. package/dist/{dist-es-TYYZ5KEF.js → dist-es-JSTDUS7Q.js} +7 -5
  46. package/dist/{dist-es-7EZIM4JU.js → dist-es-OSNJBLXB.js} +6 -4
  47. package/dist/{dist-es-6RSPR56Q.js → dist-es-RYHIPOTN.js} +15 -13
  48. package/dist/{dist-es-33Z3Y6VE.js → dist-es-VNKHQVIB.js} +5 -3
  49. package/dist/{dist-es-D6QQVWRZ.js → dist-es-WV4AMOII.js} +9 -7
  50. package/dist/{dist-es-GMEQINIE.js → dist-es-X3B5QYKB.js} +7 -5
  51. package/dist/docker-U7AF5PTA.js +16 -0
  52. package/dist/docker-edge-executor-VHW3JPJS.js +13 -0
  53. package/dist/edge-import-V5CBA47C.js +45 -0
  54. package/dist/ensure-container-edge-CMYROUSI.js +33 -0
  55. package/dist/{event-streams-G7F6Q7QY.js → event-streams-EHRAKL75.js} +5 -3
  56. package/dist/{executor-O5NR7LMP.js → executor-YPT6RH6O.js} +9 -7
  57. package/dist/index.d.ts +2 -1
  58. package/dist/index.js +256 -245
  59. package/dist/{loadSso-LH753OSJ.js → loadSso-46FQRIZS.js} +11 -9
  60. package/dist/local-executor-V7U5VOZW.js +12 -0
  61. package/dist/nginx-2GTRUIDE.js +24 -0
  62. package/dist/{noop-6KC6HRDB.js → noop-FMMFG2EZ.js} +4 -2
  63. package/dist/{openresty-lua-KFCOJAG4.js → openresty-lua-4WLGDSER.js} +11 -3
  64. package/dist/server/engine/ChangeLog +2289 -0
  65. package/dist/server/engine/Documentations +5 -0
  66. package/dist/server/engine/LICENSE +674 -0
  67. package/dist/server/engine/README.md +34 -0
  68. package/dist/server/engine/conf/amavisd +150 -0
  69. package/dist/server/engine/conf/clamav +71 -0
  70. package/dist/server/engine/conf/core +632 -0
  71. package/dist/server/engine/conf/dovecot +151 -0
  72. package/dist/server/engine/conf/fail2ban +72 -0
  73. package/dist/server/engine/conf/global +698 -0
  74. package/dist/server/engine/conf/iredapd +52 -0
  75. package/dist/server/engine/conf/logwatch +28 -0
  76. package/dist/server/engine/conf/postfix +97 -0
  77. package/dist/server/engine/conf/postgresql +93 -0
  78. package/dist/server/engine/conf/spamassassin +39 -0
  79. package/dist/server/engine/dialog/config_via_dialog.sh +258 -0
  80. package/dist/server/engine/dialog/optional_components.sh +122 -0
  81. package/dist/server/engine/dialog/pgsql_config.sh +52 -0
  82. package/dist/server/engine/dialog/virtual_domain_config.sh +94 -0
  83. package/dist/server/engine/functions/amavisd.sh +267 -0
  84. package/dist/server/engine/functions/backend.sh +85 -0
  85. package/dist/server/engine/functions/clamav.sh +100 -0
  86. package/dist/server/engine/functions/cleanup.sh +393 -0
  87. package/dist/server/engine/functions/dovecot.sh +583 -0
  88. package/dist/server/engine/functions/fail2ban.sh +209 -0
  89. package/dist/server/engine/functions/iredapd.sh +356 -0
  90. package/dist/server/engine/functions/optional_components.sh +24 -0
  91. package/dist/server/engine/functions/packages.sh +522 -0
  92. package/dist/server/engine/functions/packages_freebsd.sh +179 -0
  93. package/dist/server/engine/functions/postfix.sh +457 -0
  94. package/dist/server/engine/functions/postgresql.sh +239 -0
  95. package/dist/server/engine/functions/spamassassin.sh +49 -0
  96. package/dist/server/engine/functions/system_accounts.sh +128 -0
  97. package/dist/server/engine/iRedMail.sh +144 -0
  98. package/dist/server/engine/pkgs/get_all.sh +338 -0
  99. package/dist/server/engine/pkgs/pkgs.freebsd.sha256 +3 -0
  100. package/dist/server/engine/pkgs/pkgs.openbsd.sha256 +6 -0
  101. package/dist/server/engine/pkgs/pkgs.sha256 +1 -0
  102. package/dist/server/engine/samples/amavisd/amavisd.conf +677 -0
  103. package/dist/server/engine/samples/amavisd/amavisd.mysql +278 -0
  104. package/dist/server/engine/samples/amavisd/amavisd.pgsql +253 -0
  105. package/dist/server/engine/samples/amavisd/amavisd.schema +942 -0
  106. package/dist/server/engine/samples/amavisd/default_spam_policy.sql +46 -0
  107. package/dist/server/engine/samples/dovecot/dovecot-2.4-mariadb.conf +758 -0
  108. package/dist/server/engine/samples/dovecot/dovecot-2.4-openldap.conf +767 -0
  109. package/dist/server/engine/samples/dovecot/dovecot-2.4-pgsql.conf +762 -0
  110. package/dist/server/engine/samples/dovecot/dovecot-last-login.conf +50 -0
  111. package/dist/server/engine/samples/dovecot/dovecot-ldap.conf +21 -0
  112. package/dist/server/engine/samples/dovecot/dovecot-share-folder.conf +22 -0
  113. package/dist/server/engine/samples/dovecot/dovecot-sql.conf +28 -0
  114. package/dist/server/engine/samples/dovecot/dovecot-used-quota.conf +13 -0
  115. package/dist/server/engine/samples/dovecot/dovecot.conf +484 -0
  116. package/dist/server/engine/samples/dovecot/dovecot.sieve +7 -0
  117. package/dist/server/engine/samples/dovecot/dovecot2-quota-warning.sh +38 -0
  118. package/dist/server/engine/samples/dovecot/sql/imap_share_folder.mysql +16 -0
  119. package/dist/server/engine/samples/dovecot/sql/last_login.mysql +12 -0
  120. package/dist/server/engine/samples/dovecot/sql/used_quota.mysql +26 -0
  121. package/dist/server/engine/samples/dovecot/systemd/override.conf +3 -0
  122. package/dist/server/engine/samples/fail2ban/action.d/banned_db.conf +9 -0
  123. package/dist/server/engine/samples/fail2ban/bin/fail2ban_banned_db +268 -0
  124. package/dist/server/engine/samples/fail2ban/fail2ban.local +17 -0
  125. package/dist/server/engine/samples/fail2ban/filter.d/dovecot.iredmail.conf +5 -0
  126. package/dist/server/engine/samples/fail2ban/filter.d/postfix-pregreet.iredmail.conf +16 -0
  127. package/dist/server/engine/samples/fail2ban/filter.d/postfix.iredmail.conf +18 -0
  128. package/dist/server/engine/samples/fail2ban/filter.d/roundcube.iredmail.conf +9 -0
  129. package/dist/server/engine/samples/fail2ban/jail.d/dovecot.local +8 -0
  130. package/dist/server/engine/samples/fail2ban/jail.d/nginx-http-auth.local +8 -0
  131. package/dist/server/engine/samples/fail2ban/jail.d/postfix-pregreet.local +9 -0
  132. package/dist/server/engine/samples/fail2ban/jail.d/postfix.local +8 -0
  133. package/dist/server/engine/samples/fail2ban/jail.d/roundcube.local +9 -0
  134. package/dist/server/engine/samples/fail2ban/jail.d/sogo.local +8 -0
  135. package/dist/server/engine/samples/fail2ban/jail.d/sshd.local +8 -0
  136. package/dist/server/engine/samples/fail2ban/jail.local +6 -0
  137. package/dist/server/engine/samples/fail2ban/openbsd/rc +27 -0
  138. package/dist/server/engine/samples/fail2ban/sql/fail2ban.mysql +49 -0
  139. package/dist/server/engine/samples/fail2ban/sql/fail2ban.pgsql +48 -0
  140. package/dist/server/engine/samples/firewall/firewalld/services/ssh.xml +6 -0
  141. package/dist/server/engine/samples/firewall/firewalld/zones/iredmail.xml +15 -0
  142. package/dist/server/engine/samples/firewall/iptables/ip6tables.init.debian +362 -0
  143. package/dist/server/engine/samples/firewall/iptables/ip6tables.rules +53 -0
  144. package/dist/server/engine/samples/firewall/iptables/iptables.init.debian +363 -0
  145. package/dist/server/engine/samples/firewall/iptables/iptables.rules +54 -0
  146. package/dist/server/engine/samples/firewall/nftables.conf +58 -0
  147. package/dist/server/engine/samples/freebsd/newsyslog.conf.d/dovecot.conf +3 -0
  148. package/dist/server/engine/samples/freebsd/newsyslog.conf.d/iredapd.conf +1 -0
  149. package/dist/server/engine/samples/freebsd/newsyslog.conf.d/mlmmjadmin.conf +1 -0
  150. package/dist/server/engine/samples/freebsd/newsyslog.conf.d/php-fpm.conf +2 -0
  151. package/dist/server/engine/samples/freebsd/newsyslog.conf.d/slapd.conf +1 -0
  152. package/dist/server/engine/samples/freebsd/syslog.d/dovecot.conf +2 -0
  153. package/dist/server/engine/samples/freebsd/syslog.d/fail2ban.conf +2 -0
  154. package/dist/server/engine/samples/freebsd/syslog.d/iredapd.conf +2 -0
  155. package/dist/server/engine/samples/freebsd/syslog.d/mlmmjadmin.conf +2 -0
  156. package/dist/server/engine/samples/freebsd/syslog.d/php-fpm.conf +2 -0
  157. package/dist/server/engine/samples/freebsd/syslog.d/slapd.conf +2 -0
  158. package/dist/server/engine/samples/iredmail/iredmail.mysql +491 -0
  159. package/dist/server/engine/samples/iredmail/iredmail.pgsql +465 -0
  160. package/dist/server/engine/samples/iredmail/iredmail.schema +456 -0
  161. package/dist/server/engine/samples/iredmail/used_quota_triggers_dovecot_2.3.pgsql +40 -0
  162. package/dist/server/engine/samples/iredmail/used_quota_triggers_dovecot_2.4.pgsql +18 -0
  163. package/dist/server/engine/samples/logrotate/dovecot +13 -0
  164. package/dist/server/engine/samples/logrotate/iredapd +13 -0
  165. package/dist/server/engine/samples/logrotate/mlmmjadmin +13 -0
  166. package/dist/server/engine/samples/logrotate/openldap +19 -0
  167. package/dist/server/engine/samples/logrotate/php-fpm +13 -0
  168. package/dist/server/engine/samples/openbsd/ldapd.conf +58 -0
  169. package/dist/server/engine/samples/openbsd/pf.conf +28 -0
  170. package/dist/server/engine/samples/postfix/command_filter.pcre +3 -0
  171. package/dist/server/engine/samples/postfix/freebsd/mailer.conf +9 -0
  172. package/dist/server/engine/samples/postfix/helo_access.pcre +180 -0
  173. package/dist/server/engine/samples/postfix/ldap/catchall_maps.cf +11 -0
  174. package/dist/server/engine/samples/postfix/ldap/recipient_bcc_maps_domain.cf +11 -0
  175. package/dist/server/engine/samples/postfix/ldap/recipient_bcc_maps_user.cf +11 -0
  176. package/dist/server/engine/samples/postfix/ldap/relay_domains.cf +11 -0
  177. package/dist/server/engine/samples/postfix/ldap/sender_bcc_maps_domain.cf +11 -0
  178. package/dist/server/engine/samples/postfix/ldap/sender_bcc_maps_user.cf +11 -0
  179. package/dist/server/engine/samples/postfix/ldap/sender_dependent_relayhost_maps_domain.cf +11 -0
  180. package/dist/server/engine/samples/postfix/ldap/sender_dependent_relayhost_maps_user.cf +11 -0
  181. package/dist/server/engine/samples/postfix/ldap/sender_login_maps.cf +11 -0
  182. package/dist/server/engine/samples/postfix/ldap/transport_maps_domain.cf +11 -0
  183. package/dist/server/engine/samples/postfix/ldap/transport_maps_user.cf +11 -0
  184. package/dist/server/engine/samples/postfix/ldap/virtual_alias_maps.cf +11 -0
  185. package/dist/server/engine/samples/postfix/ldap/virtual_group_maps.cf +11 -0
  186. package/dist/server/engine/samples/postfix/ldap/virtual_group_members_maps.cf +11 -0
  187. package/dist/server/engine/samples/postfix/ldap/virtual_mailbox_domains.cf +11 -0
  188. package/dist/server/engine/samples/postfix/ldap/virtual_mailbox_maps.cf +12 -0
  189. package/dist/server/engine/samples/postfix/main.cf +282 -0
  190. package/dist/server/engine/samples/postfix/main.cf.amavisd +7 -0
  191. package/dist/server/engine/samples/postfix/main.cf.dovecot +8 -0
  192. package/dist/server/engine/samples/postfix/main.cf.ldap +39 -0
  193. package/dist/server/engine/samples/postfix/main.cf.mlmmj +5 -0
  194. package/dist/server/engine/samples/postfix/main.cf.mysql +39 -0
  195. package/dist/server/engine/samples/postfix/main.cf.pgsql +39 -0
  196. package/dist/server/engine/samples/postfix/main.cf.postscreen +30 -0
  197. package/dist/server/engine/samples/postfix/master.cf +87 -0
  198. package/dist/server/engine/samples/postfix/mysql/catchall_maps.cf +5 -0
  199. package/dist/server/engine/samples/postfix/mysql/domain_alias_catchall_maps.cf +5 -0
  200. package/dist/server/engine/samples/postfix/mysql/domain_alias_maps.cf +5 -0
  201. package/dist/server/engine/samples/postfix/mysql/recipient_bcc_maps_domain.cf +5 -0
  202. package/dist/server/engine/samples/postfix/mysql/recipient_bcc_maps_user.cf +5 -0
  203. package/dist/server/engine/samples/postfix/mysql/relay_domains.cf +5 -0
  204. package/dist/server/engine/samples/postfix/mysql/sender_bcc_maps_domain.cf +5 -0
  205. package/dist/server/engine/samples/postfix/mysql/sender_bcc_maps_user.cf +5 -0
  206. package/dist/server/engine/samples/postfix/mysql/sender_dependent_relayhost_maps.cf +6 -0
  207. package/dist/server/engine/samples/postfix/mysql/sender_login_maps.cf +5 -0
  208. package/dist/server/engine/samples/postfix/mysql/transport_maps_domain.cf +5 -0
  209. package/dist/server/engine/samples/postfix/mysql/transport_maps_maillist.cf +5 -0
  210. package/dist/server/engine/samples/postfix/mysql/transport_maps_user.cf +5 -0
  211. package/dist/server/engine/samples/postfix/mysql/virtual_alias_maps.cf +5 -0
  212. package/dist/server/engine/samples/postfix/mysql/virtual_mailbox_domains.cf +5 -0
  213. package/dist/server/engine/samples/postfix/mysql/virtual_mailbox_maps.cf +5 -0
  214. package/dist/server/engine/samples/postfix/pgsql/catchall_maps.cf +5 -0
  215. package/dist/server/engine/samples/postfix/pgsql/domain_alias_catchall_maps.cf +5 -0
  216. package/dist/server/engine/samples/postfix/pgsql/domain_alias_maps.cf +5 -0
  217. package/dist/server/engine/samples/postfix/pgsql/recipient_bcc_maps_domain.cf +5 -0
  218. package/dist/server/engine/samples/postfix/pgsql/recipient_bcc_maps_user.cf +5 -0
  219. package/dist/server/engine/samples/postfix/pgsql/relay_domains.cf +5 -0
  220. package/dist/server/engine/samples/postfix/pgsql/sender_bcc_maps_domain.cf +5 -0
  221. package/dist/server/engine/samples/postfix/pgsql/sender_bcc_maps_user.cf +5 -0
  222. package/dist/server/engine/samples/postfix/pgsql/sender_dependent_relayhost_maps.cf +6 -0
  223. package/dist/server/engine/samples/postfix/pgsql/sender_login_maps.cf +5 -0
  224. package/dist/server/engine/samples/postfix/pgsql/transport_maps_domain.cf +5 -0
  225. package/dist/server/engine/samples/postfix/pgsql/transport_maps_maillist.cf +5 -0
  226. package/dist/server/engine/samples/postfix/pgsql/transport_maps_user.cf +5 -0
  227. package/dist/server/engine/samples/postfix/pgsql/virtual_alias_maps.cf +5 -0
  228. package/dist/server/engine/samples/postfix/pgsql/virtual_mailbox_domains.cf +5 -0
  229. package/dist/server/engine/samples/postfix/pgsql/virtual_mailbox_maps.cf +5 -0
  230. package/dist/server/engine/samples/postfix/postscreen_access.cidr +6 -0
  231. package/dist/server/engine/samples/postgresql/sql/add_first_domain_and_user.sql +34 -0
  232. package/dist/server/engine/samples/postgresql/sql/grant_permissions.sql +14 -0
  233. package/dist/server/engine/samples/postgresql/sql/init_vmail_db.sql +15 -0
  234. package/dist/server/engine/samples/rsyslog.d/1-iredmail-dovecot.conf +23 -0
  235. package/dist/server/engine/samples/rsyslog.d/1-iredmail-fail2ban.conf +2 -0
  236. package/dist/server/engine/samples/rsyslog.d/1-iredmail-iredapd.conf +12 -0
  237. package/dist/server/engine/samples/rsyslog.d/1-iredmail-mlmmjadmin.conf +12 -0
  238. package/dist/server/engine/samples/rsyslog.d/1-iredmail-openldap.conf +2 -0
  239. package/dist/server/engine/samples/rsyslog.d/1-iredmail-phpfpm.conf +3 -0
  240. package/dist/server/engine/samples/spamassassin/local.cf +186 -0
  241. package/dist/server/engine/samples/spamassassin/razor.conf +1 -0
  242. package/dist/server/engine/samples/systemd/clamd.service.d/override.conf +2 -0
  243. package/dist/server/engine/samples/systemd/mariadb.service.d/override.conf +3 -0
  244. package/dist/server/engine/samples/systemd/slapd.service.d/override.conf +6 -0
  245. package/dist/server/engine/samples/yum/CentOS-Linux-AppStream.repo +6 -0
  246. package/dist/server/engine/samples/yum/CentOS-Linux-PowerTools.repo +6 -0
  247. package/dist/server/engine/samples/yum/CentOS-Stream-AppStream.repo +7 -0
  248. package/dist/server/engine/samples/yum/CentOS-Stream-PowerTools.repo +7 -0
  249. package/dist/server/engine/samples/yum/symas-openldap.repo +6 -0
  250. package/dist/server/engine/tools/add_enabled_service.py +60 -0
  251. package/dist/server/engine/tools/backup_mysql.sh +238 -0
  252. package/dist/server/engine/tools/backup_openldap.sh +230 -0
  253. package/dist/server/engine/tools/backup_pgsql.sh +217 -0
  254. package/dist/server/engine/tools/backup_sogo.sh +156 -0
  255. package/dist/server/engine/tools/create_mail_user_OpenLDAP.py +335 -0
  256. package/dist/server/engine/tools/create_mail_user_OpenLDAP.sh +287 -0
  257. package/dist/server/engine/tools/create_mail_user_SQL.sh +127 -0
  258. package/dist/server/engine/tools/enable_postscreen.sh +144 -0
  259. package/dist/server/engine/tools/fail2ban_unban_ip.sh +39 -0
  260. package/dist/server/engine/tools/find_sasl_login_ip.sh +20 -0
  261. package/dist/server/engine/tools/find_top_sasl_usernames.sh +28 -0
  262. package/dist/server/engine/tools/generate_ssl_keys.sh +85 -0
  263. package/dist/server/engine/tools/kill_high_cpu_sogo_process.sh +32 -0
  264. package/dist/server/engine/tools/ldap_assign_user_to_groups.py +151 -0
  265. package/dist/server/engine/tools/ldap_move_members_to_another_group.py +129 -0
  266. package/dist/server/engine/tools/migrate_sql_alias_table.py +177 -0
  267. package/dist/server/engine/update/0.9.8/amavisd.mysql +29 -0
  268. package/dist/server/engine/update/0.9.8/amavisd.pgsql +39 -0
  269. package/dist/server/engine/update/0.9.8/iredmail.mysql +53 -0
  270. package/dist/server/engine/update/0.9.8/iredmail.pgsql +61 -0
  271. package/dist/server/engine/update/0.9.9/iredmail.mysql +2 -0
  272. package/dist/server/engine/update/0.9.9/iredmail.pgsql +2 -0
  273. package/dist/server/engine/update/1.0/iredmail.mysql +2 -0
  274. package/dist/server/engine/update/1.0/iredmail.pgsql +2 -0
  275. package/dist/server/engine/update/1.2/last_login.mysql +16 -0
  276. package/dist/server/engine/update/1.4.0/iredmail.mysql +22 -0
  277. package/dist/server/engine/update/1.4.0/iredmail.pgsql +20 -0
  278. package/dist/server/engine/update/1.4.1/iredmail.mysql +3 -0
  279. package/dist/server/engine/update/1.4.1/iredmail.pgsql +3 -0
  280. package/dist/server/engine/update/1.4.1/sogo.mysql +11 -0
  281. package/dist/server/engine/update/1.4.1/sogo.pgsql +30 -0
  282. package/dist/server/engine/update/1.4.1/update-ldap.py +66 -0
  283. package/dist/server/engine/update/1.4.2/iredmail.mysql +9 -0
  284. package/dist/server/engine/update/1.4.2/iredmail.pgsql +9 -0
  285. package/dist/server/engine/update/1.4.2/sogo.pgsql +30 -0
  286. package/dist/server/engine/update/1.6.0/sogo_view.pgsql +27 -0
  287. package/dist/server/engine/update/1.6.3/iredmail.mysql +1 -0
  288. package/dist/server/engine/update/1.7.0/fail2ban.mysql +11 -0
  289. package/dist/server/engine/update/1.7.0/fail2ban.pgsql +12 -0
  290. package/dist/server/engine/update/1.7.1/amavisd.mysql +1 -0
  291. package/dist/server/engine/update/1.7.2/vmail.mysql +30 -0
  292. package/dist/server/engine/update/1.7.3/deleted_mailboxes.mysql +43 -0
  293. package/dist/server/engine/update/1.7.3/iredadmin.mysql +26 -0
  294. package/dist/server/engine/update/1.7.3/vmail.mysql +79 -0
  295. package/dist/server/engine/update/1.7.3/vmail.pgsql +9 -0
  296. package/dist/server/engine/update/README.md +1 -0
  297. package/dist/server/engine/update/ldap/README.md +40 -0
  298. package/dist/server/engine/update/ldap/update-ldap-dovecot-2.3.py +69 -0
  299. package/dist/server/index.js +55574 -53675
  300. package/dist/server/migrations/0071_gh_device_token.sql +3 -0
  301. package/dist/server/migrations/0072_gh_device_token_method.sql +1 -0
  302. package/dist/server/migrations/meta/_journal.json +14 -0
  303. package/dist/setup-HQIZLUOJ.js +20 -0
  304. package/dist/{signin-PVC7MBZJ.js → signin-ITOPKKUB.js} +11 -9
  305. package/dist/{sso-oidc-ZXY77BSL.js → sso-oidc-NON2PD7Y.js} +11 -9
  306. package/dist/{sts-LX5L4UU3.js → sts-HHFFSAY2.js} +10 -8
  307. package/package.json +1 -1
  308. package/dist/bare-CNSFDNSZ.js +0 -20
  309. package/dist/cloud-655YYCEW.js +0 -26
  310. package/dist/docker-UWQPDEGW.js +0 -14
  311. package/dist/docker-edge-executor-ZLAYE5FE.js +0 -11
  312. package/dist/edge-import-AFID2EN3.js +0 -41
  313. package/dist/nginx-M36GDYL7.js +0 -18
  314. package/dist/setup-ZXXB5S22.js +0 -16
@@ -1,11 +1,18 @@
1
+ #!/usr/bin/env sh
2
+ ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
1
3
  import { createRequire as __ospCreateRequire } from "node:module";
2
4
  const require = __ospCreateRequire(import.meta.url);
5
+ import {
6
+ ENV_KEY,
7
+ ENV_SECRET,
8
+ fromEnv
9
+ } from "./chunk-FRNAR33O.js";
3
10
  import {
4
11
  SignatureV4MultiRegion,
5
12
  XmlNode,
6
13
  XmlShapeDeserializer,
7
14
  XmlText
8
- } from "./chunk-TDFK6ISF.js";
15
+ } from "./chunk-6APIPIJY.js";
9
16
  import {
10
17
  AwsSdkSigV4ASigner,
11
18
  AwsSdkSigV4Signer,
@@ -21,27 +28,10 @@ import {
21
28
  resolveAwsSdkSigV4AConfig,
22
29
  resolveAwsSdkSigV4Config,
23
30
  streamCollector
24
- } from "./chunk-PARRPUXN.js";
31
+ } from "./chunk-IXCHURVK.js";
25
32
  import {
26
33
  NodeHttpHandler
27
- } from "./chunk-VLPJLXXB.js";
28
- import {
29
- AwsCrc32,
30
- __awaiter,
31
- __generator,
32
- __values,
33
- convertToBuffer,
34
- eventStreamSerdeProvider2 as eventStreamSerdeProvider,
35
- isEmptyData,
36
- numToUint8,
37
- resolveEventStreamSerdeConfig,
38
- uint32ArrayFrom
39
- } from "./chunk-SJBR527P.js";
40
- import {
41
- ENV_KEY,
42
- ENV_SECRET,
43
- fromEnv
44
- } from "./chunk-FZJX6XP7.js";
34
+ } from "./chunk-OWED2GRM.js";
45
35
  import {
46
36
  BinaryDecisionDiagram,
47
37
  Client,
@@ -77,7 +67,7 @@ import {
77
67
  resolveRetryConfig,
78
68
  resolveUserAgentConfig,
79
69
  setFeature
80
- } from "./chunk-65KKUJBR.js";
70
+ } from "./chunk-VWPEKOH6.js";
81
71
  import {
82
72
  CredentialsProviderError,
83
73
  ENV_PROFILE,
@@ -108,7 +98,25 @@ import {
108
98
  resolveHttpHandlerRuntimeConfig,
109
99
  resolveRegionConfig,
110
100
  toEndpointV1
111
- } from "./chunk-GHXGCANU.js";
101
+ } from "./chunk-W73X43R7.js";
102
+ import {
103
+ CloudRuntime
104
+ } from "./chunk-5FNIWBFI.js";
105
+ import {
106
+ systemCatalog
107
+ } from "./chunk-SQ77DZOI.js";
108
+ import {
109
+ AwsCrc32,
110
+ __awaiter,
111
+ __generator,
112
+ __values,
113
+ convertToBuffer,
114
+ eventStreamSerdeProvider2 as eventStreamSerdeProvider,
115
+ isEmptyData,
116
+ numToUint8,
117
+ resolveEventStreamSerdeConfig,
118
+ uint32ArrayFrom
119
+ } from "./chunk-O6ZZF52V.js";
112
120
  import {
113
121
  Hash,
114
122
  NumericValue,
@@ -126,24 +134,26 @@ import {
126
134
  toBase64,
127
135
  toUint8Array,
128
136
  toUtf8
129
- } from "./chunk-YJAS5RQX.js";
137
+ } from "./chunk-JYGD5WSN.js";
130
138
  import {
131
139
  DockerRuntime,
132
140
  isHostPathSource,
133
141
  scopedVolumeName
134
- } from "./chunk-R74UB4X4.js";
142
+ } from "./chunk-2ZLR7ULL.js";
135
143
  import {
136
144
  BareRuntime
137
- } from "./chunk-3YCMJRDZ.js";
145
+ } from "./chunk-VDMQJHPI.js";
138
146
  import {
139
- CloudRuntime
140
- } from "./chunk-7EYFCKZX.js";
147
+ invalidateEdgeContainer
148
+ } from "./chunk-FQGJZ2HS.js";
141
149
  import {
142
- systemCatalog
143
- } from "./chunk-UMYQALBH.js";
150
+ EDGE_CONTAINER_MOUNTS,
151
+ EDGE_HOST_STATE_DIR
152
+ } from "./chunk-VFINNTUL.js";
144
153
  import {
154
+ DEFAULT_IMAGE_REGISTRY,
145
155
  safeErrorMessage
146
- } from "./chunk-3LCRNQ2C.js";
156
+ } from "./chunk-6APULWSU.js";
147
157
 
148
158
  // src/lib/edge-import.ts
149
159
  import chalk from "chalk";
@@ -152,8 +162,8 @@ import ora from "ora";
152
162
  // src/lib/compose.ts
153
163
  import { spawnSync as spawnSync3 } from "child_process";
154
164
  import { randomBytes as randomBytes5 } from "crypto";
155
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
156
- import { homedir as homedir2 } from "os";
165
+ import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
166
+ import { homedir as homedir2, userInfo } from "os";
157
167
  import { join as join6 } from "path";
158
168
 
159
169
  // ../../packages/adapters/src/runtime/image-transfer.ts
@@ -10967,10 +10977,10 @@ var package_default = {
10967
10977
  // ../../node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
10968
10978
  var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
10969
10979
  var remoteProvider = async (init) => {
10970
- const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import("./dist-es-33Z3Y6VE.js");
10980
+ const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import("./dist-es-VNKHQVIB.js");
10971
10981
  if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
10972
10982
  init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
10973
- const { fromHttp } = await import("./dist-es-DCR6UJMP.js");
10983
+ const { fromHttp } = await import("./dist-es-5DY7K32L.js");
10974
10984
  return chain(fromHttp(init), fromContainerMetadata(init));
10975
10985
  }
10976
10986
  if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") {
@@ -11082,22 +11092,22 @@ var defaultProvider = (init = {}) => memoizeChain([
11082
11092
  if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
11083
11093
  throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger });
11084
11094
  }
11085
- const { fromSSO } = await import("./dist-es-D6QQVWRZ.js");
11095
+ const { fromSSO } = await import("./dist-es-WV4AMOII.js");
11086
11096
  return fromSSO(init)(awsIdentityProperties);
11087
11097
  },
11088
11098
  async (awsIdentityProperties) => {
11089
11099
  init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
11090
- const { fromIni } = await import("./dist-es-6RSPR56Q.js");
11100
+ const { fromIni } = await import("./dist-es-RYHIPOTN.js");
11091
11101
  return fromIni(init)(awsIdentityProperties);
11092
11102
  },
11093
11103
  async (awsIdentityProperties) => {
11094
11104
  init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
11095
- const { fromProcess } = await import("./dist-es-7EZIM4JU.js");
11105
+ const { fromProcess } = await import("./dist-es-OSNJBLXB.js");
11096
11106
  return fromProcess(init)(awsIdentityProperties);
11097
11107
  },
11098
11108
  async (awsIdentityProperties) => {
11099
11109
  init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
11100
- const { fromTokenFile } = await import("./dist-es-GMEQINIE.js");
11110
+ const { fromTokenFile } = await import("./dist-es-X3B5QYKB.js");
11101
11111
  return fromTokenFile(init)(awsIdentityProperties);
11102
11112
  },
11103
11113
  async () => {
@@ -12818,6 +12828,11 @@ async function rebuildFromSource(info) {
12818
12828
  }
12819
12829
 
12820
12830
  // src/lib/compose.ts
12831
+ var EDGE_SITES_HOST_DIR = `${EDGE_HOST_STATE_DIR}/sites-enabled`;
12832
+ var EDGE_ACME_HOST_DIR = `${EDGE_HOST_STATE_DIR}/acme`;
12833
+ function edgeVolumeYaml(indent) {
12834
+ return EDGE_CONTAINER_MOUNTS.map((m2) => `${indent}- ${m2.host}:${m2.container}:z`).join("\n");
12835
+ }
12821
12836
  var COMPOSE_DIR = join6(OS_DIR, "compose");
12822
12837
  var INSTALL_METHOD_FILE = join6(OS_DIR, "install-method");
12823
12838
  var COMPOSE_FILE = join6(COMPOSE_DIR, "docker-compose.yml");
@@ -12828,6 +12843,7 @@ var BUILT_SERVICES = [
12828
12843
  { service: "dashboard", dockerfile: "apps/dashboard/Dockerfile" },
12829
12844
  { service: "edge", dockerfile: "apps/edge/Dockerfile" }
12830
12845
  ];
12846
+ var ENV_CONSUMING_SERVICES = ["api", "dashboard", "edge"];
12831
12847
  function readInstallMethod() {
12832
12848
  try {
12833
12849
  const v2 = readFileSync2(INSTALL_METHOD_FILE, "utf8").trim();
@@ -12907,11 +12923,12 @@ services:
12907
12923
  ports: ["\${OPENSHIP_BIND_ADDR:-0.0.0.0}:\${API_PORT:-4000}:\${API_PORT:-4000}"]
12908
12924
  volumes:
12909
12925
  - /var/run/docker.sock:/var/run/docker.sock
12910
- - openship_sites:/usr/local/openresty/nginx/conf/sites-enabled
12911
- - openship_certs:/etc/letsencrypt
12912
- - openship_acme:/var/www/acme
12913
- # Static sites' extracted doc-roots \u2014 API writes, edge serves (shared).
12914
- - openship_static:/opt/openship/static
12926
+ # Routing state shared with the edge, as HOST BIND MOUNTS (generated from
12927
+ # EDGE_CONTAINER_MOUNTS): the vhost tree, /etc/letsencrypt, the ACME webroot
12928
+ # and the static doc-roots the API writes and the edge serves. Named volumes
12929
+ # hid all of it from every host-side reader (migrate's proxy scan, cert carry,
12930
+ # cert reuse, mail cert symlinks), each of which then silently saw "nothing".
12931
+ ${edgeVolumeYaml(" ")}
12915
12932
  # Host-op SSH key (createHostExecutor \u2192 host.docker.internal). /dev/null
12916
12933
  # when the host channel isn't provisioned \u2192 OPENSHIP_HOST_SSH_HOST stays
12917
12934
  # unset and the API falls back to LocalExecutor.
@@ -12960,18 +12977,11 @@ services:
12960
12977
  restart: unless-stopped
12961
12978
  network_mode: host
12962
12979
  volumes:
12963
- - openship_sites:/usr/local/openresty/nginx/conf/sites-enabled
12964
- - openship_certs:/etc/letsencrypt
12965
- - openship_acme:/var/www/acme
12966
- - openship_static:/opt/openship/static
12980
+ ${edgeVolumeYaml(" ")}
12967
12981
 
12968
12982
  volumes:
12969
12983
  postgres_data:
12970
12984
  redis_data:
12971
- openship_sites:
12972
- openship_certs:
12973
- openship_acme:
12974
- openship_static:
12975
12985
  `;
12976
12986
  function keepSecret(existing, key) {
12977
12987
  return existing[key] || randomBytes5(32).toString("hex");
@@ -12987,6 +12997,15 @@ function readEnvFile() {
12987
12997
  }
12988
12998
  return out;
12989
12999
  }
13000
+ var HOST_KEY_COMMENT = "openship-host-executor";
13001
+ var HOST_KEY_FROM = "172.16.0.0/12,192.168.0.0/16,10.0.0.0/8,127.0.0.1";
13002
+ function hostKeyAuthLine(pub) {
13003
+ return `from="${HOST_KEY_FROM}",restrict,pty ${pub}`;
13004
+ }
13005
+ function rewriteHostAuthorizedKeys(existing, pub) {
13006
+ const kept = existing.split("\n").filter((line) => line.trim() && !line.includes(HOST_KEY_COMMENT));
13007
+ return [...kept, hostKeyAuthLine(pub)].join("\n") + "\n";
13008
+ }
12990
13009
  function provisionHostSshChannel() {
12991
13010
  if (process.platform !== "linux") return null;
12992
13011
  try {
@@ -12996,23 +13015,28 @@ function provisionHostSshChannel() {
12996
13015
  if (!existsSync3(keyPath)) {
12997
13016
  const g2 = spawnSync3(
12998
13017
  "ssh-keygen",
12999
- ["-t", "ed25519", "-N", "", "-q", "-f", keyPath, "-C", "openship-host-executor"],
13018
+ ["-t", "ed25519", "-N", "", "-q", "-f", keyPath, "-C", HOST_KEY_COMMENT],
13000
13019
  { stdio: "ignore" }
13001
13020
  );
13002
13021
  if (g2.status !== 0) return null;
13003
13022
  }
13004
13023
  const pub = readFileSync2(`${keyPath}.pub`, "utf8").trim();
13005
13024
  if (!pub) return null;
13025
+ const user = (() => {
13026
+ try {
13027
+ return userInfo().username;
13028
+ } catch {
13029
+ return process.env.USER || process.env.LOGNAME || "root";
13030
+ }
13031
+ })();
13006
13032
  const userSshDir = join6(homedir2(), ".ssh");
13007
13033
  mkdirSync2(userSshDir, { recursive: true, mode: 448 });
13008
13034
  const authKeys = join6(userSshDir, "authorized_keys");
13009
13035
  const existing = existsSync3(authKeys) ? readFileSync2(authKeys, "utf8") : "";
13010
- if (!existing.includes(pub)) {
13011
- const sep = existing && !existing.endsWith("\n") ? "\n" : "";
13012
- writeFileSync(authKeys, `${existing}${sep}${pub}
13013
- `, { mode: 384 });
13014
- }
13015
- return { user: process.env.USER || process.env.LOGNAME || "root", keyPath };
13036
+ const next = rewriteHostAuthorizedKeys(existing, pub);
13037
+ if (next !== existing) writeFileSync(authKeys, next, { mode: 384 });
13038
+ chmodSync(authKeys, 384);
13039
+ return { user, keyPath };
13016
13040
  } catch {
13017
13041
  return null;
13018
13042
  }
@@ -13044,7 +13068,7 @@ function orphanedStackContainers(project) {
13044
13068
  function reconcileDbPassword(user, password) {
13045
13069
  if (!password) return;
13046
13070
  if (compose(["up", "-d", "--wait", "postgres"], { quiet: true }) !== 0) return;
13047
- const r2 = spawnSync3(
13071
+ const attempt = (asRole) => spawnSync3(
13048
13072
  "docker",
13049
13073
  [
13050
13074
  "compose",
@@ -13055,7 +13079,7 @@ function reconcileDbPassword(user, password) {
13055
13079
  "postgres",
13056
13080
  "psql",
13057
13081
  "-U",
13058
- user,
13082
+ asRole,
13059
13083
  "-d",
13060
13084
  "postgres",
13061
13085
  "-v",
@@ -13071,15 +13095,31 @@ function reconcileDbPassword(user, password) {
13071
13095
  {
13072
13096
  cwd: COMPOSE_DIR,
13073
13097
  encoding: "utf8",
13074
- input: `ALTER USER "${user}" WITH PASSWORD '${password}';
13098
+ // Create the role if the volume predates it, else just realign it. Both
13099
+ // branches leave exactly the credentials this `.env` will present.
13100
+ input: `DO $$ BEGIN
13101
+ IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${user}') THEN
13102
+ ALTER ROLE "${user}" WITH LOGIN PASSWORD '${password}';
13103
+ ELSE
13104
+ CREATE ROLE "${user}" WITH LOGIN SUPERUSER PASSWORD '${password}';
13105
+ END IF;
13106
+ END $$;
13075
13107
  `
13076
13108
  }
13077
13109
  );
13110
+ let r2 = attempt(user);
13111
+ if (r2.status !== 0) r2 = attempt("postgres");
13078
13112
  if (r2.status !== 0) {
13079
13113
  console.log(
13080
- ` Note: couldn't reconcile the database password (${(r2.stderr ?? "").trim() || "psql failed"}).
13081
- If the api reports "password authentication failed", the data volume predates this install \u2014
13082
- either restore the old .env or remove the volume to start fresh.`
13114
+ `
13115
+ ! Could not realign the database password (${(r2.stderr ?? "").trim() || "psql failed"}).
13116
+ The api will fail with "password authentication failed for user "${user}"" because the
13117
+ existing data volume was initialized with a different password.
13118
+
13119
+ Fix it one of two ways:
13120
+ \u2022 restore the .env that created the volume, or
13121
+ \u2022 start fresh (DESTROYS DB DATA): openship uninstall then openship up
13122
+ `
13083
13123
  );
13084
13124
  }
13085
13125
  }
@@ -13092,6 +13132,48 @@ function removeOrphanedStack(project) {
13092
13132
  );
13093
13133
  spawnSync3("docker", ["rm", "-f", ...orphans.map((o2) => o2.name)], { stdio: "ignore" });
13094
13134
  }
13135
+ function migrateLegacyEdgeVolumes(project) {
13136
+ const pairs = [
13137
+ { volume: `${project}_openship_sites`, host: EDGE_SITES_HOST_DIR },
13138
+ { volume: `${project}_openship_certs`, host: "/etc/letsencrypt" },
13139
+ { volume: `${project}_openship_acme`, host: EDGE_ACME_HOST_DIR },
13140
+ { volume: `${project}_openship_static`, host: "/opt/openship/static" }
13141
+ ];
13142
+ const ls = spawnSync3("docker", ["volume", "ls", "--format", "{{.Name}}"], { encoding: "utf8" });
13143
+ if (ls.status !== 0 || !ls.stdout) return;
13144
+ const existing = new Set(ls.stdout.split("\n").map((l2) => l2.trim()).filter(Boolean));
13145
+ for (const { volume, host } of pairs) {
13146
+ if (!existing.has(volume)) continue;
13147
+ mkdirSync2(host, { recursive: true });
13148
+ const alreadyThere = spawnSync3("sh", ["-c", `ls -A ${JSON.stringify(host)} 2>/dev/null | head -1`], {
13149
+ encoding: "utf8"
13150
+ });
13151
+ if (alreadyThere.stdout?.trim()) continue;
13152
+ console.log(` Moving edge state from volume ${volume} onto ${host}...`);
13153
+ const copy = spawnSync3(
13154
+ "docker",
13155
+ [
13156
+ "run",
13157
+ "--rm",
13158
+ "-v",
13159
+ `${volume}:/from:ro`,
13160
+ "-v",
13161
+ `${host}:/to`,
13162
+ "alpine:3",
13163
+ "sh",
13164
+ "-c",
13165
+ "cp -a /from/. /to/ 2>/dev/null || true"
13166
+ ],
13167
+ { stdio: "inherit" }
13168
+ );
13169
+ if (copy.status !== 0) {
13170
+ console.log(
13171
+ ` Could not copy ${volume} \u2014 the stack will start with an empty ${host}.
13172
+ Recover manually with: docker run --rm -v ${volume}:/from -v ${host}:/to alpine cp -a /from/. /to/`
13173
+ );
13174
+ }
13175
+ }
13176
+ }
13095
13177
  function warnOrphanedVolumes(project) {
13096
13178
  const r2 = spawnSync3("docker", ["volume", "ls", "--format", "{{.Name}}"], { encoding: "utf8" });
13097
13179
  if (r2.status !== 0 || !r2.stdout) return;
@@ -13101,11 +13183,40 @@ function warnOrphanedVolumes(project) {
13101
13183
  if (others.size === 0) return;
13102
13184
  console.log(
13103
13185
  ` Note: volumes from a previous install (project "${[...others].join(", ")}") are still on disk
13104
- and are NOT mounted by this stack \u2014 its database and certificates start fresh.
13186
+ and are NOT mounted by this stack \u2014 its database starts fresh. (Certificates and
13187
+ vhosts now live on the host, so those carry over.)
13105
13188
  Remove them with \`docker volume ls | grep _openship_\` once you're sure they aren't needed.`
13106
13189
  );
13107
13190
  }
13108
- function renderEnv(opts, host) {
13191
+ function keepConfig(prev, key, explicit) {
13192
+ const set = explicit?.trim();
13193
+ if (set) return set;
13194
+ const carried = prev[key]?.trim();
13195
+ return carried || void 0;
13196
+ }
13197
+ function resolveEnvConfig(prev, opts) {
13198
+ const publicUrl = keepConfig(prev, "OPENSHIP_PUBLIC_URL", opts.publicUrl);
13199
+ return {
13200
+ apiPort: keepConfig(prev, "API_PORT", opts.apiPort) ?? "4000",
13201
+ dashPort: keepConfig(prev, "DASHBOARD_PORT", opts.dashboardPort) ?? "3001",
13202
+ ...publicUrl ? { publicUrl } : {},
13203
+ // A public URL always implies a proxy in front; otherwise keep whatever the
13204
+ // install was configured with.
13205
+ trustProxy: Boolean(opts.trustProxy) || Boolean(publicUrl) || prev.TRUST_PROXY === "true",
13206
+ ...keepConfig(prev, "OPENSHIP_EXTRA_TRUSTED_ORIGINS", opts.extraTrustedOrigins) ? {
13207
+ extraTrustedOrigins: keepConfig(
13208
+ prev,
13209
+ "OPENSHIP_EXTRA_TRUSTED_ORIGINS",
13210
+ opts.extraTrustedOrigins
13211
+ )
13212
+ } : {},
13213
+ registry: keepConfig(prev, "OPENSHIP_IMAGE_REGISTRY", opts.registry) ?? DEFAULT_IMAGE_REGISTRY,
13214
+ // Tri-state: the flag is absent on a plain re-run, so fall back to what the
13215
+ // install chose rather than silently re-granting host control.
13216
+ hostControl: opts.noHostControl === void 0 ? prev.OPENSHIP_HOST_CONTROL !== "false" : !opts.noHostControl
13217
+ };
13218
+ }
13219
+ function renderEnv(opts, host, cfg) {
13109
13220
  const prev = readEnvFile();
13110
13221
  const lines = [
13111
13222
  "# Managed by `openship up`. Secrets are generated once and preserved.",
@@ -13116,17 +13227,20 @@ function renderEnv(opts, host) {
13116
13227
  "OPENSHIP_REQUIRE_AUTH=true",
13117
13228
  // Read by createHostExecutor (throws when false) and by the servers list
13118
13229
  // (hides the local row). Written explicitly so the policy is visible in .env.
13119
- `OPENSHIP_HOST_CONTROL=${opts.noHostControl ? "false" : "true"}`,
13120
- `OPENSHIP_IMAGE_REGISTRY=${opts.registry || "ghcr.io/oblien"}`,
13121
- `OPENSHIP_VERSION=${opts.version || (true ? "0.4.5" : "latest")}`,
13230
+ `OPENSHIP_HOST_CONTROL=${cfg.hostControl ? "true" : "false"}`,
13231
+ `OPENSHIP_IMAGE_REGISTRY=${cfg.registry}`,
13232
+ `OPENSHIP_VERSION=${opts.version || (true ? "0.4.6" : "latest")}`,
13122
13233
  `POSTGRES_PASSWORD=${keepSecret(prev, "POSTGRES_PASSWORD")}`,
13123
13234
  `BETTER_AUTH_SECRET=${keepSecret(prev, "BETTER_AUTH_SECRET")}`,
13124
- `INTERNAL_TOKEN=${keepSecret(prev, "INTERNAL_TOKEN")}`
13235
+ `INTERNAL_TOKEN=${keepSecret(prev, "INTERNAL_TOKEN")}`,
13236
+ `API_PORT=${cfg.apiPort}`,
13237
+ `DASHBOARD_PORT=${cfg.dashPort}`
13125
13238
  ];
13126
- if (opts.apiPort) lines.push(`API_PORT=${opts.apiPort}`);
13127
- if (opts.dashboardPort) lines.push(`DASHBOARD_PORT=${opts.dashboardPort}`);
13128
- if (opts.publicUrl) lines.push(`OPENSHIP_PUBLIC_URL=${opts.publicUrl}`);
13129
- if (opts.trustProxy || opts.publicUrl) lines.push("TRUST_PROXY=true");
13239
+ if (cfg.publicUrl) lines.push(`OPENSHIP_PUBLIC_URL=${cfg.publicUrl}`);
13240
+ if (cfg.extraTrustedOrigins) {
13241
+ lines.push(`OPENSHIP_EXTRA_TRUSTED_ORIGINS=${cfg.extraTrustedOrigins}`);
13242
+ }
13243
+ if (cfg.trustProxy) lines.push("TRUST_PROXY=true");
13130
13244
  if (host) {
13131
13245
  lines.push(
13132
13246
  "OPENSHIP_HOST_SSH_HOST=host.docker.internal",
@@ -13158,13 +13272,20 @@ ${services}`;
13158
13272
  }
13159
13273
  function materialize(opts) {
13160
13274
  mkdirSync2(COMPOSE_DIR, { recursive: true, mode: 448 });
13161
- const regeneratedSecrets = !readEnvFile().POSTGRES_PASSWORD;
13162
- const host = opts.noHostControl ? null : provisionHostSshChannel();
13275
+ const prev = readEnvFile();
13276
+ const cfg = resolveEnvConfig(prev, opts);
13277
+ const host = cfg.hostControl ? provisionHostSshChannel() : null;
13278
+ let before = "";
13279
+ try {
13280
+ before = readFileSync2(ENV_FILE, "utf8");
13281
+ } catch {
13282
+ }
13283
+ const rendered = renderEnv(opts, host, cfg);
13163
13284
  writeFileSync(COMPOSE_FILE, COMPOSE_YAML);
13164
- writeFileSync(ENV_FILE, renderEnv(opts, host), { mode: 384 });
13285
+ writeFileSync(ENV_FILE, rendered, { mode: 384 });
13165
13286
  const buildDir = opts.build === false ? null : sourceBuildDir();
13166
13287
  if (buildDir) writeFileSync(BUILD_FILE, renderBuildOverride(buildDir));
13167
- return { buildDir, regeneratedSecrets };
13288
+ return { buildDir, cfg, envChanged: before !== "" && rendered !== before };
13168
13289
  }
13169
13290
  function dbVolumeExists(project) {
13170
13291
  const r2 = spawnSync3("docker", ["volume", "inspect", `${project}_postgres_data`], {
@@ -13182,15 +13303,19 @@ function compose(args, opts) {
13182
13303
  return r2.status ?? 1;
13183
13304
  }
13184
13305
  function composeUp(opts) {
13185
- const { buildDir, regeneratedSecrets } = materialize(opts);
13186
- const apiPort = opts.apiPort || "4000";
13187
- const dashPort = opts.dashboardPort || "3001";
13306
+ const { buildDir, cfg, envChanged } = materialize(opts);
13307
+ const apiPort = cfg.apiPort;
13308
+ const dashPort = cfg.dashPort;
13309
+ const up = (extra = {}) => compose(
13310
+ envChanged ? ["up", "-d", "--force-recreate", ...ENV_CONSUMING_SERVICES] : ["up", "-d"],
13311
+ extra
13312
+ );
13188
13313
  const env = readEnvFile();
13189
13314
  const project = env.COMPOSE_PROJECT_NAME || "openship";
13190
13315
  removeOrphanedStack(project);
13316
+ migrateLegacyEdgeVolumes(project);
13191
13317
  warnOrphanedVolumes(project);
13192
- if (regeneratedSecrets && dbVolumeExists(project)) {
13193
- console.log(" Existing database volume with regenerated credentials \u2014 realigning the password...");
13318
+ if (dbVolumeExists(project)) {
13194
13319
  reconcileDbPassword(env.POSTGRES_USER || "openship", env.POSTGRES_PASSWORD ?? "");
13195
13320
  }
13196
13321
  if (buildDir) {
@@ -13200,17 +13325,22 @@ function composeUp(opts) {
13200
13325
  if (compose(["build"], { withBuildOverride: true }) !== 0) {
13201
13326
  return { ok: false, apiPort, dashPort };
13202
13327
  }
13203
- if (compose(["up", "-d"], { withBuildOverride: true }) !== 0) {
13328
+ if (up({ withBuildOverride: true }) !== 0) {
13204
13329
  return { ok: false, apiPort, dashPort };
13205
13330
  }
13331
+ onEdgeContainerChanged();
13206
13332
  writeInstallMethod("compose");
13207
13333
  return { ok: true, apiPort, dashPort };
13208
13334
  }
13209
13335
  if (compose(["pull"]) !== 0) return { ok: false, apiPort, dashPort };
13210
- if (compose(["up", "-d"]) !== 0) return { ok: false, apiPort, dashPort };
13336
+ if (up() !== 0) return { ok: false, apiPort, dashPort };
13337
+ onEdgeContainerChanged();
13211
13338
  writeInstallMethod("compose");
13212
13339
  return { ok: true, apiPort, dashPort };
13213
13340
  }
13341
+ function onEdgeContainerChanged() {
13342
+ invalidateEdgeContainer();
13343
+ }
13214
13344
  function composeDown() {
13215
13345
  if (!existsSync3(COMPOSE_FILE)) return false;
13216
13346
  return compose(["down"]) === 0;
@@ -13220,7 +13350,7 @@ function composeUninstall(opts = {}) {
13220
13350
  const ok = existsSync3(COMPOSE_FILE) ? compose(["down", "-v", "--remove-orphans"]) === 0 : false;
13221
13351
  if (opts.removeImages) {
13222
13352
  const env = readEnvFile();
13223
- const registry = env.OPENSHIP_IMAGE_REGISTRY || "ghcr.io/oblien";
13353
+ const registry = env.OPENSHIP_IMAGE_REGISTRY || DEFAULT_IMAGE_REGISTRY;
13224
13354
  const version = env.OPENSHIP_VERSION || "latest";
13225
13355
  for (const { service } of BUILT_SERVICES) {
13226
13356
  const ref = `${registry}/openship-${service}:${version}`;
@@ -13233,23 +13363,25 @@ function composeUninstall(opts = {}) {
13233
13363
  }
13234
13364
  function composeUpdate(version) {
13235
13365
  if (!existsSync3(COMPOSE_FILE)) return false;
13236
- if (version) {
13237
- const env = readEnvFile();
13238
- env.OPENSHIP_VERSION = version;
13239
- writeFileSync(
13240
- ENV_FILE,
13241
- Object.entries(env).map(([k2, v2]) => `${k2}=${v2}`).join("\n") + "\n",
13242
- { mode: 384 }
13243
- );
13244
- }
13245
- if (sourceBuildDir()) {
13246
- return compose(["build"], { withBuildOverride: true }) === 0 && compose(["up", "-d"], { withBuildOverride: true }) === 0;
13247
- }
13248
- return compose(["pull"]) === 0 && compose(["up", "-d"]) === 0;
13366
+ return composeUp(version ? { version } : {}).ok;
13249
13367
  }
13250
13368
  function composePs() {
13251
13369
  return compose(["ps"]);
13252
13370
  }
13371
+ function composeRunning() {
13372
+ const r2 = spawnSync3(
13373
+ "docker",
13374
+ ["compose", "-f", COMPOSE_FILE, "ps", "--status", "running", "-q"],
13375
+ { cwd: COMPOSE_DIR, encoding: "utf8" }
13376
+ );
13377
+ return r2.status === 0 && r2.stdout.trim().length > 0;
13378
+ }
13379
+ function composeStart() {
13380
+ return compose(["up", "-d"], { quiet: true }) === 0;
13381
+ }
13382
+ function composeRestart() {
13383
+ return compose(["restart"], { quiet: true }) === 0;
13384
+ }
13253
13385
  function composeInternalToken() {
13254
13386
  return readEnvFile().INTERNAL_TOKEN ?? null;
13255
13387
  }
@@ -13350,6 +13482,9 @@ export {
13350
13482
  composeUninstall,
13351
13483
  composeUpdate,
13352
13484
  composePs,
13485
+ composeRunning,
13486
+ composeStart,
13487
+ composeRestart,
13353
13488
  composeInternalToken,
13354
13489
  waitForApiHealth,
13355
13490
  importMigratedSites
@@ -1,8 +1,7 @@
1
+ #!/usr/bin/env sh
2
+ ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
1
3
  import { createRequire as __ospCreateRequire } from "node:module";
2
4
  const require = __ospCreateRequire(import.meta.url);
3
- import {
4
- LocalExecutor
5
- } from "./chunk-SYCZE6FQ.js";
6
5
  import {
7
6
  connectSshClient,
8
7
  getTarCreateEnv,
@@ -10,22 +9,25 @@ import {
10
9
  openSshUnixSocket,
11
10
  prepareSourceTarArgs,
12
11
  reconcileKnownHosts
13
- } from "./chunk-C4FOQJ63.js";
12
+ } from "./chunk-OXWDY22G.js";
14
13
  import {
15
14
  SshDisconnectedError
16
- } from "./chunk-JYAGTMSJ.js";
15
+ } from "./chunk-RPHRPFEH.js";
16
+ import {
17
+ LocalExecutor
18
+ } from "./chunk-TYVME3XD.js";
17
19
  import {
18
20
  emitBufferedLines,
19
21
  flushBufferedLines,
20
22
  hasLocalCommand,
21
23
  logEntry,
22
24
  sq
23
- } from "./chunk-Z6EKX6CX.js";
25
+ } from "./chunk-FPRHYBY2.js";
24
26
  import {
25
27
  TRANSFER_EXCLUDES,
26
28
  formatBytes,
27
29
  safeErrorMessage
28
- } from "./chunk-3LCRNQ2C.js";
30
+ } from "./chunk-6APULWSU.js";
29
31
 
30
32
  // ../../packages/adapters/src/system/executor.ts
31
33
  import { readFileSync } from "fs";
@@ -492,6 +494,9 @@ var SshExecutor = class _SshExecutor {
492
494
  });
493
495
  });
494
496
  }
497
+ async rename(from, to) {
498
+ await this.exec(`mv ${sq(from)} ${sq(to)}`);
499
+ }
495
500
  async readFile(path) {
496
501
  return this.withChannelRetry(async () => {
497
502
  const sftp = await this.sftp();
@@ -1220,6 +1225,9 @@ var SystemSshExecutor = class _SystemSshExecutor {
1220
1225
  throw new Error(res.stderr.trim() || `Failed to write ${path} (exit ${res.code})`);
1221
1226
  }
1222
1227
  }
1228
+ async rename(from, to) {
1229
+ await this.exec(`mv ${sq(from)} ${sq(to)}`);
1230
+ }
1223
1231
  async readFile(path) {
1224
1232
  const res = await this.runSsh(`cat ${sq(path)}`);
1225
1233
  if (res.code !== 0) {
@@ -1489,12 +1497,13 @@ var SystemSshExecutor = class _SystemSshExecutor {
1489
1497
  };
1490
1498
 
1491
1499
  // ../../packages/adapters/src/system/executor.ts
1500
+ var localExecutor = new LocalExecutor();
1492
1501
  function createExecutor(ssh) {
1493
1502
  if (ssh) {
1494
1503
  if (ssh.useSystemSsh) return new SystemSshExecutor(ssh);
1495
1504
  return new SshExecutor(ssh);
1496
1505
  }
1497
- return new LocalExecutor();
1506
+ return localExecutor;
1498
1507
  }
1499
1508
  function hostControlDisabled() {
1500
1509
  return process.env.OPENSHIP_HOST_CONTROL?.trim().toLowerCase() === "false";
@@ -1506,7 +1515,7 @@ function createHostExecutor() {
1506
1515
  );
1507
1516
  }
1508
1517
  const host = process.env.OPENSHIP_HOST_SSH_HOST?.trim();
1509
- if (!host) return new LocalExecutor();
1518
+ if (!host) return localExecutor;
1510
1519
  const keyPath = process.env.OPENSHIP_HOST_SSH_KEY?.trim();
1511
1520
  const portRaw = Number(process.env.OPENSHIP_HOST_SSH_PORT || "22");
1512
1521
  const port = Number.isInteger(portRaw) && portRaw > 0 && portRaw < 65536 ? portRaw : 22;