A full-featured download manager.
feat(server): support custom access passwords (#2529)
Dr_rOotc601dcf41d82
diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.ymlindex 6b68f94f..c8e2d338 100644--- a/.github/workflows/flatpak.yml+++ b/.github/workflows/flatpak.yml@@ -206,6 +206,10 @@ jobs:container:image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-25.08@sha256:e3d9fbd75c7e5ce6241fb9114f59dce2156315f5977b594ea75fc97c3d364dfaoptions: --privileged+ # SDK updates rename deployments, which can fail with EXDEV on overlayfs.+ # Docker seeds this job-local volume with the image's installed runtimes.+ volumes:+ - /var/lib/flatpaktimeout-minutes: 90strategy:fail-fast: falsediff --git a/docs/docker-server.md b/docs/docker-server.mdindex 6b0c848d..3a938bf2 100644--- a/docs/docker-server.md+++ b/docs/docker-server.md@@ -396,6 +396,46 @@ The same token is reused across restart and image replacement. You may set`MOTRIX_OPERATOR_TOKEN` instead, but environment variables are visible incontainer metadata; the generated file is the safer single-host default.+After signing in, open **Settings → Advanced → Access password → Change password**+and enter the current password, new password, and confirmation in the dialog,+then select **Update password** in the footer. Alternatively, run the+CLI inside the running container; input is hidden and requested twice:++```bash+docker compose exec server motrix-admin token set+```++Scripts can provide one line through standard input, keeping the token out of+command arguments and shell history:++```bash+docker compose exec -T server motrix-admin token set --stdin --json < /secure/new-token.txt+```++Weak tokens produce a warning but can still be saved. There is no required mix+of uppercase, lowercase, numbers, or symbols; Unicode and spaces are supported.+Only blank values, control characters, and inputs longer than 1,024 UTF-16 code+units are rejected. The CLI removes one trailing line ending from stdin and+preserves spaces in the token. The new token atomically replaces `operator-token`+at mode `0600`, takes effect immediately, and survives restarts. The old token and+other sessions stop working. A Web change keeps the current browser session;+a CLI change signs out all existing sessions. Downloads are not removed or+interrupted. If a network failure leaves the outcome uncertain, read the token+file on the host before retrying. A forgotten token can also be recovered from+that file without clearing download data.++When `MOTRIX_OPERATOR_TOKEN` is set, Web and CLI explain that the credential is+deployment-managed. Change the environment variable and restart the server;+it always takes precedence over the file. Native fnOS and Synology packages+continue to authenticate through NAS accounts and do not expose a separate+administrator-token setting.++Login and HTTP credential verification are limited by connection source IP:+after 20 failures within a minute, verification pauses until the window expires.+Clients behind a reverse proxy may share the same source IP. Ordinary ASCII+tokens still support Bearer authentication. Tokens containing spaces or non-ASCII+characters support HTTP Basic with an empty username; the CLI selects this automatically.+If the Web approval URL is unavailable, an operator connected over SSH canapprove the exact device code from inside the running container. The commanduses the existing operator credential over container loopback; it never prints@@ -745,7 +785,7 @@ detection.| Port is already allocated | Change `MOTRIX_HTTP_PORT` or `MOTRIX_MDXP_PUBLIC_PORT`, and update `MOTRIX_PUBLIC_URL` if the Web port changes. || Web UI is healthy but port 16801 refuses connections | Look for `bridge data ownership unavailable` and inspect its `stage` and `reason` fields. If ownership is ready, verify the MDXP publish address and all four remote Extension variables. || External aria2 RPC client cannot connect | Confirm `MOTRIX_ARIA2_RPC_LISTEN_ALL=true`, a non-empty matching RPC secret, the correct 16800 mapping (or configured RPC port), and the host firewall. The standard Compose files do not publish this port. |-| Web UI opens but unlock fails | Read the current persistent `/data/operator-token`; do not use a token copied from another deployment. Verify the file is regular, base64url text, and mode `0600`. |+| Web UI opens but unlock fails | Read the current persistent `/data/operator-token`; do not use a token copied from another deployment. Verify the file is regular, contains a nonblank single-line token, and has mode `0600`; environment configuration takes precedence. Wait a minute after too many attempts. || Download directory is rejected or files are missing from the NAS share | Use an absolute container path below `MOTRIX_ALLOWED_SAVE_DIRS`; verify the intended host directory is mounted at that exact path and writable by the runtime UID/GID. || Plugin install fails | Inspect `/api/diagnostics` and logs, retain `/data`, confirm package/source trust and network/TLS access, and mount any `MOTRIX_PLUGIN_IMPORT_DIRS` explicitly. Do not enable unmanaged plugins for a normal `.moext`, URL, or registry install. || Container is unhealthy after an upgrade | Inspect logs and diagnostics, verify both mounts, then roll back to the recorded immutable image and matching `/data` backup. |diff --git a/docs/docker-server.zh-CN.md b/docs/docker-server.zh-CN.mdindex ef4a2a9c..17916b41 100644--- a/docs/docker-server.zh-CN.md+++ b/docs/docker-server.zh-CN.md@@ -351,6 +351,35 @@ cat motrix-data/operator-token重启或替换镜像时会继续使用同一 token。也可以设置 `MOTRIX_OPERATOR_TOKEN`,但环境变量能从容器元数据中看到;单机部署默认使用生成文件更安全。+登录 WebUI 后,可以在 **设置 → 高级 → 访问密码 → 修改密码** 中输入当前密码、+新密码和确认值,然后点击“更新密码”。也可以在运行中的容器内使用 CLI,默认隐藏输入并要求再次输入:++```bash+docker compose exec server motrix-admin token set+```++脚本可以通过标准输入提供一行令牌,避免把令牌放入命令参数或 shell 历史:++```bash+docker compose exec -T server motrix-admin token set --stdin --json < /secure/new-token.txt+```++弱令牌只显示提醒,不阻止保存;不要求大小写、数字或符号组合,支持中文和含空格的+短语。只拒绝空白值、控制字符和超过 1,024 个 UTF-16 代码单元的输入。+CLI 会移除标准输入末尾的一个换行符,令牌本身的空格会保留。+新令牌以 `0600` 权限原子写入原来的 `operator-token` 文件,立即生效并在重启后保留。+旧令牌及其他登录会话失效;Web 修改时当前浏览器会话保持登录,CLI 修改时所有旧会话+均退出。下载任务不会被删除或中断。若保存结果因断网无法确认,先读取主机上的令牌+文件再重试;忘记令牌也可以从该文件找回,无须清空下载数据。++若设置了 `MOTRIX_OPERATOR_TOKEN`,Web 和 CLI 会提示该凭据由部署配置管理;+请修改环境变量并重启服务器。此设置始终优先于文件。飞牛和群晖原生版继续使用 NAS+账号验证,不提供独立的管理员令牌设置。++登录和 HTTP 凭据验证按连接来源 IP 限流:一分钟内失败 20 次后暂停验证,窗口结束后+恢复。反向代理后的客户端可能共享同一来源 IP。普通 ASCII 令牌可继续使用 Bearer+认证;含空格或非 ASCII 字符的令牌可使用空用户名的 HTTP Basic 认证,CLI 自动选择。+当 Web 审批 URL 暂时不可用时,通过 SSH 连接的 operator 可以在运行中的容器里批准指定的 device code。该命令只通过容器 loopback 使用现有 operatorcredential,不会输出该 credential 或客户端 token:@@ -634,7 +663,7 @@ secret-store 状态和 FFmpeg 探测结果。| 端口已分配 | 修改 `MOTRIX_HTTP_PORT` 或 `MOTRIX_MDXP_PUBLIC_PORT`;Web 端口变化时同步更新 `MOTRIX_PUBLIC_URL`。 || Web 界面健康但连接 16801 被拒绝 | 查找 `bridge data ownership unavailable`,检查日志中的 `stage` 和 `reason` 字段。ownership 就绪时,再核对 MDXP 发布地址和四个远程 Extension 变量。 || 外部 aria2 RPC 客户端无法连接 | 确认 `MOTRIX_ARIA2_RPC_LISTEN_ALL=true`、RPC secret 非空且匹配、16800(或自定义 RPC 端口)映射正确,并检查宿主 firewall。标准 Compose 文件不会发布该端口。 |-| Web 能打开但无法解锁 | 读取当前持久化 `/data/operator-token`,不要使用另一套部署的 token。确认它是普通文件、内容为 base64url 文本且权限为 `0600`。 |+| Web 能打开但无法解锁 | 读取当前持久化 `/data/operator-token`,不要使用另一套部署的 token。确认它是普通文件、内容为非空白单行令牌且权限为 `0600`;环境变量配置优先。尝试过多时等待一分钟再试。 || 下载目录被拒绝或 NAS 共享目录中没有文件 | 使用 `MOTRIX_ALLOWED_SAVE_DIRS` 下的绝对容器路径;确认目标宿主目录正好挂载到该路径,并允许 runtime UID/GID 写入。 || 插件安装失败 | 检查 `/api/diagnostics` 与日志,保留 `/data`,核实包/来源可信且网络/TLS 可达;显式挂载所有 `MOTRIX_PLUGIN_IMPORT_DIRS`。正常 `.moext`、URL 或 registry 安装不要开启 unmanaged plugins。 || 升级后容器 unhealthy | 检查日志、诊断和两个挂载,然后回滚到已记录的不可变镜像及其配套 `/data` 备份。 |diff --git a/public/favicon.ico b/public/favicon.icoindex 03e9ec2f..9fb94ab1 100644Binary files a/public/favicon.ico and b/public/favicon.ico differdiff --git a/scripts/vite-app-locales.ts b/scripts/vite-app-locales.tsindex 8556e748..77dc481d 100644--- a/scripts/vite-app-locales.ts+++ b/scripts/vite-app-locales.ts@@ -16,6 +16,8 @@ export function appLocaleProjection(delete catalog.operatorAdminif (host === 'renderer')return { code: JSON.stringify(catalog), map: null }+ // Password settings and their validation are rendered only in the Web UI.+ delete catalog.operatorTokenconst creator = catalog.createTorrent as| Record<string, unknown>| undefineddiff --git a/src/renderer/components/operator-unlock-gate.test.tsx b/src/renderer/components/operator-unlock-gate.test.tsxindex fa287136..e3fc6551 100644--- a/src/renderer/components/operator-unlock-gate.test.tsx+++ b/src/renderer/components/operator-unlock-gate.test.tsx@@ -47,10 +47,10 @@ describe('OperatorUnlockGate', () => {.mockResolvedValueOnce(new Response('{}')).mockResolvedValueOnce(reply(true))render(<OperatorUnlockGate>{child}</OperatorUnlockGate>)- fireEvent.change(await screen.findByPlaceholderText('Operator token'), {+ fireEvent.change(await screen.findByPlaceholderText('Access password'), {target: { value: 'machine-token' },})- fireEvent.click(screen.getByRole('button', { name: 'Unlock' }))+ fireEvent.click(screen.getByRole('button', { name: 'Sign in' }))expect(await screen.findByTestId('app')).toBeTruthy()expect(fetchMock.mock.calls[1][1].body).toBe(JSON.stringify({ token: 'machine-token' })@@ -61,11 +61,23 @@ describe('OperatorUnlockGate', () => {.mockResolvedValueOnce(reply(false)).mockResolvedValueOnce(new Response('{}', { status: 401 }))render(<OperatorUnlockGate>{child}</OperatorUnlockGate>)- fireEvent.change(await screen.findByPlaceholderText('Operator token'), {+ fireEvent.change(await screen.findByPlaceholderText('Access password'), {target: { value: 'bad' },})- fireEvent.click(screen.getByRole('button', { name: 'Unlock' }))- expect(await screen.findByText(/Invalid operator token/)).toBeTruthy()+ fireEvent.click(screen.getByRole('button', { name: 'Sign in' }))+ expect(await screen.findByText(/Incorrect password/)).toBeTruthy()+ })+ it('explains rate limiting instead of reporting a correct token as invalid', async () => {+ fetchMock+ .mockResolvedValueOnce(reply(false))+ .mockResolvedValueOnce(new Response('{}', { status: 429 }))+ render(<OperatorUnlockGate>{child}</OperatorUnlockGate>)+ fireEvent.change(await screen.findByPlaceholderText('Access password'), {+ target: { value: 'test' },+ })+ fireEvent.click(screen.getByRole('button', { name: 'Sign in' }))+ expect(await screen.findByText(/Too many attempts/)).toBeTruthy()+ expect(screen.queryByTestId('app')).toBeNull()})it('offers retry for an unreachable server without pretending the session was revoked', async () => {fetchMock@@ -98,5 +110,5 @@ it('shows a safe DSM failure code while keeping the app locked without requestinawait screen.findByText('session / commandFailed / exit / 5')).toBeTruthy()expect(screen.queryByTestId('app')).toBeNull()- expect(screen.queryByPlaceholderText('Operator token')).toBeNull()+ expect(screen.queryByPlaceholderText('Access password')).toBeNull()})diff --git a/src/renderer/components/operator-unlock-gate.tsx b/src/renderer/components/operator-unlock-gate.tsxindex 5b312cbe..38fb8593 100644--- a/src/renderer/components/operator-unlock-gate.tsx+++ b/src/renderer/components/operator-unlock-gate.tsx@@ -46,7 +46,7 @@ function WebGate({ children }: { children: ReactNode }) {(s) => s.status?.nasUnavailableDownloadRoots)const [token, setToken] = useState('')- const [error, setError] = useState(false)+ const [error, setError] = useState<'invalid' | 'rateLimited' | null>(null)const [busy, setBusy] = useState(false)useEffect(() => {@@ -103,11 +103,14 @@ function WebGate({ children }: { children: ReactNode }) {e.preventDefault()if (!token.trim() || busy) returnsetBusy(true)- setError(false)- const ok = await operatorLogin(token.trim())+ setError(null)+ let limited = false+ const ok = await operatorLogin(token, (status) => {+ limited = status === 429+ })setBusy(false)if (ok) setToken('')- else setError(true)+ else setError(limited ? 'rateLimited' : 'invalid')}return (@@ -116,6 +119,12 @@ function WebGate({ children }: { children: ReactNode }) {onSubmit={onSubmit}className="w-full max-w-sm space-y-4 rounded-lg border border-border p-6">+ <input+ type="hidden"+ name="username"+ autoComplete="username"+ value="operator"+ /><div className="space-y-1"><h1 className="text-lg font-semibold text-foreground">{t('operatorUnlock.title')}@@ -125,16 +134,22 @@ function WebGate({ children }: { children: ReactNode }) {</p></div><input+ id="operator-token"+ name="operator-token"type="password"value={token}onChange={(e) => setToken(e.target.value)}placeholder={t('operatorUnlock.placeholder')}- autoComplete="off"+ autoComplete="current-password"className="w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"/>{error && (<p className="text-sm text-destructive">- {t('operatorUnlock.error')}+ {t(+ error === 'rateLimited'+ ? 'operatorToken.rateLimited'+ : 'operatorUnlock.error'+ )}</p>)}<Buttondiff --git a/src/renderer/lib/operator-auth.ts b/src/renderer/lib/operator-auth.tsindex d3091ab8..130f4bac 100644--- a/src/renderer/lib/operator-auth.ts+++ b/src/renderer/lib/operator-auth.ts@@ -3,6 +3,10 @@ import {type OperatorStatus,operatorStatusSchema,} from '@shared/schemas/operator-auth'+import {+ type ChangeOperatorTokenResult,+ changeOperatorTokenResultSchema,+} from '@shared/schemas/operator-token'import { create } from 'zustand'import { webBaseUrl } from './web-base-url'@@ -130,7 +134,10 @@ export async function getOperatorStatus(): Promise<boolean> {return useOperatorSession.getState().state === 'authenticated'}-export async function operatorLogin(token: string): Promise<boolean> {+export async function operatorLogin(+ token: string,+ onFailure?: (status: number) => void+): Promise<boolean> {const epoch = useOperatorSession.getState().epoch + 1statusRequest += 1useOperatorSession.setState({ epoch })@@ -141,7 +148,11 @@ export async function operatorLogin(token: string): Promise<boolean> {credentials: 'same-origin',body: JSON.stringify({ token }),})- if (!res.ok || epoch !== useOperatorSession.getState().epoch) return false+ if (epoch !== useOperatorSession.getState().epoch) return false+ if (!res.ok) {+ onFailure?.(res.status)+ return false+ }await refreshOperatorSession(epoch)hints?.postMessage('changed')return useOperatorSession.getState().state === 'authenticated'@@ -173,3 +184,27 @@ export async function operatorLogout(): Promise<void> {throw error}}++export async function changeOperatorToken(+ currentToken: string,+ newToken: string+): Promise<ChangeOperatorTokenResult> {+ const res = await fetch(`${base}/rpc/auth/token`, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ credentials: 'same-origin',+ cache: 'no-store',+ body: JSON.stringify({ currentToken, newToken }),+ })+ const parsed = changeOperatorTokenResultSchema.safeParse(await res.json())+ if (!parsed.success) {+ if (res.status === 401) await refreshOperatorSession()+ throw new Error('Token change outcome unknown')+ }+ if (parsed.data.ok) {+ if (!res.ok) throw new Error('Token change outcome unknown')+ hints?.postMessage('changed')+ void refreshOperatorSession()+ }+ return parsed.data+}diff --git a/src/renderer/routes/settings/cards/advanced-dialog.tsx b/src/renderer/routes/settings/cards/advanced-dialog.tsxindex 3117e38a..a97a6bed 100644--- a/src/renderer/routes/settings/cards/advanced-dialog.tsx+++ b/src/renderer/routes/settings/cards/advanced-dialog.tsx@@ -56,6 +56,7 @@ import { useEffect, useId, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { useNavigate } from 'react-router'import type { SettingsCardDialogProps } from './card-types'+import { OperatorTokenSection } from './operator-token-section'import { SettingsFileSection } from './settings-file-section'import { advancedFormSchema } from './settings-form-schemas'@@ -507,6 +508,7 @@ export function AdvancedDialog({</Form><Separator className="my-4" /><SettingsFileSection />+ {__MOTRIX_TARGET__ === 'web' && <OperatorTokenSection />}{__MOTRIX_TARGET__ === 'electron' && (<><Separator className="my-4" />diff --git a/src/renderer/routes/settings/cards/operator-token-section.test.tsx b/src/renderer/routes/settings/cards/operator-token-section.test.tsxnew file mode 100644index 00000000..8892d8de--- /dev/null+++ b/src/renderer/routes/settings/cards/operator-token-section.test.tsx@@ -0,0 +1,157 @@+import '@test-utils/dom-animations'+import '@testing-library/jest-dom/vitest'+import {+ Dialog,+ DialogContent,+ DialogTitle,+} from '@renderer/components/ui/dialog'+import { i18n } from '@renderer/lib/i18n'+import {+ changeOperatorToken,+ useOperatorSession,+} from '@renderer/lib/operator-auth'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { useState } from 'react'+import { afterEach, beforeEach, expect, it, vi } from 'vitest'+import { OperatorTokenSection } from './operator-token-section'++vi.mock('@renderer/lib/operator-auth', async (original) => ({+ ...(await original<typeof import('@renderer/lib/operator-auth')>()),+ changeOperatorToken: vi.fn(),+}))+beforeEach(async () => {+ await i18n.changeLanguage('en-US')+ useOperatorSession.setState({+ state: 'authenticated',+ status: {+ authed: true,+ mode: 'cookie',+ canLogout: true,+ tokenSource: 'file',+ },+ })+ vi.mocked(changeOperatorToken).mockReset()+})+afterEach(cleanup)++function Harness() {+ const [open, setOpen] = useState(true)+ return (+ <Dialog open={open} onOpenChange={setOpen}>+ <DialogContent>+ <DialogTitle>Advanced settings</DialogTitle>+ <OperatorTokenSection />+ </DialogContent>+ </Dialog>+ )+}++async function edit(next = '1', confirmation = next) {+ render(<Harness />)+ const user = userEvent.setup()+ await user.click(screen.getByRole('button', { name: 'Change password' }))+ fireEvent.change(screen.getByLabelText('Current password'), {+ target: { value: 'original' },+ })+ fireEvent.change(screen.getByLabelText('New password'), {+ target: { value: next },+ })+ fireEvent.blur(screen.getByLabelText('New password'))+ fireEvent.change(screen.getByLabelText('Confirm new password'), {+ target: { value: confirmation },+ })+ return user+}++it('warns about a weak token but saves it without another confirmation', async () => {+ vi.mocked(changeOperatorToken).mockResolvedValue({ ok: true })+ const user = await edit()+ expect(screen.getByText(/public internet/)).toBeVisible()+ await user.click(screen.getByRole('button', { name: 'Update password' }))+ expect(changeOperatorToken).toHaveBeenCalledWith('original', '1')+ expect(await screen.findByRole('status')).toHaveTextContent(+ 'Access password updated'+ )+ expect(screen.queryByLabelText('New password')).toBeNull()+})++it('does not send mismatched entries and lets the user correct them', async () => {+ const user = await edit('one', 'two')+ await user.click(screen.getByRole('button', { name: 'Update password' }))+ expect(await screen.findByText('The passwords do not match.')).toBeVisible()+ expect(changeOperatorToken).not.toHaveBeenCalled()+})++it('reports a failed write without dismissing the form or claiming success', async () => {+ vi.mocked(changeOperatorToken).mockResolvedValue({+ ok: false,+ reason: 'unavailable',+ })+ const user = await edit()+ await user.click(screen.getByRole('button', { name: 'Update password' }))+ expect(await screen.findByRole('alert')).toHaveTextContent(+ 'current password still works'+ )+ expect(screen.getByLabelText('New password')).toHaveValue('1')+})++it('shows deployment guidance for environment tokens and hides the section for NAS', () => {+ useOperatorSession.setState({+ status: {+ authed: true,+ mode: 'cookie',+ canLogout: true,+ tokenSource: 'env',+ },+ })+ const view = render(<Harness />)+ expect(screen.getByText(/managed by the server administrator/)).toBeVisible()+ expect(screen.queryByRole('button', { name: 'Change password' })).toBeNull()+ view.unmount()+ useOperatorSession.setState({+ status: { authed: true, mode: 'synologyDsm', canLogout: false },+ })+ render(<Harness />)+ expect(screen.queryByText('Access password')).toBeNull()+})++it('adds its own backdrop and discards only its draft on cancel, restoring trigger focus', async () => {+ const user = await edit()+ expect(document.querySelectorAll('[role=dialog]')).toHaveLength(2)+ expect(document.querySelectorAll('[data-slot=dialog-overlay]')).toHaveLength(+ 2+ )+ await user.click(screen.getByRole('button', { name: 'Cancel' }))+ expect(screen.queryByLabelText('New password')).toBeNull()+ expect(+ screen.getByRole('dialog', { name: 'Advanced settings' })+ ).toBeVisible()+ expect(changeOperatorToken).not.toHaveBeenCalled()+ expect(screen.getByRole('button', { name: 'Change password' })).toHaveFocus()+ await user.click(screen.getByRole('button', { name: 'Change password' }))+ expect(screen.getByLabelText('Current password')).toHaveValue('')+ expect(screen.getByLabelText('New password')).toHaveValue('')+ expect(screen.queryByText(/public internet/)).toBeNull()+})++it('does not show weakness feedback until the new password field loses focus', async () => {+ render(<Harness />)+ const user = userEvent.setup()+ await user.click(screen.getByRole('button', { name: 'Change password' }))+ fireEvent.change(screen.getByLabelText('New password'), {+ target: { value: '1' },+ })+ expect(screen.queryByText(/public internet/)).toBeNull()+ fireEvent.blur(screen.getByLabelText('New password'))+ expect(screen.getByText(/public internet/)).toBeVisible()+})++it('Escape dismisses the password dialog while keeping the parent open', async () => {+ const user = await edit()+ await user.keyboard('{Escape}')+ expect(screen.queryByLabelText('New password')).toBeNull()+ expect(+ screen.getByRole('dialog', { name: 'Advanced settings' })+ ).toBeVisible()+})diff --git a/src/renderer/routes/settings/cards/operator-token-section.tsx b/src/renderer/routes/settings/cards/operator-token-section.tsxnew file mode 100644index 00000000..0885f206--- /dev/null+++ b/src/renderer/routes/settings/cards/operator-token-section.tsx@@ -0,0 +1,257 @@+import { zodResolver } from '@hookform/resolvers/zod'+import { Button } from '@renderer/components/ui/button'+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from '@renderer/components/ui/dialog'+import {+ Form,+ FormControl,+ FormField,+ FormItem,+ FormLabel,+ FormMessage,+} from '@renderer/components/ui/form'+import { PasswordInput } from '@renderer/components/ui/password-input'+import { Separator } from '@renderer/components/ui/separator'+import {+ changeOperatorToken,+ useOperatorSession,+} from '@renderer/lib/operator-auth'+import {+ changeOperatorTokenSchema,+ isWeakOperatorToken,+} from '@shared/schemas/operator-token'+import { useEffect, useId, useRef, useState } from 'react'+import { useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { z } from 'zod'++const schema = changeOperatorTokenSchema+ .extend({+ currentToken: z.string().min(1).max(4096),+ confirmation: z.string(),+ })+ .refine((value) => value.newToken === value.confirmation, {+ path: ['confirmation'],+ })+type Fields = z.infer<typeof schema>++export function OperatorTokenSection() {+ const [editing, onEditingChange] = useState(false)+ const { t } = useTranslation()+ const source = useOperatorSession((state) => state.status?.tokenSource)+ const [saved, setSaved] = useState(false)+ const titleId = useId()+ const trigger = useRef<HTMLButtonElement>(null)+ const wasEditing = useRef(editing)+ useEffect(() => {+ if (wasEditing.current && !editing) trigger.current?.focus()+ wasEditing.current = editing+ }, [editing])+ if (!source) return null+ return (+ <>+ <Separator className="my-4" />+ <section aria-labelledby={titleId}>+ <div className="flex items-center justify-between gap-4">+ <h3 id={titleId} className="text-sm font-semibold">+ {t('operatorToken.title')}+ </h3>+ {source === 'file' && (+ <Button+ ref={trigger}+ type="button"+ size="sm"+ variant="outline"+ onClick={() => {+ setSaved(false)+ onEditingChange(true)+ }}+ >+ {t('operatorToken.change')}+ </Button>+ )}+ </div>+ {source === 'env' && (+ <p className="mt-1 text-xs text-muted-foreground">+ {t('operatorToken.managed')}+ </p>+ )}+ {saved && (+ <p role="status" className="mt-1 text-xs text-muted-foreground">+ {t('operatorToken.saved')}+ </p>+ )}+ {editing && source === 'file' && (+ <TokenDialog+ onClose={() => onEditingChange(false)}+ onSaved={() => {+ setSaved(true)+ onEditingChange(false)+ }}+ />+ )}+ </section>+ </>+ )+}++function TokenDialog({+ onClose,+ onSaved,+}: {+ onClose: () => void+ onSaved: () => void+}) {+ const { t } = useTranslation()+ const id = useId()+ const [error, setError] = useState<string | null>(null)+ const [touched, setTouched] = useState(false)+ const form = useForm<Fields>({+ resolver: async (values, context, options) => {+ const result = await zodResolver(schema)(values, context, options)+ for (const name of [+ 'currentToken',+ 'newToken',+ 'confirmation',+ ] as const) {+ const error = result.errors[name]+ if (error) {+ const key =+ name === 'confirmation'+ ? 'mismatch'+ : values[name].trim().length === 0+ ? name === 'currentToken'+ ? 'requiredCurrent'+ : 'requiredNew'+ : values[name].length > 1024+ ? 'tooLong'+ : 'invalid'+ error.message = t(`operatorToken.${key}`)+ }+ }+ return result+ },+ defaultValues: { currentToken: '', newToken: '', confirmation: '' },+ })+ const newToken = form.watch('newToken')+ const weak = touched && newToken.length > 0 && isWeakOperatorToken(newToken)+ const busy = form.formState.isSubmitting+ const submit = form.handleSubmit(async ({ currentToken, newToken: next }) => {+ setError(null)+ try {+ const result = await changeOperatorToken(currentToken, next)+ if (result.ok) {+ form.reset()+ onSaved()+ } else setError(result.reason)+ } catch {+ setError('unknown')+ }+ })+ return (+ <Dialog+ open+ disablePointerDismissal+ onOpenChange={(next, details) => {+ if (!next) {+ if (busy) details.cancel()+ else onClose()+ }+ }}+ >+ <DialogContent+ forceRenderOverlay+ showCloseButton={!busy}+ className="flex max-h-[calc(100dvh-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-md"+ >+ <DialogHeader className="shrink-0 px-6 pt-6">+ <DialogTitle>{t('operatorToken.change')}</DialogTitle>+ <DialogDescription>{t('operatorToken.effect')}</DialogDescription>+ </DialogHeader>+ <Form {...form}>+ <form onSubmit={submit} className="flex min-h-0 flex-col">+ <div className="space-y-3 overflow-y-auto px-6 py-4">+ <input+ type="hidden"+ name="username"+ autoComplete="username"+ value="operator"+ />+ {(['currentToken', 'newToken', 'confirmation'] as const).map(+ (name) => (+ <FormField+ key={name}+ control={form.control}+ name={name}+ render={({ field, fieldState }) => (+ <FormItem>+ <FormLabel>{t(`operatorToken.${name}`)}</FormLabel>+ <FormControl>+ <PasswordInput+ {...field}+ disabled={busy}+ onBlur={() => {+ field.onBlur()+ if (name === 'newToken') setTouched(true)+ }}+ autoComplete={+ name === 'currentToken'+ ? 'current-password'+ : 'new-password'+ }+ showPasswordLabel={t('common.showPassword')}+ hidePasswordLabel={t('common.hidePassword')}+ aria-describedby={+ name === 'newToken' && weak+ ? `${id}-hint`+ : undefined+ }+ />+ </FormControl>+ {name === 'newToken' && weak && (+ <p+ id={`${id}-hint`}+ className="text-xs text-muted-foreground"+ aria-live="polite"+ >+ {t('operatorToken.weak')}+ </p>+ )}+ {fieldState.error && <FormMessage />}+ </FormItem>+ )}+ />+ )+ )}+ {error && (+ <p role="alert" className="text-xs text-destructive">+ {t(`operatorToken.${error}`)}+ </p>+ )}+ </div>+ <DialogFooter className="shrink-0 border-t px-6 py-4">+ <Button+ type="button"+ size="sm"+ variant="outline"+ disabled={busy}+ onClick={onClose}+ >+ {t('common.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={busy}>+ {t(busy ? 'operatorToken.saving' : 'operatorToken.update')}+ </Button>+ </DialogFooter>+ </form>+ </Form>+ </DialogContent>+ </Dialog>+ )+}diff --git a/src/server/http/operator-auth.test.ts b/src/server/http/operator-auth.test.tsindex 161e81af..05513759 100644--- a/src/server/http/operator-auth.test.ts+++ b/src/server/http/operator-auth.test.ts@@ -158,8 +158,7 @@ describe('operator auth gate', () => {expect(last).toBe(429)})- it('a correct token still logs in after the failure window is saturated (no DoS)', async () => {- // An attacker flooding wrong tokens must not lock out the operator.+ it('throttles guesses before comparison without blocking a different client', async () => {for (let i = 0; i < 30; i++) {await app.inject({method: 'POST',@@ -172,8 +171,14 @@ describe('operator auth gate', () => {url: '/rpc/auth/login',payload: { token: TOKEN },})- expect(ok.statusCode).toBe(200)- expect(ok.headers['set-cookie']).toBeDefined()+ expect(ok.statusCode).toBe(429)+ const other = await app.inject({+ method: 'POST',+ url: '/rpc/auth/login',+ remoteAddress: '127.0.0.2',+ payload: { token: TOKEN },+ })+ expect(other.statusCode).toBe(200)})})diff --git a/src/server/http/operator-auth.ts b/src/server/http/operator-auth.tsindex 3e31e025..218dce0c 100644--- a/src/server/http/operator-auth.ts+++ b/src/server/http/operator-auth.ts@@ -3,6 +3,7 @@ import type {ClientPairingCapabilities,OperatorStatus,} from '@shared/schemas/operator-auth'+import { changeOperatorTokenSchema } from '@shared/schemas/operator-token'import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'/**@@ -36,6 +37,8 @@ export interface OperatorAuthOptions {* and the control plane never depends on the (non-fatal) bridge bootstrap.*/operatorToken: string+ tokenSource?: 'file' | 'env'+ persistToken?: (token: string) => Promise<void>/** Public operator URL advertised by MOTRIX_PUBLIC_URL. Cookie-authenticated* event WebSockets must present this exact URL origin; scripts using Bearer* authentication remain independent of browser Origin semantics. */@@ -73,8 +76,13 @@ function parseCookies(header: string | undefined): Record<string, string> {function bearerToken(req: FastifyRequest): string | null {const h = req.headers.authorization- if (typeof h !== 'string' || !h.startsWith('Bearer ')) return null- return h.slice(7)+ if (typeof h !== 'string') return null+ if (h.startsWith('Bearer ')) return h.slice(7)+ if (h.startsWith('Basic ')) {+ const decoded = Buffer.from(h.slice(6), 'base64').toString('utf8')+ if (decoded.startsWith(':')) return decoded.slice(1)+ }+ return null}function isSecure(req: FastifyRequest): boolean {@@ -144,7 +152,12 @@ function deny(const isUpgrade = isWebSocketUpgrade(req)if (isUpgrade) {reply.hijack()- const text = code === 403 ? 'Forbidden' : 'Unauthorized'+ const text =+ code === 429+ ? 'Too Many Requests'+ : code === 403+ ? 'Forbidden'+ : 'Unauthorized'req.raw.socket.write(`HTTP/1.1 ${code} ${text}\r\nConnection: close\r\nContent-Length: 0\r\n\r\n`)@@ -197,16 +210,43 @@ export function registerOperatorAuth(opts: OperatorAuthOptions): OperatorSessionPolicy {const now = opts.now ?? Date.now+ let operatorToken = opts.operatorToken+ let generation = 0+ let rotation: Promise<unknown> = Promise.resolve()const publicOrigin = configuredPublicOrigin(opts.publicUrl)const sessions = new Map<string, number>() // sessionId -> expiresAtconst sessionSockets = new Map<string, Set<SessionSocket>>()+ const bearerSockets = new Set<SessionSocket>()const revoke = (id: string): void => {sessions.delete(id)const sockets = sessionSockets.get(id)sessionSockets.delete(id)for (const socket of sockets ?? []) socket.close(4401, 'Session expired')}- let failedLogins: number[] = [] // timestamps of FAILED attempts only+ // Weak custom credentials need throttling before comparison, including direct+ // HTTP credentials. Bound memory and use the socket IP (not forwarded headers).+ const failures = new Map<string, { count: number; until: number }>()+ const limited = (req: FastifyRequest): boolean => {+ for (const [ip, entry] of failures) {+ if (entry.until <= now()) failures.delete(ip)+ }+ const entry = failures.get(req.ip)+ return entry ? entry.count >= LOGIN_MAX : failures.size >= 256+ }+ const verify = (req: FastifyRequest, token: string): boolean => {+ if (limited(req)) return false+ if (token && safeEqual(token, operatorToken)) {+ failures.delete(req.ip)+ return true+ }+ const entry = failures.get(req.ip) ?? {+ count: 0,+ until: now() + LOGIN_WINDOW_MS,+ }+ entry.count += 1+ failures.set(req.ip, entry)+ return false+ }const validSession = (id: string | undefined, renew = true): boolean => {if (!id) return false@@ -222,7 +262,7 @@ export function registerOperatorAuth(const authenticate = (req: FastifyRequest): 'bearer' | 'cookie' | null => {const tok = bearerToken(req)- if (tok && safeEqual(tok, opts.operatorToken)) return 'bearer'+ if (tok && verify(req, tok)) return 'bearer'return validSession(parseCookies(req.headers.cookie)[COOKIE])? 'cookie': null@@ -264,7 +304,7 @@ export function registerOperatorAuth(expectedOrigin: expectedBrowserOrigin(req, publicOrigin),presentedOrigin: configuredPublicOrigin(req.headers.origin),})- return deny(req, reply, 401, 'unauthorized')+ return deny(req, reply, limited(req) ? 429 : 401, 'unauthorized')}if (isWebSocketUpgrade(req) &&@@ -286,10 +326,9 @@ export function registerOperatorAuth(async (req, reply) => {const t = now()const token = typeof req.body?.token === 'string' ? req.body.token : ''- // Verify FIRST: a correct token is NEVER blocked by the failure limiter,- // so a remote attacker flooding wrong tokens cannot lock out the operator.- // (Token is never logged — mirrors EndpointFileWriter's rule.)- if (token && safeEqual(token, opts.operatorToken)) {+ if (limited(req))+ return reply.code(429).send({ error: 'too many attempts' })+ if (verify(req, token)) {const id = randomBytes(32).toString('base64url')sessions.set(id, t + SESSION_TTL_MS)const flags = [@@ -303,17 +342,50 @@ export function registerOperatorAuth(reply.header('set-cookie', flags.join('; '))return { ok: true }}- // Rate-limit ONLY failed attempts (256-bit token → brute force is- // infeasible regardless; this just bounds log spam / probing).- failedLogins = failedLogins.filter((ts) => ts > t - LOGIN_WINDOW_MS)- if (failedLogins.length >= LOGIN_MAX) {- return reply.code(429).send({ error: 'too many attempts' })- }- failedLogins.push(t)return reply.code(401).send({ error: 'invalid token' })})+ app.post('/rpc/auth/token', { bodyLimit: 16_384 }, async (req, reply) => {+ // Cookie mutations require an exact Origin. CLI requests use HTTP auth.+ if (+ authenticate(req) !== 'bearer' &&+ !exactBrowserOrigin(req, publicOrigin)+ ) {+ return reply.code(403).send({ ok: false, reason: 'incorrectToken' })+ }+ const parsed = changeOperatorTokenSchema.safeParse(req.body)+ if (!parsed.success)+ return reply.code(400).send({ ok: false, reason: 'invalid' })+ const change = async () => {+ if (opts.tokenSource !== 'file' || !opts.persistToken) {+ return reply.code(409).send({ ok: false, reason: 'managed' })+ }+ if (limited(req))+ return reply.code(429).send({ ok: false, reason: 'rateLimited' })+ if (!verify(req, parsed.data.currentToken)) {+ return reply.code(403).send({ ok: false, reason: 'incorrectToken' })+ }+ try {+ await opts.persistToken(parsed.data.newToken)+ } catch {+ return reply.code(503).send({ ok: false, reason: 'unavailable' })+ }+ operatorToken = parsed.data.newToken+ generation += 1+ const keep = parseCookies(req.headers.cookie)[COOKIE]+ for (const id of sessions.keys()) if (id !== keep) revoke(id)+ for (const socket of bearerSockets) socket.close(4401, 'Session expired')+ bearerSockets.clear()+ return reply.send({ ok: true })+ }+ // Recheck the old credential inside the queue, so simultaneous changes+ // cannot both succeed and silently replace the first caller's new token.+ const pending = rotation.then(change)+ rotation = pending.catch(() => {})+ return pending+ })+app.get('/rpc/auth/status', async (req): Promise<OperatorStatus> => {const mode = authenticate(req)const browserOrigin = req.headers['x-motrix-web-origin']@@ -321,6 +393,9 @@ export function registerOperatorAuth(authed: mode !== null,mode: mode ?? 'unauthenticated',canLogout: mode === 'cookie',+ ...(mode !== null && opts.tokenSource+ ? { tokenSource: opts.tokenSource }+ : {}),...(mode !== null && opts.clientPairing? { clientPairing: opts.clientPairing }: {}),@@ -350,10 +425,11 @@ export function registerOperatorAuth(return {principal(req) {const mode = authenticate(req)+ const issuedGeneration = generationif (mode === 'bearer')return {- id: `bearer:${sha256(opts.operatorToken).toString('hex')}`,- eligible: () => true,+ id: `bearer:${sha256(operatorToken).toString('hex')}`,+ eligible: () => issuedGeneration === generation,}const id = parseCookies(req.headers.cookie)[COOKIE]if (mode !== 'cookie' || !id) return undefined@@ -364,6 +440,8 @@ export function registerOperatorAuth(},bindSocket(req, socket) {const mode = authenticate(req)+ const issuedGeneration = generation+ if (mode === 'bearer') bearerSockets.add(socket)const id =mode === 'cookie' ? parseCookies(req.headers.cookie)[COOKIE] : undefinedif (id) {@@ -373,8 +451,10 @@ export function registerOperatorAuth(}return {eligible: () =>- mode === 'bearer' || (mode === 'cookie' && validSession(id, false)),+ (mode === 'bearer' && issuedGeneration === generation) ||+ (mode === 'cookie' && validSession(id, false)),dispose: () => {+ bearerSockets.delete(socket)if (!id) returnconst sockets = sessionSockets.get(id)sockets?.delete(socket)diff --git a/src/server/http/rpc-ws-auth.test.ts b/src/server/http/rpc-ws-auth.test.tsindex 1cd67d6d..e3b22988 100644--- a/src/server/http/rpc-ws-auth.test.ts+++ b/src/server/http/rpc-ws-auth.test.ts@@ -29,6 +29,8 @@ describe('/rpc/events WebSocket auth', () => {},operatorAuth: {operatorToken: TOKEN,+ tokenSource: 'file',+ persistToken: async () => {},now: () => now,publicUrl: 'https://motrix.example/operator',},@@ -60,6 +62,30 @@ describe('/rpc/events WebSocket auth', () => {return (login.headers['set-cookie'] as string).split(';')[0]}+ it('closes old cookie and Bearer sockets when the token is changed through CLI authentication', async () => {+ const browser = await connect({+ cookie: await cookie(),+ origin: 'https://motrix.example',+ })+ const script = await connect({ authorization: `Bearer ${TOKEN}` })+ const closed = [browser, script].map(+ (ws) => new Promise<number>((resolve) => ws.once('close', resolve))+ )+ const response = await app.inject({+ method: 'POST',+ url: '/rpc/auth/token',+ headers: { authorization: `Bearer ${TOKEN}` },+ payload: { currentToken: TOKEN, newToken: '1' },+ })+ expect(response.statusCode).toBe(200)+ expect(await Promise.all(closed)).toEqual([4401, 4401])+ await expect(+ connect({ authorization: `Bearer ${TOKEN}` })+ ).rejects.toThrow()+ const next = await connect({ authorization: 'Bearer 1' })+ next.close()+ })+it('rejects an anonymous upgrade', async () => {await expect(connect()).rejects.toThrow()})diff --git a/src/server/index.ts b/src/server/index.tsindex 2e77e0d7..f2d7b4df 100644--- a/src/server/index.ts+++ b/src/server/index.ts@@ -172,7 +172,7 @@ import { createApp } from './http/app'import { buildServerCommandHandlers } from './ipc/commands'import { buildServerQueryHandlers } from './ipc/queries'import { createServerMediaRuntime } from './media-runtime'-import { provisionOperatorToken } from './operator-token'+import { persistOperatorToken, provisionOperatorToken } from './operator-token'import { FnosAccountAuthority } from './platform/fnos/accounts'import { FnosFiles } from './platform/fnos/files'import { registerFnosRoutes } from './platform/fnos/routes'@@ -1565,6 +1565,10 @@ async function main() {? undefined: {operatorToken: operator.token,+ tokenSource: operator.source,+ persistToken: operator.path+ ? (token) => persistOperatorToken(operator.path as string, token)+ : undefined,publicUrl: process.env.MOTRIX_PUBLIC_URL,onEventSocketRejected: (detail) =>log.warn(detail, 'operator event connection rejected'),diff --git a/src/server/operator-admin.ts b/src/server/operator-admin.tsindex 09986ce0..424957b5 100644--- a/src/server/operator-admin.ts+++ b/src/server/operator-admin.ts@@ -14,6 +14,11 @@ import {type ResolvePairParams,type ResolvePairResult,} from '@shared/protocol/bridge'+import {+ changeOperatorTokenResultSchema,+ isWeakOperatorToken,+ operatorTokenSchema,+} from '@shared/schemas/operator-token'import { createInstance } from 'i18next'import {Agent,@@ -32,8 +37,13 @@ import {type PairingTerminal,runExtensionPairingTerminal,} from './operator-extension-pairing'+import { operatorTokenAuthorization } from './operator-token'+import {+ OperatorTokenInputError,+ readOperatorSecret,+ readOperatorTokenStdin,+} from './operator-token-input'-const OPERATOR_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43,128}$/const USER_CODE_PATTERN = /^[A-HJ-NP-Z2-9]{8}$/const WIRE_USER_CODE_PATTERN = /^[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$/const DEFAULT_DATA_DIR = '/data'@@ -185,6 +195,8 @@ interface OperatorAdminDependencies {pendingRetryWindowMs: numbermutationTimeoutMs: numberterminal?: PairingTerminal+ readSecret: (prompt: string) => Promise<string>+ readTokenStdin: () => Promise<string>}export interface OperatorAdminOptions@@ -192,7 +204,8 @@ export interface OperatorAdminOptionsinterface ParsedCommand {json: boolean- operation: 'pending' | 'approve' | 'deny' | 'extension-pair'+ operation: 'pending' | 'approve' | 'deny' | 'extension-pair' | 'token-set'+ stdin?: booleanuserCode?: string}@@ -228,6 +241,8 @@ function defaultDependencies(process.stderr.write(`${message}\n`)}),terminal: options.terminal,+ readSecret: options.readSecret ?? readOperatorSecret,+ readTokenStdin: options.readTokenStdin ?? readOperatorTokenStdin,pendingRetryWindowMs:options.pendingRetryWindowMs ?? PENDING_RETRY_WINDOW_MS,mutationTimeoutMs: options.mutationTimeoutMs ?? MUTATION_TIMEOUT_MS,@@ -291,6 +306,13 @@ function parseCommand(argv: readonly string[]): ParsedCommand | 'help' {return { json: false, operation: 'extension-pair' }}const args = argv.filter((arg) => arg !== '--json')+ if (+ args[0] === 'token' &&+ args[1] === 'set' &&+ (args.length === 2 || (args.length === 3 && args[2] === '--stdin'))+ ) {+ return { json, operation: 'token-set', stdin: args[2] === '--stdin' }+ }if (args.some((arg) => arg.startsWith('--'))) {throw new OperatorAdminError(OperatorAdminErrorKind.Usage,@@ -386,7 +408,7 @@ async function readOperatorToken(OperatorAdminErrorCode.CredentialUnreadable)}- if (!OPERATOR_TOKEN_PATTERN.test(token)) {+ if (!operatorTokenSchema.safeParse(token).success) {throw new OperatorAdminError(OperatorAdminErrorKind.Credential,OperatorAdminErrorCode.CredentialInvalid@@ -467,7 +489,7 @@ function requestInit(token: string, args: unknown[]): RequestInit {method: 'POST',headers: {accept: 'application/json',- authorization: `Bearer ${token}`,+ authorization: operatorTokenAuthorization(token),'content-type': 'application/json',},body: JSON.stringify({ args }),@@ -780,6 +802,33 @@ function printError(}}+function tokenCommandFailure(+ deps: OperatorAdminDependencies,+ t: Translate,+ reason: string,+ json: boolean,+ exitCode: OperatorAdminExitCode+): OperatorAdminExitCode {+ const message = t(`operatorAdmin.token.${reason}`)+ const kind =+ exitCode === OperatorAdminExitCode.Usage+ ? 'usage'+ : exitCode === OperatorAdminExitCode.Credential+ ? 'credential'+ : exitCode === OperatorAdminExitCode.Unavailable+ ? 'unavailable'+ : 'server'+ deps.writeStderr(+ json+ ? JSON.stringify({+ ok: false,+ error: { code: `token.${reason}`, kind, message },+ })+ : message+ )+ return exitCode+}+export async function runOperatorAdmin(argv: readonly string[],options: OperatorAdminOptions = {}@@ -815,6 +864,91 @@ export async function runOperatorAdmin(throw new ExtensionPairingTerminalError('ttyRequired')const token = await readOperatorToken(deps)const baseUrl = serverBaseUrl(deps.env)+ if (command.operation === 'token-set') {+ if (deps.env.MOTRIX_OPERATOR_TOKEN) {+ return tokenCommandFailure(+ deps,+ t,+ 'managed',+ json,+ OperatorAdminExitCode.Credential+ )+ }+ const newToken = command.stdin+ ? await deps.readTokenStdin()+ : await deps.readSecret(t('operatorAdmin.token.prompt'))+ if (!operatorTokenSchema.safeParse(newToken).success) {+ return tokenCommandFailure(+ deps,+ t,+ 'invalid',+ json,+ OperatorAdminExitCode.Usage+ )+ }+ if (+ !command.stdin &&+ newToken !== (await deps.readSecret(t('operatorAdmin.token.confirm')))+ ) {+ return tokenCommandFailure(+ deps,+ t,+ 'mismatch',+ json,+ OperatorAdminExitCode.Usage+ )+ }+ if (isWeakOperatorToken(newToken)) {+ const message = t('operatorAdmin.token.weak')+ deps.writeStderr(+ json+ ? JSON.stringify({ warning: { code: 'token.weak', message } })+ : message+ )+ }+ let response: Response+ try {+ response = await deps.fetch(`${baseUrl}/rpc/auth/token`, {+ ...requestInit(token, []),+ body: JSON.stringify({ currentToken: token, newToken }),+ signal: AbortSignal.timeout(deps.mutationTimeoutMs),+ })+ } catch {+ return tokenCommandFailure(+ deps,+ t,+ 'unknown',+ json,+ OperatorAdminExitCode.Unavailable+ )+ }+ const result = changeOperatorTokenResultSchema.safeParse(+ await parseJsonResponse(response).catch(() => undefined)+ )+ if (!result.success || !response.ok || !result.data.ok) {+ const reason =+ result.success && !result.data.ok+ ? result.data.reason+ : response.status === 429+ ? 'rateLimited'+ : response.status === 401 || response.status === 403+ ? 'incorrectToken'+ : 'unknown'+ const exitCode =+ reason === 'managed' || reason === 'incorrectToken'+ ? OperatorAdminExitCode.Credential+ : reason === 'rateLimited'+ ? OperatorAdminExitCode.Unavailable+ : OperatorAdminExitCode.Server+ return tokenCommandFailure(deps, t, reason, json, exitCode)+ }+ deps.writeStdout(+ command.json+ ? JSON.stringify({ ok: true })+ : t('operatorAdmin.token.saved')+ )+ return OperatorAdminExitCode.Success+ }if (terminal) {const outcome = await runExtensionPairingTerminal({terminal,@@ -846,6 +980,15 @@ export async function runOperatorAdmin(printDecision(deps, t, request, command.operation, command.json)return OperatorAdminExitCode.Success} catch (error) {+ if (error instanceof OperatorTokenInputError) {+ return tokenCommandFailure(+ deps,+ t,+ error.reason,+ json,+ OperatorAdminExitCode.Usage+ )+ }if (error instanceof ExtensionPairingTerminalError) {deps.writeStderr(t(`operatorAdmin.extension.${error.reason}`))return error.reason === 'ttyRequired' ||diff --git a/src/server/operator-token-input.ts b/src/server/operator-token-input.tsnew file mode 100644index 00000000..34721394--- /dev/null+++ b/src/server/operator-token-input.ts@@ -0,0 +1,51 @@+import { createInterface } from 'node:readline/promises'+import { Writable } from 'node:stream'++export class OperatorTokenInputError extends Error {+ constructor(readonly reason: 'ttyRequired' | 'cancelled' | 'invalid') {+ super(reason)+ }+}++/** Read without echoing the credential or placing it in command arguments. */+export async function readOperatorSecret(prompt: string): Promise<string> {+ if (!process.stdin.isTTY || !process.stderr.isTTY) {+ throw new OperatorTokenInputError('ttyRequired')+ }+ const output = new Writable({ write: (_chunk, _encoding, done) => done() })+ const reader = createInterface({+ input: process.stdin,+ output,+ terminal: true,+ })+ const controller = new AbortController()+ const cancel = () => controller.abort()+ reader.on('SIGINT', cancel)+ reader.on('SIGTSTP', cancel)+ reader.on('close', cancel)+ for (const signal of ['SIGTERM', 'SIGHUP'] as const)+ process.on(signal, cancel)+ process.stderr.write(`${prompt} `)+ try {+ return await reader.question('', { signal: controller.signal })+ } catch {+ throw new OperatorTokenInputError('cancelled')+ } finally {+ reader.close()+ output.destroy()+ for (const signal of ['SIGTERM', 'SIGHUP'] as const)+ process.off(signal, cancel)+ process.stderr.write('\n')+ }+}++export async function readOperatorTokenStdin(): Promise<string> {+ let data = ''+ process.stdin.setEncoding('utf8')+ for await (const chunk of process.stdin) {+ data += chunk+ if (data.length > 4096) throw new OperatorTokenInputError('invalid')+ }+ // A single terminating line ending is the CLI delimiter, not token content.+ return data.replace(/\r?\n$/, '')+}diff --git a/src/server/operator-token-management.test.ts b/src/server/operator-token-management.test.tsnew file mode 100644index 00000000..4737835d--- /dev/null+++ b/src/server/operator-token-management.test.ts@@ -0,0 +1,305 @@+import { mkdtemp, readFile, rm } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import type { FastifyInstance } from 'fastify'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { createApp } from './http/app'+import { OperatorAdminExitCode, runOperatorAdmin } from './operator-admin'+import {+ operatorTokenAuthorization,+ persistOperatorToken,+ provisionOperatorToken,+} from './operator-token'++describe('operator token management', () => {+ let dir: string+ let app: FastifyInstance+ let token: string+ let path: string+ let persist: ReturnType<typeof vi.fn<(next: string) => Promise<void>>>+ let now: number+ beforeEach(async () => {+ dir = await mkdtemp(join(tmpdir(), 'motrix-token-change-'))+ const provisioned = await provisionOperatorToken({ dataDir: dir, env: {} })+ token = provisioned.token+ path = provisioned.path!+ persist = vi.fn((next: string) => persistOperatorToken(path, next))+ now = 1000+ app = await createApp({+ operatorAuth: {+ operatorToken: token,+ tokenSource: 'file',+ persistToken: persist,+ now: () => now,+ },+ })+ })+ afterEach(async () => {+ await app.close()+ await rm(dir, { recursive: true, force: true })+ })++ async function login(value = token) {+ const res = await app.inject({+ method: 'POST',+ url: '/rpc/auth/login',+ payload: { token: value },+ })+ expect(res.statusCode).toBe(200)+ return String(res.headers['set-cookie']).split(';')[0]!+ }+ const status = (cookie: string) =>+ app.inject({ url: '/rpc/auth/status', headers: { cookie } })+ const change = (+ newToken: string,+ currentToken = token,+ headers: Record<string, string> = {+ authorization: operatorTokenAuthorization(token),+ }+ ) =>+ app.inject({+ method: 'POST',+ url: '/rpc/auth/token',+ headers,+ payload: { currentToken, newToken },+ })++ it('accepts a weak token, persists it, preserves the current cookie and revokes others', async () => {+ const current = await login()+ const other = await login()+ const res = await change('1', token, {+ cookie: current,+ host: 'motrix.test',+ origin: 'http://motrix.test',+ })+ expect(res.statusCode).toBe(200)+ expect(res.json()).toEqual({ ok: true })+ expect(+ (await provisionOperatorToken({ dataDir: dir, env: {} })).token+ ).toBe('1')+ expect((await status(current)).json().authed).toBe(true)+ expect((await status(other)).json().authed).toBe(false)+ expect(+ (+ await app.inject({+ url: '/rpc/auth/status',+ headers: { authorization: operatorTokenAuthorization(token) },+ })+ ).json().authed+ ).toBe(false)+ await login('1')+ })++ it('rejects unauthenticated, cross-origin, and stale-credential changes without writing', async () => {+ expect((await change('1', token, {})).statusCode).toBe(401)+ const cookie = await login()+ expect(+ (await change('1', token, { cookie, origin: 'http://evil.example' }))+ .statusCode+ ).toBe(403)+ expect((await change('1', token, { cookie })).statusCode).toBe(403)+ expect(+ (await change('1', token, { cookie, authorization: 'Bearer invalid' }))+ .statusCode+ ).toBe(403)+ expect(+ (+ await change('1', token, {+ cookie,+ host: 'motrix.test',+ origin: 'https://motrix.test',+ authorization: 'Bearer invalid',+ })+ ).statusCode+ ).toBe(403)+ expect((await change('1', 'wrong')).json()).toEqual({+ ok: false,+ reason: 'incorrectToken',+ })+ expect(persist).not.toHaveBeenCalled()+ })++ it('retains the previous credential and sessions if persistence fails', async () => {+ const cookie = await login()+ persist.mockRejectedValueOnce(new Error('storage unavailable'))+ expect((await change('1')).json()).toEqual({+ ok: false,+ reason: 'unavailable',+ })+ expect(await readFile(path, 'utf8')).toBe(token)+ expect((await status(cookie)).json().authed).toBe(true)+ await login()+ })++ it('serializes concurrent changes and rejects the stale second request', async () => {+ let release!: () => void+ persist.mockImplementationOnce(async (next) => {+ await new Promise<void>((resolve) => {+ release = resolve+ })+ await persistOperatorToken(path, next)+ })+ const first = change('first').then((response) => response)+ await vi.waitFor(() => expect(persist).toHaveBeenCalledOnce())+ const second = change('second').then((response) => response)+ await new Promise((resolve) => setTimeout(resolve, 10))+ release()+ expect((await first).statusCode).toBe(200)+ expect((await second).statusCode).toBe(403)+ expect(await readFile(path, 'utf8')).toBe('first')+ expect(persist).toHaveBeenCalledOnce()+ })++ it('throttles direct HTTP credential guesses and recovers after the window', async () => {+ for (let i = 0; i < 20; i++)+ await app.inject({+ url: '/rpc/auth/status',+ headers: { authorization: 'Bearer wrong' },+ })+ expect(+ (+ await app.inject({+ method: 'POST',+ url: '/rpc/auth/login',+ payload: { token },+ })+ ).statusCode+ ).toBe(429)+ now += 60_001+ await login()+ })++ it('keeps environment-managed credentials read-only', async () => {+ await app.close()+ app = await createApp({+ operatorAuth: {+ operatorToken: token,+ tokenSource: 'env',+ persistToken: persist,+ },+ })+ expect((await change('1')).json()).toEqual({ ok: false, reason: 'managed' })+ expect(persist).not.toHaveBeenCalled()+ })++ it('changes via CLI stdin, then uses a Unicode token to rotate again without exposing credentials', async () => {+ const output: string[] = []+ const fetchMock = vi.fn(+ async (input: string | URL | Request, init?: RequestInit) => {+ const response = await app.inject({+ method: 'POST',+ url: new URL(String(input)).pathname,+ headers: Object.fromEntries(new Headers(init?.headers)),+ payload: String(init?.body),+ })+ return new Response(response.body, { status: response.statusCode })+ }+ )+ let next = '中文令牌'+ const options = {+ env: { MOTRIX_DATA_DIR: dir },+ fetch: fetchMock as typeof fetch,+ readTokenStdin: async () => next,+ writeStdout: (line: string) => output.push(line),+ writeStderr: (line: string) => output.push(line),+ }+ expect(+ await runOperatorAdmin(['token', 'set', '--stdin', '--json'], options)+ ).toBe(OperatorAdminExitCode.Success)+ await login(next)+ next = '2'+ expect(await runOperatorAdmin(['token', 'set', '--stdin'], options)).toBe(+ OperatorAdminExitCode.Success+ )+ await login(next)+ expect(output.join('\n')).toContain('easy to guess')+ expect(output.join('\n')).not.toContain(token)+ expect(output.join('\n')).not.toContain('中文令牌')+ })++ it('rejects mismatched confirmation and environment configuration before attempting a mutation', async () => {+ const fetchMock = vi.fn()+ const readSecret = vi+ .fn()+ .mockResolvedValueOnce('1')+ .mockResolvedValueOnce('2')+ const options = {+ env: { MOTRIX_DATA_DIR: dir },+ fetch: fetchMock,+ readSecret,+ writeStderr: vi.fn(),+ }+ expect(await runOperatorAdmin(['token', 'set'], options)).toBe(+ OperatorAdminExitCode.Usage+ )+ expect(fetchMock).not.toHaveBeenCalled()+ expect(+ await runOperatorAdmin(['token', 'set'], {+ ...options,+ env: { MOTRIX_OPERATOR_TOKEN: token },+ })+ ).toBe(OperatorAdminExitCode.Credential)+ expect(readSecret).toHaveBeenCalledTimes(2)+ })++ it.each([+ {+ status: 401,+ body: { error: 'unauthorized' },+ code: 'token.incorrectToken',+ exit: OperatorAdminExitCode.Credential,+ },+ {+ status: 429,+ body: { error: 'too many attempts' },+ code: 'token.rateLimited',+ exit: OperatorAdminExitCode.Unavailable,+ },+ {+ status: 503,+ body: { ok: false, reason: 'unavailable' },+ code: 'token.unavailable',+ exit: OperatorAdminExitCode.Server,+ },+ ])(+ 'reports JSON warnings and failures without credentials for HTTP $status',+ async ({ status, body, code, exit }) => {+ const stdout: string[] = []+ const stderr: string[] = []+ expect(+ await runOperatorAdmin(['token', 'set', '--stdin', '--json'], {+ env: { MOTRIX_DATA_DIR: dir },+ readTokenStdin: async () => '1',+ fetch: vi+ .fn()+ .mockResolvedValue(new Response(JSON.stringify(body), { status })),+ writeStdout: (line) => stdout.push(line),+ writeStderr: (line) => stderr.push(line),+ })+ ).toBe(exit)+ expect(stdout).toEqual([])+ expect(stderr.map((line) => JSON.parse(line))).toMatchObject([+ { warning: { code: 'token.weak' } },+ { ok: false, error: { code } },+ ])+ expect(stderr.join('\n')).not.toContain(token)+ }+ )++ it('reports local input errors in JSON without calling the server', async () => {+ const stderr: string[] = []+ const fetchMock = vi.fn()+ expect(+ await runOperatorAdmin(['token', 'set', '--stdin', '--json'], {+ env: { MOTRIX_DATA_DIR: dir },+ readTokenStdin: async () => '',+ fetch: fetchMock,+ writeStderr: (line) => stderr.push(line),+ })+ ).toBe(OperatorAdminExitCode.Usage)+ expect(stderr.map((line) => JSON.parse(line))).toMatchObject([+ { ok: false, error: { code: 'token.invalid' } },+ ])+ expect(fetchMock).not.toHaveBeenCalled()+ })+})diff --git a/src/server/operator-token.test.ts b/src/server/operator-token.test.tsindex 4ba26938..c688c5d7 100644--- a/src/server/operator-token.test.ts+++ b/src/server/operator-token.test.ts@@ -1,8 +1,16 @@-import { chmod, mkdtemp, readFile, rm, stat, writeFile } from 'node:fs/promises'+import {+ chmod,+ mkdtemp,+ readFile,+ rm,+ stat,+ symlink,+ writeFile,+} from 'node:fs/promises'import { tmpdir } from 'node:os'import { join } from 'node:path'import { afterEach, beforeEach, describe, expect, it } from 'vitest'-import { provisionOperatorToken } from './operator-token'+import { persistOperatorToken, provisionOperatorToken } from './operator-token'describe('provisionOperatorToken', () => {let dir: string@@ -62,11 +70,33 @@ describe('provisionOperatorToken', () => {it('refuses to rotate an invalid persistent token silently', async () => {const path = join(dir, 'operator-token')- await writeFile(path, 'not-a-valid-generated-token', { mode: 0o600 })+ await writeFile(path, 'invalid\ntoken', { mode: 0o600 })await expect(provisionOperatorToken({ dataDir: dir, env: {} })).rejects.toThrow(/Operator token file is invalid/)- expect(await readFile(path, 'utf8')).toBe('not-a-valid-generated-token')+ expect(await readFile(path, 'utf8')).toBe('invalid\ntoken')+ })++ it.each(['1', '只想安静地下载文件', ' spaced passphrase '])(+ 'persists a custom token and reads it on restart: %s',+ async (token) => {+ const initial = await provisionOperatorToken({ dataDir: dir, env: {} })+ await persistOperatorToken(initial.path!, token)+ expect(+ (await provisionOperatorToken({ dataDir: dir, env: {} })).token+ ).toBe(token)+ expect((await stat(initial.path!)).mode & 0o777).toBe(0o600)+ }+ )++ it('keeps the old file after invalid input and refuses symlink destinations', async () => {+ const initial = await provisionOperatorToken({ dataDir: dir, env: {} })+ await expect(persistOperatorToken(initial.path!, '')).rejects.toThrow()+ expect(await readFile(initial.path!, 'utf8')).toBe(initial.token)+ const link = join(dir, 'linked-token')+ await symlink(initial.path!, link)+ await expect(persistOperatorToken(link, '1')).rejects.toThrow()+ expect(await readFile(initial.path!, 'utf8')).toBe(initial.token)})})diff --git a/src/server/operator-token.ts b/src/server/operator-token.tsindex c388c4dd..ffe96fae 100644--- a/src/server/operator-token.ts+++ b/src/server/operator-token.ts@@ -1,8 +1,17 @@import { randomBytes } from 'node:crypto'-import { chmod, lstat, mkdir, readFile, writeFile } from 'node:fs/promises'+import {+ chmod,+ lstat,+ mkdir,+ open,+ readFile,+ rename,+ rm,+ writeFile,+} from 'node:fs/promises'import { dirname, join } from 'node:path'-const FILE_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43,128}$/+import { operatorTokenSchema } from '@shared/schemas/operator-token'export interface ProvisionedOperatorToken {token: string@@ -63,9 +72,38 @@ async function readExistingToken(path: string): Promise<string | undefined> {throw new Error(`Operator token path is not a regular file: ${path}`)}const token = await readFile(path, 'utf8')- if (!FILE_TOKEN_PATTERN.test(token)) {+ if (!operatorTokenSchema.safeParse(token).success) {throw new Error(`Operator token file is invalid: ${path}`)}await chmod(path, 0o600)return token}++/** Keep the previous credential intact if writing the replacement fails. */+export async function persistOperatorToken(+ path: string,+ token: string+): Promise<void> {+ operatorTokenSchema.parse(token)+ const metadata = await lstat(path)+ if (!metadata.isFile())+ throw new Error('Operator token is not a regular file')+ const temporary = `${path}.${randomBytes(12).toString('hex')}.tmp`+ const file = await open(temporary, 'wx', 0o600)+ try {+ await file.writeFile(token, 'utf8')+ await file.sync()+ await file.close()+ await rename(temporary, path)+ } finally {+ await file.close().catch(() => {})+ await rm(temporary, { force: true }).catch(() => {})+ }+}++/** Basic with an empty username carries Unicode/space-containing passphrases. */+export function operatorTokenAuthorization(token: string): string {+ return /^[\x21-\x7e]+$/.test(token)+ ? `Bearer ${token}`+ : `Basic ${Buffer.from(`:${token}`, 'utf8').toString('base64')}`+}diff --git a/src/shared/lib/log-redact.ts b/src/shared/lib/log-redact.tsindex 1871f567..ff504b8c 100644--- a/src/shared/lib/log-redact.ts+++ b/src/shared/lib/log-redact.ts@@ -73,6 +73,8 @@ const SENSITIVE_VALUE_KEYS = new Set(['credentials','rpcsecret','token',+ 'currenttoken',+ 'newtoken','authtoken','accesstoken','refreshtoken',diff --git a/src/shared/locales/ar.json b/src/shared/locales/ar.jsonindex a30cacf6..3d0226a3 100644--- a/src/shared/locales/ar.json+++ b/src/shared/locales/ar.json@@ -377,7 +377,7 @@"unknownOption": "خيار سطر أوامر غير معروف."}},- "help": "الاستخدام:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nيتصل الأمر بخادم Motrix الجاري فقط عبر واجهة الاسترجاع داخل الحاوية.",+ "help": "الاستخدام:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nيتصل الأمر بخادم Motrix الجاري فقط عبر واجهة الاسترجاع داخل الحاوية.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "لا توجد طلبات اقتران معلّقة.","row": "{{userCode}} {{clientName}} {{clientVersion}} تنتهي الصلاحية خلال {{ttl}}",@@ -397,6 +397,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3644,5 +3659,27 @@"invalidOptions": "كل قائمة تقبل حتى {{limit}} عنوانًا صالحًا. يحتاج التورنت الخاص إلى متتبّع.","menuLabel": "إنشاء ملف تورنت…","downloadRequested": "طُلب تنزيل {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/bg.json b/src/shared/locales/bg.jsonindex fd36465a..bf87b13f 100644--- a/src/shared/locales/bg.json+++ b/src/shared/locales/bg.json@@ -373,7 +373,7 @@"unknownOption": "Непозната опция на командния ред."}},- "help": "Употреба:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКомандата се свързва само с работещия сървър Motrix през локалния интерфейс на контейнера.",+ "help": "Употреба:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКомандата се свързва само с работещия сървър Motrix през локалния интерфейс на контейнера.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Няма чакащи заявки за сдвояване.","row": "{{userCode}} {{clientName}} {{clientVersion}} изтича след {{ttl}}",@@ -393,6 +393,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3548,5 +3563,27 @@"invalidOptions": "До {{limit}} валидни URL адреса в списък. Частните торенти изискват тракер.","menuLabel": "Създаване на торент файл…","downloadRequested": "Заявено е изтегляне: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/ca.json b/src/shared/locales/ca.jsonindex a6cdf503..12b3954a 100644--- a/src/shared/locales/ca.json+++ b/src/shared/locales/ca.json@@ -374,7 +374,7 @@"unknownOption": "Opció de línia d'ordres desconeguda."}},- "help": "Ús:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nL'ordre només es comunica amb el servidor Motrix en execució mitjançant la interfície de bucle local del contenidor.",+ "help": "Ús:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nL'ordre només es comunica amb el servidor Motrix en execució mitjançant la interfície de bucle local del contenidor.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "No hi ha peticions d'aparellament pendents.","row": "{{userCode}} {{clientName}} {{clientVersion}} caduca d'aquí a {{ttl}}",@@ -394,6 +394,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3572,5 +3587,27 @@"invalidOptions": "Cada llista admet fins a {{limit}} URL vàlids. Els torrents privats necessiten un rastrejador.","menuLabel": "Crea un fitxer torrent…","downloadRequested": "S’ha sol·licitat la baixada de {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/de.json b/src/shared/locales/de.jsonindex 1c1f7947..9bf6564d 100644--- a/src/shared/locales/de.json+++ b/src/shared/locales/de.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Verwendung:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nDer Befehl kommuniziert ausschließlich über die Loopback-Schnittstelle des Containers mit dem laufenden Motrix-Server.",+ "help": "Verwendung:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nDer Befehl kommuniziert ausschließlich über die Loopback-Schnittstelle des Containers mit dem laufenden Motrix-Server.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Hinweise zur Verwendung erhalten Sie mit `motrix-admin --help`.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3548,5 +3563,27 @@"invalidOptions": "Pro Liste sind bis zu {{limit}} gültige URLs zulässig. Private Torrents benötigen einen Tracker.","menuLabel": "Torrent-Datei erstellen…","downloadRequested": "Download angefordert: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/el.json b/src/shared/locales/el.jsonindex 4a5fb589..0d694eca 100644--- a/src/shared/locales/el.json+++ b/src/shared/locales/el.json@@ -373,7 +373,7 @@"unknownOption": "Άγνωστη επιλογή γραμμής εντολών."}},- "help": "Χρήση:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nΗ εντολή επικοινωνεί μόνο με τον εκτελούμενο διακομιστή Motrix μέσω της τοπικής διεπαφής loopback του περιέκτη.",+ "help": "Χρήση:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nΗ εντολή επικοινωνεί μόνο με τον εκτελούμενο διακομιστή Motrix μέσω της τοπικής διεπαφής loopback του περιέκτη.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Δεν υπάρχουν εκκρεμή αιτήματα σύζευξης.","row": "{{userCode}} {{clientName}} {{clientVersion}} λήγει σε {{ttl}}",@@ -393,6 +393,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3548,5 +3563,27 @@"invalidOptions": "Έως {{limit}} έγκυρα URL ανά λίστα. Τα ιδιωτικά torrent απαιτούν tracker.","menuLabel": "Δημιουργία αρχείου torrent…","downloadRequested": "Ζητήθηκε λήψη: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/en-US.json b/src/shared/locales/en-US.jsonindex 541585e9..ea2c4e20 100644--- a/src/shared/locales/en-US.json+++ b/src/shared/locales/en-US.json@@ -1,15 +1,15 @@{"operatorUnlock": {- "title": "Unlock Motrix",- "help": "This server requires the operator token. On the host, set MOTRIX_OPERATOR_TOKEN, or read the token from <dataDir>/operator-token, then paste it below.",- "placeholder": "Operator token",- "error": "Invalid operator token. Check MOTRIX_OPERATOR_TOKEN or <dataDir>/operator-token on the host and try again.",- "submit": "Unlock",+ "title": "Sign in to Motrix",+ "help": "For first-time access or a forgotten password, contact the server administrator.",+ "placeholder": "Access password",+ "error": "Incorrect password. Try again.",+ "submit": "Sign in","nasSessionExpired": "Unable to verify your NAS administrator session. Open Motrix from the NAS desktop.","openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Usage:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nThe command talks only to the running Motrix server over container loopback.",+ "help": "Usage:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nThe command talks only to the running Motrix server over container loopback.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Run `motrix-admin --help` for usage.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3548,5 +3563,27 @@"invalidOptions": "Use up to {{limit}} valid URLs per list. Private torrents need a tracker.","menuLabel": "Create Torrent File…","downloadRequested": "Download requested: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/es.json b/src/shared/locales/es.jsonindex 96e47865..2276b21b 100644--- a/src/shared/locales/es.json+++ b/src/shared/locales/es.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Uso:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nEl comando solo se comunica con el servidor Motrix en ejecución a través de la interfaz de bucle local del contenedor.",+ "help": "Uso:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nEl comando solo se comunica con el servidor Motrix en ejecución a través de la interfaz de bucle local del contenedor.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Ejecuta `motrix-admin --help` para consultar el uso.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3572,5 +3587,27 @@"invalidOptions": "Hasta {{limit}} URL válidas por lista. Los torrents privados requieren un rastreador.","menuLabel": "Crear archivo torrent…","downloadRequested": "Descarga solicitada: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/fa.json b/src/shared/locales/fa.jsonindex 48615adc..3af24d5c 100644--- a/src/shared/locales/fa.json+++ b/src/shared/locales/fa.json@@ -373,7 +373,7 @@"unknownOption": "گزینهٔ خط فرمان ناشناخته است."}},- "help": "نحوهٔ استفاده:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nاین فرمان فقط از طریق رابط loopback کانتینر با سرور در حال اجرای Motrix ارتباط برقرار میکند.",+ "help": "نحوهٔ استفاده:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nاین فرمان فقط از طریق رابط loopback کانتینر با سرور در حال اجرای Motrix ارتباط برقرار میکند.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "درخواست جفتسازی در انتظاری وجود ندارد.","row": "{{userCode}} {{clientName}} {{clientVersion}} انقضا در {{ttl}}",@@ -393,6 +393,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3548,5 +3563,27 @@"invalidOptions": "هر فهرست حداکثر {{limit}} نشانی معتبر میپذیرد. تورنت خصوصی به ترکر نیاز دارد.","menuLabel": "ساخت فایل تورنت…","downloadRequested": "درخواست دانلود: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/fr.json b/src/shared/locales/fr.jsonindex a12c787e..b1481d17 100644--- a/src/shared/locales/fr.json+++ b/src/shared/locales/fr.json@@ -374,7 +374,7 @@"unknownOption": "Option de ligne de commande inconnue."}},- "help": "Utilisation :\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nCette commande communique uniquement avec le serveur Motrix en cours d’exécution via l’interface de bouclage du conteneur.",+ "help": "Utilisation :\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nCette commande communique uniquement avec le serveur Motrix en cours d’exécution via l’interface de bouclage du conteneur.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Aucune demande d’association en attente.","row": "{{userCode}} {{clientName}} {{clientVersion}} expire dans {{ttl}}",@@ -394,6 +394,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3572,5 +3587,27 @@"invalidOptions": "Chaque liste accepte jusqu’à {{limit}} URL valides. Un torrent privé nécessite un tracker.","menuLabel": "Créer un fichier torrent…","downloadRequested": "Téléchargement demandé : {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/hu.json b/src/shared/locales/hu.jsonindex c8685567..b317ac80 100644--- a/src/shared/locales/hu.json+++ b/src/shared/locales/hu.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Használat:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nA parancs kizárólag a futó Motrix szerverrel kommunikál a konténer loopback kapcsolatán keresztül.",+ "help": "Használat:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nA parancs kizárólag a futó Motrix szerverrel kommunikál a konténer loopback kapcsolatán keresztül.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "A használati útmutatóhoz futtasd a `motrix-admin --help` parancsot.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3548,5 +3563,27 @@"invalidOptions": "Listánként legfeljebb {{limit}} érvényes URL adható meg. A privát torrenthez tracker szükséges.","menuLabel": "Torrentfájl létrehozása…","downloadRequested": "Letöltés kérve: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/id.json b/src/shared/locales/id.jsonindex 00fe9462..ca5b970f 100644--- a/src/shared/locales/id.json+++ b/src/shared/locales/id.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Penggunaan:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nPerintah ini hanya berkomunikasi dengan server Motrix yang berjalan melalui loopback kontainer.",+ "help": "Penggunaan:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nPerintah ini hanya berkomunikasi dengan server Motrix yang berjalan melalui loopback kontainer.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Jalankan `motrix-admin --help` untuk petunjuk penggunaan.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "Maksimal {{limit}} URL valid per daftar. Torrent privat memerlukan pelacak.","menuLabel": "Buat berkas torrent…","downloadRequested": "Unduhan diminta: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/it.json b/src/shared/locales/it.jsonindex 924af8fc..f928b816 100644--- a/src/shared/locales/it.json+++ b/src/shared/locales/it.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Utilizzo:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nIl comando comunica esclusivamente con il server Motrix in esecuzione tramite l’interfaccia di loopback del container.",+ "help": "Utilizzo:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nIl comando comunica esclusivamente con il server Motrix in esecuzione tramite l’interfaccia di loopback del container.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Esegui `motrix-admin --help` per le istruzioni d’uso.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3572,5 +3587,27 @@"invalidOptions": "Ogni elenco accetta fino a {{limit}} URL validi. I torrent privati richiedono un tracker.","menuLabel": "Crea file torrent…","downloadRequested": "Download richiesto: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/ja.json b/src/shared/locales/ja.jsonindex 21000dc2..a0fbd585 100644--- a/src/shared/locales/ja.json+++ b/src/shared/locales/ja.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "使い方:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nこのコマンドは、コンテナーのループバック経由で、実行中の Motrix サーバーとのみ通信します。",+ "help": "使い方:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nこのコマンドは、コンテナーのループバック経由で、実行中の Motrix サーバーとのみ通信します。\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "使い方を確認するには `motrix-admin --help` を実行してください。","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "各リストには有効な URL を {{limit}} 件まで入力できます。プライベートトレントにはトラッカーが必要です。","menuLabel": "トレントファイルを作成…","downloadRequested": "ダウンロードをリクエストしました:{{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/ko.json b/src/shared/locales/ko.jsonindex 1966cd02..7909d5a4 100644--- a/src/shared/locales/ko.json+++ b/src/shared/locales/ko.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "사용법:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\n이 명령은 컨테이너 루프백을 통해 실행 중인 Motrix 서버와만 통신합니다.",+ "help": "사용법:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\n이 명령은 컨테이너 루프백을 통해 실행 중인 Motrix 서버와만 통신합니다.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "사용법을 보려면 `motrix-admin --help`를 실행하세요.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "목록마다 유효한 URL을 최대 {{limit}}개 입력할 수 있습니다. 비공개 토렌트에는 트래커가 필요합니다.","menuLabel": "토렌트 파일 만들기…","downloadRequested": "다운로드 요청됨: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/nb.json b/src/shared/locales/nb.jsonindex df02da1b..3c8d1549 100644--- a/src/shared/locales/nb.json+++ b/src/shared/locales/nb.json@@ -373,7 +373,7 @@"unknownOption": "Ukjent kommandolinjealternativ."}},- "help": "Bruk:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nKommandoen kommuniserer bare med den kjørende Motrix-serveren via containerens loopback-grensesnitt.",+ "help": "Bruk:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nKommandoen kommuniserer bare med den kjørende Motrix-serveren via containerens loopback-grensesnitt.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Ingen ventende sammenkoblingsforespørsler.","row": "{{userCode}} {{clientName}} {{clientVersion}} utløper om {{ttl}}",@@ -393,6 +393,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3548,5 +3563,27 @@"invalidOptions": "Hver liste kan ha opptil {{limit}} gyldige URL-er. Private torrenter trenger en tracker.","menuLabel": "Opprett torrentfil…","downloadRequested": "Nedlasting forespurt: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/nl.json b/src/shared/locales/nl.jsonindex 6506a7d0..0c232149 100644--- a/src/shared/locales/nl.json+++ b/src/shared/locales/nl.json@@ -373,7 +373,7 @@"unknownOption": "Onbekende opdrachtregeloptie."}},- "help": "Gebruik:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nDe opdracht communiceert alleen met de actieve Motrix-server via de loopbackinterface van de container.",+ "help": "Gebruik:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nDe opdracht communiceert alleen met de actieve Motrix-server via de loopbackinterface van de container.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Geen koppelingsverzoeken in behandeling.","row": "{{userCode}} {{clientName}} {{clientVersion}} verloopt over {{ttl}}",@@ -393,6 +393,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3548,5 +3563,27 @@"invalidOptions": "Elke lijst kan maximaal {{limit}} geldige URL’s bevatten. Privétorrents hebben een tracker nodig.","menuLabel": "Torrentbestand maken…","downloadRequested": "Download aangevraagd: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/pl.json b/src/shared/locales/pl.jsonindex 74e52427..4a3fec8c 100644--- a/src/shared/locales/pl.json+++ b/src/shared/locales/pl.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Użycie:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nPolecenie łączy się wyłącznie z działającym serwerem Motrix przez interfejs pętli zwrotnej kontenera.",+ "help": "Użycie:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nPolecenie łączy się wyłącznie z działającym serwerem Motrix przez interfejs pętli zwrotnej kontenera.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Uruchom `motrix-admin --help`, aby wyświetlić sposób użycia.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3596,5 +3611,27 @@"invalidOptions": "Każda lista może zawierać do {{limit}} poprawnych adresów URL. Prywatny torrent wymaga trackera.","menuLabel": "Utwórz plik torrent…","downloadRequested": "Zlecono pobranie: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/pt-BR.json b/src/shared/locales/pt-BR.jsonindex d563050b..48553f72 100644--- a/src/shared/locales/pt-BR.json+++ b/src/shared/locales/pt-BR.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Uso:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nO comando se comunica apenas com o servidor Motrix em execução, pela interface de loopback do contêiner.",+ "help": "Uso:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nO comando se comunica apenas com o servidor Motrix em execução, pela interface de loopback do contêiner.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Execute `motrix-admin --help` para ver as instruções de uso.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3572,5 +3587,27 @@"invalidOptions": "Cada lista aceita até {{limit}} URLs válidas. Torrents privados precisam de um rastreador.","menuLabel": "Criar arquivo torrent…","downloadRequested": "Download solicitado: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/ro.json b/src/shared/locales/ro.jsonindex e46c06a0..a79e1567 100644--- a/src/shared/locales/ro.json+++ b/src/shared/locales/ro.json@@ -374,7 +374,7 @@"unknownOption": "Opțiune necunoscută a liniei de comandă."}},- "help": "Utilizare:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nComanda comunică doar cu serverul Motrix activ, prin interfața loopback a containerului.",+ "help": "Utilizare:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nComanda comunică doar cu serverul Motrix activ, prin interfața loopback a containerului.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Nu există cereri de asociere în așteptare.","row": "{{userCode}} {{clientName}} {{clientVersion}} expiră în {{ttl}}",@@ -394,6 +394,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3572,5 +3587,27 @@"invalidOptions": "Fiecare listă acceptă până la {{limit}} URL-uri valide. Torrentele private necesită un tracker.","menuLabel": "Creează un fișier torrent…","downloadRequested": "Descărcare solicitată: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/ru.json b/src/shared/locales/ru.jsonindex 01220278..8e4c2058 100644--- a/src/shared/locales/ru.json+++ b/src/shared/locales/ru.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Использование:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКоманда взаимодействует только с запущенным сервером Motrix через интерфейс обратной петли контейнера.",+ "help": "Использование:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКоманда взаимодействует только с запущенным сервером Motrix через интерфейс обратной петли контейнера.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Выполните `motrix-admin --help`, чтобы узнать, как использовать команду.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3596,5 +3611,27 @@"invalidOptions": "В каждом списке допускается до {{limit}} корректных URL. Для приватного торрента нужен трекер.","menuLabel": "Создать торрент-файл…","downloadRequested": "Запрошено скачивание: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/th.json b/src/shared/locales/th.jsonindex 868b4f85..e70a2356 100644--- a/src/shared/locales/th.json+++ b/src/shared/locales/th.json@@ -372,7 +372,7 @@"unknownOption": "ไม่รู้จักตัวเลือกบรรทัดคำสั่งนี้"}},- "help": "วิธีใช้:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nคำสั่งนี้สื่อสารกับเซิร์ฟเวอร์ Motrix ที่กำลังทำงานอยู่ผ่านลูปแบ็กของคอนเทนเนอร์เท่านั้น",+ "help": "วิธีใช้:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nคำสั่งนี้สื่อสารกับเซิร์ฟเวอร์ Motrix ที่กำลังทำงานอยู่ผ่านลูปแบ็กของคอนเทนเนอร์เท่านั้น\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "ไม่มีคำขอจับคู่ที่รออยู่","row": "{{userCode}} {{clientName}} {{clientVersion}} หมดอายุใน {{ttl}}",@@ -392,6 +392,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3524,5 +3539,27 @@"invalidOptions": "แต่ละรายการมี URL ที่ถูกต้องได้สูงสุด {{limit}} รายการ ทอร์เรนต์ส่วนตัวต้องมีแทร็กเกอร์","menuLabel": "สร้างไฟล์ทอร์เรนต์…","downloadRequested": "ขอดาวน์โหลดแล้ว: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/tr.json b/src/shared/locales/tr.jsonindex 1b6f124d..bb3d75bc 100644--- a/src/shared/locales/tr.json+++ b/src/shared/locales/tr.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Kullanım:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nKomut yalnızca çalışan Motrix sunucusuyla, kapsayıcının geri döngü bağlantısı üzerinden iletişim kurar.",+ "help": "Kullanım:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nKomut yalnızca çalışan Motrix sunucusuyla, kapsayıcının geri döngü bağlantısı üzerinden iletişim kurar.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Kullanım bilgisi için `motrix-admin --help` komutunu çalıştırın.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3548,5 +3563,27 @@"invalidOptions": "Her liste en fazla {{limit}} geçerli URL içerebilir. Özel torrentler izleyici gerektirir.","menuLabel": "Torrent dosyası oluştur…","downloadRequested": "İndirme istendi: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/uk.json b/src/shared/locales/uk.jsonindex e08c4c9c..4da4d4d2 100644--- a/src/shared/locales/uk.json+++ b/src/shared/locales/uk.json@@ -375,7 +375,7 @@"unknownOption": "Невідомий параметр командного рядка."}},- "help": "Використання:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКоманда звертається лише до запущеного сервера Motrix через петльовий інтерфейс контейнера.",+ "help": "Використання:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nКоманда звертається лише до запущеного сервера Motrix через петльовий інтерфейс контейнера.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","pending": {"none": "Немає запитів на сполучення, що очікують рішення.","row": "{{userCode}} {{clientName}} {{clientVersion}} спливає через {{ttl}}",@@ -395,6 +395,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"operatorUnlock": {@@ -3596,5 +3611,27 @@"invalidOptions": "У кожному списку дозволено до {{limit}} дійсних URL. Приватному торенту потрібен трекер.","menuLabel": "Створити торрент-файл…","downloadRequested": "Запит на завантаження: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/vi.json b/src/shared/locales/vi.jsonindex 3f91cf70..5b430d4f 100644--- a/src/shared/locales/vi.json+++ b/src/shared/locales/vi.json@@ -9,7 +9,7 @@"openDsm": "Open DSM to sign in"},"operatorAdmin": {- "help": "Cách dùng:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nLệnh chỉ giao tiếp với máy chủ Motrix đang chạy qua địa chỉ loopback của container.",+ "help": "Cách dùng:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\nLệnh chỉ giao tiếp với máy chủ Motrix đang chạy qua địa chỉ loopback của container.\n\n motrix-admin token set [--stdin] [--json]\nSet a custom administrator token; weak tokens are accepted with a warning.","errorPrefix": "motrix-admin: {{message}}","usageHint": "Chạy `motrix-admin --help` để xem cách dùng.","pending": {@@ -71,6 +71,21 @@"cancelled": "Pairing code view closed. No approval or denial was sent.","invalidSelection": "Select exactly one listed request by its number.","unavailable": "The selected request expired, ended or changed. Start a new pairing attempt in the Extension."+ },+ "token": {+ "weak": "This token may be easy to guess. Consider a longer, unique passphrase. You can still save it.",+ "invalid": "Enter a nonblank token of up to 1,024 characters, without control characters.",+ "mismatch": "The new tokens do not match.",+ "incorrectToken": "The current token is incorrect. Check it and try again.",+ "managed": "This token is managed by MOTRIX_OPERATOR_TOKEN. Change the deployment environment variable and restart the server.",+ "unavailable": "The token could not be saved. The previous token is still active. Check server storage and retry.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "The result could not be confirmed. Check the token file on the server before retrying.",+ "prompt": "New token (input hidden):",+ "confirm": "Confirm new token:",+ "saved": "Token updated. Existing sessions have been signed out. Downloads continue.",+ "ttyRequired": "Use an interactive terminal, or token set --stdin to read the token from standard input.",+ "cancelled": "Token change cancelled."}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "Mỗi danh sách nhận tối đa {{limit}} URL hợp lệ. Torrent riêng tư cần có tracker.","menuLabel": "Tạo tệp torrent…","downloadRequested": "Đã yêu cầu tải xuống: {{path}}"+ },+ "operatorToken": {+ "title": "Access password",+ "change": "Change password",+ "effect": "Other devices will need to sign in again.",+ "currentToken": "Current password",+ "newToken": "New password",+ "confirmation": "Confirm new password",+ "weak": "If you plan to access Motrix over the public internet, use a stronger password.",+ "invalid": "Remove line breaks and other control characters.",+ "mismatch": "The passwords do not match.",+ "incorrectToken": "The current password is incorrect. Try again.",+ "managed": "This password is managed by the server administrator.",+ "unavailable": "Could not save. Your current password still works. Try again later.",+ "rateLimited": "Too many attempts. Wait a minute and try again.",+ "unknown": "Connection interrupted. The change could not be confirmed.",+ "saved": "Access password updated.",+ "saving": "Updating…",+ "update": "Update password",+ "requiredCurrent": "Enter your current password.",+ "requiredNew": "Enter a new password.",+ "tooLong": "This password is too long. Shorten it and try again."}}diff --git a/src/shared/locales/zh-CN.json b/src/shared/locales/zh-CN.jsonindex 7f529e4a..92a6ce09 100644--- a/src/shared/locales/zh-CN.json+++ b/src/shared/locales/zh-CN.json@@ -1,15 +1,15 @@{"operatorUnlock": {- "title": "解锁 Motrix",- "help": "此服务器需要管理员令牌。请在主机上设置 MOTRIX_OPERATOR_TOKEN,或读取 <dataDir>/operator-token 中的令牌,然后粘贴到下方。",- "placeholder": "管理员令牌",- "error": "管理员令牌无效。请核对主机上的 MOTRIX_OPERATOR_TOKEN 或 <dataDir>/operator-token 后重试。",- "submit": "解锁",+ "title": "登录 Motrix",+ "help": "首次登录或忘记密码时,请向服务器管理员获取访问密码。",+ "placeholder": "访问密码",+ "error": "密码不正确,请重试。",+ "submit": "登录","nasSessionExpired": "无法验证 NAS 管理员会话,请从 NAS 桌面重新打开 Motrix。","openDsm": "打开 DSM 登录"},"operatorAdmin": {- "help": "用法:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <配对码> [--json]\n motrix-admin pairing deny <配对码> [--json]\n motrix-admin extension pair\n\n此命令仅通过容器内的本机回环地址与正在运行的 Motrix 服务器通信。",+ "help": "用法:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <配对码> [--json]\n motrix-admin pairing deny <配对码> [--json]\n motrix-admin extension pair\n\n此命令仅通过容器内的本机回环地址与正在运行的 Motrix 服务器通信。\n\n motrix-admin token set [--stdin] [--json]\n设置自定义管理员令牌;弱令牌只提示,不阻止保存。","errorPrefix": "motrix-admin:{{message}}","usageHint": "运行 `motrix-admin --help` 查看用法。","pending": {@@ -71,6 +71,21 @@"cancelled": "已关闭配对码视图,未发送批准或拒绝操作。","invalidSelection": "请通过序号选择一个列表中的请求。","unavailable": "所选请求已过期、结束或发生变化,请在扩展中重新发起配对。"+ },+ "token": {+ "weak": "此令牌可能容易被猜到,建议使用更长、独特的短语。你仍然可以保存。",+ "invalid": "请输入非空白令牌,最多 1,024 个字符,不能包含控制字符。",+ "mismatch": "两次输入的新令牌不一致。",+ "incorrectToken": "当前令牌不正确,请核对后重试。",+ "managed": "此令牌由 MOTRIX_OPERATOR_TOKEN 管理,请修改部署环境变量并重启服务器。",+ "unavailable": "无法保存令牌,旧令牌仍然有效。请检查服务器存储后重试。",+ "rateLimited": "尝试次数过多,请等待一分钟后重试。",+ "unknown": "无法确认修改结果,请先检查服务器上的令牌文件再重试。",+ "prompt": "新令牌(输入隐藏):",+ "confirm": "再次输入新令牌:",+ "saved": "令牌已更新,已有会话已退出登录,下载任务继续运行。",+ "ttyRequired": "请在交互式终端运行,或使用 token set --stdin 从标准输入读取令牌。",+ "cancelled": "已取消令牌修改。"}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "每个列表最多 {{limit}} 个有效 URL。私有种子至少需要一个 Tracker。","menuLabel": "创建种子文件…","downloadRequested": "已请求下载 {{path}}"+ },+ "operatorToken": {+ "title": "访问密码",+ "change": "修改密码",+ "effect": "修改后,其他设备需要重新登录。",+ "currentToken": "当前密码",+ "newToken": "新密码",+ "confirmation": "再次输入新密码",+ "weak": "如需通过公网访问,建议设置更复杂的密码。",+ "invalid": "请移除换行等控制字符。",+ "mismatch": "两次输入的密码不一致。",+ "incorrectToken": "当前密码不正确,请重试。",+ "managed": "此密码由服务器管理员管理。",+ "unavailable": "未能保存,原密码仍然有效。请稍后重试。",+ "rateLimited": "尝试次数过多,请等待一分钟后重试。",+ "unknown": "连接中断,暂时无法确认修改结果。",+ "saved": "访问密码已更新。",+ "saving": "正在更新…",+ "update": "更新密码",+ "requiredCurrent": "请输入当前密码。",+ "requiredNew": "请输入新密码。",+ "tooLong": "密码过长,请缩短后重试。"}}diff --git a/src/shared/locales/zh-TW.json b/src/shared/locales/zh-TW.jsonindex 53d24872..7f26945f 100644--- a/src/shared/locales/zh-TW.json+++ b/src/shared/locales/zh-TW.json@@ -1,15 +1,15 @@{"operatorUnlock": {- "title": "解鎖 Motrix",- "help": "此伺服器需要 Operator Token。請在主機上設定 MOTRIX_OPERATOR_TOKEN,或讀取 <dataDir>/operator-token 的 Token,然後貼到下方。",- "placeholder": "Operator Token",- "error": "Operator Token 無效。請確認主機上的 MOTRIX_OPERATOR_TOKEN 或 <dataDir>/operator-token,然後再試一次。",- "submit": "解鎖",+ "title": "登入 Motrix",+ "help": "首次登入或忘記密碼時,請向伺服器管理員取得存取密碼。",+ "placeholder": "存取密碼",+ "error": "密碼不正確,請再試一次。",+ "submit": "登入","nasSessionExpired": "無法驗證 NAS 管理員工作階段,請從 NAS 桌面重新開啟 Motrix。","openDsm": "開啟 DSM 登入"},"operatorAdmin": {- "help": "用法:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\n此命令只會透過容器 loopback 與正在執行的 Motrix 伺服器通訊。",+ "help": "用法:\n motrix-admin pairing pending [--json]\n motrix-admin pairing approve <user-code> [--json]\n motrix-admin pairing deny <user-code> [--json]\n motrix-admin extension pair\n\n此命令只會透過容器 loopback 與正在執行的 Motrix 伺服器通訊。\n\n motrix-admin token set [--stdin] [--json]\n設定自訂管理員權杖;弱權杖僅提醒,不阻止儲存。","errorPrefix": "motrix-admin: {{message}}","usageHint": "執行「motrix-admin --help」查看用法。","pending": {@@ -71,6 +71,21 @@"cancelled": "已關閉配對碼檢視,未傳送核准或拒絕操作。","invalidSelection": "請透過序號選擇一個清單中的請求。","unavailable": "所選請求已過期、結束或發生變化,請在擴充功能中重新發起配對。"+ },+ "token": {+ "weak": "此權杖可能容易被猜到,建議使用更長、獨特的片語。你仍然可以儲存。",+ "invalid": "請輸入非空白權杖,最多 1,024 個字元,不能包含控制字元。",+ "mismatch": "兩次輸入的新權杖不一致。",+ "incorrectToken": "目前權杖不正確,請確認後再試。",+ "managed": "此權杖由 MOTRIX_OPERATOR_TOKEN 管理,請變更部署環境變數並重新啟動伺服器。",+ "unavailable": "無法儲存權杖,舊權杖仍然有效。請檢查伺服器儲存空間後再試。",+ "rateLimited": "嘗試次數過多,請等待一分鐘後再試。",+ "unknown": "無法確認變更結果,請先檢查伺服器上的權杖檔案再試。",+ "prompt": "新權杖(輸入隱藏):",+ "confirm": "再次輸入新權杖:",+ "saved": "權杖已更新,現有工作階段已登出,下載工作繼續執行。",+ "ttyRequired": "請在互動式終端執行,或使用 token set --stdin 從標準輸入讀取權杖。",+ "cancelled": "已取消權杖變更。"}},"common": {@@ -3524,5 +3539,27 @@"invalidOptions": "每個清單最多 {{limit}} 個有效網址。私人種子至少需要一個 Tracker。","menuLabel": "建立種子檔案…","downloadRequested": "已要求下載 {{path}}"+ },+ "operatorToken": {+ "title": "存取密碼",+ "change": "變更密碼",+ "effect": "變更後,其他裝置需要重新登入。",+ "currentToken": "目前密碼",+ "newToken": "新密碼",+ "confirmation": "再次輸入新密碼",+ "weak": "如需透過公網存取,建議設定更複雜的密碼。",+ "invalid": "請移除換行等控制字元。",+ "mismatch": "兩次輸入的密碼不一致。",+ "incorrectToken": "目前密碼不正確,請再試一次。",+ "managed": "此密碼由伺服器管理員管理。",+ "unavailable": "無法儲存,原密碼仍然有效。請稍後再試。",+ "rateLimited": "嘗試次數過多,請等待一分鐘後再試。",+ "unknown": "連線中斷,暫時無法確認變更結果。",+ "saved": "存取密碼已更新。",+ "saving": "正在更新…",+ "update": "更新密碼",+ "requiredCurrent": "請輸入目前密碼。",+ "requiredNew": "請輸入新密碼。",+ "tooLong": "密碼過長,請縮短後再試。"}}diff --git a/src/shared/schemas/operator-auth.ts b/src/shared/schemas/operator-auth.tsindex 7e5c40f7..82f950e5 100644--- a/src/shared/schemas/operator-auth.ts+++ b/src/shared/schemas/operator-auth.ts@@ -68,6 +68,7 @@ export const operatorStatusSchema = z.object({]),username: z.string().optional(),canLogout: z.boolean(),+ tokenSource: z.enum(['file', 'env']).optional(),eventOriginMatches: z.boolean().optional(),clientPairing: clientPairingCapabilitiesSchema.optional(),nasAuthDiagnostic: nasAuthDiagnosticSchema.optional(),diff --git a/src/shared/schemas/operator-token.test.ts b/src/shared/schemas/operator-token.test.tsnew file mode 100644index 00000000..56d61d08--- /dev/null+++ b/src/shared/schemas/operator-token.test.ts@@ -0,0 +1,26 @@+import { describe, expect, it } from 'vitest'+import { isWeakOperatorToken, operatorTokenSchema } from './operator-token'++describe('custom operator tokens', () => {+ it.each([+ '1',+ 'abc',+ 'password123456',+ '中文短语',+ ' space separated words ',+ ])('accepts user choices without complexity enforcement: %s', (value) => {+ expect(operatorTokenSchema.safeParse(value).success).toBe(true)+ })+ it.each(['', ' ', 'a\nb', 'a\0b', '\ud800', 'a'.repeat(1025)])(+ 'rejects unusable input',+ (value) => {+ expect(operatorTokenSchema.safeParse(value).success).toBe(false)+ }+ )+ it('warns about short, repeated and common choices without requiring character classes', () => {+ expect(isWeakOperatorToken('123')).toBe(true)+ expect(isWeakOperatorToken('password123456')).toBe(true)+ expect(isWeakOperatorToken('abcabcabcabcabc')).toBe(true)+ expect(isWeakOperatorToken('orchard railway violet')).toBe(false)+ })+})diff --git a/src/shared/schemas/operator-token.ts b/src/shared/schemas/operator-token.tsnew file mode 100644index 00000000..6c3896ed--- /dev/null+++ b/src/shared/schemas/operator-token.ts@@ -0,0 +1,42 @@+import { z } from 'zod'++// Storage and transport bounds only; strength never determines acceptance.+export const operatorTokenSchema = z+ .string()+ .min(1)+ .max(1024)+ .refine((value) => value.trim().length > 0)+ .refine((value) => !/[\p{Cc}\p{Cs}]/u.test(value))++export const changeOperatorTokenSchema = z+ .object({ currentToken: z.string().max(4096), newToken: operatorTokenSchema })+ .strict()++export const changeOperatorTokenResultSchema = z.discriminatedUnion('ok', [+ z.object({ ok: z.literal(true) }),+ z.object({+ ok: z.literal(false),+ reason: z.enum([+ 'invalid',+ 'incorrectToken',+ 'managed',+ 'unavailable',+ 'rateLimited',+ ]),+ }),+])++export type ChangeOperatorTokenResult = z.infer<+ typeof changeOperatorTokenResultSchema+>++/** A deliberately modest hint, not a strength score or an acceptance rule. */+export function isWeakOperatorToken(value: string): boolean {+ const token = value.trim().toLowerCase()+ return (+ [...token].length < 12 ||+ /^\d+$/.test(token) ||+ /^(.{1,4})\1+$/u.test(token) ||+ /^(password|qwerty|admin|letmein|motrix)[\d!@#$%^&*._-]*$/.test(token)+ )+}diff --git a/tests/scripts/vite-app-locales.test.ts b/tests/scripts/vite-app-locales.test.tsindex 8c012e1e..65a86118 100644--- a/tests/scripts/vite-app-locales.test.ts+++ b/tests/scripts/vite-app-locales.test.ts@@ -20,6 +20,7 @@ describe('desktop main locale projection', () => {expect(original.operatorAdmin).toBeDefined()const result = JSON.parse(transform(source, path.join(root, file))!.code)expect(result.operatorAdmin).toBeUndefined()+ expect(result.operatorToken).toBeUndefined()expect(result.settings.integration.browser).toBeUndefined()expect(result.task.add.duplicate).toBeUndefined()expect(result.task.storage).toEqual({@@ -28,6 +29,7 @@ describe('desktop main locale projection', () => {errors: original.task.storage.errors,})delete original.operatorAdmin+ delete original.operatorTokenoriginal.createTorrent = { menuLabel: original.createTorrent.menuLabel }delete original.settings.integration.browserdelete original.task.add.duplicate@@ -59,6 +61,7 @@ describe('desktop main locale projection', () => {delete original.operatorAdminexpect(projected).toEqual(original)expect(projected.createTorrent.seedAfter).toBeTruthy()+ expect(projected.operatorToken).toEqual(original.operatorToken)})it('leaves unrelated JSON and scripts unchanged', () => {diff --git a/tests/scripts/workflow-flatpak-release.test.ts b/tests/scripts/workflow-flatpak-release.test.tsindex 8994bb15..23f5be4a 100644--- a/tests/scripts/workflow-flatpak-release.test.ts+++ b/tests/scripts/workflow-flatpak-release.test.ts@@ -21,6 +21,7 @@ interface Workflow {if?: stringwith?: Record<string, unknown>steps?: Step[]+ container?: { image: string; options: string; volumes?: string[] }}>}@@ -33,6 +34,16 @@ const release = load() as Workflowdescribe('Flatpak release gate', () => {+ it('keeps SDK deployment updates off the container overlay without hiding preinstalled runtimes', () => {+ // A bare destination creates a fresh Docker volume populated from the image;+ // a host bind mount would instead hide its preinstalled SDK and remotes.+ expect(flatpak.jobs.build?.container).toMatchObject({+ image: expect.stringMatching(/@sha256:[a-f0-9]{64}$/),+ options: '--privileged',+ volumes: ['/var/lib/flatpak'],+ })+ })+it('builds within the release run, after version preflight, and blocks assembly on failure', () => {expect(flatpak.on.workflow_call).toEqual({inputs: {