Skip to content

Commit d57220d

Browse files
committed
beta 48 and i18n
1 parent cfe2252 commit d57220d

File tree

19 files changed

+562
-99
lines changed

19 files changed

+562
-99
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
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.48"
9+
"@start9labs/start-sdk": "0.4.0-beta.48"
1010
},
1111
"devDependencies": {
1212
"@types/node": "^22.19.0",

s9pk.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PACKAGE_ID := $(shell awk -F"'" '/id:/ {print $$2}' startos/manifest.ts)
1+
PACKAGE_ID := $(shell awk -F"'" '/id:/ {print $$2}' startos/manifest/index.ts)
22
INGREDIENTS := $(shell start-cli s9pk list-ingredients 2>/dev/null)
33
ALL_ARCHES ?= x86 arm riscv
44
ALL_TARGETS ?= all_arches

startos/actions/config.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
import { homeserverYaml } from '../fileModels/homeserver.yml'
22
import { storeJson } from '../fileModels/store.json'
3+
import { i18n } from '../i18n'
34
import { sdk } from '../sdk'
45

56
const { InputSpec, Value, Variants, List } = sdk
67

78
export const inputSpec = InputSpec.of({
89
registration: Value.select({
9-
name: 'Registration',
10-
description: `Allow outsiders to create their own accounts on your homeserver. This is not recommended, as it leaves your server vulnerable to attack. It is preferable for you to create accounts on their behalf using your server's admin portal.`,
10+
name: i18n('Registration'),
11+
description: i18n('Allow outsiders to create their own accounts on your homeserver. This is not recommended, as it leaves your server vulnerable to attack. It is preferable for you to create accounts on their behalf using your server\'s admin portal.'),
1112
default: 'disabled',
1213
values: {
13-
disabled: 'Disabled',
14-
enabled: 'Enabled',
14+
disabled: i18n('Disabled'),
15+
enabled: i18n('Enabled'),
1516
},
1617
}),
1718
federation: Value.union({
18-
name: 'Federation',
19+
name: i18n('Federation'),
1920
default: 'disabled',
2021
description:
21-
'If enabled, users on your homeserver will be able to join rooms on other homeservers and vica versa. If disabled, users on your homeserver will only be able to interact with other users and rooms on your homeserver.',
22+
i18n('If enabled, users on your homeserver will be able to join rooms on other homeservers and vica versa. If disabled, users on your homeserver will only be able to interact with other users and rooms on your homeserver.'),
2223
variants: Variants.of({
23-
disabled: { name: 'Disabled', spec: InputSpec.of({}) },
24+
disabled: { name: i18n('Disabled'), spec: InputSpec.of({}) },
2425
enabled: {
25-
name: 'Enabled',
26+
name: i18n('Enabled'),
2627
spec: InputSpec.of({
2728
federation_domain_whitelist: Value.list(
2829
List.text(
2930
{
30-
name: 'Domain Whitelist (optional)',
31+
name: i18n('Domain Whitelist (optional)'),
3132
default: [],
3233
description:
33-
'If you only want your server to federate with specific homeservers and reject all others, enter the server addresses/domains here. If no domains are provided, your server will be capable of federating with all public Matrix servers',
34+
i18n('If you only want your server to federate with specific homeservers and reject all others, enter the server addresses/domains here. If no domains are provided, your server will be capable of federating with all public Matrix servers'),
3435
},
3536
{
3637
placeholder: 'matrix.start9labs.com',
@@ -42,12 +43,12 @@ export const inputSpec = InputSpec.of({
4243
}),
4344
}),
4445
max_upload_size: Value.number({
45-
name: 'Max Upload Size',
46+
name: i18n('Max Upload Size'),
4647
description:
47-
'The maximum file size that is permitted to be uploaded by users to your homeserver.',
48+
i18n('The maximum file size that is permitted to be uploaded by users to your homeserver.'),
4849
required: true,
4950
default: 50,
50-
units: 'MB',
51+
units: i18n('MB'),
5152
integer: true,
5253
min: 1,
5354
max: 2000,
@@ -61,8 +62,8 @@ export const config = sdk.Action.withInput(
6162

6263
// metadata
6364
async ({ effects }) => ({
64-
name: 'Config',
65-
description: 'Configure your Synapse homeserver.',
65+
name: i18n('Config'),
66+
description: i18n('Configure your Synapse homeserver.'),
6667
warning: null,
6768
allowedStatuses: 'any',
6869
group: null,

startos/actions/createBotUser.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1+
import { i18n } from '../i18n'
12
import { sdk } from '../sdk'
23
import { mount } from '../utils'
34

45
const { InputSpec, Value } = sdk
56

67
export const inputSpec = InputSpec.of({
78
username: Value.dynamicText(async () => ({
8-
name: 'Username',
9+
name: i18n('Username'),
910
description:
10-
'The localpart for the bot user (e.g. "mybot" creates @mybot:your.domain)',
11+
i18n('The localpart for the bot user (e.g. "mybot" creates @mybot:your.domain)'),
1112
required: true as const,
1213
default: null,
1314
placeholder: 'mybot',
1415
masked: false,
15-
disabled: 'Provided by the bridge service',
16+
disabled: i18n('Provided by the bridge service'),
1617
})),
1718
password: Value.dynamicText(async () => ({
18-
name: 'Password',
19-
description: 'The password for the bot user',
19+
name: i18n('Password'),
20+
description: i18n('The password for the bot user'),
2021
required: true as const,
2122
default: null,
2223
placeholder: null,
2324
masked: true,
24-
disabled: 'Provided by the bot service',
25+
disabled: i18n('Provided by the bot service'),
2526
})),
2627
})
2728

2829
export const createBotUser = sdk.Action.withInput(
2930
'create-bot-user',
3031

3132
async ({ effects }) => ({
32-
name: 'Create Bot User',
33-
description: 'Create a new bot (non-admin) user account on the homeserver.',
33+
name: i18n('Create Bot User'),
34+
description: i18n('Create a new bot (non-admin) user account on the homeserver.'),
3435
warning: null,
3536
allowedStatuses: 'only-running',
3637
group: null,

startos/actions/deleteAppservice.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { unlink } from 'node:fs/promises'
22
import { homeserverYaml } from '../fileModels/homeserver.yml'
3+
import { i18n } from '../i18n'
34
import { sdk } from '../sdk'
45
import { mountpoint } from '../utils'
56

@@ -22,8 +23,8 @@ export const inputSpec = InputSpec.of({
2223
const keys = Object.keys(values)
2324

2425
return {
25-
name: 'Appservice',
26-
description: 'Select the appservice to remove',
26+
name: i18n('Appservice'),
27+
description: i18n('Select the appservice to remove'),
2728
values,
2829
default: keys[0] || '',
2930
}
@@ -34,10 +35,10 @@ export const deleteAppservice = sdk.Action.withInput(
3435
'delete-appservice',
3536

3637
async ({ effects }) => ({
37-
name: 'Delete Appservice',
38-
description: 'Remove a registered appservice (bridge) from the homeserver.',
38+
name: i18n('Delete Appservice'),
39+
description: i18n('Remove a registered appservice (bridge) from the homeserver.'),
3940
warning:
40-
'This will remove the appservice registration. The bridge service will no longer be able to communicate with Synapse until re-registered.',
41+
i18n('This will remove the appservice registration. The bridge service will no longer be able to communicate with Synapse until re-registered.'),
4142
allowedStatuses: 'any',
4243
group: null,
4344
visibility: 'enabled',

startos/actions/listAppservices.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { YAML } from '@start9labs/start-sdk'
22
import { homeserverYaml } from '../fileModels/homeserver.yml'
3+
import { i18n } from '../i18n'
34
import { sdk } from '../sdk'
45
import { mountpoint } from '../utils'
56

@@ -24,9 +25,9 @@ export const listAppservices = sdk.Action.withoutInput(
2425
'list-appservices',
2526

2627
async ({ effects }) => ({
27-
name: 'List Appservices',
28+
name: i18n('List Appservices'),
2829
description:
29-
'View all registered Matrix appservices (bridges) on this homeserver.',
30+
i18n('View all registered Matrix appservices (bridges) on this homeserver.'),
3031
warning: null,
3132
allowedStatuses: 'any',
3233
group: null,
@@ -41,8 +42,8 @@ export const listAppservices = sdk.Action.withoutInput(
4142
if (files.length === 0) {
4243
return {
4344
version: '1' as const,
44-
title: 'Registered Appservices',
45-
message: 'No appservices are currently registered.',
45+
title: i18n('Registered Appservices'),
46+
message: i18n('No appservices are currently registered.'),
4647
result: null,
4748
}
4849
}
@@ -58,7 +59,7 @@ export const listAppservices = sdk.Action.withoutInput(
5859
const fields: ResultEntry[] = [
5960
{
6061
type: 'single',
61-
name: 'ID',
62+
name: i18n('ID'),
6263
description: null,
6364
value: parsed.id || 'unknown',
6465
masked: false,
@@ -67,7 +68,7 @@ export const listAppservices = sdk.Action.withoutInput(
6768
},
6869
{
6970
type: 'single',
70-
name: 'URL',
71+
name: i18n('URL'),
7172
description: null,
7273
value: parsed.url || 'not configured',
7374
masked: false,
@@ -76,7 +77,7 @@ export const listAppservices = sdk.Action.withoutInput(
7677
},
7778
{
7879
type: 'single',
79-
name: 'Sender Localpart',
80+
name: i18n('Sender Localpart'),
8081
description: null,
8182
value: parsed.sender_localpart || 'unknown',
8283
masked: false,
@@ -85,7 +86,7 @@ export const listAppservices = sdk.Action.withoutInput(
8586
},
8687
{
8788
type: 'single',
88-
name: 'AS Token',
89+
name: i18n('AS Token'),
8990
description: null,
9091
value: parsed.as_token || 'unknown',
9192
masked: true,
@@ -94,7 +95,7 @@ export const listAppservices = sdk.Action.withoutInput(
9495
},
9596
{
9697
type: 'single',
97-
name: 'HS Token',
98+
name: i18n('HS Token'),
9899
description: null,
99100
value: parsed.hs_token || 'unknown',
100101
masked: true,
@@ -103,7 +104,7 @@ export const listAppservices = sdk.Action.withoutInput(
103104
},
104105
{
105106
type: 'single',
106-
name: 'Rate Limited',
107+
name: i18n('Rate Limited'),
107108
description: null,
108109
value: String(parsed.rate_limited ?? 'unknown'),
109110
masked: false,
@@ -115,7 +116,7 @@ export const listAppservices = sdk.Action.withoutInput(
115116
if (parsed.namespaces?.users?.[0]?.regex) {
116117
fields.push({
117118
type: 'single',
118-
name: 'User Namespace',
119+
name: i18n('User Namespace'),
119120
description: null,
120121
value: parsed.namespaces.users[0].regex,
121122
masked: false,
@@ -135,7 +136,7 @@ export const listAppservices = sdk.Action.withoutInput(
135136
type: 'single',
136137
name: subpath,
137138
description: null,
138-
value: 'Error reading registration file',
139+
value: i18n('Error reading registration file'),
139140
masked: false,
140141
copyable: false,
141142
qr: false,
@@ -145,7 +146,7 @@ export const listAppservices = sdk.Action.withoutInput(
145146

146147
return {
147148
version: '1' as const,
148-
title: 'Registered Appservices',
149+
title: i18n('Registered Appservices'),
149150
message: null,
150151
result: {
151152
type: 'group' as const,

startos/actions/registerAppservice.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { homeserverYaml } from '../fileModels/homeserver.yml'
2+
import { i18n } from '../i18n'
23
import { sdk } from '../sdk'
34
import { mountpoint } from '../utils'
45

@@ -8,58 +9,58 @@ const appservicesSubpath = 'appservices'
89

910
export const inputSpec = InputSpec.of({
1011
id: Value.text({
11-
name: 'Appservice ID',
12-
description: 'Unique identifier for this appservice (e.g. "signal")',
12+
name: i18n('Appservice ID'),
13+
description: i18n('Unique identifier for this appservice (e.g. "signal")'),
1314
required: true,
1415
default: null,
1516
placeholder: 'signal',
1617
masked: false,
1718
}),
1819
asToken: Value.text({
19-
name: 'AS Token',
20+
name: i18n('AS Token'),
2021
description:
21-
'Appservice token used by the bridge to authenticate with the homeserver',
22+
i18n('Appservice token used by the bridge to authenticate with the homeserver'),
2223
required: true,
2324
default: null,
2425
placeholder: null,
2526
masked: true,
2627
}),
2728
hsToken: Value.text({
28-
name: 'HS Token',
29+
name: i18n('HS Token'),
2930
description:
30-
'Homeserver token used by the homeserver to authenticate with the bridge',
31+
i18n('Homeserver token used by the homeserver to authenticate with the bridge'),
3132
required: true,
3233
default: null,
3334
placeholder: null,
3435
masked: true,
3536
}),
3637
senderLocalpart: Value.text({
37-
name: 'Sender Localpart',
38-
description: 'The localpart of the bot user (e.g. "signalbot")',
38+
name: i18n('Sender Localpart'),
39+
description: i18n('The localpart of the bot user (e.g. "signalbot")'),
3940
required: true,
4041
default: null,
4142
placeholder: 'signalbot',
4243
masked: false,
4344
}),
4445
url: Value.text({
45-
name: 'Bridge URL',
46+
name: i18n('Bridge URL'),
4647
description:
47-
'The URL where the homeserver can reach the bridge appservice',
48+
i18n('The URL where the homeserver can reach the bridge appservice'),
4849
required: true,
4950
default: null,
5051
placeholder: 'http://mautrix-signal.startos:29328',
5152
masked: false,
5253
}),
5354
rateLimited: Value.toggle({
54-
name: 'Rate Limited',
55+
name: i18n('Rate Limited'),
5556
description:
56-
'Whether requests from this appservice should be rate limited',
57+
i18n('Whether requests from this appservice should be rate limited'),
5758
default: false,
5859
}),
5960
userNamespaceRegex: Value.text({
60-
name: 'User Namespace Regex',
61+
name: i18n('User Namespace Regex'),
6162
description:
62-
'Regex pattern for user IDs managed by this appservice (e.g. "@signal_.*:.*")',
63+
i18n('Regex pattern for user IDs managed by this appservice (e.g. "@signal_.*:.*")'),
6364
required: true,
6465
default: null,
6566
placeholder: '@signal_.*:.*',
@@ -71,9 +72,9 @@ export const registerAppservice = sdk.Action.withInput(
7172
'register-appservice',
7273

7374
async ({ effects }) => ({
74-
name: 'Register Appservice',
75+
name: i18n('Register Appservice'),
7576
description:
76-
'Register a Matrix appservice (bridge) with the homeserver. This is typically triggered automatically by bridge services.',
77+
i18n('Register a Matrix appservice (bridge) with the homeserver. This is typically triggered automatically by bridge services.'),
7778
warning: null,
7879
allowedStatuses: 'any',
7980
group: null,

0 commit comments

Comments
 (0)