@stacksjs/buddy 0.70.294 → 0.70.295

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.
@@ -187,8 +187,27 @@ fi
187
187
  # renewed in place, was actively harmful: each extra name made the renewal open
188
188
  # another certificate file, and two files sharing a CN meant one overwrote the
189
189
  # other.
190
+ #
191
+ # The CLI is resolved rather than hardcoded. This step used to run
192
+ # 'cd /opt/tlsx && bun run packages/tlsx/bin/cli.ts', which requires a source
193
+ # checkout at one exact path and silently does nothing when it is absent -
194
+ # there is no other way to satisfy the guard. On the box this was found on, that
195
+ # checkout had been pinned to a two-month-old tag nobody was updating, so the
196
+ # deploy kept invoking a build whose renewal logic had a known data-loss bug.
197
+ # Preferring an installed 'tlsx' on PATH lets a package manager own the version;
198
+ # the checkout stays as the fallback so existing boxes keep working.
199
+ tlsx_cli() {
200
+ if command -v tlsx >/dev/null 2>&1; then
201
+ tlsx "$@"
202
+ else
203
+ (cd /opt/tlsx && /usr/local/bin/bun run packages/tlsx/bin/cli.ts "$@")
204
+ fi
205
+ }
206
+ have_tlsx() {
207
+ command -v tlsx >/dev/null 2>&1 || { [ -x /usr/local/bin/bun ] && [ -f /opt/tlsx/packages/tlsx/bin/cli.ts ]; }
208
+ }
190
209
  CERTFILE=/etc/bun-gateway/certs/mail.stacksjs.com.crt
191
- if [ -n "$DOMAIN" ] && [ -f "$CERTFILE" ] && [ -d /opt/tlsx ]; then
210
+ if [ -n "$DOMAIN" ] && [ -f "$CERTFILE" ] && have_tlsx; then
192
211
  MAILHOSTNAME="mail.$DOMAIN"
193
212
  CERTNAME=$(basename "$CERTFILE" .crt)
194
213
  CERTKEY=/etc/bun-gateway/certs/mail.stacksjs.com.key
@@ -203,7 +222,7 @@ if [ -n "$DOMAIN" ] && [ -f "$CERTFILE" ] && [ -d /opt/tlsx ]; then
203
222
  SAFE=$(mktemp -d)
204
223
  cp -a "$CERTFILE" "$SAFE/cert" 2>/dev/null || true
205
224
  cp -a "$CERTKEY" "$SAFE/key" 2>/dev/null || true
206
- if (cd /opt/tlsx && /usr/local/bin/bun run packages/tlsx/bin/cli.ts acme:issue -d "$ALL" --cert-name "$CERTNAME" --method http-01 --webroot /var/www/acme-challenge --dir /etc/bun-gateway/certs --prod) >/tmp/.mailtenant-cert 2>&1; then
225
+ if tlsx_cli acme:issue -d "$ALL" --cert-name "$CERTNAME" --method http-01 --webroot /var/www/acme-challenge --dir /etc/bun-gateway/certs --prod >/tmp/.mailtenant-cert 2>&1; then
207
226
  # Verify rather than assume. The old code reported CERTHOST on a zero
208
227
  # exit alone, which is how an issuance that wrote somewhere else was
209
228
  # reported as "added to the mail certificate" for weeks.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.294",
5
+ "version": "0.70.295",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -95,53 +95,53 @@
95
95
  "prepublishOnly": "bun run build"
96
96
  },
