openship 0.4.5 → 0.4.7
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.
- package/README.md +2 -24
- package/dist/bare-2HYDXQEH.js +23 -0
- package/dist/{bowser-L6PVH37V.js → bowser-O3AEA6AN.js} +3 -1
- package/dist/{chunk-YFLQGDN2.js → chunk-4TJC4JZQ.js} +18 -9
- package/dist/{chunk-JXQCFTDV.js → chunk-4Z5QO7N6.js} +4 -2
- package/dist/{chunk-JJVSOE4I.js → chunk-5MZ624VX.js} +2 -0
- package/dist/{chunk-TDFK6ISF.js → chunk-6APIPIJY.js} +6 -4
- package/dist/{chunk-3LCRNQ2C.js → chunk-6APULWSU.js} +151 -133
- package/dist/{chunk-FTBXJ2VA.js → chunk-6B5YCFFV.js} +6 -4
- package/dist/{chunk-MDFYN2QH.js → chunk-AVIB7CT7.js} +3 -1
- package/dist/{chunk-W7KGHYLV.js → chunk-DYPH4HCI.js} +2 -0
- package/dist/{chunk-5WI7ZXOC.js → chunk-EI575GHN.js} +4 -2
- package/dist/{chunk-Z6EKX6CX.js → chunk-FPRHYBY2.js} +2 -0
- package/dist/{chunk-FZJX6XP7.js → chunk-FRNAR33O.js} +4 -2
- package/dist/{chunk-XRWV5ZNR.js → chunk-FXTBHTWY.js} +360 -42
- package/dist/chunk-ILFETZOM.js +131 -0
- package/dist/{chunk-E3ZPCNPU.js → chunk-IMBD5PZ5.js} +251 -105
- package/dist/{chunk-VJTXRCTT.js → chunk-IPYPMI3S.js} +10 -6
- package/dist/{chunk-PARRPUXN.js → chunk-IXCHURVK.js} +5 -3
- package/dist/{chunk-YJAS5RQX.js → chunk-JYGD5WSN.js} +2 -0
- package/dist/{chunk-JWBXYO24.js → chunk-KI2EY3WB.js} +2 -0
- package/dist/{chunk-YVXF6GGR.js → chunk-L2VOGB2X.js} +5 -104
- package/dist/{chunk-K5OH5U7N.js → chunk-MZ2WEHHY.js} +5 -3
- package/dist/{chunk-SJBR527P.js → chunk-O6ZZF52V.js} +3 -1
- package/dist/{chunk-VLPJLXXB.js → chunk-OWED2GRM.js} +3 -1
- package/dist/{chunk-C4FOQJ63.js → chunk-OXWDY22G.js} +4 -2
- package/dist/{chunk-NPVJYR7M.js → chunk-Q2CIRAOK.js} +2 -0
- package/dist/chunk-R5BHFFAV.js +282 -0
- package/dist/{chunk-JYAGTMSJ.js → chunk-RPHRPFEH.js} +2 -0
- package/dist/{chunk-R74UB4X4.js → chunk-SJIFLLX4.js} +397 -85
- package/dist/{chunk-HYL4QYZM.js → chunk-TGIINPVM.js} +13 -2
- package/dist/{chunk-SYCZE6FQ.js → chunk-TYVME3XD.js} +7 -1
- package/dist/{chunk-UMYQALBH.js → chunk-UXWAVM4C.js} +1788 -1484
- package/dist/{chunk-HDV4NSA3.js → chunk-V6AN6XLZ.js} +16 -6
- package/dist/{chunk-3YCMJRDZ.js → chunk-VDMQJHPI.js} +36 -15
- package/dist/{chunk-RZPDJC2J.js → chunk-VFINNTUL.js} +20 -1
- package/dist/{chunk-65KKUJBR.js → chunk-VWPEKOH6.js} +4 -2
- package/dist/{chunk-GHXGCANU.js → chunk-W73X43R7.js} +4 -2
- package/dist/{chunk-7EYFCKZX.js → chunk-XFCDYZUQ.js} +8 -6
- package/dist/cloud-2KXREXMO.js +30 -0
- package/dist/{cloud-7IGG45CF.js → cloud-7QYOGF7F.js} +4 -2
- package/dist/detect-2XSCFFTF.js +44 -0
- package/dist/{dist-NQB6QGX3.js → dist-IQJ6H6UZ.js} +4 -2
- package/dist/{dist-es-DCR6UJMP.js → dist-es-5DY7K32L.js} +7 -5
- package/dist/{dist-es-TYYZ5KEF.js → dist-es-JSTDUS7Q.js} +7 -5
- package/dist/{dist-es-7EZIM4JU.js → dist-es-OSNJBLXB.js} +6 -4
- package/dist/{dist-es-6RSPR56Q.js → dist-es-RYHIPOTN.js} +15 -13
- package/dist/{dist-es-33Z3Y6VE.js → dist-es-VNKHQVIB.js} +5 -3
- package/dist/{dist-es-D6QQVWRZ.js → dist-es-WV4AMOII.js} +9 -7
- package/dist/{dist-es-GMEQINIE.js → dist-es-X3B5QYKB.js} +7 -5
- package/dist/docker-LODK5Y2S.js +16 -0
- package/dist/docker-edge-executor-VHW3JPJS.js +13 -0
- package/dist/edge-import-ZQ4Y5HEA.js +45 -0
- package/dist/ensure-container-edge-ED25XL3Z.js +31 -0
- package/dist/{event-streams-G7F6Q7QY.js → event-streams-EHRAKL75.js} +5 -3
- package/dist/{executor-O5NR7LMP.js → executor-YPT6RH6O.js} +9 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +279 -245
- package/dist/{loadSso-LH753OSJ.js → loadSso-46FQRIZS.js} +11 -9
- package/dist/local-executor-V7U5VOZW.js +12 -0
- package/dist/nginx-XWJAOGS4.js +24 -0
- package/dist/{noop-6KC6HRDB.js → noop-FMMFG2EZ.js} +4 -2
- package/dist/{openresty-lua-KFCOJAG4.js → openresty-lua-4WLGDSER.js} +11 -3
- package/dist/server/engine/ChangeLog +2289 -0
- package/dist/server/engine/Documentations +5 -0
- package/dist/server/engine/LICENSE +674 -0
- package/dist/server/engine/README.md +34 -0
- package/dist/server/engine/conf/amavisd +150 -0
- package/dist/server/engine/conf/clamav +71 -0
- package/dist/server/engine/conf/core +632 -0
- package/dist/server/engine/conf/dovecot +151 -0
- package/dist/server/engine/conf/fail2ban +72 -0
- package/dist/server/engine/conf/global +698 -0
- package/dist/server/engine/conf/iredapd +52 -0
- package/dist/server/engine/conf/logwatch +28 -0
- package/dist/server/engine/conf/postfix +97 -0
- package/dist/server/engine/conf/postgresql +93 -0
- package/dist/server/engine/conf/spamassassin +39 -0
- package/dist/server/engine/dialog/config_via_dialog.sh +258 -0
- package/dist/server/engine/dialog/optional_components.sh +122 -0
- package/dist/server/engine/dialog/pgsql_config.sh +52 -0
- package/dist/server/engine/dialog/virtual_domain_config.sh +94 -0
- package/dist/server/engine/functions/amavisd.sh +267 -0
- package/dist/server/engine/functions/backend.sh +85 -0
- package/dist/server/engine/functions/clamav.sh +100 -0
- package/dist/server/engine/functions/cleanup.sh +393 -0
- package/dist/server/engine/functions/dovecot.sh +583 -0
- package/dist/server/engine/functions/fail2ban.sh +209 -0
- package/dist/server/engine/functions/iredapd.sh +356 -0
- package/dist/server/engine/functions/optional_components.sh +24 -0
- package/dist/server/engine/functions/packages.sh +522 -0
- package/dist/server/engine/functions/packages_freebsd.sh +179 -0
- package/dist/server/engine/functions/postfix.sh +457 -0
- package/dist/server/engine/functions/postgresql.sh +239 -0
- package/dist/server/engine/functions/spamassassin.sh +49 -0
- package/dist/server/engine/functions/system_accounts.sh +128 -0
- package/dist/server/engine/iRedMail.sh +144 -0
- package/dist/server/engine/pkgs/get_all.sh +338 -0
- package/dist/server/engine/pkgs/pkgs.freebsd.sha256 +3 -0
- package/dist/server/engine/pkgs/pkgs.openbsd.sha256 +6 -0
- package/dist/server/engine/pkgs/pkgs.sha256 +1 -0
- package/dist/server/engine/samples/amavisd/amavisd.conf +677 -0
- package/dist/server/engine/samples/amavisd/amavisd.mysql +278 -0
- package/dist/server/engine/samples/amavisd/amavisd.pgsql +253 -0
- package/dist/server/engine/samples/amavisd/amavisd.schema +942 -0
- package/dist/server/engine/samples/amavisd/default_spam_policy.sql +46 -0
- package/dist/server/engine/samples/dovecot/dovecot-2.4-mariadb.conf +758 -0
- package/dist/server/engine/samples/dovecot/dovecot-2.4-openldap.conf +767 -0
- package/dist/server/engine/samples/dovecot/dovecot-2.4-pgsql.conf +762 -0
- package/dist/server/engine/samples/dovecot/dovecot-last-login.conf +50 -0
- package/dist/server/engine/samples/dovecot/dovecot-ldap.conf +21 -0
- package/dist/server/engine/samples/dovecot/dovecot-share-folder.conf +22 -0
- package/dist/server/engine/samples/dovecot/dovecot-sql.conf +28 -0
- package/dist/server/engine/samples/dovecot/dovecot-used-quota.conf +13 -0
- package/dist/server/engine/samples/dovecot/dovecot.conf +484 -0
- package/dist/server/engine/samples/dovecot/dovecot.sieve +7 -0
- package/dist/server/engine/samples/dovecot/dovecot2-quota-warning.sh +38 -0
- package/dist/server/engine/samples/dovecot/sql/imap_share_folder.mysql +16 -0
- package/dist/server/engine/samples/dovecot/sql/last_login.mysql +12 -0
- package/dist/server/engine/samples/dovecot/sql/used_quota.mysql +26 -0
- package/dist/server/engine/samples/dovecot/systemd/override.conf +3 -0
- package/dist/server/engine/samples/fail2ban/action.d/banned_db.conf +9 -0
- package/dist/server/engine/samples/fail2ban/bin/fail2ban_banned_db +268 -0
- package/dist/server/engine/samples/fail2ban/fail2ban.local +17 -0
- package/dist/server/engine/samples/fail2ban/filter.d/dovecot.iredmail.conf +5 -0
- package/dist/server/engine/samples/fail2ban/filter.d/postfix-pregreet.iredmail.conf +16 -0
- package/dist/server/engine/samples/fail2ban/filter.d/postfix.iredmail.conf +18 -0
- package/dist/server/engine/samples/fail2ban/filter.d/roundcube.iredmail.conf +9 -0
- package/dist/server/engine/samples/fail2ban/jail.d/dovecot.local +8 -0
- package/dist/server/engine/samples/fail2ban/jail.d/nginx-http-auth.local +8 -0
- package/dist/server/engine/samples/fail2ban/jail.d/postfix-pregreet.local +9 -0
- package/dist/server/engine/samples/fail2ban/jail.d/postfix.local +8 -0
- package/dist/server/engine/samples/fail2ban/jail.d/roundcube.local +9 -0
- package/dist/server/engine/samples/fail2ban/jail.d/sogo.local +8 -0
- package/dist/server/engine/samples/fail2ban/jail.d/sshd.local +8 -0
- package/dist/server/engine/samples/fail2ban/jail.local +6 -0
- package/dist/server/engine/samples/fail2ban/openbsd/rc +27 -0
- package/dist/server/engine/samples/fail2ban/sql/fail2ban.mysql +49 -0
- package/dist/server/engine/samples/fail2ban/sql/fail2ban.pgsql +48 -0
- package/dist/server/engine/samples/firewall/firewalld/services/ssh.xml +6 -0
- package/dist/server/engine/samples/firewall/firewalld/zones/iredmail.xml +15 -0
- package/dist/server/engine/samples/firewall/iptables/ip6tables.init.debian +362 -0
- package/dist/server/engine/samples/firewall/iptables/ip6tables.rules +53 -0
- package/dist/server/engine/samples/firewall/iptables/iptables.init.debian +363 -0
- package/dist/server/engine/samples/firewall/iptables/iptables.rules +54 -0
- package/dist/server/engine/samples/firewall/nftables.conf +58 -0
- package/dist/server/engine/samples/freebsd/newsyslog.conf.d/dovecot.conf +3 -0
- package/dist/server/engine/samples/freebsd/newsyslog.conf.d/iredapd.conf +1 -0
- package/dist/server/engine/samples/freebsd/newsyslog.conf.d/mlmmjadmin.conf +1 -0
- package/dist/server/engine/samples/freebsd/newsyslog.conf.d/php-fpm.conf +2 -0
- package/dist/server/engine/samples/freebsd/newsyslog.conf.d/slapd.conf +1 -0
- package/dist/server/engine/samples/freebsd/syslog.d/dovecot.conf +2 -0
- package/dist/server/engine/samples/freebsd/syslog.d/fail2ban.conf +2 -0
- package/dist/server/engine/samples/freebsd/syslog.d/iredapd.conf +2 -0
- package/dist/server/engine/samples/freebsd/syslog.d/mlmmjadmin.conf +2 -0
- package/dist/server/engine/samples/freebsd/syslog.d/php-fpm.conf +2 -0
- package/dist/server/engine/samples/freebsd/syslog.d/slapd.conf +2 -0
- package/dist/server/engine/samples/iredmail/iredmail.mysql +491 -0
- package/dist/server/engine/samples/iredmail/iredmail.pgsql +465 -0
- package/dist/server/engine/samples/iredmail/iredmail.schema +456 -0
- package/dist/server/engine/samples/iredmail/used_quota_triggers_dovecot_2.3.pgsql +40 -0
- package/dist/server/engine/samples/iredmail/used_quota_triggers_dovecot_2.4.pgsql +18 -0
- package/dist/server/engine/samples/logrotate/dovecot +13 -0
- package/dist/server/engine/samples/logrotate/iredapd +13 -0
- package/dist/server/engine/samples/logrotate/mlmmjadmin +13 -0
- package/dist/server/engine/samples/logrotate/openldap +19 -0
- package/dist/server/engine/samples/logrotate/php-fpm +13 -0
- package/dist/server/engine/samples/openbsd/ldapd.conf +58 -0
- package/dist/server/engine/samples/openbsd/pf.conf +28 -0
- package/dist/server/engine/samples/postfix/command_filter.pcre +3 -0
- package/dist/server/engine/samples/postfix/freebsd/mailer.conf +9 -0
- package/dist/server/engine/samples/postfix/helo_access.pcre +180 -0
- package/dist/server/engine/samples/postfix/ldap/catchall_maps.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/recipient_bcc_maps_domain.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/recipient_bcc_maps_user.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/relay_domains.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/sender_bcc_maps_domain.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/sender_bcc_maps_user.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/sender_dependent_relayhost_maps_domain.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/sender_dependent_relayhost_maps_user.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/sender_login_maps.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/transport_maps_domain.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/transport_maps_user.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/virtual_alias_maps.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/virtual_group_maps.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/virtual_group_members_maps.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/virtual_mailbox_domains.cf +11 -0
- package/dist/server/engine/samples/postfix/ldap/virtual_mailbox_maps.cf +12 -0
- package/dist/server/engine/samples/postfix/main.cf +282 -0
- package/dist/server/engine/samples/postfix/main.cf.amavisd +7 -0
- package/dist/server/engine/samples/postfix/main.cf.dovecot +8 -0
- package/dist/server/engine/samples/postfix/main.cf.ldap +39 -0
- package/dist/server/engine/samples/postfix/main.cf.mlmmj +5 -0
- package/dist/server/engine/samples/postfix/main.cf.mysql +39 -0
- package/dist/server/engine/samples/postfix/main.cf.pgsql +39 -0
- package/dist/server/engine/samples/postfix/main.cf.postscreen +30 -0
- package/dist/server/engine/samples/postfix/master.cf +87 -0
- package/dist/server/engine/samples/postfix/mysql/catchall_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/domain_alias_catchall_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/domain_alias_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/recipient_bcc_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/recipient_bcc_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/relay_domains.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/sender_bcc_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/sender_bcc_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/sender_dependent_relayhost_maps.cf +6 -0
- package/dist/server/engine/samples/postfix/mysql/sender_login_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/transport_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/transport_maps_maillist.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/transport_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/virtual_alias_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/virtual_mailbox_domains.cf +5 -0
- package/dist/server/engine/samples/postfix/mysql/virtual_mailbox_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/catchall_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/domain_alias_catchall_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/domain_alias_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/recipient_bcc_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/recipient_bcc_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/relay_domains.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/sender_bcc_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/sender_bcc_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/sender_dependent_relayhost_maps.cf +6 -0
- package/dist/server/engine/samples/postfix/pgsql/sender_login_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/transport_maps_domain.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/transport_maps_maillist.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/transport_maps_user.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/virtual_alias_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/virtual_mailbox_domains.cf +5 -0
- package/dist/server/engine/samples/postfix/pgsql/virtual_mailbox_maps.cf +5 -0
- package/dist/server/engine/samples/postfix/postscreen_access.cidr +6 -0
- package/dist/server/engine/samples/postgresql/sql/add_first_domain_and_user.sql +34 -0
- package/dist/server/engine/samples/postgresql/sql/grant_permissions.sql +14 -0
- package/dist/server/engine/samples/postgresql/sql/init_vmail_db.sql +15 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-dovecot.conf +23 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-fail2ban.conf +2 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-iredapd.conf +12 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-mlmmjadmin.conf +12 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-openldap.conf +2 -0
- package/dist/server/engine/samples/rsyslog.d/1-iredmail-phpfpm.conf +3 -0
- package/dist/server/engine/samples/spamassassin/local.cf +186 -0
- package/dist/server/engine/samples/spamassassin/razor.conf +1 -0
- package/dist/server/engine/samples/systemd/clamd.service.d/override.conf +2 -0
- package/dist/server/engine/samples/systemd/mariadb.service.d/override.conf +3 -0
- package/dist/server/engine/samples/systemd/slapd.service.d/override.conf +6 -0
- package/dist/server/engine/samples/yum/CentOS-Linux-AppStream.repo +6 -0
- package/dist/server/engine/samples/yum/CentOS-Linux-PowerTools.repo +6 -0
- package/dist/server/engine/samples/yum/CentOS-Stream-AppStream.repo +7 -0
- package/dist/server/engine/samples/yum/CentOS-Stream-PowerTools.repo +7 -0
- package/dist/server/engine/samples/yum/symas-openldap.repo +6 -0
- package/dist/server/engine/tools/add_enabled_service.py +60 -0
- package/dist/server/engine/tools/backup_mysql.sh +238 -0
- package/dist/server/engine/tools/backup_openldap.sh +230 -0
- package/dist/server/engine/tools/backup_pgsql.sh +217 -0
- package/dist/server/engine/tools/backup_sogo.sh +156 -0
- package/dist/server/engine/tools/create_mail_user_OpenLDAP.py +335 -0
- package/dist/server/engine/tools/create_mail_user_OpenLDAP.sh +287 -0
- package/dist/server/engine/tools/create_mail_user_SQL.sh +127 -0
- package/dist/server/engine/tools/enable_postscreen.sh +144 -0
- package/dist/server/engine/tools/fail2ban_unban_ip.sh +39 -0
- package/dist/server/engine/tools/find_sasl_login_ip.sh +20 -0
- package/dist/server/engine/tools/find_top_sasl_usernames.sh +28 -0
- package/dist/server/engine/tools/generate_ssl_keys.sh +85 -0
- package/dist/server/engine/tools/kill_high_cpu_sogo_process.sh +32 -0
- package/dist/server/engine/tools/ldap_assign_user_to_groups.py +151 -0
- package/dist/server/engine/tools/ldap_move_members_to_another_group.py +129 -0
- package/dist/server/engine/tools/migrate_sql_alias_table.py +177 -0
- package/dist/server/engine/update/0.9.8/amavisd.mysql +29 -0
- package/dist/server/engine/update/0.9.8/amavisd.pgsql +39 -0
- package/dist/server/engine/update/0.9.8/iredmail.mysql +53 -0
- package/dist/server/engine/update/0.9.8/iredmail.pgsql +61 -0
- package/dist/server/engine/update/0.9.9/iredmail.mysql +2 -0
- package/dist/server/engine/update/0.9.9/iredmail.pgsql +2 -0
- package/dist/server/engine/update/1.0/iredmail.mysql +2 -0
- package/dist/server/engine/update/1.0/iredmail.pgsql +2 -0
- package/dist/server/engine/update/1.2/last_login.mysql +16 -0
- package/dist/server/engine/update/1.4.0/iredmail.mysql +22 -0
- package/dist/server/engine/update/1.4.0/iredmail.pgsql +20 -0
- package/dist/server/engine/update/1.4.1/iredmail.mysql +3 -0
- package/dist/server/engine/update/1.4.1/iredmail.pgsql +3 -0
- package/dist/server/engine/update/1.4.1/sogo.mysql +11 -0
- package/dist/server/engine/update/1.4.1/sogo.pgsql +30 -0
- package/dist/server/engine/update/1.4.1/update-ldap.py +66 -0
- package/dist/server/engine/update/1.4.2/iredmail.mysql +9 -0
- package/dist/server/engine/update/1.4.2/iredmail.pgsql +9 -0
- package/dist/server/engine/update/1.4.2/sogo.pgsql +30 -0
- package/dist/server/engine/update/1.6.0/sogo_view.pgsql +27 -0
- package/dist/server/engine/update/1.6.3/iredmail.mysql +1 -0
- package/dist/server/engine/update/1.7.0/fail2ban.mysql +11 -0
- package/dist/server/engine/update/1.7.0/fail2ban.pgsql +12 -0
- package/dist/server/engine/update/1.7.1/amavisd.mysql +1 -0
- package/dist/server/engine/update/1.7.2/vmail.mysql +30 -0
- package/dist/server/engine/update/1.7.3/deleted_mailboxes.mysql +43 -0
- package/dist/server/engine/update/1.7.3/iredadmin.mysql +26 -0
- package/dist/server/engine/update/1.7.3/vmail.mysql +79 -0
- package/dist/server/engine/update/1.7.3/vmail.pgsql +9 -0
- package/dist/server/engine/update/README.md +1 -0
- package/dist/server/engine/update/ldap/README.md +40 -0
- package/dist/server/engine/update/ldap/update-ldap-dovecot-2.3.py +69 -0
- package/dist/server/index.js +55793 -53701
- package/dist/server/migrations/0071_gh_device_token.sql +3 -0
- package/dist/server/migrations/0072_gh_device_token_method.sql +1 -0
- package/dist/server/migrations/meta/_journal.json +14 -0
- package/dist/setup-2DMFIA74.js +20 -0
- package/dist/{signin-PVC7MBZJ.js → signin-ITOPKKUB.js} +11 -9
- package/dist/{sso-oidc-ZXY77BSL.js → sso-oidc-NON2PD7Y.js} +11 -9
- package/dist/{sts-LX5L4UU3.js → sts-HHFFSAY2.js} +10 -8
- package/package.json +1 -1
- package/dist/bare-CNSFDNSZ.js +0 -20
- package/dist/cloud-655YYCEW.js +0 -26
- package/dist/docker-UWQPDEGW.js +0 -14
- package/dist/docker-edge-executor-ZLAYE5FE.js +0 -11
- package/dist/edge-import-AFID2EN3.js +0 -41
- package/dist/nginx-M36GDYL7.js +0 -18
- package/dist/setup-ZXXB5S22.js +0 -16
|
@@ -1,10 +1,12 @@
|
|
|
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
5
|
import {
|
|
4
6
|
decorateServiceException,
|
|
5
7
|
normalizeProvider as normalizeProvider2,
|
|
6
8
|
setCredentialFeature
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VWPEKOH6.js";
|
|
8
10
|
import {
|
|
9
11
|
HttpRequest,
|
|
10
12
|
HttpResponse,
|
|
@@ -15,14 +17,14 @@ import {
|
|
|
15
17
|
getSmithyContext,
|
|
16
18
|
normalizeProvider,
|
|
17
19
|
toEndpointV1
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-W73X43R7.js";
|
|
19
21
|
import {
|
|
20
22
|
fromHex,
|
|
21
23
|
fromUtf8,
|
|
22
24
|
isArrayBuffer,
|
|
23
25
|
toHex,
|
|
24
26
|
toUint8Array
|
|
25
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JYGD5WSN.js";
|
|
26
28
|
|
|
27
29
|
// ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js
|
|
28
30
|
var operation = (namespace, name, traits, input, output) => ({
|
|
@@ -1,112 +1,15 @@
|
|
|
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
5
|
import {
|
|
4
6
|
formatDuration,
|
|
5
7
|
isRemoteConnectionError,
|
|
6
8
|
systemDebug
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RPHRPFEH.js";
|
|
8
10
|
import {
|
|
9
11
|
safeErrorMessage
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
|
|
12
|
-
// ../../packages/adapters/src/system/port-listen.ts
|
|
13
|
-
var PROC_NET_TCP_CMD = "cat /proc/net/tcp 2>/dev/null; cat /proc/net/tcp6 2>/dev/null; true";
|
|
14
|
-
var TCP_LISTEN = "0A";
|
|
15
|
-
function parseListeningPorts(procText) {
|
|
16
|
-
const ports = /* @__PURE__ */ new Set();
|
|
17
|
-
for (const rawLine of procText.split("\n")) {
|
|
18
|
-
const line = rawLine.trim();
|
|
19
|
-
if (!line) continue;
|
|
20
|
-
const fields = line.split(/\s+/);
|
|
21
|
-
if (fields.length < 4) continue;
|
|
22
|
-
if (fields[3] !== TCP_LISTEN) continue;
|
|
23
|
-
const local = fields[1];
|
|
24
|
-
const colon = local.lastIndexOf(":");
|
|
25
|
-
if (colon === -1) continue;
|
|
26
|
-
const hexPort = local.slice(colon + 1);
|
|
27
|
-
if (!/^[0-9A-Fa-f]{1,4}$/.test(hexPort)) continue;
|
|
28
|
-
const port = parseInt(hexPort, 16);
|
|
29
|
-
if (port > 0) ports.add(port);
|
|
30
|
-
}
|
|
31
|
-
return ports;
|
|
32
|
-
}
|
|
33
|
-
async function probePortListeningOnce(executor, port) {
|
|
34
|
-
try {
|
|
35
|
-
const out = await executor.exec(PROC_NET_TCP_CMD, { timeout: 5e3 });
|
|
36
|
-
return parseListeningPorts(out).has(port);
|
|
37
|
-
} catch {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// ../../packages/adapters/src/runtime/port-conflict.ts
|
|
43
|
-
async function tryExec(executor, command) {
|
|
44
|
-
try {
|
|
45
|
-
return await executor.exec(command);
|
|
46
|
-
} catch {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async function resolveSystemdUnit(executor, pid) {
|
|
51
|
-
const cgroup = await tryExec(executor, `cat /proc/${pid}/cgroup 2>/dev/null || true`);
|
|
52
|
-
const unitMatch = cgroup?.match(/(?:^|\/)([^/\n]+\.service)(?:$|\n|\/)/m) ?? cgroup?.match(/(?:^|\/)([^/\n]+\.service)(?:$|\n|\/)/m);
|
|
53
|
-
const systemdUnit = unitMatch?.[1]?.trim();
|
|
54
|
-
if (!systemdUnit || !/^[A-Za-z0-9@._:\\-]+\.service$/.test(systemdUnit)) {
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
const description = await tryExec(
|
|
58
|
-
executor,
|
|
59
|
-
`systemctl show ${systemdUnit} --property=Description --value 2>/dev/null || true`
|
|
60
|
-
);
|
|
61
|
-
const managedMatch = systemdUnit.match(/^openship-(.+)\.service$/);
|
|
62
|
-
return {
|
|
63
|
-
systemdUnit,
|
|
64
|
-
systemdDescription: description?.trim() || void 0,
|
|
65
|
-
deploymentId: managedMatch?.[1],
|
|
66
|
-
isManagedDeployment: Boolean(managedMatch)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
async function resolveListener(executor, port) {
|
|
70
|
-
const out = await tryExec(
|
|
71
|
-
executor,
|
|
72
|
-
`ss -tlnp sport = :${port} 2>/dev/null | grep LISTEN || lsof -ti tcp:${port} -sTCP:LISTEN 2>/dev/null || true`
|
|
73
|
-
);
|
|
74
|
-
if (out) {
|
|
75
|
-
const ssMatch = out.match(/pid=(\d+)/);
|
|
76
|
-
const lsofMatch = !ssMatch ? out.match(/^\s*(\d+)\s*$/m) : null;
|
|
77
|
-
const pid = ssMatch ? parseInt(ssMatch[1], 10) : lsofMatch ? parseInt(lsofMatch[1], 10) : null;
|
|
78
|
-
if (pid) return { pid, occupied: true };
|
|
79
|
-
}
|
|
80
|
-
const listening = await probePortListeningOnce(executor, port);
|
|
81
|
-
return { pid: null, occupied: listening === true };
|
|
82
|
-
}
|
|
83
|
-
async function probeListeningPort(executor, port) {
|
|
84
|
-
try {
|
|
85
|
-
const { pid, occupied } = await resolveListener(executor, port);
|
|
86
|
-
if (!occupied) return null;
|
|
87
|
-
if (pid === null) return { pid: null, command: "unknown listener" };
|
|
88
|
-
return await describeProcess(executor, pid);
|
|
89
|
-
} catch {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async function describeProcess(executor, pid) {
|
|
94
|
-
let command = `PID ${pid}`;
|
|
95
|
-
let rawCommand;
|
|
96
|
-
const args = await tryExec(executor, `ps -p ${pid} -o args= 2>/dev/null || true`);
|
|
97
|
-
if (args?.trim()) {
|
|
98
|
-
rawCommand = args.trim();
|
|
99
|
-
command = `${rawCommand} (PID ${pid})`;
|
|
100
|
-
} else {
|
|
101
|
-
const cmd = await tryExec(executor, `ps -p ${pid} -o comm= 2>/dev/null || true`);
|
|
102
|
-
if (cmd?.trim()) {
|
|
103
|
-
rawCommand = cmd.trim();
|
|
104
|
-
command = `${rawCommand} (PID ${pid})`;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const systemd = await resolveSystemdUnit(executor, pid);
|
|
108
|
-
return { pid, command, rawCommand, ...systemd };
|
|
109
|
-
}
|
|
12
|
+
} from "./chunk-6APULWSU.js";
|
|
110
13
|
|
|
111
14
|
// ../../packages/adapters/src/system/environment.ts
|
|
112
15
|
var profileCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -237,7 +140,5 @@ async function resolveEnvironment(executor) {
|
|
|
237
140
|
}
|
|
238
141
|
|
|
239
142
|
export {
|
|
240
|
-
resolveEnvironment
|
|
241
|
-
probeListeningPort,
|
|
242
|
-
describeProcess
|
|
143
|
+
resolveEnvironment
|
|
243
144
|
};
|
|
@@ -1,16 +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);
|
|
3
5
|
import {
|
|
4
6
|
detectBuildKillHint,
|
|
5
7
|
runBuildPipeline,
|
|
6
8
|
transferLocalDirectory
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4Z5QO7N6.js";
|
|
8
10
|
import {
|
|
9
11
|
LocalExecutor
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TYVME3XD.js";
|
|
11
13
|
import {
|
|
12
14
|
wrapLocalBuildCommand
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FPRHYBY2.js";
|
|
14
16
|
|
|
15
17
|
// ../../packages/adapters/src/runtime/local-build.ts
|
|
16
18
|
var LOCAL_BUILD_DIR = "/tmp/openship/.builds";
|
|
@@ -1,3 +1,5 @@
|
|
|
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
5
|
import {
|
|
@@ -5,7 +7,7 @@ import {
|
|
|
5
7
|
fromUtf8,
|
|
6
8
|
toHex,
|
|
7
9
|
toUtf8
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JYGD5WSN.js";
|
|
9
11
|
|
|
10
12
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
11
13
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
@@ -1,9 +1,11 @@
|
|
|
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
5
|
import {
|
|
4
6
|
HttpResponse,
|
|
5
7
|
buildQueryString
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W73X43R7.js";
|
|
7
9
|
|
|
8
10
|
// ../../node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js
|
|
9
11
|
function buildAbortError(abortSignal) {
|
|
@@ -1,12 +1,14 @@
|
|
|
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
5
|
import {
|
|
4
6
|
isSshAuthError,
|
|
5
7
|
systemDebug
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RPHRPFEH.js";
|
|
7
9
|
import {
|
|
8
10
|
PACKAGE_ROOT_ONLY_EXCLUDES
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6APULWSU.js";
|
|
10
12
|
|
|
11
13
|
// ../../packages/adapters/src/archive.ts
|
|
12
14
|
import { execFile } from "child_process";
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
|
|
3
|
+
import { createRequire as __ospCreateRequire } from "node:module";
|
|
4
|
+
const require = __ospCreateRequire(import.meta.url);
|
|
5
|
+
import {
|
|
6
|
+
describeProcess,
|
|
7
|
+
probeListeningPort
|
|
8
|
+
} from "./chunk-ILFETZOM.js";
|
|
9
|
+
import {
|
|
10
|
+
OPENRESTY_LUA_DIR
|
|
11
|
+
} from "./chunk-VFINNTUL.js";
|
|
12
|
+
import {
|
|
13
|
+
AppError
|
|
14
|
+
} from "./chunk-6APULWSU.js";
|
|
15
|
+
|
|
16
|
+
// ../../packages/adapters/src/system/proxy/detect.ts
|
|
17
|
+
var EDGE_PORTS = [80, 443];
|
|
18
|
+
var EdgeConflictError = class extends AppError {
|
|
19
|
+
constructor(status) {
|
|
20
|
+
super(
|
|
21
|
+
`Ports ${status.occupants.map((o) => o.port).join("/") || "80/443"} are in use by another service (${status.classification}). Accept a migrate or takeover to continue.`,
|
|
22
|
+
409,
|
|
23
|
+
"EDGE_CONFLICT"
|
|
24
|
+
);
|
|
25
|
+
this.status = status;
|
|
26
|
+
this.name = "EdgeConflictError";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var EdgeMigrateRequested = class extends Error {
|
|
30
|
+
constructor(status, sites, warnings = []) {
|
|
31
|
+
super("Edge migration requested by user");
|
|
32
|
+
this.status = status;
|
|
33
|
+
this.sites = sites;
|
|
34
|
+
this.warnings = warnings;
|
|
35
|
+
this.name = "EdgeMigrateRequested";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
async function tryExec(executor, command) {
|
|
39
|
+
try {
|
|
40
|
+
return await executor.exec(command);
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function classifyProxy(text) {
|
|
46
|
+
if (!text) return void 0;
|
|
47
|
+
const t = text.toLowerCase();
|
|
48
|
+
if (t.includes("openresty")) return "openresty";
|
|
49
|
+
if (/(^|[\s/:])nginx/.test(t)) return "nginx";
|
|
50
|
+
if (/(^|[\s/:])caddy/.test(t)) return "caddy";
|
|
51
|
+
if (/(apache2|httpd)/.test(t)) return "apache";
|
|
52
|
+
if (/(^|[\s/:])traefik/.test(t)) return "traefik";
|
|
53
|
+
if (/(^|[\s/:])haproxy/.test(t)) return "haproxy";
|
|
54
|
+
return void 0;
|
|
55
|
+
}
|
|
56
|
+
function sq(value) {
|
|
57
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
58
|
+
}
|
|
59
|
+
function isOurEdgeContainer(name, image) {
|
|
60
|
+
return /openship-edge/i.test(`${name ?? ""} ${image ?? ""}`);
|
|
61
|
+
}
|
|
62
|
+
async function edgeIsServing(executor, port = 80) {
|
|
63
|
+
const running = await tryExec(
|
|
64
|
+
executor,
|
|
65
|
+
`docker inspect -f '{{.State.Running}}' ${sq(EDGE_CONTAINER_NAME)} 2>/dev/null`
|
|
66
|
+
);
|
|
67
|
+
if ((running ?? "").trim() !== "true") return false;
|
|
68
|
+
const probe = await tryExec(
|
|
69
|
+
executor,
|
|
70
|
+
containerShell(`wget -q -O /dev/null -T 3 http://127.0.0.1:${port}/ >/dev/null 2>&1; echo $?`)
|
|
71
|
+
);
|
|
72
|
+
const code = (probe ?? "").trim().split("\n").pop() ?? "1";
|
|
73
|
+
return code === "0" || code === "8";
|
|
74
|
+
}
|
|
75
|
+
function containerShell(command) {
|
|
76
|
+
return `docker exec ${sq(EDGE_CONTAINER_NAME)} sh -c ${sq(command)}`;
|
|
77
|
+
}
|
|
78
|
+
async function edgeCrashReason(executor) {
|
|
79
|
+
const logs = await tryExec(
|
|
80
|
+
executor,
|
|
81
|
+
`docker logs --tail 40 ${sq(EDGE_CONTAINER_NAME)} 2>&1`
|
|
82
|
+
);
|
|
83
|
+
return logs ? edgeFailureReason(logs) : null;
|
|
84
|
+
}
|
|
85
|
+
function edgeFailureReason(containerLog) {
|
|
86
|
+
const lines = containerLog.split("\n").map((l) => l.trim()).filter(Boolean);
|
|
87
|
+
const emerg = lines.find((l) => l.includes("[emerg]"));
|
|
88
|
+
if (emerg) return emerg.replace(/^.*\[emerg\]\s*\d*#\d*:\s*/, "");
|
|
89
|
+
return lines.at(-1) ?? null;
|
|
90
|
+
}
|
|
91
|
+
var EDGE_CONTAINER_NAME = "openship-edge";
|
|
92
|
+
async function ourEdgeContainerRunning(executor) {
|
|
93
|
+
return Boolean(await resolveOurEdgeContainer(executor));
|
|
94
|
+
}
|
|
95
|
+
var EDGE_CONTAINER_TTL_MS = 2e4;
|
|
96
|
+
var edgeContainerMemo = /* @__PURE__ */ new WeakMap();
|
|
97
|
+
var edgeMemoGeneration = 0;
|
|
98
|
+
function invalidateEdgeContainer(executor) {
|
|
99
|
+
if (executor) edgeContainerMemo.delete(executor);
|
|
100
|
+
else edgeMemoGeneration++;
|
|
101
|
+
}
|
|
102
|
+
async function resolveOurEdgeContainer(executor, opts) {
|
|
103
|
+
if (!opts?.fresh) {
|
|
104
|
+
const hit = edgeContainerMemo.get(executor);
|
|
105
|
+
if (hit && hit.generation === edgeMemoGeneration && Date.now() - hit.at < EDGE_CONTAINER_TTL_MS) {
|
|
106
|
+
return hit.value;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const resolved = await probeOurEdgeContainer(executor);
|
|
110
|
+
edgeContainerMemo.set(executor, {
|
|
111
|
+
value: resolved,
|
|
112
|
+
at: Date.now(),
|
|
113
|
+
generation: edgeMemoGeneration
|
|
114
|
+
});
|
|
115
|
+
return resolved;
|
|
116
|
+
}
|
|
117
|
+
async function probeOurEdgeContainer(executor) {
|
|
118
|
+
const byName = await tryExec(
|
|
119
|
+
executor,
|
|
120
|
+
`docker ps --filter name=openship-edge --format '{{.Names}}' 2>/dev/null | head -1`
|
|
121
|
+
);
|
|
122
|
+
if (byName?.trim()) return byName.trim();
|
|
123
|
+
const all = await tryExec(executor, `docker ps --format '{{.Names}} {{.Image}}' 2>/dev/null`);
|
|
124
|
+
if (!all) return null;
|
|
125
|
+
for (const line of all.split("\n").map((l) => l.trim()).filter(Boolean)) {
|
|
126
|
+
const [name, image] = line.split(" ");
|
|
127
|
+
if (name && isOurEdgeContainer(name, image)) return name;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
async function ourLuaOnHost(executor) {
|
|
132
|
+
const lua = await tryExec(
|
|
133
|
+
executor,
|
|
134
|
+
`test -f ${OPENRESTY_LUA_DIR}/site_logger.lua && echo ok`
|
|
135
|
+
);
|
|
136
|
+
return Boolean(lua && lua.includes("ok"));
|
|
137
|
+
}
|
|
138
|
+
async function detectDockerOnPort(executor, port) {
|
|
139
|
+
const out = await tryExec(
|
|
140
|
+
executor,
|
|
141
|
+
`docker ps --filter publish=${port} --format '{{.Names}} {{.Image}}' 2>/dev/null | head -1`
|
|
142
|
+
);
|
|
143
|
+
const line = out?.trim();
|
|
144
|
+
if (!line) return null;
|
|
145
|
+
const [name, image] = line.split(" ");
|
|
146
|
+
if (!name) return null;
|
|
147
|
+
return { name, image: image ?? "" };
|
|
148
|
+
}
|
|
149
|
+
async function listenerIsOurOpenResty(executor, listener) {
|
|
150
|
+
if (!listener) return false;
|
|
151
|
+
if (/openresty/i.test(`${listener.rawCommand ?? ""} ${listener.command ?? ""}`)) return true;
|
|
152
|
+
if (listener.pid) {
|
|
153
|
+
const exe = await tryExec(executor, `readlink -f /proc/${listener.pid}/exe 2>/dev/null || true`);
|
|
154
|
+
if (exe && /openresty/i.test(exe)) return true;
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
var WORKER_RE = /\b(?:nginx|openresty)\s*:\s*worker process/i;
|
|
159
|
+
var MASTER_RE = /\b(?:nginx|openresty)\s*:\s*master process/i;
|
|
160
|
+
async function resolveProxyMaster(executor, listener) {
|
|
161
|
+
if (!listener?.pid) return listener;
|
|
162
|
+
if (!WORKER_RE.test(`${listener.rawCommand ?? ""} ${listener.command ?? ""}`)) return listener;
|
|
163
|
+
const ppidRaw = await tryExec(
|
|
164
|
+
executor,
|
|
165
|
+
`awk '/^PPid:/{print $2}' /proc/${listener.pid}/status 2>/dev/null || true`
|
|
166
|
+
);
|
|
167
|
+
const ppid = Number.parseInt((ppidRaw ?? "").trim(), 10);
|
|
168
|
+
if (!Number.isInteger(ppid) || ppid <= 1) return listener;
|
|
169
|
+
const master = await describeProcess(executor, ppid);
|
|
170
|
+
if (!master || !MASTER_RE.test(`${master.rawCommand ?? ""} ${master.command ?? ""}`)) {
|
|
171
|
+
return listener;
|
|
172
|
+
}
|
|
173
|
+
return master;
|
|
174
|
+
}
|
|
175
|
+
async function probeEdgePort(executor, port, ours) {
|
|
176
|
+
const listener = await resolveProxyMaster(executor, await probeListeningPort(executor, port));
|
|
177
|
+
const docker = await detectDockerOnPort(executor, port);
|
|
178
|
+
if (!listener && !docker) return null;
|
|
179
|
+
const proxy = classifyProxy(
|
|
180
|
+
[
|
|
181
|
+
docker?.image,
|
|
182
|
+
docker?.name,
|
|
183
|
+
listener?.rawCommand,
|
|
184
|
+
listener?.command,
|
|
185
|
+
listener?.systemdUnit
|
|
186
|
+
].filter(Boolean).join(" ")
|
|
187
|
+
);
|
|
188
|
+
const foreignDockerProxy = Boolean(docker) && !isOurEdgeContainer(docker?.name, docker?.image);
|
|
189
|
+
const managedByOpenship = isOurEdgeContainer(docker?.name, docker?.image) || ours.containerRunning && !foreignDockerProxy || !docker && ours.luaOnHost && await listenerIsOurOpenResty(executor, listener);
|
|
190
|
+
return {
|
|
191
|
+
port,
|
|
192
|
+
pid: listener?.pid ?? void 0,
|
|
193
|
+
command: docker ? `docker container ${docker.name} (${docker.image})` : listener?.command,
|
|
194
|
+
rawCommand: listener?.rawCommand,
|
|
195
|
+
systemdUnit: listener?.systemdUnit,
|
|
196
|
+
systemdDescription: listener?.systemdDescription,
|
|
197
|
+
isDocker: Boolean(docker),
|
|
198
|
+
containerName: docker?.name,
|
|
199
|
+
proxy,
|
|
200
|
+
managedByOpenship
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
async function probeEdge(executor) {
|
|
204
|
+
const containerRunning = await ourEdgeContainerRunning(executor);
|
|
205
|
+
const luaOnHost = await ourLuaOnHost(executor);
|
|
206
|
+
const all = [];
|
|
207
|
+
for (const port of EDGE_PORTS) {
|
|
208
|
+
const occ = await probeEdgePort(executor, port, { containerRunning, luaOnHost });
|
|
209
|
+
if (occ) all.push(occ);
|
|
210
|
+
}
|
|
211
|
+
const foreign = all.filter((o) => !o.managedByOpenship);
|
|
212
|
+
let classification;
|
|
213
|
+
if (all.length === 0) classification = "free";
|
|
214
|
+
else if (foreign.length === 0) classification = "ours";
|
|
215
|
+
else if (foreign.every((o) => o.proxy && o.proxy !== "openresty")) classification = "known";
|
|
216
|
+
else classification = "unknown";
|
|
217
|
+
return {
|
|
218
|
+
classification,
|
|
219
|
+
occupants: foreign,
|
|
220
|
+
canProceedClean: classification === "free" || classification === "ours"
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function stopTargetsForStatus(status) {
|
|
224
|
+
const out = [];
|
|
225
|
+
const seen = /* @__PURE__ */ new Set();
|
|
226
|
+
for (const o of status.occupants) {
|
|
227
|
+
const identity = o.systemdUnit ?? o.containerName ?? (o.pid ? `pid:${o.pid}` : `port:${o.port}`);
|
|
228
|
+
if (seen.has(identity)) continue;
|
|
229
|
+
seen.add(identity);
|
|
230
|
+
out.push({
|
|
231
|
+
port: o.port,
|
|
232
|
+
unit: o.systemdUnit,
|
|
233
|
+
pid: o.pid,
|
|
234
|
+
container: o.containerName,
|
|
235
|
+
// Prefer the proxy kind over the raw cmdline — `nginx (PID 123)` reads
|
|
236
|
+
// better in "Stopping …" than `nginx: master process /usr/sbin/nginx …`.
|
|
237
|
+
label: o.proxy && o.pid ? `${o.proxy} (PID ${o.pid})` : o.command
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return out;
|
|
241
|
+
}
|
|
242
|
+
async function freeEdgeTargets(executor, targets, onLog) {
|
|
243
|
+
for (const t of targets) {
|
|
244
|
+
const where = t.port ? ` (port ${t.port})` : "";
|
|
245
|
+
if (t.container) {
|
|
246
|
+
onLog(`Stopping container ${t.container}${where}...`, "warn");
|
|
247
|
+
await tryExec(executor, `docker update --restart=no ${sq(t.container)} 2>/dev/null || true`);
|
|
248
|
+
await tryExec(executor, `docker stop ${sq(t.container)} 2>/dev/null || true`);
|
|
249
|
+
} else if (t.unit) {
|
|
250
|
+
onLog(`Stopping & disabling service ${t.unit}${where}...`, "warn");
|
|
251
|
+
await tryExec(
|
|
252
|
+
executor,
|
|
253
|
+
`systemctl disable --now ${sq(t.unit)} 2>/dev/null || systemctl stop ${sq(t.unit)} 2>/dev/null || true; systemctl reset-failed ${sq(t.unit)} 2>/dev/null || true`
|
|
254
|
+
);
|
|
255
|
+
} else if (t.pid) {
|
|
256
|
+
onLog(`Stopping ${t.label ?? `process ${t.pid}`}${where}...`, "warn");
|
|
257
|
+
await tryExec(executor, `kill ${t.pid} 2>/dev/null || true`);
|
|
258
|
+
await new Promise((r) => setTimeout(r, 800));
|
|
259
|
+
await tryExec(executor, `kill -9 ${t.pid} 2>/dev/null || true`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
EdgeConflictError,
|
|
267
|
+
EdgeMigrateRequested,
|
|
268
|
+
classifyProxy,
|
|
269
|
+
sq,
|
|
270
|
+
isOurEdgeContainer,
|
|
271
|
+
edgeIsServing,
|
|
272
|
+
edgeCrashReason,
|
|
273
|
+
edgeFailureReason,
|
|
274
|
+
EDGE_CONTAINER_NAME,
|
|
275
|
+
ourEdgeContainerRunning,
|
|
276
|
+
invalidateEdgeContainer,
|
|
277
|
+
resolveOurEdgeContainer,
|
|
278
|
+
ourLuaOnHost,
|
|
279
|
+
probeEdge,
|
|
280
|
+
stopTargetsForStatus,
|
|
281
|
+
freeEdgeTargets
|
|
282
|
+
};
|