Skip to content

Commit 138db8f

Browse files
MattDHillclaude
andcommitted
Update start-sdk to beta.58
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc5bd0c commit 138db8f

File tree

5 files changed

+44
-34
lines changed

5 files changed

+44
-34
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"check": "tsc --noEmit"
77
},
88
"dependencies": {
9-
"@start9labs/start-sdk": "^0.4.0-beta.55"
9+
"@start9labs/start-sdk": "^0.4.0-beta.58"
1010
},
1111
"devDependencies": {
1212
"@types/node": "^22.19.0",

startos/init/seedFiles.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { sdk } from '../sdk'
2-
import { configDefaults, mount } from '../utils'
3-
import { homeserverYaml } from '../fileModels/homeserver.yml'
41
import { homeserverLogConfig } from '../fileModels/homeserver.log.config'
2+
import { homeserverYaml } from '../fileModels/homeserver.yml'
53
import { storeJson } from '../fileModels/store.json'
4+
import { sdk } from '../sdk'
5+
import { configDefaults, mount } from '../utils'
66

77
export const seedFiles = sdk.setupOnInit(async (effects, kind) => {
88
if (kind !== 'install') return
@@ -22,13 +22,9 @@ export const seedFiles = sdk.setupOnInit(async (effects, kind) => {
2222
}),
2323
)
2424

25-
await storeJson.write(effects, {
25+
await storeJson.merge(effects, {
2626
adminUserCreated: false,
2727
serverStarted: false,
28-
smtp: {
29-
selection: 'disabled',
30-
value: {},
31-
},
3228
})
3329
await homeserverYaml.merge(effects, configDefaults)
3430
await homeserverLogConfig.merge(effects, {})

startos/install/versions/v1.146.0.0.b1.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ export const v_1_146_0_0_b1 = VersionInfo.of({
4646
selection: 'other' as const,
4747
value: {
4848
host: configYaml['smtp-host'],
49-
port: configYaml['smtp-port'],
5049
from: configYaml['from-name'],
5150
username: configYaml['smtp-user'],
5251
password: configYaml['smtp-pass'],
53-
security: 'starttls' as const,
52+
security: {
53+
selection: 'starttls' as const,
54+
value: {
55+
port: String(configYaml['smtp-port']) as
56+
| '587'
57+
| '25'
58+
| '2525',
59+
},
60+
},
5461
},
5562
},
5663
},

startos/main.ts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,33 @@ export const main = sdk.setupMain(async ({ effects }) => {
3232
await storeJson.merge(effects, { serverStarted: true })
3333

3434
const smtp = await storeJson.read((s) => s.smtp).const(effects)
35-
if (smtp) {
36-
const creds =
37-
smtp.selection === 'disabled'
38-
? null
39-
: smtp.selection === 'custom'
40-
? smtp.value.provider.value
41-
: await sdk.getSystemSmtp(effects).const()
42-
43-
if (creds) {
44-
const { host, port, from, username, password } = creds
35+
if (smtp && smtp.selection !== 'disabled') {
36+
if (smtp.selection === 'system') {
37+
const creds = await sdk.getSystemSmtp(effects).const()
38+
if (creds) {
39+
await homeserverYaml.merge(effects, {
40+
email: {
41+
enable_notifs: true,
42+
require_transport_security: true,
43+
notif_from: smtp.value.customFrom || creds.from,
44+
smtp_host: creds.host,
45+
smtp_port: creds.port,
46+
smtp_user: creds.username,
47+
smtp_pass: creds.password || undefined,
48+
},
49+
})
50+
}
51+
} else {
52+
const p = smtp.value.provider.value
4553
await homeserverYaml.merge(effects, {
4654
email: {
4755
enable_notifs: true,
4856
require_transport_security: true,
49-
notif_from:
50-
(smtp.selection === 'system' && smtp.value.customFrom) || from,
51-
smtp_host: host,
52-
smtp_port: port,
53-
smtp_user: username,
54-
smtp_pass: password || undefined,
57+
notif_from: p.from,
58+
smtp_host: p.host,
59+
smtp_port: Number(p.security.value.port),
60+
smtp_user: p.username,
61+
smtp_pass: p.password || undefined,
5562
},
5663
})
5764
}

0 commit comments

Comments
 (0)