97
97
  "dependencies": {
98
- "@stacksjs/actions": "^0.70.294",
99
- "@stacksjs/ai": "^0.70.294",
100
- "@stacksjs/alias": "^0.70.294",
101
- "@stacksjs/arrays": "^0.70.294",
102
- "@stacksjs/auth": "^0.70.294",
103
- "@stacksjs/build": "^0.70.294",
104
- "@stacksjs/cache": "^0.70.294",
105
- "@stacksjs/cli": "^0.70.294",
98
+ "@stacksjs/actions": "^0.70.295",
99
+ "@stacksjs/ai": "^0.70.295",
100
+ "@stacksjs/alias": "^0.70.295",
101
+ "@stacksjs/arrays": "^0.70.295",
102
+ "@stacksjs/auth": "^0.70.295",
103
+ "@stacksjs/build": "^0.70.295",
104
+ "@stacksjs/cache": "^0.70.295",
105
+ "@stacksjs/cli": "^0.70.295",
106
106
  "@stacksjs/clapp": "^0.2.12",
107
- "@stacksjs/cloud": "^0.70.294",
108
- "@stacksjs/collections": "^0.70.294",
109
- "@stacksjs/config": "^0.70.294",
110
- "@stacksjs/database": "^0.70.294",
111
- "@stacksjs/desktop-build": "^0.70.294",
112
- "@stacksjs/dns": "^0.70.294",
113
- "@stacksjs/email": "^0.70.294",
114
- "@stacksjs/enums": "^0.70.294",
115
- "@stacksjs/error-handling": "^0.70.294",
116
- "@stacksjs/events": "^0.70.294",
117
- "@stacksjs/git": "^0.70.294",
107
+ "@stacksjs/cloud": "^0.70.295",
108
+ "@stacksjs/collections": "^0.70.295",
109
+ "@stacksjs/config": "^0.70.295",
110
+ "@stacksjs/database": "^0.70.295",
111
+ "@stacksjs/desktop-build": "^0.70.295",
112
+ "@stacksjs/dns": "^0.70.295",
113
+ "@stacksjs/email": "^0.70.295",
114
+ "@stacksjs/enums": "^0.70.295",
115
+ "@stacksjs/error-handling": "^0.70.295",
116
+ "@stacksjs/events": "^0.70.295",
117
+ "@stacksjs/git": "^0.70.295",
118
118
  "@stacksjs/gitit": "^0.2.5",
119
- "@stacksjs/health": "^0.70.294",
119
+ "@stacksjs/health": "^0.70.295",
120
120
  "@stacksjs/dnsx": "^0.2.3",
121
121
  "@stacksjs/httx": "^0.1.10",
122
- "@stacksjs/image": "^0.70.294",
123
- "@stacksjs/lint": "^0.70.294",
124
- "@stacksjs/logging": "^0.70.294",
125
- "@stacksjs/notifications": "^0.70.294",
126
- "@stacksjs/objects": "^0.70.294",
127
- "@stacksjs/orm": "^0.70.294",
128
- "@stacksjs/path": "^0.70.294",
129
- "@stacksjs/skills": "^0.70.294",
130
- "@stacksjs/payments": "^0.70.294",
131
- "@stacksjs/realtime": "^0.70.294",
132
- "@stacksjs/router": "^0.70.294",
122
+ "@stacksjs/image": "^0.70.295",
123
+ "@stacksjs/lint": "^0.70.295",
124
+ "@stacksjs/logging": "^0.70.295",
125
+ "@stacksjs/notifications": "^0.70.295",
126
+ "@stacksjs/objects": "^0.70.295",
127
+ "@stacksjs/orm": "^0.70.295",
128
+ "@stacksjs/path": "^0.70.295",
129
+ "@stacksjs/skills": "^0.70.295",
130
+ "@stacksjs/payments": "^0.70.295",
131
+ "@stacksjs/realtime": "^0.70.295",
132
+ "@stacksjs/router": "^0.70.295",
133
133
  "@stacksjs/rpx": "^0.11.42",
134
- "@stacksjs/search-engine": "^0.70.294",
135
- "@stacksjs/security": "^0.70.294",
136
- "@stacksjs/server": "^0.70.294",
137
- "@stacksjs/storage": "^0.70.294",
138
- "@stacksjs/strings": "^0.70.294",
139
- "@stacksjs/testing": "^0.70.294",
140
- "@stacksjs/tunnel": "^0.70.294",
141
- "@stacksjs/types": "^0.70.294",
142
- "@stacksjs/ui": "^0.70.294",
143
- "@stacksjs/utils": "^0.70.294",
144
- "@stacksjs/validation": "^0.70.294",
134
+ "@stacksjs/search-engine": "^0.70.295",
135
+ "@stacksjs/security": "^0.70.295",
136
+ "@stacksjs/server": "^0.70.295",
137
+ "@stacksjs/storage": "^0.70.295",
138
+ "@stacksjs/strings": "^0.70.295",
139
+ "@stacksjs/testing": "^0.70.295",
140
+ "@stacksjs/tunnel": "^0.70.295",
141
+ "@stacksjs/types": "^0.70.295",
142
+ "@stacksjs/ui": "^0.70.295",
143
+ "@stacksjs/utils": "^0.70.295",
144
+ "@stacksjs/validation": "^0.70.295",
145
145
  "@stacksjs/ts-cloud": "^0.7.103",
146
146
  "ajv": "^8.20.0",
147
147
  "ajv-formats": "^3.0.1",