Compare commits

..
Author SHA1 Message Date
Nariman Jelveh a299872bcc Remove code paths that only ran for the desktop's item container
The desktop is no longer an item container, so the Trash item that
refresh_item_container added to it, the empty-folder message exemption,
and the context menu parent check for it can't be reached.
2026-11-12 12:31:06 -07:00
Nariman Jelveh d374cdb04f Redirect /desktop and /settings to the dashboard
/desktop redirects to the root with its query intact, and /settings to the
dashboard's Home tab. /desktop drops out of the OIDC return_to allowlist,
sign-out returns to the root, and the auth cover page's logo links there.

Also removes eight GUI globals nothing references.
2026-11-12 12:22:28 -07:00
Nariman Jelveh 2d13b73b04 Remove the desktop's icons and right-click menu
The desktop no longer lists the Desktop folder's items, and right-clicking
its background opens no menu. It stays as the surface windows open on.

Also removes what only the icons used: file drops and item drops on the
desktop, rubber-band selection, auto arrange and saved icon positions, and
their two keys in puter.js's GUI boot cache. Clicking the desktop clears the
active item container so keyboard shortcuts stop acting on a window's items.
2026-11-12 12:16:58 -07:00
160 changed files with 5654 additions and 5162 deletions

No files matched your search

-7
View File
@@ -190,13 +190,6 @@ S3_BUCKET=puter-local
providers = [ordered]@{
ollama = [ordered]@{ enabled = $false }
}
# Off because a self-hosted install has no paid plans: every account
# is on the free policy, so the plan gates would 402 the surfaces that
# declare one (the OpenAI/Anthropic-compatible AI endpoints) for
# everybody. Same as install.sh.
meteringEnforcement = [ordered]@{
subscriptions = $false
}
trust_proxy = 1
}
$configJson = $config | ConvertTo-Json -Depth 10
+1
View File
@@ -125,6 +125,7 @@ describe('core without a teams registration', () => {
actor: { user: row },
} as never,
{ title: 'Puter' } as never,
{} as never,
);
const params = JSON.parse(
/gui\((\{.*?\})\);/s.exec(html)![1].replaceAll('\\u003c', '<'),
+11 -12
View File
@@ -736,8 +736,6 @@ export type EventMap = {
'outer.permission.flatInvalidated': {
entries: Array<{ holderUserId: number; permission: string }>;
};
/** Links on these nodes were removed; read them from the primary. */
'outer.share.linksRevoked': { fsentryIds: number[]; uuids: string[] };
/**
* A user's subscription set changed, so every process must drop its cached
* "does this user have any subscriptions" answer. Carries the counter the
@@ -876,11 +874,8 @@ export type EventMap = {
session_uids: string[];
};
/**
* One access token was revoked; only its own connections should drop.
* `outer.*` for the same reason as `outer.auth.sessions.revoked`.
*/
'outer.auth.access-token.revoked': { token_uid: string };
/** One access token was revoked; only its own connections should drop. */
'auth.access-token.revoked': { token_uid: string };
/** Same-cluster eviction for raw realtime WebSockets. */
'pubsub.realtime.auth-revoked': {
@@ -1088,10 +1083,11 @@ export type EventKey = keyof EventMap & string;
// Generates a wildcard for every non-final dot-separated prefix of K.
export type WildcardPrefixes<K extends string> =
K extends `${infer Head}.${infer Tail}`
? | `${Head}.*`
| (Tail extends `${string}.${string}`
? `${Head}.${WildcardPrefixes<Tail>}`
: never)
?
| `${Head}.*`
| (Tail extends `${string}.${string}`
? `${Head}.${WildcardPrefixes<Tail>}`
: never)
: never;
export type ListenKey = EventKey | WildcardPrefixes<EventKey>;
@@ -1102,7 +1098,10 @@ export type MatchingEvents<P extends ListenKey> = P extends `${infer Prefix}.*`
/** Acked, not acked, no socket anywhere, or sockets only in a peer region. */
export type NotifDeliveryOutcome =
'received' | 'unreceived' | 'no-socket' | 'remote-only';
| 'received'
| 'unreceived'
| 'no-socket'
| 'remote-only';
/** One socket's receipt for a live notification. */
export interface NotifDeliveryResponder {
@@ -23,7 +23,6 @@ import { makeActor } from '../../core/actor.js';
import { runWithContext } from '../../core/context.js';
import { createSecret as otpCreateSecret } from '../../services/auth/OTPUtil.js';
import { FULL_API_ACCESS } from '../../services/permission/consts.js';
import { tokenClaimsDigest } from '../../../gui/src/helpers/guiToken.js';
import {
createTestUser,
setupPuterTestEnv,
@@ -715,67 +714,4 @@ describe('session token helpers over HTTP', () => {
'puter_auth_token=',
);
});
describe("the shell's guiTokenDigest", () => {
/** The session cookie `/session/sync-cookie` sets for `token`. */
const sessionCookie = async (token: string) => {
const sync = await get('/session/sync-cookie', token);
expect(sync.status).toBe(204);
const value = /puter_auth_token=([^;]+)/.exec(
sync.headers.get('set-cookie') ?? '',
)?.[1];
expect(value).toBeTruthy();
return `puter_auth_token=${value}`;
};
/** What the shell at `path` renders for `guiTokenDigest`. */
const shellDigest = async (path: string, cookie?: string) => {
const res = await fetch(new URL(path, env.origin), {
headers: cookie ? { cookie } : {},
});
expect(res.status).toBe(200);
const html = await res.text();
const match = /"guiTokenDigest":(null|"[0-9a-f]{32}")/.exec(html);
if (!match) {
expect(html).not.toContain('guiTokenDigest');
return undefined;
}
return JSON.parse(match[1]) as string | null;
};
it("names the token /get-gui-token hands over for the session cookie", async () => {
const { token } = await signupTemp();
const cookie = await sessionCookie(token);
const gui = await fetch(new URL('/get-gui-token', env.origin), {
headers: { cookie },
});
expect(gui.status).toBe(200);
const { token: guiToken } = (await gui.json()) as { token: string };
const digest = await shellDigest('/', cookie);
expect(digest).toBe(await tokenClaimsDigest(guiToken));
// The token the browser stored at sign-up is for the same session.
expect(await tokenClaimsDigest(token)).toBe(digest);
});
it('is null without a session cookie, even with a token in the URL', async () => {
const { token } = await signupTemp();
expect(await shellDigest('/')).toBe(null);
expect(
await shellDigest(`/?auth_token=${encodeURIComponent(token)}`),
).toBe(null);
});
it('is left out when the session cookie does not resolve to a session', async () => {
const { token } = await signupTemp();
const cookie = await sessionCookie(token);
await env.server.services.auth.revokeSession(claims(token).session_uid);
expect(await shellDigest('/', cookie)).toBe(undefined);
expect(await shellDigest('/', 'puter_auth_token=garbage')).toBe(
undefined,
);
});
});
});
@@ -8293,10 +8293,11 @@ describe('AuthController session endpoints', () => {
).rejects.toMatchObject({ statusCode: 400 });
});
it('revoke-session: 404 when revoking someone else’s session', async () => {
it('revoke-session: 403 when revoking someone else’s session', async () => {
const { user: u1 } = await makeUserAndActor();
const { actor: a2 } = await makeUserAndActor();
// A real session of u1, revoked as a2: answers as a missing one.
// Create a real session for u1 so the lookup succeeds, then attempt
// to revoke it as a2 — must 403.
const sessionRes = await server.services.auth.createSessionToken(
u1,
{},
@@ -8309,7 +8310,7 @@ describe('AuthController session endpoints', () => {
),
makeRes(),
),
).rejects.toMatchObject({ statusCode: 404 });
).rejects.toMatchObject({ statusCode: 403 });
});
it('rename-session: 400 when uuid param is missing', async () => {
@@ -10081,77 +10082,6 @@ describe('AuthController.handleRevokeSession additional branches', () => {
expect(Array.isArray(body.sessions)).toBe(true);
});
const expiredSessionOf = async (user: { id: number }) => {
const row = await server.stores.session.create(user.id, {
expires_at: Math.floor(Date.now() / 1000) - 1,
});
return row.uuid as string;
};
it('revokes an expired session the caller owns', async () => {
const { user, actor } = await makeUserAndActor();
const uuid = await expiredSessionOf(user);
const res = makeRes();
await controller.handleRevokeSession(makeReq({ uuid }, { actor }), res);
const body = res.body as { sessions: Array<{ uuid: string }> };
expect(body.sessions.map((s) => s.uuid)).not.toContain(uuid);
const rows = await server.clients.db.read(
'SELECT `revoked_at` FROM `sessions` WHERE `uuid` = ?',
[uuid],
);
expect(rows[0].revoked_at).not.toBeNull();
});
it('revoking an expired session ends its live child token', async () => {
const { user, actor } = await makeUserAndActor();
const parent = await expiredSessionOf(user);
const child = await server.stores.session.getOrCreateGodmodeToken(
user.id,
{
parentSessionUid: parent,
appUid: `app-${uuidv4()}`,
expiresAt: Math.floor(Date.now() / 1000) + 3600,
maxAgeSeconds: 3600,
label: 'Godmode app',
auth_id: user.uuid,
},
);
const childUuid = child!.row.uuid as string;
expect(await server.stores.session.getByUuid(childUuid)).toBeTruthy();
await controller.handleRevokeSession(
makeReq({ uuid: parent }, { actor }),
makeRes(),
);
expect(await server.stores.session.getByUuid(childUuid)).toBeNull();
});
it('answers 404 for an expired session of another user', async () => {
const { user: owner } = await makeUserAndActor();
const { actor } = await makeUserAndActor();
const uuid = await expiredSessionOf(owner);
await expect(
controller.handleRevokeSession(
makeReq({ uuid }, { actor }),
makeRes(),
),
).rejects.toMatchObject({ statusCode: 404 });
});
it('answers 404 for a session that is already revoked', async () => {
const { user, actor } = await makeUserAndActor();
const row = await server.stores.session.create(user.id);
await server.stores.session.removeByUuid(row.uuid);
await expect(
controller.handleRevokeSession(
makeReq({ uuid: row.uuid }, { actor }),
makeRes(),
),
).rejects.toMatchObject({ statusCode: 404 });
});
it('refuses to revoke the caller’s OWN current session row (400)', async () => {
// Invariant: a self-revoke leaves the client in an ambiguous
// identity state because the response can't write fresh auth
+11 -8
View File
@@ -3585,18 +3585,21 @@ export class AuthController extends PuterController {
{ legacyCode: 'bad_request' },
);
}
// Missing, already revoked and other users' rows all answer 404; an
// expired row is still revoked so its children go with it.
const session = await this.stores.session.getByUuidAny(uuid);
if (
!session ||
session.revoked_at != null ||
session.user_id !== req.actor!.user.id
) {
// `getByUuid` returns null when the row is missing, already
// soft-revoked, or past `expires_at` — surface as 404 so a stale
// manage-sessions UI doesn't 500 when it clicks revoke on a row
// that already went away.
const session = await this.stores.session.getByUuid(uuid);
if (!session) {
throw new HttpError(404, 'Session not found', {
legacyCode: 'not_found',
});
}
if (session.user_id !== req.actor!.user.id) {
throw new HttpError(403, 'Can only revoke your own sessions', {
legacyCode: 'unauthorized',
});
}
await this.services.auth.revokeSession(uuid);
const sessions = await this.services.auth.listSessions(req.actor!);
res.json({ sessions });
@@ -154,26 +154,6 @@ describe('GET /fs/readdir over HTTP', () => {
).toEqual(['a', 'a/b']);
});
it('answers 404 for a directory whose parent chain is broken', async () => {
const { username, token } = env.users.user;
const path = `/${username}/Documents/http-orphan-${Date.now()}`;
const created = await fetch(new URL('/fs/mkdir', env.apiOrigin), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ path, auth_token: token }),
});
expect(created.status).toBe(200);
const { uid } = (await created.json()) as { uid: string };
await env.server.clients.db.write(
'UPDATE fsentries SET path = NULL, parent_uid = ? WHERE uuid = ?',
['does-not-exist', uid],
);
await env.server.stores.fsEntry.invalidateEntryCacheByUuid(uid);
const response = await fetch(readdirUrl({ uid, auth_token: token }));
expect(response.status).toBe(404);
});
it('mkdir does not return internal ids, storage columns or tokens', async () => {
const { username, token } = env.users.user;
const response = await fetch(new URL('/fs/mkdir', env.apiOrigin), {
@@ -222,22 +222,6 @@ describe('HomepageController shell routes', () => {
expect(String(captured.body)).toMatch(/<!DOCTYPE html>/i);
});
it('leaves guiTokenDigest out for a session cookie that is not a user session', async () => {
const { actor } = await makeUser();
const appActor = {
...actor,
app: { id: 1, uid: 'app-test' },
session: { uid: uuidv4() },
} as unknown as Actor;
const req = Object.assign(makeReq({ path: '/', actor: appActor }), {
tokenSource: 'cookie',
cookies: { puter_token_v2: 'legacy' },
});
const { res, captured } = makeRes();
await callRoute('get', '/', req, res);
expect(String(captured.body)).not.toContain('guiTokenDigest');
});
it('serves the shell on /dashboard and /action', async () => {
for (const path of ['/dashboard', '/dashboard/', '/action/*splat']) {
const { res, captured } = makeRes();
@@ -482,22 +466,21 @@ describe('HomepageController app landing rate limit', () => {
// ── /show/* ─────────────────────────────────────────────────────────
describe('HomepageController GET /show/*splat', () => {
it('redirects to the path in the dashboard Files tab, keeping the query', async () => {
it('emits a launch_app explorer call with the post-/show path', async () => {
const { res, captured } = makeRes();
await callRoute(
'get',
'/show/*splat',
makeReq({
path: '/show/alice/My%20Documents',
originalUrl: '/show/alice/My%20Documents?ref=abc',
}),
makeReq({ path: '/show/alice/Documents' }),
res,
);
expect(captured.statusCode).toBe(302);
expect(captured.location).toBe(
'/dashboard?ref=abc#files/alice/My%20Documents',
);
expect(captured.body).toBeUndefined();
// The launch payload is JSON-serialized into the rendered HTML.
// We assert the rendered shell included the explorer launch hint
// pointing at the expected (slashed) path.
const html = String(captured.body);
expect(html).toContain('launch_app');
expect(html).toContain('explorer');
expect(html).toContain('/alice/Documents');
});
});
@@ -20,7 +20,6 @@
import express from 'express';
import path from 'node:path';
import { PuterController } from '../types.js';
import { isPlainUserActor } from '../../core/actor.js';
import { toAppShellView } from '../../util/appShellView.js';
import type { PuterRouter } from '../../core/http/PuterRouter';
import {
@@ -28,12 +27,11 @@ import {
subdomainLabelOf,
} from '../../core/http/middleware/hostRedirects.js';
import type { IConfig } from '../../types';
import type { UserRow } from '../../stores/user/UserStore';
import type {
PuterHomepageService,
PageMeta,
LaunchOptions,
PopupFrame,
ShellContext,
} from '../../services/homepage/PuterHomepageService';
/**
@@ -172,6 +170,7 @@ export class HomepageController extends PuterController {
req: express.Request,
res: express.Response,
metaOverrides: Partial<PageMeta> = {},
launch: LaunchOptions = {},
popupFrame?: PopupFrame,
) => {
const meta = { ...defaultMeta(req), ...metaOverrides };
@@ -181,16 +180,7 @@ export class HomepageController extends PuterController {
actor?: Parameters<typeof homepage.send>[0]['actor'];
}
).actor ?? null;
await homepage.send(
{
req,
res,
actor,
guiTokenDigest: this.#guiTokenDigest(req, actor),
},
meta,
popupFrame,
);
await homepage.send({ req, res, actor }, meta, launch, popupFrame);
};
// -- Root + path-aliased shell routes ------------------------
@@ -262,6 +252,7 @@ export class HomepageController extends PuterController {
req,
res,
{},
{},
{
hostOrigin: embedHostOrigin(
this.config,
@@ -363,10 +354,20 @@ export class HomepageController extends PuterController {
sendAppShell,
);
// Old /show links open the path in the dashboard's Files tab, query intact.
// -- /show/* - launch explorer with the requested file path --
router.get('/show/*splat', {}, (req, res) => {
const filePath = req.path.slice('/show'.length);
res.redirect(`/dashboard${queryOf(req)}#files${filePath}`);
const launch: LaunchOptions = {
on_initialized: [
{
$: 'window-call',
fn_name: 'launch_app',
args: [{ name: 'explorer', path: filePath }],
},
],
};
return sendShell(req, res, {}, launch);
});
// -- /sw.js - the service worker, scoped to the whole origin --
@@ -395,38 +396,6 @@ export class HomepageController extends PuterController {
);
}
}
/**
* Lets the GUI skip `/get-gui-token`, which reads the session cookie: the
* digest of the token it would hand over, null when there is no session
* cookie (either name the auth probe reads), and undefined (the GUI asks)
* when a cookie didn't resolve to a session.
*/
#guiTokenDigest(
req: express.Request,
actor: ShellContext['actor'],
): string | null | undefined {
if (req.tokenSource === 'cookie') {
if (!actor || !isPlainUserActor(actor) || !actor.session?.uid) {
return undefined;
}
return this.services.auth.guiTokenDigest(
actor.user as UserRow,
actor.session.uid,
);
}
const cookies = (req.cookies ?? {}) as Record<string, unknown>;
const hasSessionCookie = [
this.config.cookie_name,
'puter_token_v2',
].some(
(name) =>
!!name &&
typeof cookies[name] === 'string' &&
cookies[name] !== '',
);
return hasSessionCookie ? undefined : null;
}
}
const safeJsonParse = (s: string): Record<string, unknown> | null => {
+13 -20
View File
@@ -24,7 +24,11 @@ import { computeNetworkFingerprint } from '../../core/http/middleware/rateLimit.
import type { PuterRouter } from '../../core/http/PuterRouter.js';
import { PuterController } from '../types.js';
import { PEER_COSTS } from './costs.js';
import { signGuestGrant, verifyGuestGrant } from './guestGrant.js';
import {
readClaimedGrantIdentifier,
signGuestGrant,
verifyGuestGrant,
} from './guestGrant.js';
import {
DEFAULT_FREE_SUBSCRIPTION,
DEFAULT_TEMP_SUBSCRIPTION,
@@ -187,30 +191,19 @@ export class PeerController extends PuterController {
// guests share one bucket and no host can be relayed for by
// more guests per minute than this — the only ceiling on guest
// spend we can apply before the bytes are already spent.
// The limiter counts a request when it admits it, so only a
// grant that would redeem names a host; otherwise anyone
// holding the host's identifier could drain the bucket and
// lock out every real guest. Anything else - forged, expired,
// malformed, or no secret configured - is charged to the
// caller's own network.
// A grant that doesn't parse can't name a bucket, so those
// requests fall back to the caller's own network.
rateLimit: {
scope: 'peer-guest-turn',
limit: 60,
window: 60_000,
key: (req: Request) => {
const secret =
this.config.peers?.guest_turn?.grant_secret;
const verified = secret
? verifyGuestGrant({
grant: (
req.body as
{ grant?: unknown } | undefined
)?.grant,
secret,
})
: null;
return verified?.status === 'ok'
? `host:${verified.customIdentifier}`
const claimed = readClaimedGrantIdentifier(
(req.body as { grant?: unknown } | undefined)
?.grant,
);
return claimed
? `host:${claimed}`
: `net:${computeNetworkFingerprint(req)}`;
},
},
+1 -1
View File
@@ -19,7 +19,7 @@
import { toMicroCents } from '../../services/metering/utils';
// Microcents per byte of TURN egress ($0.10/GB).
// Microcents per byte of TURN egress ($0.05/GB).
export const PEER_COSTS = {
'turn:egress-bytes': toMicroCents(0.1 / 1000 ** 3),
} as const;
@@ -1,6 +1,7 @@
import { createHmac } from 'node:crypto';
import { describe, expect, it } from 'vitest';
import {
readClaimedGrantIdentifier,
signGuestGrant,
verifyGuestGrant,
} from './guestGrant.js';
@@ -242,3 +243,59 @@ describe('signGuestGrant / verifyGuestGrant', () => {
});
});
});
describe('readClaimedGrantIdentifier', () => {
it('reads the identifier from a valid grant', () => {
const { grant } = signGuestGrant({
customIdentifier: USER_ID,
ttlSeconds: 60,
secret: SECRET,
});
expect(readClaimedGrantIdentifier(grant)).toBe(USER_ID);
});
it('reads the claimed identifier without checking the signature', () => {
// Bucketing runs before verification, so this is expected: a forged
// grant still names a bucket, and the handler still rejects it.
const grant = forgeGrant(
{ id: USER_ID, exp: 9_999_999_999, n: 'x' },
{ secret: 'wrong-secret' },
);
expect(readClaimedGrantIdentifier(grant)).toBe(USER_ID);
});
it('reads an expired grant, which the handler then rejects', () => {
const { grant } = signGuestGrant({
customIdentifier: USER_ID,
ttlSeconds: 60,
secret: SECRET,
now: 1_000_000_000_000,
});
expect(readClaimedGrantIdentifier(grant)).toBe(USER_ID);
expect(verifyGuestGrant({ grant, secret: SECRET })).toEqual({
status: 'expired',
});
});
it.each([
['a non-string', 42],
['undefined', undefined],
['a wrong-shaped string', 'not-a-grant'],
['an unknown version', 'pg2.abc.def'],
['an over-long string', `pg1.${'a'.repeat(600)}.sig`],
[
'a non-JSON payload',
`pg1.${Buffer.from('x').toString('base64url')}.sig`,
],
])('returns null for %s', (_label, grant) => {
expect(readClaimedGrantIdentifier(grant)).toBeNull();
});
it('returns null for an identifier of the wrong shape', () => {
const grant = forgeGrant({ id: 'nope', exp: 9_999_999_999 });
expect(readClaimedGrantIdentifier(grant)).toBeNull();
});
});
@@ -171,3 +171,37 @@ export const verifyGuestGrant = ({
expiresAt: payload.exp,
};
};
/**
* Read the claimed identifier out of a grant _without_ verifying it, for
* rate-limit bucketing only.
*
* Bucketing has to happen before the handler runs, and a forged grant is
* rejected there without reaching the upstream API — so an unverified read is
* enough to put a host's guests in one bucket, and the worst a forger achieves
* is choosing which bucket their own rejections land in. Never use this to
* decide attribution.
*
* @returns The claimed identifier, or null if the grant doesn't parse.
*/
export const readClaimedGrantIdentifier = (grant: unknown): string | null => {
if (typeof grant !== 'string' || grant.length > MAX_GRANT_LENGTH) {
return null;
}
const parts = grant.split('.');
if (parts.length !== 3 || parts[0] !== GRANT_VERSION) return null;
try {
const payload = JSON.parse(
Buffer.from(parts[1]!, 'base64url').toString('utf8'),
) as { id?: unknown };
if (
typeof payload?.id !== 'string' ||
!IDENTIFIER_RE.test(payload.id)
) {
return null;
}
return payload.id;
} catch {
return null;
}
};
@@ -243,33 +243,6 @@ describe('WispController', () => {
expect(await verifyStatus(token)).toBe(403);
});
it('binds a token minted by an access token to that token while the replica lags', async () => {
const { sessionActor, apiTokenActor, apiToken } = await freshUser();
const db = server.clients.db;
const original = db.read.bind(db);
const spy = vi
.spyOn(db, 'read')
.mockImplementation(async (sql: string, params?: unknown[]) =>
sql.includes("FROM `sessions` WHERE `kind` = 'access_token'")
? []
: original(sql, params),
);
let token: string;
try {
token = await relayTokenFor(apiTokenActor);
} finally {
spy.mockRestore();
}
expect(await verifyStatus(token)).toBe(200);
await server.services.auth.revokeAccessToken(
sessionActor,
apiToken,
);
expect(await verifyStatus(token)).toBe(403);
});
it('applies the account checks to a token with no session claim', async () => {
const { row } = await freshUser();
const token = server.services.token.sign(
@@ -151,12 +151,11 @@ export class WispController extends PuterController {
/**
* The session a relay token lives no longer than. An access token's is its
* own session row.
* own session row; the actor doesn't carry it.
*/
async #sessionUidFor(actor: Actor): Promise<string | undefined> {
if (actor.session?.uid) return actor.session.uid;
if (!actor.accessToken) return undefined;
if (actor.accessToken.sessionUid) return actor.accessToken.sessionUid;
const row = await this.stores.session.findActiveByAccessTokenUid(
actor.accessToken.uid,
);
-5
View File
@@ -47,11 +47,6 @@ export interface ActorAccessToken {
* reach while revokes, audits and gate hooks can still name the app.
*/
godmodeApp?: ActorApp | null;
/**
* The token's own session row, checked live when it authenticated. Unset
* when the token carries no `session_uid` naming its row.
*/
sessionUid?: string;
}
export interface Actor {
@@ -50,13 +50,6 @@ declare global {
tokenAuthFailed?: boolean;
/**
* What `authenticate` threw while checking the token (a database
* failure, say). The token may be fine; gates rethrow this instead
* of answering 401.
*/
tokenAuthError?: unknown;
/**
* Set when a token authenticated but its app is on the origin
* blocklist. The auth probe leaves `actor` unset; gates translate
@@ -1,110 +0,0 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
import { setupPuterTestEnv, type PuterTestEnv } from '../../../testUtil.js';
const loadShed = () =>
Object.assign(new Error('Database operation failed'), {
code: 'dbBatchFailed',
});
/**
* A token whose lookup fails is not a dead token: clients discard a token on
* 401 `token_auth_failed`, so that answer is kept for tokens that checked out
* invalid.
*/
describe('auth probe when the token lookup fails', () => {
let env: PuterTestEnv;
beforeAll(async () => {
env = await setupPuterTestEnv();
}, 120_000);
afterAll(async () => {
await env?.shutdown();
});
const get = (path: string, token: string) =>
fetch(new URL(path, env.apiOrigin), {
headers: { authorization: `Bearer ${token}` },
});
/** Run `fn` while the next user lookup rejects with `error`. */
const withFailedUserLookup = async <T>(
error: Error,
fn: () => Promise<T>,
): Promise<T> => {
const spy = vi
.spyOn(env.server.stores.user, 'getByUuid')
.mockRejectedValueOnce(error);
try {
return await fn();
} finally {
spy.mockRestore();
}
};
it.each([
['a session token', () => env.users.user.token],
['an access token', () => env.users.user.apiToken],
])(
'answers %s with 503 db_unavailable during a database outage',
async (_kind, tokenOf) => {
const token = tokenOf();
const res = await withFailedUserLookup(loadShed(), () =>
get('/whoami', token),
);
expect(res.status).toBe(503);
expect(res.headers.get('retry-after')).toBe('5');
expect(await res.json()).toEqual({
error: 'Service temporarily unavailable',
message: 'Service temporarily unavailable',
code: 'db_unavailable',
});
expect((await get('/whoami', token)).status).toBe(200);
},
);
it('answers an unexpected lookup failure with a generic 500, not a 401', async () => {
const res = await withFailedUserLookup(new Error('boom'), () =>
get('/whoami', env.users.user.token),
);
expect(res.status).toBe(500);
expect((await res.json()).code).toBe('internal_error');
});
it('serves a route that does not require auth anonymously', async () => {
const res = await withFailedUserLookup(loadShed(), () =>
get('/version', env.users.user.token),
);
expect(res.status).toBe(200);
});
it('still answers an invalid token with 401 token_auth_failed', async () => {
const res = await get('/whoami', 'not-a-real-jwt');
expect(res.status).toBe(401);
expect(await res.json()).toEqual({
error: 'Authentication failed',
message: 'Authentication failed',
code: 'token_auth_failed',
});
});
});
@@ -555,18 +555,17 @@ describe('createAuthProbe — actor attachment + failure tracking', () => {
expect(req.tokenAuthFailed).toBe(true);
});
it('never rejects — records the error, not tokenAuthFailed, when AuthService throws', async () => {
it('never rejects — sets tokenAuthFailed even when AuthService throws', async () => {
const stub = makeStubAuth();
stub.setNext('throw');
const probe = createAuthProbe({ authService: stub.service });
const { req, next } = await runProbe(
probe,
makeReq({ headers: { authorization: 'Bearer some-tok' } }),
makeReq({ headers: { authorization: 'Bearer bad-tok' } }),
);
// Critical invariant: the probe NEVER rejects, no matter what.
expect(next).toHaveBeenCalledWith();
expect(req.tokenAuthFailed).toBeUndefined();
expect(req.tokenAuthError).toBeInstanceOf(Error);
expect(req.tokenAuthFailed).toBe(true);
expect(req.actor).toBeUndefined();
});
@@ -881,27 +880,4 @@ describe('createAuthProbe (integration) — real session token → real actor',
expect(req.actor).toBeUndefined();
expect(req.tokenAuthFailed).toBe(true);
});
it('records a failed user lookup on a valid token without marking it invalid', async () => {
const user = await makeUser();
const { token } = await authService.createSessionToken(user);
const lookupError = Object.assign(new Error('db down'), {
code: 'dbBatchFailed',
});
const spy = vi
.spyOn(server.stores.user, 'getByUuid')
.mockRejectedValueOnce(lookupError);
try {
const probe = createAuthProbe({ authService });
const { req } = await runProbe(
probe,
makeReq({ headers: { authorization: `Bearer ${token}` } }),
);
expect(req.actor).toBeUndefined();
expect(req.tokenAuthFailed).toBeUndefined();
expect(req.tokenAuthError).toBe(lookupError);
} finally {
spy.mockRestore();
}
});
});
@@ -45,9 +45,9 @@ interface AuthProbeOptions {
* and valid — attaches an `Actor` to `req.actor`.
*
* Key property: this middleware **never rejects**. Missing tokens, malformed
* tokens, expired tokens, tokens pointing at deleted users, and lookups that
* fail outright all result in `req.actor` being left undefined. Per-route gates
* decide whether absence is acceptable.
* tokens, expired tokens, tokens pointing at deleted users — all result in
* `req.actor` being left undefined. Per-route gates decide whether absence is
* acceptable.
*
* Token lookup order:
*
@@ -153,10 +153,8 @@ export const createAuthProbe = (opts: AuthProbeOptions): RequestHandler => {
} else if (result.invalid) {
req.tokenAuthFailed = true;
}
} catch (err) {
// Not a verdict on the token: routes that require auth answer
// with this error, routes that don't serve the request anonymously.
req.tokenAuthError = err;
} catch {
req.tokenAuthFailed = true;
}
next();
};
@@ -288,22 +288,6 @@ describe('requireAuthGate', () => {
});
expectHttpError(got, 401, 'reauth_required');
});
it('passes on the error when the token could not be checked', () => {
const lookupError = Object.assign(new Error('down'), {
code: 'dbBatchFailed',
});
const got = runGate(requireAuthGate(), { tokenAuthError: lookupError });
expect(got).toBe(lookupError);
});
it('still answers token_auth_failed when a check found the token invalid', () => {
const got = runGate(requireAuthGate(), {
tokenAuthFailed: true,
tokenAuthError: new Error('down'),
});
expectHttpError(got, 401, 'token_auth_failed');
});
});
// ── requireUserActorGate ────────────────────────────────────────────
@@ -346,14 +330,6 @@ describe('requireUserActorGate', () => {
expectHttpError(got, 401, 'token_missing');
});
it('passes on the error when the token could not be checked', () => {
const lookupError = new Error('down');
const got = runGate(requireUserActorGate(), {
tokenAuthError: lookupError,
});
expect(got).toBe(lookupError);
});
it('rejects a FULL-ACCESS access token too — account routes stay closed', () => {
// The account wall is actor-type based: even a full-access PAT (which
// the resource wall lets through) is rejected here, so it can never
+1 -4
View File
@@ -50,7 +50,7 @@ import { assertVerifiedEmail } from '../verifiedEmail';
// Make sure the `Express.Request.actor` augmentation is in scope.
import '../expressAugmentation';
const rejectAuth = (req: Request): unknown => {
const rejectAuth = (req: Request): HttpError => {
if (req.requiresReauth) {
return new HttpError(401, 'Re-authentication required', {
legacyCode: 'reauth_required',
@@ -71,9 +71,6 @@ const rejectAuth = (req: Request): unknown => {
legacyCode: 'token_auth_failed',
});
}
// The token couldn't be checked, so a 401 would wrongly tell the client
// to discard it; the error handler answers (503 for a database outage).
if (req.tokenAuthError !== undefined) return req.tokenAuthError;
return new HttpError(401, 'Missing authentication token', {
legacyCode: 'token_missing',
});
@@ -18,7 +18,7 @@
*/
import type { Request } from 'express';
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import { v4 as uuidv4 } from 'uuid';
import { makeActor } from '../../actor';
import {
@@ -1132,150 +1132,14 @@ describe('resolvePublicHostedIdentity', () => {
const reqOf = (init: {
cookies?: Record<string, string>;
actor?: unknown;
headers?: Record<string, string>;
query?: Record<string, string>;
}): Request =>
({
cookies: init.cookies ?? {},
actor: init.actor,
headers: init.headers ?? {},
query: init.query ?? {},
headers: {},
query: {},
}) as unknown as Request;
describe('with the launch token in the Referer', () => {
const host = 'launch.site.puter.localhost';
const cookieName = HOSTED_ASSET_COOKIES.public.name;
const launch = async () => {
const user = await makeUser();
const sub = `launch-${uuidv4().slice(0, 8)}`;
const app = await server.stores.app.create(
{ name: sub, title: sub, index_url: `http://${host}/` },
{ ownerUserId: user.id },
);
const token = await authService.getUserAppToken(
{ user } as unknown as Parameters<
typeof authService.getUserAppToken
>[0],
app.uid,
);
const actor = (await authService.authenticateFromToken(token))!;
const cookie = await authService.createHostedAssetToken('public', {
appUid: app.uid,
userUid: user.uuid,
sessionUuid: actor.session?.uid,
subdomain: 'launch',
host,
});
return { user, appUid: app.uid, token, cookie, actor };
};
const resolve = (
appUid: string,
init: Parameters<typeof reqOf>[0],
expectedHost = host,
) =>
resolvePublicHostedIdentity({
req: reqOf(init),
authService,
sessionCookieName: 'puter_auth_token',
expectedAppUid: appUid,
expectedSubdomain: 'launch',
expectedHost,
});
const refererFor = (token: string) =>
`http://${host}/?puter.auth.token=${encodeURIComponent(token)}`;
it('takes the cookie when the token names its user and session', async () => {
const { user, appUid, token, cookie } = await launch();
const authenticate = vi.spyOn(authService, 'authenticate');
try {
const out = await resolve(appUid, {
cookies: { [cookieName]: cookie },
headers: { referer: refererFor(token) },
});
expect(out).toMatchObject({
source: 'public-cookie',
userUid: user.uuid,
hasValidPublicCookie: true,
});
expect(authenticate).not.toHaveBeenCalled();
} finally {
authenticate.mockRestore();
}
});
it('authenticates a query token even when it names the cookie identity', async () => {
const { user, appUid, token, cookie } = await launch();
const out = await resolve(appUid, {
cookies: { [cookieName]: cookie },
query: { 'puter.auth.token': token },
});
expect(out.source).toBe('query');
expect(out.userUid).toBe(user.uuid);
expect(
(out as { hasValidPublicCookie?: boolean })
.hasValidPublicCookie,
).toBeUndefined();
});
it('authenticates the token when the cookie was minted for another host', async () => {
const { user, appUid, token, cookie } = await launch();
const out = await resolve(
appUid,
{
cookies: { [cookieName]: cookie },
headers: { referer: refererFor(token) },
},
'other.site.puter.localhost',
);
expect(out.source).toBe('referrer');
expect(out.userUid).toBe(user.uuid);
});
it('authenticates a token that names another app under the same session', async () => {
const { user, appUid, cookie, actor } = await launch();
const otherAppToken = server.services.token.sign('auth', {
type: 'app-under-user',
version: '2',
user_uid: user.uuid,
app_uid: `app-${uuidv4()}`,
session_uid: actor.session!.uid,
});
const authenticate = vi.spyOn(authService, 'authenticate');
try {
const out = await resolve(appUid, {
cookies: { [cookieName]: cookie },
headers: { referer: refererFor(otherAppToken) },
});
expect(authenticate).toHaveBeenCalledTimes(1);
expect(out.source).toBe('public-cookie');
} finally {
authenticate.mockRestore();
}
});
it('never resolves a scoped access token, with or without the cookie', async () => {
const { user, appUid, cookie } = await launch();
const scoped = await authService.createAccessToken(
makeActor({
user: { id: user.id, uuid: user.uuid, username: user.username },
}),
[[`user:${user.uuid}:email:read`]],
);
const withCookie = await resolve(appUid, {
cookies: { [cookieName]: cookie },
headers: { referer: refererFor(scoped) },
});
expect(withCookie.source).toBe('public-cookie');
const withoutCookie = await resolve(appUid, {
headers: { referer: refererFor(scoped) },
});
expect(withoutCookie.source).toBe('none');
});
});
it('returns the cookie identity when present and valid', async () => {
const user = await makeUser();
const appUid = `app-${uuidv4()}`;
@@ -86,10 +86,6 @@ export interface PrivateIdentity {
hasValidPrivateCookie?: boolean;
}
type PublicCookieClaims = Awaited<
ReturnType<AuthService['verifyHostedAssetToken']>
>;
interface SubdomainLike {
user_id?: number | null;
}
@@ -537,63 +533,8 @@ export async function resolvePublicHostedIdentity(opts: {
}
}
const { name: publicCookieNameV2, legacyName: publicCookieNameLegacy } =
HOSTED_ASSET_COOKIES.public;
const publicCookieToken =
(typeof cookies?.[publicCookieNameV2] === 'string'
? cookies[publicCookieNameV2]
: null) ??
(typeof cookies?.[publicCookieNameLegacy] === 'string'
? cookies[publicCookieNameLegacy]
: null);
let publicCookieClaims: Promise<PublicCookieClaims | null> | undefined;
const verifyPublicCookie = () =>
(publicCookieClaims ??= (async () => {
if (!publicCookieToken) return null;
try {
return await authService.verifyHostedAssetToken(
'public',
publicCookieToken,
{
appUid: expectedAppUid,
subdomain: expectedSubdomain,
host: expectedHost,
},
);
} catch {
// v1-signed cookies land here and get re-minted.
return null;
}
})());
const publicCookieIdentity = (claims: PublicCookieClaims) => ({
source: 'public-cookie' as const,
userUid: claims.userUid,
sessionUuid: claims.sessionUuid,
hasValidPublicCookie: true,
});
const bootstrap = getBootstrapToken(req);
if (bootstrap) {
// A launched app's own assets carry its launch token in the Referer.
// When that token names the cookie's user and session, the cookie
// already stands for it and nothing needs re-authenticating or minting.
if (
bootstrap.source === 'referrer' &&
publicCookieToken &&
expectedAppUid
) {
const named = authService.signedSessionClaims(bootstrap.token);
if (named && (!named.appUid || named.appUid === expectedAppUid)) {
const claims = await verifyPublicCookie();
if (
claims &&
claims.userUid === named.userUid &&
claims.sessionUuid === named.sessionUuid
) {
return publicCookieIdentity(claims);
}
}
}
try {
const actor = await authService.authenticateFromToken(
bootstrap.token,
@@ -613,8 +554,36 @@ export async function resolvePublicHostedIdentity(opts: {
}
}
const claims = await verifyPublicCookie();
if (claims) return publicCookieIdentity(claims);
const { name: publicCookieNameV2, legacyName: publicCookieNameLegacy } =
HOSTED_ASSET_COOKIES.public;
const publicCookieToken =
(typeof cookies?.[publicCookieNameV2] === 'string'
? cookies[publicCookieNameV2]
: null) ??
(typeof cookies?.[publicCookieNameLegacy] === 'string'
? cookies[publicCookieNameLegacy]
: null);
if (publicCookieToken) {
try {
const claims = await authService.verifyHostedAssetToken(
'public',
publicCookieToken,
{
appUid: expectedAppUid,
subdomain: expectedSubdomain,
host: expectedHost,
},
);
return {
source: 'public-cookie',
userUid: claims.userUid,
sessionUuid: claims.sessionUuid,
hasValidPublicCookie: true,
};
} catch {
/* fall through — v1-signed cookies land here and get re-minted */
}
}
return { source: 'none' };
}
@@ -2763,321 +2763,6 @@ describe('public hosted asset billing identity', () => {
});
});
describe('public hosted assets requested with the launch token in the Referer', () => {
const cookieName = HOSTED_ASSET_COOKIES.public.name;
const makeLaunchedApp = async () => {
const owner = await makeUserWithHome();
const home = (await server.stores.fsEntry.getEntryByPath(
`/${owner.username}`,
))!;
const sub = `ref-${uuidv4().slice(0, 8)}`;
const host = `${sub}.site.puter.localhost`;
await server.stores.subdomain.create({
userId: owner.id,
subdomain: sub,
rootDirId: home.id,
});
await writeFile(
owner.id,
`/${owner.username}/index.html`,
Buffer.from('<html></html>'),
);
await writeFile(
owner.id,
`/${owner.username}/app.css`,
Buffer.from('body{}'),
);
const app = await server.stores.app.create(
{ name: sub, title: sub, index_url: `http://${host}/` },
{ ownerUserId: owner.id },
);
return { owner, sub, host, appUid: app.uid };
};
const cookieFor = async (
token: string,
site: { sub: string; host: string; appUid: string },
) => {
const actor = (await server.services.auth.authenticateFromToken(
token,
))!;
return server.services.auth.createHostedAssetToken('public', {
appUid: site.appUid,
userUid: actor.user.uuid,
sessionUuid: actor.session?.uid,
subdomain: site.sub,
host: site.host,
});
};
const refererFor = (host: string, token: string) =>
`http://${host}/?puter.app_instance_id=x&puter.auth.token=${encodeURIComponent(token)}`;
const serve = async (
host: string,
init: {
path?: string;
cookies?: Record<string, string>;
headers?: Record<string, string>;
query?: Record<string, string>;
} = {},
) => {
const req = makeReq({ hostname: host, path: '/app.css', ...init });
const { res, out } = makeRes();
await buildMiddleware()(req, res, vi.fn());
await new Promise<void>((resolve) => setImmediate(resolve));
expect(out.statusCode).toBe(200);
return { req, out };
};
const claimsOf = (cookie: string, appUid: string, host: string) =>
server.services.auth.verifyHostedAssetToken('public', cookie, {
appUid,
host,
});
const REDIS_METHODS = [
'get',
'mget',
'exists',
'hget',
'hgetall',
'smembers',
'set',
'del',
'expire',
'incr',
'incrby',
'hset',
'sadd',
'pipeline',
'multi',
];
/** Redis calls, JWT signs and full authentications made by `fn`. */
const measure = async <T>(fn: () => Promise<T>) => {
const redis = server.clients.redis as unknown as Record<
string,
unknown
>;
const redisSpies = REDIS_METHODS.filter(
(m) => typeof redis[m] === 'function',
).map((m) => [m, vi.spyOn(redis as never, m as never)] as const);
const sign = vi.spyOn(server.services.token, 'sign');
const authenticate = vi.spyOn(server.services.auth, 'authenticate');
try {
const result = await fn();
const redisCalls: Record<string, number> = {};
for (const [m, spy] of redisSpies) {
const n = (spy as unknown as { mock: { calls: unknown[] } })
.mock.calls.length;
if (n) redisCalls[m] = n;
}
return {
result,
redisCalls,
signs: sign.mock.calls.length,
authentications: authenticate.mock.calls.length,
};
} finally {
for (const [, spy] of redisSpies) spy.mockRestore();
sign.mockRestore();
authenticate.mockRestore();
}
};
it('costs the same as the cookie alone when the token names the cookie user and session', async () => {
const site = await makeLaunchedApp();
const visitor = await makeUser();
const token = await server.services.auth.getUserAppToken(
actorFor(visitor),
site.appUid,
);
const cookies = { [cookieName]: await cookieFor(token, site) };
const headers = { referer: refererFor(site.host, token) };
// Warm the caches both paths read.
await serve(site.host, { cookies });
await serve(site.host, { cookies, headers });
const cookieOnly = await measure(() => serve(site.host, { cookies }));
const withReferer = await measure(() =>
serve(site.host, { cookies, headers }),
);
expect(withReferer.result.req.egressActor?.user?.uuid).toBe(
visitor.uuid,
);
expect(withReferer.result.out.cookies).toEqual({});
expect(withReferer.signs).toBe(0);
expect(withReferer.authentications).toBe(0);
expect(withReferer.redisCalls).toEqual(cookieOnly.redisCalls);
expect(cookieOnly.signs).toBe(0);
});
it('bills the token account when the launch could not replace an older cookie', async () => {
const site = await makeLaunchedApp();
const previous = await makeUser();
const current = await makeUser();
const previousToken = await server.services.auth.getUserAppToken(
actorFor(previous),
site.appUid,
);
const currentToken = await server.services.auth.getUserAppToken(
actorFor(current),
site.appUid,
);
const oldCookies = {
[cookieName]: await cookieFor(previousToken, site),
};
const mint = vi
.spyOn(server.services.auth, 'createHostedAssetToken')
.mockRejectedValueOnce(new Error('mint failed'));
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
let launch;
try {
launch = await serve(site.host, {
path: '/index.html',
cookies: oldCookies,
query: { 'puter.auth.token': currentToken },
});
} finally {
mint.mockRestore();
warn.mockRestore();
}
expect(launch.out.cookies).toEqual({});
expect(launch.req.egressActor?.user?.uuid).toBe(current.uuid);
const asset = await serve(site.host, {
cookies: oldCookies,
headers: { referer: refererFor(site.host, currentToken) },
});
expect(asset.req.egressActor?.user?.uuid).toBe(current.uuid);
const replaced = asset.out.cookies[cookieName];
expect(replaced).toBeTruthy();
expect((await claimsOf(replaced, site.appUid, site.host)).userUid).toBe(
current.uuid,
);
});
it('bills the token account when a cached page of another account loads assets', async () => {
// The document never reaches the server (served from an app's own
// cache), so only the assets show which account launched it.
const site = await makeLaunchedApp();
const previous = await makeUser();
const current = await makeUser();
const previousToken = await server.services.auth.getUserAppToken(
actorFor(previous),
site.appUid,
);
const currentToken = await server.services.auth.getUserAppToken(
actorFor(current),
site.appUid,
);
const oldCookies = {
[cookieName]: await cookieFor(previousToken, site),
};
for (const path of ['/app.css', '/index.html']) {
const asset = await serve(site.host, {
path,
cookies: oldCookies,
headers: { referer: refererFor(site.host, currentToken) },
});
expect(asset.req.egressActor?.user?.uuid).toBe(current.uuid);
const replaced = asset.out.cookies[cookieName];
expect(
(await claimsOf(replaced, site.appUid, site.host)).userUid,
).toBe(current.uuid);
}
});
it('re-mints the cookie when the token names the same user under another session', async () => {
const site = await makeLaunchedApp();
const visitor = await makeUser();
const appToken = await server.services.auth.getUserAppToken(
actorFor(visitor),
site.appUid,
);
const cookies = { [cookieName]: await cookieFor(appToken, site) };
const { session, token: sessionToken } =
await server.services.auth.createSessionToken(visitor as never);
const asset = await serve(site.host, {
cookies,
headers: { referer: refererFor(site.host, sessionToken) },
});
expect(asset.req.egressActor?.user?.uuid).toBe(visitor.uuid);
const replaced = asset.out.cookies[cookieName];
expect(replaced).toBeTruthy();
expect(
(await claimsOf(replaced, site.appUid, site.host)).sessionUuid,
).toBe(session.uuid);
});
it('falls back to the cookie when the Referer token does not verify', async () => {
const site = await makeLaunchedApp();
const visitor = await makeUser();
const token = await server.services.auth.getUserAppToken(
actorFor(visitor),
site.appUid,
);
const cookies = { [cookieName]: await cookieFor(token, site) };
const tampered = `${token.slice(0, -4)}AAAA`;
const asset = await serve(site.host, {
cookies,
headers: { referer: refererFor(site.host, tampered) },
});
expect(asset.req.egressActor?.user?.uuid).toBe(visitor.uuid);
expect(asset.out.cookies).toEqual({});
});
it('bills the site owner once the shared session is revoked', async () => {
const site = await makeLaunchedApp();
const visitor = await makeUser();
const token = await server.services.auth.getUserAppToken(
actorFor(visitor),
site.appUid,
);
const cookies = { [cookieName]: await cookieFor(token, site) };
await server.services.auth.revokeAllSessionsForUserId(visitor.id);
const asset = await serve(site.host, {
cookies,
headers: { referer: refererFor(site.host, token) },
});
expect(asset.req.egressActor?.user?.uuid).toBe(site.owner.uuid);
expect(asset.out.cookies).toEqual({});
});
it('keeps responses that set the cookie out of shared caches', async () => {
const site = await makeLaunchedApp();
const visitor = await makeUser();
const token = await server.services.auth.getUserAppToken(
actorFor(visitor),
site.appUid,
);
const launch = await serve(site.host, {
path: '/index.html',
query: { 'puter.auth.token': token },
});
const cookie = launch.out.cookies[cookieName];
expect(cookie).toBeTruthy();
expect(launch.out.headers['Cache-Control']).toBe('private');
const asset = await serve(site.host, {
cookies: { [cookieName]: cookie },
headers: { referer: refererFor(site.host, token) },
});
expect(asset.out.cookies).toEqual({});
expect(asset.out.headers['Cache-Control']).toBeUndefined();
});
});
describe('site rooted in the owner tree, root moved to Trash', () => {
it('stops serving a trashed folder and resumes when restored', async () => {
const owner = await makeUserWithHome();
@@ -548,8 +548,6 @@ export const createPuterSiteMiddleware = (
requestHostname: host,
}),
);
// A shared cache must not hand this visitor's cookie to others.
res.set('Cache-Control', 'private');
}
} catch (e) {
// Best-effort — don't block the public file serve.
+1 -357
View File
@@ -186,96 +186,6 @@ describe('AuthService (integration)', () => {
});
});
describe('signedSessionClaims', () => {
it('names the user and session of a session token', async () => {
const user = await makeUser();
const { token, session } = await authService.createSessionToken(
user,
{},
);
expect(authService.signedSessionClaims(token)).toEqual({
userUid: user.uuid,
sessionUuid: (session as { uuid: string }).uuid,
});
});
it('names the app too for an app token', async () => {
const user = await makeUser();
const appUid = `app-${uuidv4()}`;
const sessionUuid = uuidv4();
const token = server.services.token.sign('auth', {
type: 'app-under-user',
version: '2',
user_uid: user.uuid,
app_uid: appUid,
session_uid: sessionUuid,
});
expect(authService.signedSessionClaims(token)).toEqual({
userUid: user.uuid,
sessionUuid,
appUid,
});
});
it('reads the session from `uuid` on a token without `session_uid`', () => {
const [userUid, sessionUuid] = [uuidv4(), uuidv4()];
const token = server.services.token.sign('auth', {
type: 'gui',
version: '0.0.0',
uuid: sessionUuid,
user_uid: userUid,
});
expect(authService.signedSessionClaims(token)).toEqual({
userUid,
sessionUuid,
});
});
it('returns null for worker, access, expired, tampered and session-less tokens', async () => {
const user = await makeUser();
const accessToken = await authService.createAccessToken(
{
user: {
id: user.id,
uuid: user.uuid,
username: user.username,
},
} as Actor,
[[`user:${user.uuid}:email:read`]],
);
const sign = (claims: Record<string, unknown>, expiresIn?: number) =>
server.services.token.sign(
'auth',
claims,
expiresIn === undefined ? undefined : { expiresIn },
);
const sessionUuid = uuidv4();
const session = {
type: 'session',
version: '2',
uuid: sessionUuid,
session_uid: sessionUuid,
user_uid: user.uuid,
};
const valid = sign(session);
for (const token of [
accessToken,
sign({ ...session, worker: true, worker_name: 'w' }),
sign({
type: 'app-under-user',
version: '2',
user_uid: user.uuid,
app_uid: `app-${uuidv4()}`,
}),
sign(session, -120),
`${valid.slice(0, -4)}AAAA`,
'not-a-jwt',
]) {
expect(authService.signedSessionClaims(token)).toBeNull();
}
});
});
// ── Rich `authenticate()` result shape ──────────────────────────
describe('authenticate (reauth signal)', () => {
@@ -740,60 +650,6 @@ describe('AuthService (integration)', () => {
).toBeFalsy();
});
describe('listSessions and expiry', () => {
const nowS = () => Math.floor(Date.now() / 1000);
const listedUuids = async (user: { id: number }) =>
(await authService.listSessions({ user } as Actor)).map(
(r) => (r as { uuid: string }).uuid,
);
it.each(['web', 'app', 'access_token'])(
'leaves out an expired %s session and lists a live one',
async (kind) => {
const user = await makeUser();
const sessions = server.stores.session;
const live = await sessions.create(user.id, {
kind,
expires_at: nowS() + 3600,
});
const expired = await sessions.create(user.id, {
kind,
expires_at: nowS() - 1,
});
const uuids = await listedUuids(user);
expect(uuids).toContain(live.uuid);
expect(uuids).not.toContain(expired.uuid);
},
);
it('leaves out a token whose parent session has expired or is gone', async () => {
const user = await makeUser();
const sessions = server.stores.session;
const token = (parent: string) =>
sessions.create(user.id, {
kind: 'access_token',
parent_session_id: parent,
expires_at: nowS() + 3600,
});
const liveParent = await sessions.create(user.id);
const expiredParent = await sessions.create(user.id, {
expires_at: nowS() - 1,
});
const listed = await token(liveParent.uuid);
const underExpired = await token(expiredParent.uuid);
const underMissing = await token(uuidv4());
const uuids = await listedUuids(user);
expect(uuids).toContain(liveParent.uuid);
expect(uuids).toContain(listed.uuid);
expect(uuids).not.toContain(expiredParent.uuid);
expect(uuids).not.toContain(underExpired.uuid);
expect(uuids).not.toContain(underMissing.uuid);
});
});
it('listSessions excludes kind="asset" rows', async () => {
// Asset rows are per-cookie children of `web` rows, revoked
// transitively via the cascade — surfacing them in the
@@ -3243,7 +3099,7 @@ describe('AuthService (integration)', () => {
const emit = vi.spyOn(server.clients.event, 'emit');
const announced = () =>
emit.mock.calls.filter(
(c) => c[0] === 'outer.auth.access-token.revoked',
(c) => c[0] === 'auth.access-token.revoked',
).length;
const scoped = await authService.createAccessToken(actor, [
@@ -3261,35 +3117,6 @@ describe('AuthService (integration)', () => {
emit.mockRestore();
});
it('announces a desktop app token it replaces past its max age', async () => {
const user = await makeUser();
const { session } = await authService.createSessionToken(user);
const actor = makeActor({
user: { id: user.id, uuid: user.uuid, username: user.username },
session: { uid: String(session.uuid), kind: 'web' },
});
const app = { uid: `app-${uuidv4()}`, title: 'Retire probe' };
const { token } = await authService.getGodmodeAppToken(actor, app);
const { token_uid } = server.services.token.verify<{
token_uid: string;
}>('auth', token);
const emit = vi.spyOn(server.clients.event, 'emit');
const later = Date.now() + 8 * 24 * 60 * 60 * 1000;
vi.spyOn(Date, 'now').mockReturnValue(later);
try {
await authService.getGodmodeAppToken(actor, app);
expect(emit).toHaveBeenCalledWith(
'outer.auth.access-token.revoked',
{ token_uid },
{},
);
} finally {
vi.mocked(Date.now).mockRestore();
emit.mockRestore();
}
});
it('revokeAccessToken rejects with 404 when the token belongs to another user', async () => {
const u1 = await makeUser();
const u2 = await makeUser();
@@ -3898,163 +3725,6 @@ describe('AuthService (integration)', () => {
).rejects.toMatchObject({ statusCode: 404 });
expect(await authService.authenticateFromToken(jwt)).toBeTruthy();
});
const migratedTokenRow = async (userId: number) => {
const legacyUid = uuidv4();
const row = await server.stores.session.create(userId, {
kind: 'access_token',
legacy_token_uid: legacyUid,
created_via: 'legacy_backfill',
});
return { legacyUid, rowUuid: row.uuid as string };
};
it('soft-revokes a migrated token row named by its legacy token uid', async () => {
const user = await makeUser();
const actor = {
user: { id: user.id, uuid: user.uuid, username: user.username },
} as Actor;
const { legacyUid, rowUuid } = await migratedTokenRow(user.id);
await authService.revokeAccessToken(actor, legacyUid);
expect(await server.stores.session.getByUuid(rowUuid)).toBeNull();
});
it('404s for a raw uid that names no token row', async () => {
const user = await makeUser();
const actor = {
user: { id: user.id, uuid: user.uuid, username: user.username },
} as Actor;
await expect(
authService.revokeAccessToken(actor, uuidv4()),
).rejects.toMatchObject({ statusCode: 404 });
});
it("404s when another user names a migrated token's legacy uid", async () => {
const owner = await makeUser();
const other = await makeUser();
const otherActor = {
user: {
id: other.id,
uuid: other.uuid,
username: other.username,
},
} as Actor;
const { legacyUid, rowUuid } = await migratedTokenRow(owner.id);
await expect(
authService.revokeAccessToken(otherActor, legacyUid),
).rejects.toMatchObject({ statusCode: 404 });
expect(
await server.stores.session.getByUuid(rowUuid),
).toBeTruthy();
});
});
describe('tokens minted by a full-access token', () => {
const fullAccessToken = async () => {
const user = await makeUser();
const userActor = makeActor({
user: { id: user.id, uuid: user.uuid, username: user.username },
});
const jwt = await authService.createAccessToken(userActor, [
[FULL_API_ACCESS],
]);
const decoded = server.services.token.verify('auth', jwt) as {
token_uid: string;
session_uid: string;
auth_id: string;
};
return { user, userActor, jwt, decoded };
};
const parentOf = async (token: string) => {
const { session_uid } = server.services.token.verify(
'auth',
token,
) as { session_uid: string };
const rows = (await server.clients.db.read(
'SELECT `parent_session_id` FROM `sessions` WHERE `uuid` = ?',
[session_uid],
)) as Array<{ parent_session_id: string | null }>;
return rows[0]?.parent_session_id;
};
/** A replica that has not seen any access-token row yet. */
const lagTokenRows = () => {
const db = server.clients.db;
const original = db.read.bind(db);
const spy = vi
.spyOn(db, 'read')
.mockImplementation(async (sql: string, params?: unknown[]) =>
sql.includes("FROM `sessions` WHERE `kind` = 'access_token'")
? []
: original(sql, params),
);
return () => spy.mockRestore();
};
it('parents the child to the minting token row while the replica lags, and revoking it takes the child', async () => {
const { user, userActor, jwt, decoded } = await fullAccessToken();
const minter = await authService.authenticateFromToken(jwt);
const restore = lagTokenRows();
let child: string;
try {
child = await authService.createAccessToken(minter!, [
[`user:${user.uuid}:email:read`],
]);
} finally {
restore();
}
expect(await parentOf(child)).toBe(decoded.session_uid);
expect(await authService.authenticateFromToken(child)).toBeTruthy();
await authService.revokeAccessToken(userActor, jwt);
expect(await authService.authenticateFromToken(child)).toBeNull();
});
it('carries the row whether auth read it from the cache or the database', async () => {
const { jwt, decoded } = await fullAccessToken();
const key = `sessions:v2:uuid:${decoded.session_uid}`;
expect(await server.clients.redis.get(key)).toBeTruthy();
const cached = await authService.authenticateFromToken(jwt);
await server.clients.redis.del(key);
const fromDb = await authService.authenticateFromToken(jwt);
expect(cached?.accessToken?.sessionUid).toBe(decoded.session_uid);
expect(fromDb?.accessToken?.sessionUid).toBe(decoded.session_uid);
});
it('looks the row up by token uid when the claim names no row of its own', async () => {
const { user, decoded } = await fullAccessToken();
const otherSession = await authService.createSessionToken(user, {});
const claims = {
type: 'access-token',
version: '2',
token_uid: decoded.token_uid,
user_uid: user.uuid,
auth_id: decoded.auth_id,
full_access: true,
};
const unclaimed = server.services.token.sign('auth', claims);
const misclaimed = server.services.token.sign('auth', {
...claims,
session_uid: (otherSession.session as { uuid: string }).uuid,
});
for (const token of [unclaimed, misclaimed]) {
const minter = await authService.authenticateFromToken(token);
expect(minter?.accessToken?.sessionUid).toBeUndefined();
const child = await authService.createAccessToken(minter!, [
[`user:${user.uuid}:email:read`],
]);
expect(await parentOf(child)).toBe(decoded.session_uid);
}
});
});
describe('revokeSession on access-token rows', () => {
@@ -4355,32 +4025,6 @@ describe('AuthService (integration)', () => {
},
);
it.each(revokers)(
'%s revokes an expired session and its live children',
async (_name, revoke) => {
const user = await makeUser();
const sessions = server.stores.session;
const now = Math.floor(Date.now() / 1000);
const web = await sessions.create(user.id, {
expires_at: now - 1,
});
const child = await sessions.create(user.id, {
kind: 'access_token',
parent_session_id: web.uuid,
expires_at: now + 3600,
});
await revoke(user);
const rows = await server.clients.db.read(
'SELECT `uuid`, `revoked_at` FROM `sessions` WHERE `uuid` IN (?, ?)',
[web.uuid, child.uuid],
);
expect(rows).toHaveLength(2);
for (const row of rows) expect(row.revoked_at).not.toBeNull();
},
);
it('a password reset leaves workers and standalone access tokens; a forced sign-out takes them', async () => {
const user = await makeUser();
const sessions = server.stores.session;
@@ -216,10 +216,6 @@ const sequentialAuthenticate = async (
if (!app || !isGodmodeApp(app)) return { invalid: true };
godmodeApp = { uid: app.uid, id: app.id };
}
const ownRow =
session?.kind === 'access_token' &&
(session.access_token_uid === d.token_uid ||
session.legacy_token_uid === d.token_uid);
const actor = makeActor({
user: actorUser(user),
accessToken: {
@@ -228,7 +224,6 @@ const sequentialAuthenticate = async (
authorized: null,
fullAccess: !d.app_uid && d.full_access === true,
...(godmodeApp ? { godmodeApp } : {}),
...(ownRow ? { sessionUid: session!.uuid } : {}),
},
});
applyHandlerDepth(actor);
+19 -114
View File
@@ -106,15 +106,6 @@ const HOSTED_ASSET_LABELS = {
export type ReauthReason = 'session_revoked' | 'session_expired';
/** Worker claims a session/gui token can carry. */
interface SessionTypeTokenOptions {
worker?: boolean;
workerName?: string;
workerUid?: string;
workerSiteUid?: string;
workerSite?: string;
}
/**
* Request metadata for `authenticate`. `touch: false` checks the token without
* recording activity on its session, for re-checks no user made.
@@ -376,22 +367,6 @@ export class AuthService extends PuterService {
);
}
/**
* Digest of the claims `createGuiToken` signs for this session, which
* differ between two of its tokens only in `iat`.
*/
guiTokenDigest(user: UserRow, sessionUuid: string): string {
return this.services.token.claimsDigest(
'auth',
this.#sessionTypeClaims(
'gui',
user,
sessionUuid,
this.#authIdFor(user),
),
);
}
/** Sign a session token for an existing session (upgrade from GUI token). */
createSessionTokenForSession(user: UserRow, sessionUuid: string): string {
return this.#signSessionTypeToken(
@@ -411,21 +386,14 @@ export class AuthService extends PuterService {
user: UserRow,
sessionUuid: string,
authId: string,
opts: SessionTypeTokenOptions = {},
opts: {
worker?: boolean;
workerName?: string;
workerUid?: string;
workerSiteUid?: string;
workerSite?: string;
} = {},
): string {
return this.services.token.sign(
'auth',
this.#sessionTypeClaims(type, user, sessionUuid, authId, opts),
);
}
#sessionTypeClaims(
type: 'session' | 'gui',
user: UserRow,
sessionUuid: string,
authId: string,
opts: SessionTypeTokenOptions = {},
): Record<string, unknown> {
const claims: Record<string, unknown> = {
type,
version: '2',
@@ -442,7 +410,7 @@ export class AuthService extends PuterService {
if (opts.workerUid) claims.worker_uid = opts.workerUid;
if (opts.workerSiteUid) claims.workerSiteUid = opts.workerSiteUid;
if (opts.workerSite) claims.workerSite = opts.workerSite;
return claims;
return this.services.token.sign('auth', claims);
}
/**
@@ -775,22 +743,9 @@ export class AuthService extends PuterService {
const rows = (await this.stores.session.getByUserId(
actor.user.id,
)) as SessionRow[];
)) as Array<Record<string, unknown>>;
// Listed while authentication still accepts it: not expired, and for
// a token minted under another session, that session live as well.
const live = new Map(
rows
.filter((row) => !this.#endedSession(row))
.map((row) => [row.uuid, row]),
);
const visible = [...live.values()].filter(
(row) =>
row.kind !== 'asset' &&
(row.kind !== 'access_token' ||
!row.parent_session_id ||
live.has(row.parent_session_id)),
);
const visible = rows.filter((row) => row.kind !== 'asset');
const appUids = [
...new Set(
@@ -830,7 +785,7 @@ export class AuthService extends PuterService {
const enriched = visible.map((row) => {
const meta =
(typeof row.meta === 'string'
? JSON.parse(row.meta)
? JSON.parse(row.meta as string)
: row.meta) ?? {};
const isCurrent = actor.session?.uid === row.uuid;
const appUid = typeof row.app_uid === 'string' ? row.app_uid : null;
@@ -1934,7 +1889,7 @@ export class AuthService extends PuterService {
}
if (row.access_token_uid) {
this.clients.event?.emit(
'outer.auth.access-token.revoked',
'auth.access-token.revoked',
{ token_uid: row.access_token_uid },
{},
);
@@ -2096,43 +2051,6 @@ export class AuthService extends PuterService {
};
}
/**
* User, session and app a session, GUI or app token names, checked against
* its signature and expiry only: nothing is read from the stores, so this
* says nothing about whether the session or user is still live. Null for
* worker and access tokens, and for anything that doesn't verify.
*/
signedSessionClaims(
token: string,
): { userUid: string; sessionUuid: string; appUid?: string } | null {
let decoded: AnyTokenPayload;
try {
decoded = this.services.token.verify<AnyTokenPayload>(
'auth',
token,
);
} catch {
return null;
}
if (decoded.type === 'session' || decoded.type === 'gui') {
if (decoded.worker) return null;
const sessionUuid = decoded.session_uid ?? decoded.uuid;
if (!decoded.user_uid || !sessionUuid) return null;
return { userUid: decoded.user_uid, sessionUuid };
}
if (decoded.type === 'app-under-user') {
if (decoded.worker) return null;
if (!decoded.user_uid || !decoded.session_uid || !decoded.app_uid)
return null;
return {
userUid: decoded.user_uid,
sessionUuid: decoded.session_uid,
appUid: decoded.app_uid,
};
}
return null;
}
#verifyHostedAssetToken(
token: string,
expectedKind: 'private' | 'public',
@@ -2300,21 +2218,18 @@ export class AuthService extends PuterService {
let parent_session_id =
issuingApp && actor.session ? actor.session.uid : null;
if (mintingToken) {
const mintingRowUuid =
mintingToken.sessionUid ??
(
await this.stores.session.findActiveByAccessTokenUid(
mintingToken.uid,
)
)?.uuid;
if (!mintingRowUuid) {
const mintingRow =
await this.stores.session.findActiveByAccessTokenUid(
mintingToken.uid,
);
if (!mintingRow) {
throw new HttpError(
403,
'Access tokens may not create access tokens',
{ legacyCode: 'forbidden' },
);
}
parent_session_id = mintingRowUuid;
parent_session_id = mintingRow.uuid;
}
const tokenSession = await this.stores.session.create(
@@ -2596,7 +2511,7 @@ export class AuthService extends PuterService {
// Only a token the handshake admits has a socket to drop.
if (mayBeFullAccess) {
this.clients.event?.emit(
'outer.auth.access-token.revoked',
'auth.access-token.revoked',
{ token_uid: tokenUid },
{},
);
@@ -2881,15 +2796,6 @@ export class AuthService extends PuterService {
if (session) void this.#touchSession(session.uuid, user.id, ctx);
// The row `findActiveByAccessTokenUid` would return, already checked
// live above, so tokens this one mints can parent to it without a read.
const ownRow =
session?.kind === 'access_token' &&
(session.access_token_uid === decoded.token_uid ||
session.legacy_token_uid === decoded.token_uid)
? session
: null;
const actor = makeActor({
user: this.#actorUserFromRow(user),
accessToken: {
@@ -2902,7 +2808,6 @@ export class AuthService extends PuterService {
// claim on one is ignored here.
fullAccess: !decoded.app_uid && decoded.full_access === true,
...(godmodeApp ? { godmodeApp } : {}),
...(ownRow ? { sessionUid: ownRow.uuid } : {}),
},
});
this.#applyHandlerDepth(actor, decoded);
@@ -20,7 +20,6 @@
import { createHmac } from 'node:crypto';
import jwt from 'jsonwebtoken';
import { describe, expect, it } from 'vitest';
import { tokenClaimsDigest } from '../../../gui/src/helpers/guiToken.js';
import { isTokenForAnotherUser } from '../../../gui/src/helpers/tokenUser.js';
import { TokenService } from './TokenService.js';
@@ -404,35 +403,3 @@ describe('session token read by the desktop', () => {
expect(isTokenForAnotherUser(token, { uuid: otherUid })).toBe(true);
});
});
describe('TokenService.claimsDigest', () => {
const claims = {
type: 'gui',
version: '2',
uuid: '6f1e2d3c-0000-4000-8000-000000000001',
session_uid: '6f1e2d3c-0000-4000-8000-000000000001',
user_uid: '5d4adce0-a381-4982-9c02-6e2540026238',
auth_id: '5d4adce0-a381-4982-9c02-6e2540026238',
};
it('is what the desktop computes over a token signed with those claims', async () => {
const svc = createTokenService();
const digest = svc.claimsDigest('auth', claims);
expect(digest).toMatch(/^[0-9a-f]{32}$/);
expect(await tokenClaimsDigest(svc.sign('auth', claims))).toBe(digest);
});
it('differs for another session or token type', () => {
const svc = createTokenService();
const digest = svc.claimsDigest('auth', claims);
expect(
svc.claimsDigest('auth', {
...claims,
session_uid: 'b0b0b0b0-0000-4000-8000-000000000002',
}),
).not.toBe(digest);
expect(svc.claimsDigest('auth', { ...claims, type: 'session' })).not.toBe(
digest,
);
});
});
-19
View File
@@ -17,7 +17,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { createHash } from 'node:crypto';
import jwt, { type SignOptions } from 'jsonwebtoken';
import { PuterService } from '../types';
@@ -269,24 +268,6 @@ export class TokenService extends PuterService {
});
}
/**
* Digest of the claims `sign(scope, payload)` writes, minus `iat`: SHA-256
* over the claims as key-sorted `[key, value]` pairs in JSON, first 32 hex
* chars. The GUI computes the same over a stored token
* (`gui/src/helpers/guiToken.js`), so the two must stay in step.
*/
claimsDigest(scope: string, payload: Record<string, unknown>): string {
const claims = this.#compressPayload(COMPRESSION[scope], payload);
const pairs = Object.keys(claims)
.filter((key) => key !== 'iat')
.sort()
.map((key) => [key, claims[key]]);
return createHash('sha256')
.update(JSON.stringify(pairs))
.digest('hex')
.slice(0, 32);
}
/**
* Verify and decompress. Only v2 tokens (`kid: 'v2'`) verify; any other
* token — including the retired v1 format — is rejected as invalid, with no
-4
View File
@@ -126,12 +126,8 @@ export interface SessionRow {
expires_at?: number | null;
app_uid?: string | null;
legacy_token_uid?: string | null;
access_token_uid?: string | null;
created_via?: string | null;
auth_id?: string | null;
label?: string | null;
last_ip?: string | null;
last_user_agent?: string | null;
}
export {};
@@ -124,21 +124,6 @@ describe('resolveNode', () => {
expect(error.message).toContain('uuid=ghost');
});
it('treats a path-less row found by uid or id as missing', async () => {
const orphan = makeEntry({ path: null as unknown as string });
const store = makeStore({
getEntryByUuid: vi.fn(async () => orphan),
getEntryById: vi.fn(async () => orphan),
});
await expect(resolveNode(store, { uid: 'uuid-7' })).resolves.toBeNull();
await expectHttpError(
() => resolveNode(store, { id: 7 }, { required: true }),
404,
'subject_does_not_exist',
);
});
it('falls back to id lookup when uid is blank', async () => {
const entry = makeEntry();
const store = makeStore({ getEntryById: vi.fn(async () => entry) });
+2 -4
View File
@@ -62,12 +62,10 @@ export async function resolveNode(
): Promise<FSEntry | null> {
if (ref.entry) return ref.entry;
// A uid/id lookup can return a legacy row with no path when its parent
// chain is broken. Nothing can authorize or address it, so it's a miss.
const uuid = ref.uid ?? ref.uuid;
if (isNonEmptyString(uuid)) {
const entry = await fsEntryStore.getEntryByUuid(uuid);
if (entry?.path) return entry;
if (entry) return entry;
return notFoundOrNull(
options.required,
`Entry not found: uuid=${uuid}`,
@@ -82,7 +80,7 @@ export async function resolveNode(
});
}
const entry = await fsEntryStore.getEntryById(numericId);
if (entry?.path) return entry;
if (entry) return entry;
return notFoundOrNull(
options.required,
`Entry not found: id=${numericId}`,
@@ -137,6 +137,7 @@ const render = async (
service: PuterHomepageService,
req: Request = makeReq(),
meta: Record<string, unknown> = { title: 'Puter' },
launchOptions: Record<string, unknown> = {},
actor: unknown = null,
): Promise<string> => {
let sent = '';
@@ -148,6 +149,7 @@ const render = async (
await service.send(
{ req, res, actor } as never,
meta as never,
launchOptions as never,
);
return sent;
};
@@ -290,6 +292,7 @@ describe('PuterHomepageService — gui() parameters', () => {
asset_dir: '/dist',
title: 'Editor',
app: { name: 'editor' },
launch_options: {},
});
// No `config.origin`: fall back to the request's protocol + domain.
expect(params.app_origin).toBe('http://puter.test');
@@ -335,7 +338,7 @@ describe('PuterHomepageService — gui() parameters', () => {
const staff = { user: { id: 7, email: '[email protected]' } };
expect(
guiParamsOf(await render(service, makeReq(), undefined, staff))
guiParamsOf(await render(service, makeReq(), undefined, {}, staff))
.teams_ui,
).toBe(true);
expect(teamsAvailableTo).toHaveBeenCalledWith(7, '[email protected]');
@@ -346,7 +349,7 @@ describe('PuterHomepageService — gui() parameters', () => {
teamsAvailableTo.mockResolvedValueOnce(false);
expect(
guiParamsOf(
await render(service, makeReq(), undefined, {
await render(service, makeReq(), undefined, {}, {
user: { id: 9, email: '[email protected]' },
}),
).teams_ui,
@@ -417,6 +420,22 @@ describe('PuterHomepageService — gui() parameters', () => {
expect(html).toContain('\\u003c/script>');
expect(guiParamsOf(html).injected).toBe('</script><img src=x>');
});
it('passes launch options straight through', async () => {
const params = guiParamsOf(
await render(
makeService(),
makeReq(),
{ title: 'Puter' },
{
on_initialized: [{ do: 'thing' }],
},
),
);
expect(params.launch_options).toEqual({
on_initialized: [{ do: 'thing' }],
});
});
});
describe('PuterHomepageService — extension hooks', () => {
@@ -44,6 +44,10 @@ export interface PageMeta {
app?: { name?: string; [k: string]: unknown } | null;
}
export interface LaunchOptions {
on_initialized?: Array<Record<string, unknown>>;
}
/**
* A GUI popup a first-party page frames at `/embed/<action>`. `hostOrigin` is
* that page, read from the referrer and pinned with frame-ancestors; null when
@@ -53,17 +57,6 @@ export interface PopupFrame {
hostOrigin: string | null;
}
export interface ShellContext {
req: Request;
res: Response;
actor?: Actor | null;
/**
* `AuthService.guiTokenDigest` for the request's session cookie, or null
* when it carries none. Omitted when the caller doesn't work it out.
*/
guiTokenDigest?: string | null;
}
interface PuterGuiAddonsEvent {
req: Request;
path: string;
@@ -316,11 +309,12 @@ export class PuterHomepageService extends PuterService {
* called on the happy path.
*/
async send(
ctx: ShellContext,
ctx: { req: Request; res: Response; actor?: Actor | null },
meta: PageMeta,
launchOptions: LaunchOptions = {},
popupFrame?: PopupFrame,
): Promise<void> {
const { req, res, actor, guiTokenDigest } = ctx;
const { req, res, actor } = ctx;
// Easter egg: puter-in-puter detection → render error page instead.
if (
@@ -340,8 +334,9 @@ export class PuterHomepageService extends PuterService {
}
const html = await this.#renderShell(
{ req, actor: actor ?? null, guiTokenDigest },
{ req, actor: actor ?? null },
meta,
launchOptions,
popupFrame,
);
res.send(html);
@@ -350,13 +345,12 @@ export class PuterHomepageService extends PuterService {
// -- Internals ----------------------------------------------------
async #renderShell(
ctx: Pick<ShellContext, 'req' | 'guiTokenDigest'> & {
actor: Actor | null;
},
ctx: { req: Request; actor: Actor | null },
meta: PageMeta,
launchOptions: LaunchOptions,
popupFrame?: PopupFrame,
): Promise<string> {
const { req, actor, guiTokenDigest } = ctx;
const { req, actor } = ctx;
const env = this.config.env ?? 'prod';
const bundled = env !== 'dev' || this.config.use_bundled_gui === true;
const assetDir = env === 'dev' ? '/src' : '/dist';
@@ -399,13 +393,10 @@ export class PuterHomepageService extends PuterService {
// instead of the socket wire.
eventsNotifications: notificationsFoldInEnabled(this.config),
...meta,
launch_options: launchOptions,
// After `meta`, so nothing page-specific can name the opener.
...(popupFrame ? { embed_host_origin: popupFrame.hostOrigin } : {}),
};
// Only ever this request's; without one the GUI asks for its token as
// it always has.
if (guiTokenDigest === undefined) delete guiParams.guiTokenDigest;
else guiParams.guiTokenDigest = guiTokenDigest;
const event: PuterGuiAddonsEvent = {
req,
@@ -4579,209 +4579,6 @@ describe('MeteringService', () => {
});
});
describe('settling when a balance read fails', () => {
const monthKey = (a: Actor) =>
`${METRICS_V2_PREFIX}:actor:${a.user!.uuid}:${currentMonthString()}`;
/** Rejects the next `times` reads `match` picks; the rest go through. */
const failReads = (
match: (args: {
key: unknown;
consistentRead?: boolean;
}) => boolean,
times = Infinity,
) => {
const kv = server.stores.kv;
const realGet = kv.get.bind(kv);
let left = times;
return vi
.spyOn(kv, 'get')
.mockImplementation(
async (...args: Parameters<typeof realGet>) => {
if (left > 0 && match(args[0] as never)) {
left--;
throw new Error(
'ProvisionedThroughputExceededException',
);
}
return realGet(...args);
},
);
};
const isAddonsRead = ({ key }: { key: unknown }) =>
typeof key === 'string' && key.endsWith(':addons');
const pools = async (a: Actor) => {
await server.stores.meteringBuffer.flushCycle();
const { usage } = await target.getActorCurrentMonthUsageDetails(a);
const addons = await target.getActorAddons(a, {
consistentRead: true,
});
return {
total: usage.total,
allowanceUsed: usage.allowanceUsed ?? 0,
consumed: addons.consumedPurchaseCredits ?? 0,
};
};
it('charges the allowance when the purchased-credit read fails', async () => {
await target.updateAddonCredit(actor.user.uuid!, 1_000_000);
await target.incrementUsage(actor, 'ai:chat', 1, 1000);
const before = await target.getAllowedUsage(actor);
const get = failReads(isAddonsRead);
const result = await target.incrementUsage(
actor,
'ai:chat',
1,
5000,
);
get.mockRestore();
expect(result.total).toBe(6000);
expect(await pools(actor)).toEqual({
total: 6000,
allowanceUsed: 6000,
consumed: 0,
});
const after = await target.getAllowedUsage(actor);
expect(before.remaining - after.remaining).toBe(5000);
});
it('charges only the allowance share past the allowance, and nothing later charges the rest', async () => {
const { monthUsageAllowance: allowance } =
await target.getActorSubscription(actor);
await target.updateAddonCredit(actor.user.uuid!, 1_000_000);
await target.incrementUsage(actor, 'ai:chat', 1, allowance - 100);
expect(await target.hasAnyUsageCached(actor)).toBe(true);
const alarm = vi.spyOn(server.clients.alarm, 'create');
const emit = vi.spyOn(server.clients.event, 'emit');
const get = failReads(isAddonsRead);
await target.incrementUsage(actor, 'ai:chat', 1, 1000);
get.mockRestore();
// 100 fits the allowance; the 900 credit would cover isn't drawn.
expect(await pools(actor)).toEqual({
total: allowance + 900,
allowanceUsed: allowance,
consumed: 0,
});
expect(alarm).toHaveBeenCalledWith(
'metering_settle_read_failed',
expect.any(String),
expect.objectContaining({
userId: actor.user.uuid,
unchargedCost: 900,
}),
'info',
);
expect(
alarm.mock.calls.some(([id]) =>
String(id).startsWith('metering service error'),
),
).toBe(false);
// The unread credit isn't taken as spent.
expect(
emit.mock.calls.some(
([name]) => name === 'metering.credit-state',
),
).toBe(false);
expect(await target.hasAnyUsageCached(actor)).toBe(true);
alarm.mockRestore();
emit.mockRestore();
// The next settle charges its own cost once, and only that.
await target.incrementUsage(actor, 'ai:chat', 1, 700);
expect(await pools(actor)).toEqual({
total: allowance + 1600,
allowanceUsed: allowance,
consumed: 700,
});
});
it('charges the allowance from the buffered total when the exact read fails', async () => {
const Service = target.constructor as typeof MeteringService;
const interval = Service.EXACT_READ_MIN_INTERVAL_MS;
Service.EXACT_READ_MIN_INTERVAL_MS = 0;
try {
const { monthUsageAllowance: allowance } =
await target.getActorSubscription(actor);
await target.incrementUsage(
actor,
'ai:chat',
1,
allowance - 3000,
);
await server.stores.meteringBuffer.flushCycle();
const key = monthKey(actor);
const alarm = vi.spyOn(server.clients.alarm, 'create');
const get = failReads(
(args) => args.key === key && !!args.consistentRead,
);
const result = await target.incrementUsage(
actor,
'ai:chat',
1,
1000,
);
const failedReads = get.mock.calls.length;
get.mockRestore();
expect(failedReads).toBeGreaterThan(0);
expect(result.total).toBe(allowance - 2000);
expect(await pools(actor)).toEqual({
total: allowance - 2000,
allowanceUsed: allowance - 2000,
consumed: 0,
});
expect(alarm).toHaveBeenCalledWith(
'metering_settle_read_failed',
expect.any(String),
expect.objectContaining({ unchargedCost: 0 }),
'info',
);
alarm.mockRestore();
} finally {
Service.EXACT_READ_MIN_INTERVAL_MS = interval;
}
});
it('charges each of two racing calls once when one of their reads fails', async () => {
await target.updateAddonCredit(actor.user.uuid!, 1_000_000);
await target.incrementUsage(actor, 'ai:chat', 1, 1000);
const get = failReads(isAddonsRead, 1);
await Promise.all([
target.incrementUsage(actor, 'ai:chat', 1, 2000),
target.incrementUsage(actor, 'ai:chat', 1, 3000),
]);
get.mockRestore();
expect(await pools(actor)).toEqual({
total: 6000,
allowanceUsed: 6000,
consumed: 0,
});
});
it('charges a failed call and the calls after it exactly once each', async () => {
await target.updateAddonCredit(actor.user.uuid!, 1_000_000);
const costs = [1000, 2000, 3000, 4000];
for (const [i, cost] of costs.entries()) {
const get = failReads(isAddonsRead, i % 2 === 0 ? 1 : 0);
await target.incrementUsage(actor, 'ai:chat', 1, cost);
get.mockRestore();
}
expect(await pools(actor)).toEqual({
total: 10_000,
allowanceUsed: 10_000,
consumed: 0,
});
});
});
// ── Resolver registration ────────────────────────────────────────
describe('resolver registration', () => {
@@ -342,9 +342,6 @@ export class MeteringService extends PuterService {
/** Bumped on every drop, so a read that straddles one isn't cached. */
#spentAddonsDrops = 0;
/** Running sum reported by `#alarmSettleReadFailed`. */
#unchargedSinceStart = 0;
/**
* Uuid → until when a near-allowance read bypasses the exact-read throttle.
* Set on a credits change (a purchase, an admin correction): for a short
@@ -678,84 +675,49 @@ export class MeteringService extends PuterService {
appCallCount: usages.length,
});
// The usage is already being recorded, so a failed balance read
// must not skip settling it.
let settleReadError: Error | null = null;
const [usageResult, subscription, actorAddons] = await Promise.all([
usageResultPromise,
this.#actorSubscriptionWithStatus(actor),
(async () => {
try {
return await this.#addonsForSettle(actor);
} catch (e) {
settleReadError = e as Error;
return null;
}
})(),
this.#addonsForSettle(actor),
]);
const { policy: actorSubscription, provisionalUntil } =
subscription;
let actorUsages: UsageByType;
try {
actorUsages = await this.exactUsageNearAllowance(
userId,
actorUsageKey,
usageResult,
actorSubscription.monthUsageAllowance,
);
} catch (e) {
settleReadError ??= e as Error;
actorUsages = usageResult.res as unknown as UsageByType;
}
const actorUsages = await this.exactUsageNearAllowance(
userId,
actorUsageKey,
usageResult,
actorSubscription.monthUsageAllowance,
);
// After a failed read only the allowance share is charged:
// purchased credit is never drawn against an unread balance.
const readAddons = settleReadError ? null : actorAddons;
const settledAllowanceUsed = await this.settleIncrementCharges(
userId,
actorUsageKey,
actorUsages,
actorSubscription,
readAddons ?? ({} as UsageAddons),
actorAddons,
totalBatchCost,
);
// Before any hold this usage stands for is released.
await this.stores.creditHold.bump(userId);
if (!readAddons) {
const usedBefore = MeteringService.allowanceUsedBefore(
actorUsages,
actorSubscription.monthUsageAllowance,
totalBatchCost,
);
this.#alarmSettleReadFailed(
actor,
settleReadError,
Math.max(
0,
totalBatchCost - (settledAllowanceUsed - usedBefore),
),
);
} else {
this.maybeAlertOveruse({
actor,
userId,
actorUsages,
actorSubscription,
actorAddons,
incrementCost: totalBatchCost,
batchUsages: usages,
});
this.maybeAlertOveruse({
actor,
userId,
actorUsages,
actorSubscription,
actorAddons,
incrementCost: totalBatchCost,
batchUsages: usages,
});
this.rememberRemainingCredits(
userId,
settledAllowanceUsed,
actorSubscription,
actorAddons,
provisionalUntil,
);
}
this.rememberRemainingCredits(
userId,
settledAllowanceUsed,
actorSubscription,
actorAddons,
provisionalUntil,
);
const own = this.#withDetail(actorUsages, usageResult.detail);
const charged = await this.applyMonthlyCharges(
@@ -2995,31 +2957,6 @@ export class MeteringService extends PuterService {
return usedBefore + allowanceCharge;
}
/**
* One alarm id for every actor, so a store brownout is a single alarm with
* a count. `unchargedCost` is what credit would have covered, had any been
* left; nothing charges it later.
*/
#alarmSettleReadFailed(
actor: Actor,
error: Error | null,
unchargedCost: number,
): void {
this.#unchargedSinceStart += unchargedCost;
this.clients.alarm.create(
'metering_settle_read_failed',
'Metering settled usage to the allowance only: a balance read failed',
{
userId: actor.user?.uuid,
appId: actor.effectiveApp?.uid,
unchargedCost,
unchargedSinceStart: this.#unchargedSinceStart,
error: error ?? undefined,
},
'info',
);
}
private maybeAlertOveruse(ctx: {
actor: Actor;
userId: string;
@@ -55,7 +55,10 @@ import type { IConfig } from '../../types.js';
*/
export type NotifWire =
'notif.message' | 'notif.unreads' | 'notif.ack' | 'notif.removed';
| 'notif.message'
| 'notif.unreads'
| 'notif.ack'
| 'notif.removed';
export const NOTIF_DELIVERY_EVENT = 'outer.notif.delivery';
@@ -197,7 +200,7 @@ export class NotificationSocketAdapter {
});
}
/** One notification, in the shape the GUI's socket listeners receive. */
/** One notification, in the shape `UIDesktop` has always received. */
message(userId: number, uid: string, notification: unknown): void {
const response = { uid, notification };
if (this.#dispatched(userId, 'notif.message', response)) return;
@@ -17,7 +17,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import MockRedis from 'ioredis-mock';
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
import { v4 as uuidv4 } from 'uuid';
import { makeActor, type Actor } from '../../core/actor.js';
@@ -28,16 +27,6 @@ import { generateDefaultFsentries } from '../../util/userProvisioning.js';
import { kv } from '../../util/kvSingleton.js';
import { PermissionService } from './PermissionService.js';
// The servers here share one redis mock; start each on an empty one.
const setupFreshServer = async (
...args: Parameters<typeof setupTestServer>
): Promise<PuterServer> => {
const redis = new MockRedis();
await redis.flushall();
redis.disconnect();
return setupTestServer(...args);
};
/** `default_temp_group` from config.default.json. */
const DEFAULT_TEMP_GROUP_UID = 'b7220104-7905-4985-b996-649fdcdb3c8f';
@@ -201,7 +190,7 @@ describe('PermissionService (integration)', () => {
let permService: PermissionService;
beforeAll(async () => {
server = await setupFreshServer();
server = await setupTestServer();
permService = server.services
.permission as unknown as PermissionService;
});
@@ -1652,7 +1641,7 @@ describe('PermissionService — scan paths', () => {
let permService: PermissionService;
beforeAll(async () => {
server = await setupFreshServer();
server = await setupTestServer();
permService = server.services
.permission as unknown as PermissionService;
}, 60_000);
@@ -1909,77 +1898,6 @@ describe('PermissionService — scan paths', () => {
expect(await permService.check(originActor, permission)).toBe(true);
expect(await permService.check(sharerActor, permission)).toBe(true);
}, 20_000);
it('does not read a revoked group grant back from a lagging replica', async () => {
const { row: issuer } = await makeGroupedUser();
const { row: member, actor: memberActor } = await makeGroupedUser();
const groupUid = uuidv4();
await server.clients.db.write(
'INSERT INTO `group` (`uid`, `owner_user_id`, `extra`, `metadata`) ' +
'VALUES (?, ?, ?, ?)',
[groupUid, issuer.id, '{}', '{}'],
);
const [group] = await server.clients.db.read(
'SELECT `id` FROM `group` WHERE `uid` = ?',
[groupUid],
);
await server.stores.group.addUsers(groupUid, [member.username]);
const permission = `zztest:lag-${uuidv4()}:ii:read`;
await server.stores.permission.setFlatUserPerm(
issuer.id,
permission,
{
permission,
deleted: false,
issuer_user_id: issuer.id,
} as never,
);
await server.clients.db.write(
'INSERT INTO `user_to_group_permissions` ' +
'(`user_id`, `group_id`, `permission`, `extra`) VALUES (?, ?, ?, ?)',
[issuer.id, group.id, permission, '{}'],
);
expect(await permService.check(memberActor, permission)).toBe(true);
await server.stores.permission.deleteUserGroupPerm(
Number(group.id),
issuer.id,
permission,
);
await permService.bumpPermissionCacheForUsernames([
member.username,
]);
// The replica still returns the row; the primary has deleted it.
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi
.spyOn(db, 'pread')
.mockImplementation((sql, params) => primaryRead(sql, params));
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (sql, params) =>
String(sql).includes('user_to_group_permissions')
? [
{
permission,
user_id: issuer.id,
group_id: group.id,
extra: '{}',
},
]
: primaryRead(sql, params),
);
try {
expect(await permService.check(memberActor, permission)).toBe(
false,
);
} finally {
read.mockRestore();
pread.mockRestore();
}
});
});
describe('app-under-user grants', () => {
@@ -2688,7 +2606,7 @@ describe('PermissionService — default user permissions vs. group config', () =
// Self-hosted deployments may run without default groups. The floor
// is not group-derived, so it applies regardless — a deployment that
// clears both no longer has every driver call fail closed.
const bare = await setupFreshServer({
const bare = await setupTestServer({
default_user_group: '',
default_temp_group: '',
} as never);
@@ -1155,13 +1155,9 @@ export class PermissionService extends PuterService {
}
/** Batched: one event for the whole group, not one per member. */
async #bumpGroupCacheGeneration(
groupId: number,
memberUuids?: string[],
): Promise<void> {
async #bumpGroupCacheGeneration(groupId: number): Promise<void> {
const uuids =
memberUuids ??
(await this.stores.permission.listGroupMemberUuids(groupId));
await this.stores.permission.listGroupMemberUuids(groupId);
if (uuids.length === 0) return;
await this.stores.permission.bumpCacheGenerations(
uuids.map((uuid) => `user:${uuid}`),
@@ -1242,12 +1238,11 @@ export class PermissionService extends PuterService {
await this.#assertCanManage(actor, permission);
const { removed: revoked, members } =
await this.stores.permission.deleteUserGroupPerm(
groupId,
issuerId,
permission,
);
const revoked = await this.stores.permission.deleteUserGroupPerm(
groupId,
issuerId,
permission,
);
this.#audit(
this.stores.permission.auditUserGroupPerm({
@@ -1262,18 +1257,15 @@ export class PermissionService extends PuterService {
);
// Bumped even when nothing matched: a cached allow must not survive.
await this.#bumpGroupCacheGeneration(
groupId,
members
.map((member) => member.uuid)
.filter((uuid): uuid is string => Boolean(uuid)),
);
await this.#bumpGroupCacheGeneration(groupId);
// Nothing but the membership names the holders, so without this their
// watches outlive the revoke.
if (revoked) {
for (const member of members) {
this.#announceRevoked(member.id, null, permission);
for (const memberId of await this.stores.permission.listGroupMemberIds(
groupId,
)) {
this.#announceRevoked(memberId, null, permission);
}
}
return revoked;
@@ -2354,35 +2354,6 @@ describe('OpenAIRealtimeRelayService relay', () => {
b.ws.close();
});
it('evicts an access token revoked on another node', async () => {
const row = await server.stores.user.getByUsername(user.username);
const actor = makeActor({ user: row! });
const token = await server.services.auth.createAccessToken(actor, [
[FULL_API_ACCESS],
]);
const { token_uid } = server.services.token.verify<{
token_uid: string;
}>('auth', token);
const c = open(`${relayUrl}?auth_token=${token}`);
await c.waitFor('session.created');
// As a peer cluster delivers it, after a malformed payload it ignores.
server.clients.event.emit(
'outer.auth.access-token.revoked',
{ token_uid: 42 } as never,
{ from_outside: true },
);
server.clients.event.emit(
'outer.auth.access-token.revoked',
{ token_uid },
{ from_outside: true },
);
expect(await c.waitFor('error')).toMatchObject({
error: { code: 'invalid_api_key' },
});
await c.closed;
});
it('closes with a retryable error after a sustained verification outage', async () => {
const c = open(`${relayUrl}?auth_token=${user.token}`);
await c.waitFor('session.created');
@@ -838,19 +838,13 @@ export class OpenAIRealtimeRelayService extends PuterService {
{},
);
});
this.clients.event.on(
'outer.auth.access-token.revoked',
(_key, data) => {
const tokenUid = (data as { token_uid?: unknown } | null)
?.token_uid;
if (typeof tokenUid !== 'string' || !tokenUid) return;
this.clients.event.emit(
'pubsub.realtime.auth-revoked',
{ tokenUid },
{},
);
},
);
this.clients.event.on('auth.access-token.revoked', (_key, data) => {
this.clients.event.emit(
'pubsub.realtime.auth-revoked',
{ tokenUid: data.token_uid },
{},
);
});
// Raw WebSockets do not participate in socket.io's cluster adapter.
this.clients.event.on('pubsub.realtime.auth-revoked', (_key, data) => {
const revoked = data.sessionUids
@@ -1270,13 +1270,9 @@ describe('ShareService', () => {
expect(listByFsentry).not.toHaveBeenCalled();
expect(getEntriesByIds).not.toHaveBeenCalled();
const prefixes = [`fs:${file.uuid}`, `manage:fs:${file.uuid}`];
expect(revokeUserGrants).toHaveBeenCalledWith(prefixes, {
primary: true,
});
expect(revokeGroupGrants).toHaveBeenCalledWith(prefixes, {
primary: true,
});
expect(deleteRows).toHaveBeenCalledWith([file.id], [file.uuid]);
expect(revokeUserGrants).toHaveBeenCalledWith(prefixes);
expect(revokeGroupGrants).toHaveBeenCalledWith(prefixes);
expect(deleteRows).toHaveBeenCalledWith([file.id]);
// Grants go before the rows that record them.
expect(
revokeUserGrants.mock.invocationCallOrder[0]!,
@@ -19,7 +19,7 @@
import { dirname as pathDirname } from 'node:path/posix';
import { v4 as uuidv4 } from 'uuid';
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import type { Actor } from '../../core/actor.js';
import { runWithContext } from '../../core/context.js';
import { PuterServer } from '../../server.js';
@@ -240,161 +240,6 @@ describe('ShareService: deleting a shared item', () => {
);
});
it('reads no grants or shares from the primary for an owner with nothing shared', async () => {
const owner = await makeUser();
const { dir } = await makeDirWithFile(owner.user);
const trash = await dirAt(`/${owner.user.username}/Trash`);
const pread = vi.spyOn(server.clients.db, 'pread');
try {
await move(owner, dir, trash);
const retireReads = pread.mock.calls
.map(([sql]) => String(sql))
.filter((sql) =>
/`user_to_user_permissions`|`user_to_group_permissions`|FROM `share`/u.test(
sql,
),
);
expect(retireReads).toEqual([]);
} finally {
pread.mockRestore();
}
});
it('withdraws a share made just now that the replica has not seen', async () => {
const owner = await makeUser();
const recipient = await makeUser();
const { dir, file } = await makeDirWithFile(owner.user);
await share(owner.actor, {
uid: dir.uuid,
recipient: { username: recipient.user.username },
mode: 'read',
});
expect(await canRead(recipient.actor, file.path)).toBe(true);
const trash = await dirAt(`/${owner.user.username}/Trash`);
// The replica has neither the grant nor the share row yet.
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi.spyOn(db, 'pread').mockImplementation(primaryRead);
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (sql, params) =>
/`user_to_user_permissions`|FROM `share`/u.test(String(sql))
? []
: primaryRead(sql, params),
);
let moved;
try {
moved = await move(owner, dir, trash);
} finally {
read.mockRestore();
pread.mockRestore();
}
expect(
await canRead(recipient.actor, `${moved.path}/${file.name}`),
).toBe(false);
expect(
await server.stores.share.listAllByFsentrySubtree(dir.id),
).toEqual([]);
});
it("does not honour a lagging replica's copy of a link the delete removed", async () => {
const owner = await makeUser();
const stranger = await makeUser();
const { dir, file } = await makeDirWithFile(owner.user);
// The owner's plan covers link sharing.
const plan = vi
.spyOn(server.services.metering, 'getActorSubscription')
.mockResolvedValue({ id: 'business' } as never);
await server.stores.share.upsertAnyone({
issuerUserId: owner.user.id,
fsentryId: dir.id,
mode: 'read',
});
expect(await canRead(stranger.actor, file.path)).toBe(true);
const trash = await dirAt(`/${owner.user.username}/Trash`);
const moved = await move(owner, dir, trash);
// The replica still has the link row the primary just deleted.
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi.spyOn(db, 'pread').mockImplementation(primaryRead);
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (sql, params) =>
String(sql).includes('`share`.`anyone` = 1')
? [
{
mode: 'read',
entry_uuid: dir.uuid,
owner_user_id: owner.user.id,
},
]
: primaryRead(sql, params),
);
try {
expect(
await canRead(stranger.actor, `${moved.path}/${file.name}`),
).toBe(false);
} finally {
read.mockRestore();
pread.mockRestore();
plan.mockRestore();
}
});
it("drops a team member's cached access when the replica lacks them", async () => {
const owner = await makeUser();
const member = await makeUser();
const file = await makeFile(owner.user);
const groupUid = uuidv4();
await server.clients.db.write(
'INSERT INTO `group` (`uid`, `owner_user_id`, `kind`, `name`, ' +
'`extra`, `metadata`) VALUES (?, ?, ?, ?, ?, ?)',
[groupUid, owner.user.id, 'team', 'Team', '{}', '{}'],
);
const [group] = (await server.clients.db.read(
'SELECT id FROM `group` WHERE uid = ?',
[groupUid],
)) as { id: number }[];
await server.clients.db.write(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[member.user.id, group.id],
);
await server.stores.permission.upsertUserGroupPerm(
Number(group.id),
owner.user.id,
`fs:${file.uuid}:read`,
{},
);
// The replica has not seen the member join yet.
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi.spyOn(db, 'pread').mockImplementation(primaryRead);
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (sql, params) =>
String(sql).includes('jct_user_group')
? []
: primaryRead(sql, params),
);
const bump = vi.spyOn(server.stores.permission, 'bumpCacheGenerations');
try {
await server.services.share.onEntryDeleted(file.uuid);
expect(bump.mock.calls.flat(2)).toContain(
`user:${member.user.uuid}`,
);
} finally {
bump.mockRestore();
read.mockRestore();
pread.mockRestore();
}
});
it('does not answer whether a name is already in the owner\'s Trash', async () => {
const owner = await makeUser();
const recipient = await makeUser();
+20 -59
View File
@@ -292,9 +292,6 @@ export const modeFromEntryPermission = (permission: string): string | null => {
*/
const RETIRE_CHUNK_SIZE = 100;
/** How long after an owner shares the retire reads stay on the primary. */
const RECENT_SHARE_WINDOW_MS = 30_000;
/** Shares one user may create per UTC day, absent a config override. */
export const DEFAULT_DAILY_SHARE_LIMIT = 200;
@@ -400,11 +397,6 @@ export class ShareService extends PuterService {
* fleet-wide; its TTL covers a process the bump missed.
*/
readonly #ownerShares = new SubscriptionCache();
/** Owners who shared just now: a replica may not have the row yet. */
readonly #recentSharers = new SubscriptionCache(
undefined,
RECENT_SHARE_WINDOW_MS,
);
readonly #ownerLookups = new Map<string, Promise<boolean>>();
/**
@@ -627,11 +619,6 @@ export class ShareService extends PuterService {
const chunk = entries.slice(i, i + RETIRE_CHUNK_SIZE);
const removed = await this.onEntryDeleted(
chunk.map((entry) => entry.uuid),
{
primary: this.#sharedRecently(
chunk.map((entry) => entry.userId),
),
},
);
const holdersByEntry = new Map<string, Set<number>>();
@@ -945,16 +932,6 @@ export class ShareService extends PuterService {
this.#ownerShares.generationOf(ownerUserId),
true,
);
this.#recentSharers.write(
ownerUserId,
this.#recentSharers.generationOf(ownerUserId),
true,
);
}
/** Whether this process heard any of these owners share within the window. */
#sharedRecently(ownerUserIds: number[]): boolean {
return ownerUserIds.some((id) => this.#recentSharers.read(id) === true);
}
async #emitGui(
@@ -1578,9 +1555,7 @@ export class ShareService extends PuterService {
// Every row, not just the applied ones: a node whose only share is a
// pending invite or a team grant is exactly what the group and invite
// sweeps ask about.
const rows = await this.stores.share.listAllByFsentrySubtree(entry.id, {
primary: true,
});
const rows = await this.stores.share.listAllByFsentrySubtree(entry.id);
const nodes = await this.stores.fsEntry.getEntriesByIds(
rows.map((row: { fsentry_id: number }) => Number(row.fsentry_id)),
);
@@ -1804,13 +1779,9 @@ export class ShareService extends PuterService {
/**
* Retire the grants pointing at a node that no longer exists. Returns the
* rows removed, which is the only record of who had access — the index rows
* cascade away with the fsentry. Reads a replica unless `primary` says a
* grant may be too new for one.
* cascade away with the fsentry.
*/
async onEntryDeleted(
entryUids: string | string[],
{ primary = false }: { primary?: boolean } = {},
): Promise<
async onEntryDeleted(entryUids: string | string[]): Promise<
Array<{
holder_user_id: number;
issuer_user_id: number;
@@ -1825,7 +1796,6 @@ export class ShareService extends PuterService {
const removed =
await this.stores.permission.deleteUserUserPermsByPermissionPrefixes(
uids.flatMap((uid) => [`fs:${uid}`, `manage:fs:${uid}`]),
{ primary },
);
// Retiring the rows is not enough: a holder's cached scan still answers
@@ -1838,14 +1808,19 @@ export class ShareService extends PuterService {
// Group grants on the same node, and their members' caches: without
// this they outlive the file and keep answering "allowed".
const { members } =
const removedGroups =
await this.stores.permission.deleteUserGroupPermsByPermissionPrefixes(
uids.flatMap((uid) => [`fs:${uid}`, `manage:fs:${uid}`]),
{ primary },
);
const memberUuids = members
.map((member) => member.uuid)
.filter((uuid): uuid is string => Boolean(uuid));
const memberUuids = (
await Promise.all(
[...new Set(removedGroups.map((row) => Number(row.group_id)))]
.filter((id) => Number.isFinite(id))
.map((id) =>
this.stores.permission.listGroupMemberUuids(id),
),
)
).flat();
await this.stores.permission.bumpCacheGenerations([
...new Set([
@@ -1902,23 +1877,15 @@ export class ShareService extends PuterService {
* the subtree stands on its own, and one left behind keeps granting the
* issuer's recipients access under an owner who never agreed to them.
*/
async onEntryOwnerChanged(
entry: FSEntry,
{ primary = true }: { primary?: boolean } = {},
): Promise<void> {
async onEntryOwnerChanged(entry: FSEntry): Promise<void> {
// A file's share rows can only name the file itself, so there is
// nothing to list or hydrate.
if (!entry.isDir) {
await this.onEntryDeleted([entry.uuid], { primary });
await this.stores.share.deleteByFsentryIds(
[entry.id],
[entry.uuid],
);
await this.onEntryDeleted([entry.uuid]);
await this.stores.share.deleteByFsentryIds([entry.id]);
return;
}
const rows = await this.stores.share.listAllByFsentrySubtree(entry.id, {
primary,
});
const rows = await this.stores.share.listAllByFsentrySubtree(entry.id);
const fsentryIds = [
...new Set([
entry.id,
@@ -1930,8 +1897,8 @@ export class ShareService extends PuterService {
const nodes = await this.stores.fsEntry.getEntriesByIds(fsentryIds);
const uuids = [...nodes.values()].map((node) => node.uuid);
if (uuids.length > 0) await this.onEntryDeleted(uuids, { primary });
await this.stores.share.deleteByFsentryIds(fsentryIds, uuids);
if (uuids.length > 0) await this.onEntryDeleted(uuids);
await this.stores.share.deleteByFsentryIds(fsentryIds);
}
/**
@@ -1946,11 +1913,7 @@ export class ShareService extends PuterService {
async onEntryTrashed(entry: FSEntry): Promise<void> {
// The same sweep as a change of owner: every kind of row in the
// subtree, since a link share deeper down grants access on its own.
// Nearly every trashed entry has no shares, so the reads stay off the
// primary unless its owner shared just now.
await this.onEntryOwnerChanged(entry, {
primary: this.#sharedRecently([entry.userId]),
});
await this.onEntryOwnerChanged(entry);
}
// -- Reads --------------------------------------------------------
@@ -3052,7 +3015,6 @@ export class ShareService extends PuterService {
mode,
issuerAppUid: this.#actingAppUid(actor),
});
this.#ownerShared(entry.userId);
return {
...this.#resolve(row, entry, actor, { username: null }),
anyone: true,
@@ -3352,7 +3314,6 @@ export class ShareService extends PuterService {
mode,
issuerAppUid: this.#actingAppUid(actor),
});
this.#ownerShared(entry.userId);
return {
...this.#resolve(row, entry, actor, { username: null }),
pending: true,
@@ -428,43 +428,6 @@ describe('SocketService (live socket.io)', () => {
sessionSocket.disconnect();
});
it('drops a token`s socket on a revocation that reached it from elsewhere', async () => {
const row = await server.stores.user.getByUsername(user.username);
const actor = makeActor({ user: row as never });
const doomed = await runWithContext({ actor }, () =>
server.services.auth.createAccessToken(actor, [[FULL_API_ACCESS]], {
label: 'revoke-fanout-probe',
}),
);
const { token_uid } = server.services.token.verify<{
token_uid: string;
}>('auth', doomed);
const tokenSocket = await connect({ auth_token: doomed });
expect(tokenSocket.connected).toBe(true);
// A malformed peer payload is ignored.
for (const data of [null, {}, { token_uid: 42 }]) {
server.clients.event.emit(
'outer.auth.access-token.revoked',
data as never,
{ from_outside: true },
);
}
await new Promise((r) => setTimeout(r, 200));
expect(tokenSocket.connected).toBe(true);
// As a peer cluster delivers it: the token was revoked on another node.
server.clients.event.emit(
'outer.auth.access-token.revoked',
{ token_uid },
{ from_outside: true },
);
await vi.waitFor(() => expect(tokenSocket.connected).toBe(false), {
timeout: 5000,
});
});
it('rejects an app-under-user token while events are off', async () => {
const row = await server.stores.user.getByUsername(user.username);
const appUid = `app-${uuidv4()}`;
@@ -963,31 +926,6 @@ describe('SocketService (live socket.io)', () => {
socket.disconnect();
});
it('keeps a connection up when its re-check lookup fails', async () => {
const user = await createTestUser(server, {
username: 'sock-lookup-down',
password: 'sock-lookup-down-password',
});
const socket = await connect({ auth_token: `Bearer ${user.token}` });
const authenticate = vi
.spyOn(server.services.auth, 'authenticate')
.mockRejectedValue(
Object.assign(new Error('Database operation failed'), {
code: 'dbBatchFailed',
}),
);
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
try {
await socketService.reauthenticateSockets();
await new Promise((r) => setTimeout(r, 200));
expect(socket.connected).toBe(true);
} finally {
authenticate.mockRestore();
warn.mockRestore();
socket.disconnect();
}
});
it('re-checks without recording session activity', async () => {
const idle = await createTestUser(server, {
username: 'sock-idle',
+9 -18
View File
@@ -982,22 +982,15 @@ export class SocketService extends PuterService {
},
);
const decisions = new Map<string, SocketAuthDecision>();
let unchecked = 0;
checked.forEach((token, i) => {
const outcome = outcomes[i];
// A lookup that failed says nothing about the credential, so its
// sockets stay up until a later sweep gets an answer.
if (outcome?.status === 'fulfilled') {
decisions.set(token, outcome.value);
} else {
unchecked++;
}
});
if (unchecked > 0) {
console.warn(
`[socket] reauth sweep could not check ${unchecked} credential(s)`,
decisions.set(
token,
outcome?.status === 'fulfilled'
? outcome.value
: { reject: new Error('socket reauth failed') },
);
}
});
for (const socket of sockets) {
const decision = socket.authToken
@@ -1182,12 +1175,10 @@ export class SocketService extends PuterService {
);
this.clients.event.on(
'outer.auth.access-token.revoked',
'auth.access-token.revoked',
(_key: string, data: unknown) => {
const tokenUid = (data as { token_uid?: unknown } | null)
?.token_uid;
if (typeof tokenUid !== 'string') return;
this.#evictAccessTokenSockets(tokenUid).catch(
const { token_uid } = data as { token_uid: string };
this.#evictAccessTokenSockets(token_uid).catch(
(err: unknown) => {
console.error('[socket] token eviction failed', err);
},
@@ -64,29 +64,6 @@ describe('PermissionStore', () => {
);
};
/** Replica reads of `table` see `stale`; the primary stays real. */
const lagReplica = (
table: string,
stale: (sql: string) => Record<string, unknown>[],
) => {
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi
.spyOn(db, 'pread')
.mockImplementation((sql, params) => primaryRead(sql, params));
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (sql, params) =>
String(sql).includes(table)
? stale(String(sql))
: primaryRead(sql, params),
);
return () => {
read.mockRestore();
pread.mockRestore();
};
};
// -- Flat KV view --------------------------------------------------
describe('flat user permissions (KV view)', () => {
@@ -934,341 +911,6 @@ describe('PermissionStore', () => {
expect(await store.readUserGroupPerms(user.id, [])).toEqual([]);
});
it('does not read a revoked grant back from a lagging replica', async () => {
const issuer = await makeUser();
const member = await makeUser();
const groupId = await seedGroup(issuer.id);
await server.clients.db.write(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[member.id, groupId],
);
await seedGroupPerm(issuer.id, groupId, 'fs:lag:read');
const [stale] = await store.readUserGroupPerms(member.id, [
'fs:lag:read',
]);
const [staleForHolder] = await store.readUserGroupPermsForHolders(
[member.id],
['fs:lag:read'],
);
await store.deleteUserGroupPerm(groupId, issuer.id, 'fs:lag:read');
// The replica still has the row the primary just deleted.
const restore = lagReplica('user_to_group_permissions', (sql) =>
sql.includes('holder_user_id')
? [staleForHolder]
: [{ ...stale, extra: '{}' }],
);
try {
expect(
await store.readUserGroupPerms(member.id, ['fs:lag:read']),
).toEqual([]);
expect(
await store.readUserGroupPermsForHolders(
[member.id],
['fs:lag:read'],
),
).toEqual([]);
} finally {
restore();
}
});
it('does not read grants removed with their node back from a lagging replica', async () => {
const issuer = await makeUser();
const member = await makeUser();
const groupId = await seedGroup(issuer.id);
await server.clients.db.write(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[member.id, groupId],
);
const node = uuidv4();
await seedGroupPerm(issuer.id, groupId, `fs:${node}:read`);
const [stale] = await store.readUserGroupPerms(member.id, [
`fs:${node}:read`,
]);
await store.deleteUserGroupPermsByPermissionPrefixes([
`fs:${node}`,
]);
const restore = lagReplica('user_to_group_permissions', () => [
{ ...stale, extra: '{}' },
]);
try {
expect(
await store.readUserGroupPerms(member.id, [
`fs:${node}:read`,
]),
).toEqual([]);
} finally {
restore();
}
});
it('removes a grant the replica has not seen yet with its node, when asked to read the primary', async () => {
const issuer = await makeUser();
const groupId = await seedGroup(issuer.id);
const node = uuidv4();
await seedGroupPerm(issuer.id, groupId, `fs:${node}:read`);
const restore = lagReplica('user_to_group_permissions', () => []);
let unasked;
let removed;
try {
unasked = await store.deleteUserGroupPermsByPermissionPrefixes([
`fs:${node}`,
]);
removed = await store.deleteUserGroupPermsByPermissionPrefixes(
[`fs:${node}`],
{ primary: true },
);
} finally {
restore();
}
// Unasked, the replica's answer stands and the primary is left alone.
expect(unasked?.rows).toEqual([]);
expect(removed?.rows).toEqual([
{ group_id: groupId, permission: `fs:${node}:read` },
]);
expect(
await store.queryIssuerGroupPermsByPrefix(
issuer.id,
groupId,
`fs:${node}`,
),
).toEqual([]);
});
it('sends a former member to the primary once membership changes', async () => {
const issuer = await makeUser();
const member = await makeUser();
const groupId = await seedGroup(issuer.id);
await server.clients.db.write(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[member.id, groupId],
);
await seedGroupPerm(issuer.id, groupId, 'fs:left:read');
const [stale] = await store.readUserGroupPerms(member.id, [
'fs:left:read',
]);
await server.clients.db.write(
'DELETE FROM `jct_user_group` WHERE `user_id` = ? AND `group_id` = ?',
[member.id, groupId],
);
const emit = vi.spyOn(server.clients.event, 'emit');
try {
await store.markGroupMembershipChanged([member.id]);
// Only tombstones go out; there is no cached value to drop.
const sent = emit.mock.calls
.filter(([name]) => name === 'outer.cacheUpdate')
.flatMap(
([, data]) => (data as { cacheKey: string[] }).cacheKey,
);
expect(sent).toEqual([
`perms:u2g:${member.id}${CACHE_TOMBSTONE_SUFFIX}`,
]);
} finally {
emit.mockRestore();
}
const restore = lagReplica('user_to_group_permissions', () => [
{ ...stale, extra: '{}' },
]);
try {
expect(
await store.readUserGroupPerms(member.id, ['fs:left:read']),
).toEqual([]);
} finally {
restore();
}
});
const seedMember = async (issuerId: number, permission: string) => {
const member = await makeUser();
const groupId = await seedGroup(issuerId);
await server.clients.db.write(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[member.id, groupId],
);
await seedGroupPerm(issuerId, groupId, permission);
return { member, groupId };
};
const tombstoneSet = async (userId: number) =>
(await server.clients.redis.exists(
`perms:u2g:${userId}${CACHE_TOMBSTONE_SUFFIX}`,
)) > 0;
it('sends member reads to the primary before the grant is deleted', async () => {
const issuer = await makeUser();
const node = uuidv4();
const one = await seedMember(issuer.id, 'fs:order:read');
const many = await seedMember(issuer.id, `fs:${node}:read`);
const db = server.clients.db;
const primaryWrite = db.write.bind(db);
const seen: boolean[] = [];
const write = vi
.spyOn(db, 'write')
.mockImplementation(async (sql, params) => {
if (String(sql).startsWith('DELETE FROM')) {
seen.push(
(await tombstoneSet(one.member.id)) ||
(await tombstoneSet(many.member.id)),
);
}
return primaryWrite(sql, params);
});
try {
await store.deleteUserGroupPerm(
one.groupId,
issuer.id,
'fs:order:read',
);
await store.deleteUserGroupPermsByPermissionPrefixes([
`fs:${node}`,
]);
} finally {
write.mockRestore();
}
expect(seen).toEqual([true, true]);
});
it('leaves the grant in place when the member read fails', async () => {
const issuer = await makeUser();
const node = uuidv4();
const one = await seedMember(issuer.id, 'fs:retry:read');
const many = await seedMember(issuer.id, `fs:${node}:read`);
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi
.spyOn(db, 'pread')
.mockImplementation(async (sql, params) => {
if (String(sql).includes('`jct_user_group` ug')) {
throw new Error('primary unavailable');
}
return primaryRead(sql, params);
});
try {
await expect(
store.deleteUserGroupPerm(
one.groupId,
issuer.id,
'fs:retry:read',
),
).rejects.toThrow('primary unavailable');
await expect(
store.deleteUserGroupPermsByPermissionPrefixes([
`fs:${node}`,
]),
).rejects.toThrow('primary unavailable');
} finally {
pread.mockRestore();
}
// The retry still finds the grants and whose they were.
expect(
await store.deleteUserGroupPerm(
one.groupId,
issuer.id,
'fs:retry:read',
),
).toEqual({
removed: true,
members: [{ id: one.member.id, uuid: expect.any(String) }],
});
expect(
await store.deleteUserGroupPermsByPermissionPrefixes([
`fs:${node}`,
]),
).toEqual({
rows: [
{ group_id: many.groupId, permission: `fs:${node}:read` },
],
members: [{ id: many.member.id, uuid: expect.any(String) }],
});
});
it('includes someone who joined while the grant was deleted', async () => {
const issuer = await makeUser();
const joiner = await makeUser();
const { member, groupId } = await seedMember(
issuer.id,
'fs:joined:read',
);
const db = server.clients.db;
const primaryWrite = db.write.bind(db);
const write = vi
.spyOn(db, 'write')
.mockImplementation(async (sql, params) => {
if (String(sql).startsWith('DELETE FROM')) {
await primaryWrite(
'INSERT INTO `jct_user_group` (`user_id`, `group_id`) VALUES (?, ?)',
[joiner.id, groupId],
);
}
return primaryWrite(sql, params);
});
let result;
try {
result = await store.deleteUserGroupPerm(
groupId,
issuer.id,
'fs:joined:read',
);
} finally {
write.mockRestore();
}
expect(result.removed).toBe(true);
expect(result.members.map((m) => m.id).sort()).toEqual(
[member.id, joiner.id].sort(),
);
expect(await tombstoneSet(joiner.id)).toBe(true);
});
it('still reports the removal when the second member read fails', async () => {
const issuer = await makeUser();
const { member, groupId } = await seedMember(
issuer.id,
'fs:reread:read',
);
const db = server.clients.db;
const primaryRead = db.read.bind(db);
let memberReads = 0;
const pread = vi
.spyOn(db, 'pread')
.mockImplementation(async (sql, params) => {
if (
String(sql).includes('`jct_user_group` ug') &&
++memberReads > 1
) {
throw new Error('primary unavailable');
}
return primaryRead(sql, params);
});
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
try {
expect(
await store.deleteUserGroupPerm(
groupId,
issuer.id,
'fs:reread:read',
),
).toEqual({
removed: true,
members: [{ id: member.id, uuid: expect.any(String) }],
});
} finally {
pread.mockRestore();
warn.mockRestore();
}
});
it('reads many issuer/group pairs under many prefixes at once', async () => {
const issuer = await makeUser();
const rival = await makeUser();
@@ -1831,41 +1473,6 @@ describe('PermissionStore', () => {
).toHaveLength(1);
});
it('removes a grant the replica has not seen yet with its node, when asked to read the primary', async () => {
const issuer = await makeUser();
const holder = await makeUser();
const node = uuidv4();
await store.upsertUserUserPerm(
holder.id,
issuer.id,
`fs:${node}:read`,
{},
);
const restore = lagReplica('user_to_user_permissions', () => []);
let unasked;
let removed;
try {
unasked = await store.deleteUserUserPermsByPermissionPrefixes([
`fs:${node}`,
]);
removed = await store.deleteUserUserPermsByPermissionPrefixes(
[`fs:${node}`],
{ primary: true },
);
} finally {
restore();
}
// Unasked, the replica's answer stands and the primary is left alone.
expect(unasked).toEqual([]);
expect(removed).toHaveLength(1);
expect(
await store.readLinkedUserUserPermsFromPrimary(holder.id, [
`fs:${node}:read`,
]),
).toEqual([]);
});
it('does not let a wildcard in the prefix widen the match', async () => {
const issuer = await makeUser();
const holder = await makeUser();
+28 -120
View File
@@ -17,11 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {
CACHE_TOMBSTONE_SUFFIX,
CACHE_TOMBSTONE_TTL_SECONDS,
PuterStore,
} from '../types';
import { PuterStore } from '../types';
import type { LayerInstances } from '../../types';
import type { puterStores } from '../index';
import { PermissionUtil } from '../../services/permission/permissionUtil';
@@ -102,11 +98,6 @@ type DbRead = (
params: unknown[],
) => Promise<Record<string, unknown>[]>;
export interface GroupMember {
id: number;
uuid: string | null;
}
export interface LinkedUserUserPermRow {
holder_user_id: number;
issuer_user_id: number;
@@ -654,40 +645,25 @@ export class PermissionStore extends PuterStore {
}));
}
/** `primary` when a grant may be too new for a replica to have it. */
#grantRead(primary: boolean): DbRead {
return primary
? this.clients.db.pread.bind(this.clients.db)
: this.clients.db.read.bind(this.clients.db);
}
/** The group analogue: a deleted node's group grants must go with it. */
async deleteUserGroupPermsByPermissionPrefixes(
permissions: string[],
{ primary = false }: { primary?: boolean } = {},
): Promise<{
rows: Array<{ group_id: number; permission: string }>;
members: GroupMember[];
}> {
if (permissions.length === 0) return { rows: [], members: [] };
): Promise<Array<{ group_id: number; permission: string }>> {
if (permissions.length === 0) return [];
const { where, params } = subtreeClause(permissions);
const rows = (await this.#grantRead(primary)(
const rows = (await this.clients.db.read(
'SELECT `group_id`, `permission` FROM `user_to_group_permissions` ' +
`WHERE ${where}`,
params,
)) as Array<{ group_id: number; permission: string }>;
if (rows.length === 0) return { rows, members: [] };
if (rows.length === 0) return [];
const { members } = await this.#deleteGroupGrants(
rows.map((row) => row.group_id),
() =>
this.clients.db.write(
`DELETE FROM \`user_to_group_permissions\` WHERE ${where}`,
params,
),
await this.clients.db.write(
`DELETE FROM \`user_to_group_permissions\` WHERE ${where}`,
params,
);
return { rows, members };
return rows;
}
/**
@@ -702,7 +678,6 @@ export class PermissionStore extends PuterStore {
*/
async deleteUserUserPermsByPermissionPrefixes(
permissions: string[],
{ primary = false }: { primary?: boolean } = {},
): Promise<
Array<{
holder_user_id: number;
@@ -713,7 +688,7 @@ export class PermissionStore extends PuterStore {
if (permissions.length === 0) return [];
const { where, params } = subtreeClause(permissions);
const rows = (await this.#grantRead(primary)(
const rows = (await this.clients.db.read(
'SELECT `holder_user_id`, `issuer_user_id`, `permission` FROM `user_to_user_permissions` ' +
`WHERE ${where}`,
params,
@@ -1357,6 +1332,9 @@ export class PermissionStore extends PuterStore {
}
// -- SQL: user-to-group permissions ------------------------------
//
// Read-only. Group grants are seeded by migration (the admin group's
// unrestricted `driver` access); nothing writes them at runtime.
/**
* Reads group permissions granted to groups the user is a member of, for a
@@ -1373,15 +1351,9 @@ export class PermissionStore extends PuterStore {
if (permissions.length === 0) return [];
let permClause = permissions.map(() => 'p.permission = ?').join(' OR ');
if (permissions.length > 1) permClause = `(${permClause})`;
const tombstoned = await this.isCacheKeyTombstoned([
this.#u2gCacheKey(userId),
]);
const read: DbRead = tombstoned
? this.clients.db.pread.bind(this.clients.db)
: this.clients.db.read.bind(this.clients.db);
// Deletion leaves memberships and grants, so a deleted team would
// otherwise keep resolving access nothing can withdraw.
const rows = await read(
const rows = await this.clients.db.read(
'SELECT p.permission, p.user_id, p.group_id, p.extra FROM `user_to_group_permissions` p ' +
'JOIN `jct_user_group` ug ON p.group_id = ug.group_id ' +
'JOIN `group` g ON g.`id` = ug.group_id ' +
@@ -1415,44 +1387,13 @@ export class PermissionStore extends PuterStore {
.filter((uuid): uuid is string => Boolean(uuid));
}
async #listGroupMembers(groupIds: number[]): Promise<GroupMember[]> {
const ids = [...new Set(groupIds.map(Number))].filter((id) =>
Number.isFinite(id),
);
if (ids.length === 0) return [];
const rows = (await this.clients.db.pread(
'SELECT DISTINCT u.`id`, u.`uuid` FROM `jct_user_group` ug ' +
'JOIN `user` u ON u.`id` = ug.`user_id` ' +
`WHERE ug.\`group_id\` IN (${ids.map(() => '?').join(', ')})`,
ids,
)) as { id: number; uuid: string | null }[];
return rows.map((row) => ({ id: Number(row.id), uuid: row.uuid }));
}
/**
* Runs a delete of these groups' grants with their members' group reads
* already on the primary. Returns the members, later joiners included.
*/
async #deleteGroupGrants<T>(
groupIds: number[],
deleteGrants: () => Promise<T>,
): Promise<{ result: T; members: GroupMember[] }> {
// Before the delete: a failed member read leaves the grants to retry.
const members = await this.#listGroupMembers(groupIds);
await this.markGroupMembershipChanged(members.map((m) => m.id));
const result = await deleteGrants();
try {
const known = new Set(members.map((m) => m.id));
const joined = (await this.#listGroupMembers(groupIds)).filter(
(m) => !known.has(m.id),
);
await this.markGroupMembershipChanged(joined.map((m) => m.id));
members.push(...joined);
} catch (e) {
// The grants are gone; only someone who joined meanwhile is missed.
console.warn('[permission] group members not re-read:', e);
}
return { result, members };
/** Whose standing access a grant to this group settles. */
async listGroupMemberIds(groupId: number): Promise<number[]> {
const rows = (await this.clients.db.read(
'SELECT `user_id` FROM `jct_user_group` WHERE `group_id` = ?',
[groupId],
)) as { user_id: number }[];
return rows.map((r) => Number(r.user_id));
}
/** Batched `readUserGroupPerms`, tagged with the user each row reached. */
@@ -1465,14 +1406,7 @@ export class PermissionStore extends PuterStore {
const holders = [...new Set(userIds)];
const perms = [...new Set(permissions)];
if (holders.length === 0 || perms.length === 0) return [];
const changed = await this.tombstonedCacheKeys(
holders.map((holder) => this.#u2gCacheKey(holder)),
);
const read: DbRead =
changed.size > 0
? this.clients.db.pread.bind(this.clients.db)
: this.clients.db.read.bind(this.clients.db);
const rows = await read(
const rows = await this.clients.db.read(
'SELECT ug.`user_id` AS `holder_user_id`, p.`permission`, p.`user_id` ' +
'FROM `user_to_group_permissions` p ' +
'JOIN `jct_user_group` ug ON p.`group_id` = ug.`group_id` ' +
@@ -1558,34 +1492,13 @@ export class PermissionStore extends PuterStore {
groupId: number,
issuerUserId: number,
permission: string,
): Promise<{ removed: boolean; members: GroupMember[] }> {
const { result, members } = await this.#deleteGroupGrants(
[groupId],
() =>
this.clients.db.write(
'DELETE FROM `user_to_group_permissions` ' +
'WHERE `group_id` = ? AND `user_id` = ? AND `permission` = ?',
[groupId, issuerUserId, permission],
),
): Promise<boolean> {
const result = await this.clients.db.write(
'DELETE FROM `user_to_group_permissions` ' +
'WHERE `group_id` = ? AND `user_id` = ? AND `permission` = ?',
[groupId, issuerUserId, permission],
);
return { removed: result.anyRowsAffected, members };
}
/** Group reads of these users go to the primary; for leaves and deletes. */
async markGroupMembershipChanged(userIds: number[]): Promise<void> {
const ids = [...new Set(userIds.map(Number))].filter((id) =>
Number.isFinite(id),
);
if (ids.length === 0) return;
// Only the tombstones: nothing is cached under the base key.
await this.publishCacheKeys({
keys: ids.map(
(id) => this.#u2gCacheKey(id) + CACHE_TOMBSTONE_SUFFIX,
),
serializedData: '1',
ttlSeconds: CACHE_TOMBSTONE_TTL_SECONDS,
broadcast: true,
});
return result.anyRowsAffected;
}
async auditUserGroupPerm(
@@ -1975,11 +1888,6 @@ export class PermissionStore extends PuterStore {
return `perms:u2u:holder:${holderUserId}`;
}
/** Holds only a tombstone: group reads aren't cached here. */
#u2gCacheKey(userId: number): string {
return `perms:u2g:${userId}`;
}
#u2aCacheKey(userId: number, appId: number): string {
return `perms:u2a:${userId}:${appId}`;
}
+6 -20
View File
@@ -658,26 +658,12 @@ export class SessionStore extends PuterStore {
*/
async findActiveByAccessTokenUid(tokenUid) {
if (!tokenUid) return null;
// One indexed lookup per column: an OR across both can't use either
// index on MySQL. MySQL indexes the legacy uid only through its
// active-row generated column, equal to it while `revoked_at` is NULL.
const legacyColumn = this.clients.db.case({
mysql: 'legacy_token_unique_key',
otherwise: 'legacy_token_uid',
});
const findBy = async (column) => {
const rows = await this.clients.db.read(
`SELECT * FROM \`sessions\` WHERE \`kind\` = 'access_token' AND \`${column}\` = ? AND \`revoked_at\` IS NULL AND (\`expires_at\` IS NULL OR \`expires_at\` > ?) ORDER BY \`id\` DESC LIMIT 1`,
[tokenUid, nowSeconds()],
);
return this.#normalizeRow(rows[0]);
};
// Sent together, so a miss on the first costs no second round trip.
const [own, legacy] = await Promise.all([
findBy('access_token_uid'),
findBy(legacyColumn),
]);
return own ?? legacy;
const now = nowSeconds();
const rows = await this.clients.db.read(
"SELECT * FROM `sessions` WHERE `kind` = 'access_token' AND (`access_token_uid` = ? OR `legacy_token_uid` = ?) AND `revoked_at` IS NULL AND (`expires_at` IS NULL OR `expires_at` > ?) ORDER BY `id` DESC LIMIT 1",
[tokenUid, tokenUid, now],
);
return this.#normalizeRow(rows[0]);
}
/**
@@ -771,77 +771,6 @@ describe('SessionStore', () => {
});
});
describe('findActiveByAccessTokenUid', () => {
const tokenRow = (userId: number, fields: Record<string, unknown>) =>
target.create(userId, { kind: 'access_token', ...fields });
it('finds a token row by its access_token_uid', async () => {
const user = await makeUser();
const tokenUid = uuidv4();
const row = await tokenRow(user.id, { access_token_uid: tokenUid });
const found = await target.findActiveByAccessTokenUid(tokenUid);
expect(found?.uuid).toBe(row.uuid);
});
it('finds a migrated row by its legacy token uid', async () => {
const user = await makeUser();
const legacyUid = uuidv4();
const row = await tokenRow(user.id, {
legacy_token_uid: legacyUid,
created_via: 'legacy_backfill',
});
const found = await target.findActiveByAccessTokenUid(legacyUid);
expect(found?.uuid).toBe(row.uuid);
});
it('returns null for a uid no token row carries', async () => {
const user = await makeUser();
await tokenRow(user.id, { access_token_uid: uuidv4() });
expect(
await target.findActiveByAccessTokenUid(uuidv4()),
).toBeNull();
});
it('skips revoked and expired rows under either uid', async () => {
const user = await makeUser();
const revokedUid = uuidv4();
const revokedLegacyUid = uuidv4();
const expiredUid = uuidv4();
const revoked = await tokenRow(user.id, {
access_token_uid: revokedUid,
});
const revokedLegacy = await tokenRow(user.id, {
legacy_token_uid: revokedLegacyUid,
});
await tokenRow(user.id, {
access_token_uid: expiredUid,
expires_at: Math.floor(Date.now() / 1000) - 60,
});
await target.removeByUuid(revoked.uuid);
await target.removeByUuid(revokedLegacy.uuid);
for (const uid of [revokedUid, revokedLegacyUid, expiredUid]) {
expect(await target.findActiveByAccessTokenUid(uid)).toBeNull();
}
});
it('ignores a non-token row carrying the uid', async () => {
const user = await makeUser();
const tokenUid = uuidv4();
await target.create(user.id, {
kind: 'web',
access_token_uid: tokenUid,
});
expect(
await target.findActiveByAccessTokenUid(tokenUid),
).toBeNull();
});
});
describe('getOrCreateGodmodeToken', () => {
const nowS = () => Math.floor(Date.now() / 1000);
const mint = (
+27 -92
View File
@@ -48,33 +48,6 @@ const SHARED_IDS_CHUNK_SIZE = 1000;
* and no permission behind it, and is itself what the ACL reads.
*/
export class ShareStore extends PuterStore {
onServerStart() {
// A peer region's link revokes; our own emit already applied here.
this.clients.event.on(
'outer.share.linksRevoked',
async (_key, data, meta) => {
if (!meta?.from_outside) return;
const fsentryIds = Array.isArray(data?.fsentryIds)
? data.fsentryIds.filter((id) => Number.isInteger(id))
: [];
const uuids = Array.isArray(data?.uuids)
? data.uuids.filter(
(uuid) => typeof uuid === 'string' && uuid !== '',
)
: [];
if (fsentryIds.length === 0 && uuids.length === 0) return;
try {
await this.#applyLinksRevoked(fsentryIds, uuids);
} catch (e) {
console.warn(
'[share] remote link-revoke marker not set:',
e,
);
}
},
);
}
// -- Reads --------------------------------------------------------
/** Pass `primary` to read back a row just written; a replica may lag. */
@@ -365,17 +338,12 @@ export class ShareStore extends PuterStore {
* Every share row on a node and everything beneath it, whatever kind —
* user, group and link shares plus unclaimed invites.
* `listByFsentrySubtree` answers the narrower question; this one is for
* retiring the lot. Pass `primary` when a share may be too new for a
* replica.
* retiring the lot.
*
* @param {number} fsentryId
* @param {{ primary?: boolean }} [opts]
*/
async listAllByFsentrySubtree(fsentryId, { primary = false } = {}) {
const read = primary
? this.clients.db.pread.bind(this.clients.db)
: this.clients.db.read.bind(this.clients.db);
const rows = await read(
async listAllByFsentrySubtree(fsentryId) {
const rows = await this.clients.db.read(
this.#subtreeCte() +
'SELECT `share`.* FROM `share` ' +
'JOIN `subtree` ON `share`.`fsentry_id` = `subtree`.`id` ' +
@@ -996,19 +964,14 @@ export class ShareStore extends PuterStore {
* its shares never fires.
*
* @param {number[]} fsentryIds
* @param {string[]} [entryUuids] The nodes' uuids; looked up when omitted.
*/
async deleteByFsentryIds(fsentryIds, entryUuids) {
async deleteByFsentryIds(fsentryIds) {
if (fsentryIds.length === 0) return 0;
const placeholders = fsentryIds.map(() => '?').join(', ');
const result = await this.clients.db.write(
`DELETE FROM \`share\` WHERE \`fsentry_id\` IN (${placeholders})`,
fsentryIds,
);
// Which of these nodes held a link is no longer known, so mark them all.
if (result.anyRowsAffected) {
await this.#markLinksRevoked(fsentryIds, entryUuids);
}
return result.affectedRows;
}
@@ -1253,64 +1216,36 @@ export class ShareStore extends PuterStore {
[fsentryId],
);
const removed = result.anyRowsAffected;
if (removed) {
await this.#markLinksRevoked(
[fsentryId],
entryUuid ? [entryUuid] : undefined,
);
}
if (removed) await this.#markLinkRevoked(fsentryId, entryUuid);
return removed;
}
/** Reads of these nodes' links go to the primary, here and in peers. */
async #markLinksRevoked(fsentryIds, entryUuids) {
const ids = [...new Set(fsentryIds.map(Number))];
let uuids = entryUuids?.length >= ids.length ? entryUuids : null;
if (!uuids) {
try {
const rows = await this.clients.db.pread(
'SELECT `uuid` FROM `fsentries` WHERE `id` IN ' +
`(${ids.map(() => '?').join(', ')})`,
ids,
);
uuids = rows.map((row) => String(row.uuid));
} catch (e) {
console.warn('[share] link-revoke uuids not found:', e);
uuids = entryUuids ?? [];
}
}
/** Open the window in which reads of this node's link go to the primary. */
async #markLinkRevoked(fsentryId, entryUuid) {
try {
await this.#applyLinksRevoked(ids, uuids);
let uuid = entryUuid;
if (!uuid) {
const rows = await this.clients.db.pread(
'SELECT `uuid` FROM `fsentries` WHERE `id` = ? LIMIT 1',
[fsentryId],
);
uuid = rows[0]?.uuid;
}
const keys = [ShareStore.revokedLinkKey('id', fsentryId)];
if (uuid) keys.push(ShareStore.revokedLinkKey('uuid', uuid));
await Promise.all(
keys.map((key) =>
this.clients.redis.set(
key,
'1',
'EX',
ShareStore.REVOKED_LINK_PRIMARY_WINDOW_SECONDS,
),
),
);
} catch (e) {
console.warn('[share] link-revoke marker not set:', e);
}
// Peers still get the ids when the local half failed.
try {
this.clients.event.emit(
'outer.share.linksRevoked',
{ fsentryIds: ids, uuids },
{},
);
} catch (e) {
console.warn('[share] link-revoke not sent to peers:', e);
}
}
/** Local half of {@link #markLinksRevoked}; never emits. */
async #applyLinksRevoked(fsentryIds, uuids) {
const pipeline = this.clients.redis.pipeline();
for (const key of [
...fsentryIds.map((id) => ShareStore.revokedLinkKey('id', id)),
...uuids.map((uuid) => ShareStore.revokedLinkKey('uuid', uuid)),
]) {
pipeline.set(
key,
'1',
'EX',
ShareStore.REVOKED_LINK_PRIMARY_WINDOW_SECONDS,
);
}
await pipeline.exec();
}
// -- Daily quota --------------------------------------------------
-191
View File
@@ -337,176 +337,6 @@ describe('ShareStore', () => {
);
});
it('does not read back a link removed with its node from a lagging replica', async () => {
const entry = await makeEntry(issuer);
const stale = await store.upsertAnyone({
issuerUserId: issuer.id,
fsentryId: entry.id,
mode: 'read',
});
await store.deleteByFsentryIds([entry.id]);
// The replica still has the link the primary just deleted.
const db = server.clients.db;
const primaryRead = db.read.bind(db);
const pread = vi.spyOn(db, 'pread').mockImplementation(primaryRead);
const read = vi
.spyOn(db, 'read')
.mockImplementation(async (q, p) =>
/FROM `share`/u.test(q)
? [
{
...stale,
data: '{}',
entry_uuid: entry.uuid,
owner_user_id: issuer.id,
},
]
: primaryRead(q, p),
);
try {
expect(await store.getAnyone(entry.id)).toBeNull();
expect(await store.listAnyoneOnFsentries([entry.id])).toEqual(
[],
);
expect(await store.listAnyoneReaching([entry.uuid])).toEqual(
[],
);
} finally {
read.mockRestore();
pread.mockRestore();
}
});
it('tells peer regions when a link is removed', async () => {
const entry = await makeEntry(issuer);
await store.upsertAnyone({
issuerUserId: issuer.id,
fsentryId: entry.id,
mode: 'read',
});
const emit = vi.spyOn(server.clients.event, 'emit');
try {
await store.deleteByFsentryIds([entry.id]);
expect(emit).toHaveBeenCalledWith(
'outer.share.linksRevoked',
{ fsentryIds: [entry.id], uuids: [entry.uuid] },
{},
);
} finally {
emit.mockRestore();
}
});
it('applies a link removal broadcast by a peer region', async () => {
const fsentryId = 900000 + Math.floor(Math.random() * 99999);
const uuid = uuidv4();
server.clients.event.emit(
'outer.share.linksRevoked',
{ fsentryIds: [fsentryId], uuids: [uuid] },
{ from_outside: true },
);
await vi.waitFor(async () => {
expect(
await server.clients.redis.get(
ShareStore.revokedLinkKey('uuid', uuid),
),
).toBe('1');
});
expect(
await server.clients.redis.ttl(
ShareStore.revokedLinkKey('id', fsentryId),
),
).toBeGreaterThan(25);
});
it('still tells peer regions when the local marker cannot be set', async () => {
const entry = await makeEntry(issuer);
await store.upsertAnyone({
issuerUserId: issuer.id,
fsentryId: entry.id,
mode: 'read',
});
const pipeline = vi
.spyOn(server.clients.redis, 'pipeline')
.mockImplementation(() => {
throw new Error('redis unavailable');
});
const emit = vi.spyOn(server.clients.event, 'emit');
try {
await store.deleteByFsentryIds([entry.id], [entry.uuid]);
expect(emit).toHaveBeenCalledWith(
'outer.share.linksRevoked',
{ fsentryIds: [entry.id], uuids: [entry.uuid] },
{},
);
} finally {
emit.mockRestore();
pipeline.mockRestore();
}
});
it('neither marks nor tells peers when nothing was removed', async () => {
const entry = await makeEntry(issuer);
const emit = vi.spyOn(server.clients.event, 'emit');
try {
expect(await store.deleteByFsentryIds([entry.id])).toBe(0);
expect(emit).not.toHaveBeenCalledWith(
'outer.share.linksRevoked',
expect.anything(),
expect.anything(),
);
} finally {
emit.mockRestore();
}
expect(
await server.clients.redis.get(
ShareStore.revokedLinkKey('uuid', entry.uuid),
),
).toBeNull();
});
it("ignores its own region's event and malformed payloads", async () => {
const local = uuidv4();
const sentinel = uuidv4();
const bogus = 900000 + Math.floor(Math.random() * 99999);
const emit = (data, meta) =>
server.clients.event.emit(
'outer.share.linksRevoked',
data,
meta,
);
emit({ fsentryIds: [], uuids: [local] }, {});
for (const data of [
null,
{ fsentryIds: 'x', uuids: 'y' },
{
fsentryIds: [String(bogus), bogus + 0.5, null],
uuids: [bogus, '', null],
},
]) {
emit(data, { from_outside: true });
}
// Handled in order, so once this lands the ones above have too.
emit({ fsentryIds: [], uuids: [sentinel] }, { from_outside: true });
await vi.waitFor(async () => {
expect(
await server.clients.redis.get(
ShareStore.revokedLinkKey('uuid', sentinel),
),
).toBe('1');
});
for (const key of [
ShareStore.revokedLinkKey('uuid', local),
ShareStore.revokedLinkKey('uuid', String(bogus)),
ShareStore.revokedLinkKey('id', bogus),
ShareStore.revokedLinkKey('id', bogus + 0.5),
]) {
expect(await server.clients.redis.get(key)).toBeNull();
}
});
it('reads a link past the replica once one has been withdrawn', async () => {
const entry = await makeEntry(issuer);
await store.upsertAnyone({
@@ -1325,27 +1155,6 @@ describe('ShareStore', () => {
};
};
it('lists a share the replica lacks in a subtree when asked to read the primary', async () => {
const entry = await makeEntry(issuer);
const link = await store.upsertAnyone({
issuerUserId: issuer.id,
fsentryId: entry.id,
mode: 'read',
});
const restore = lagShares([]);
try {
expect(
await store.listAllByFsentrySubtree(entry.id),
).toEqual([]);
const rows = await store.listAllByFsentrySubtree(entry.id, {
primary: true,
});
expect(rows.map((row) => row.uid)).toEqual([link.uid]);
} finally {
restore();
}
});
it('returns the rows it inserts before the replica has them', async () => {
const entry = await makeEntry(issuer);
// A group row written directly: the share only needs its id,
+13
View File
@@ -196,6 +196,7 @@ async function create_app (title, source_path = null, items = null) {
feedbackEnabled: true,
metadata: {
window_resizable: true,
fullpage_on_landing: true,
},
})
.then(async (app) => {
@@ -224,6 +225,7 @@ async function create_app (title, source_path = null, items = null) {
metadata: {
category: null, // default category on creation
window_resizable: true,
fullpage_on_landing: true,
},
}).then(async (app) => {
// refresh app list
@@ -469,6 +471,11 @@ function generate_edit_app_section (app) {
<label for="edit-app-background" style="display: inline;">Run as a background process.</label>
</div>
<div>
<input type="checkbox" id="edit-app-fullpage-on-landing" name="edit-app-fullpage-on-landing" value="true" style="margin-top:30px;" ${app.metadata?.fullpage_on_landing ? 'checked' : ''} ${app.background ? 'disabled' : ''}>
<label for="edit-app-fullpage-on-landing" style="display: inline;">Load in full-page mode when a user lands directly on this app.</label>
</div>
<div>
<input type="checkbox" id="edit-app-maximize-on-start" name="edit-app-maximize-on-start" value="true" style="margin-top:30px;" ${maximize_on_start ? 'checked' : ''} ${app.background ? 'disabled' : ''}>
<label for="edit-app-maximize-on-start" style="display: inline;">Maximize window on start</label>
@@ -586,6 +593,7 @@ function trackOriginalValues () {
resizableWindow: $('#edit-app-window-resizable').is(':checked'),
hideTitleBar: $('#edit-app-hide-titlebar').is(':checked'),
locked: $('#edit-app-locked').is(':checked'),
fullPageOnLanding: $('#edit-app-fullpage-on-landing').is(':checked'),
setTitleToFile: $('#edit-app-set-title-to-file').is(':checked'),
userFeedback: $('#edit-app-user-feedback').is(':checked'),
},
@@ -627,6 +635,7 @@ function hasChanges () {
$('#edit-app-window-resizable').is(':checked') !== originalValues.checkboxes.resizableWindow ||
$('#edit-app-hide-titlebar').is(':checked') !== originalValues.checkboxes.hideTitleBar ||
$('#edit-app-locked').is(':checked') !== originalValues.checkboxes.locked ||
$('#edit-app-fullpage-on-landing').is(':checked') !== originalValues.checkboxes.fullPageOnLanding ||
$('#edit-app-set-title-to-file').is(':checked') !== originalValues.checkboxes.setTitleToFile ||
$('#edit-app-user-feedback').is(':checked') !== originalValues.checkboxes.userFeedback
);
@@ -674,6 +683,7 @@ function resetToOriginalValues () {
$('#edit-app-window-resizable').prop('checked', originalValues.checkboxes.resizableWindow);
$('#edit-app-hide-titlebar').prop('checked', originalValues.checkboxes.hideTitleBar);
$('#edit-app-locked').prop('checked', originalValues.checkboxes.locked);
$('#edit-app-fullpage-on-landing').prop('checked', originalValues.checkboxes.fullPageOnLanding);
$('#edit-app-set-title-to-file').prop('checked', originalValues.checkboxes.setTitleToFile);
$('#edit-app-user-feedback').prop('checked', originalValues.checkboxes.userFeedback);
@@ -1289,6 +1299,7 @@ async function saveEditedApp (mode) {
background: $('#edit-app-background').is(':checked'),
feedbackEnabled: $('#edit-app-user-feedback').is(':checked'),
metadata: {
fullpage_on_landing: $('#edit-app-fullpage-on-landing').is(':checked'),
social_image: socialImageUrl,
category: category || null,
window_size: {
@@ -2572,6 +2583,7 @@ $(document).on('change', '#edit-app-background', function (e) {
function disable_window_settings () {
$('#edit-app-maximize-on-start').prop('disabled', true);
$('#edit-app-fullpage-on-landing').prop('disabled', true);
$('#edit-app-window-width, #edit-app-window-height').prop('disabled', true);
$('#edit-app-window-top, #edit-app-window-left').prop('disabled', true);
$('#edit-app-window-resizable').prop('disabled', true);
@@ -2580,6 +2592,7 @@ function disable_window_settings () {
function enable_window_settings () {
$('#edit-app-maximize-on-start').prop('disabled', false);
$('#edit-app-fullpage-on-landing').prop('disabled', false);
$('#edit-app-window-width, #edit-app-window-height').prop('disabled', false);
$('#edit-app-window-top, #edit-app-window-left').prop('disabled', false);
$('#edit-app-window-resizable').prop('disabled', false);
+5 -49
View File
@@ -41,52 +41,21 @@ An object with the following properties:
| Option | Type | Description |
|--------|------|-------------|
| `path` | `String` | The item. Required when passing options as the only argument, unless `paths` or `uid` names it. |
| `paths` | `Array` | Several items to withdraw in one call. |
| `path` | `String` | The item. Required when passing options as the only argument. |
| `recipient` | `String \| Object` | Whose access to withdraw. |
| `uid` | `String` | The item, by UID. Can be used instead of `path`. |
| `recipient` | `String \| Object \| Array` | Whose access to withdraw. An array withdraws several recipients in one call. |
| `recipients` | `String \| Object \| Array` | Alias for `recipient`. |
## Return value
A `Promise` that resolves to an object with the following properties:
| Property | Type | Description |
|----------|------|-------------|
| `revoked` | `Number` | How many grants were actually removed. It is `0` when there was nothing to withdraw, which is not an error. |
| `failed` | `Array` | The recipient/item pairs that were refused. Empty when none were. |
Each entry of `failed` has the following properties:
| Property | Type | Description |
|----------|------|-------------|
| `recipient` | `String` | The recipient as the call named it. This is a username, an email address, a team's uid or handle, or `anyone`. |
| `path` | `String` | The item's absolute path, when the call named it by path. A relative path comes back resolved against the app's root directory, and a path that starts with `~` comes back under the user's home directory, such as `/username/report.txt`. |
| `uid` | `String` | The item's UID as the call passed it, when the call named it by UID. |
| `message` | `String` | Why the pair was refused. |
| `code` | `String` | One of the codes below. |
Each recipient/item pair is withdrawn on its own. With several items or recipients, every combination is one pair. A refused pair does not stop the others. The promise resolves, `revoked` counts what the others removed, and `failed` lists the pairs that were refused.
A `Promise` that resolves to `{ revoked }`, where `revoked` is how many grants were actually removed. It is `0` when there was nothing to withdraw, which is not an error.
## Errors
The promise rejects only when every pair was refused, and at least one of them for a reason other than the recipient or the item being gone. A pair refused with `user_does_not_exist` or `subject_does_not_exist` has nothing left to withdraw, so a call made only of those resolves with `revoked: 0` and the pairs listed in `failed`.
That rejection carries `{ message, code, failed }`. The `message` and `code` come from the first refused pair that names a code other than those two. The `failed` array lists every refused pair, with the same properties as in the return value.
A request that fails as a whole also rejects, with the server's error and no `failed`. This happens when a call names no recipient or no item, or names a team by both `team` and `teamHandle` (`bad_request`), when it names more recipients or items than one call allows (`too_many_recipients`, `too_many_items`), and when it's over the [rate limit](/rate-limits-and-quotas/).
The codes a refused pair carries, in `failed` or on a rejection:
A rejection carries `{ message, code }`.
| `code` | Meaning |
| --- | --- |
| `team_share` | You tried to leave an item you hold only through a team. That access is the team's grant, not yours to drop; ask whoever shared it with the team, or leave the team. If you also hold a share of your own, leaving drops that one and succeeds. |
| `forbidden` | You may not withdraw shares of this item, or you tried to close its "anyone with the link" share, which only the owner may do, in person rather than through an app. |
| `subject_does_not_exist` | No such item, or you cannot see it. It is listed in `failed` and never causes a rejection on its own. |
| `user_does_not_exist` | The username has no account. It is listed in `failed` and never causes a rejection on its own. |
| `team_not_found` | No team has that uid. |
| `cannot_revoke_owner` | The recipient owns the item. |
| `unshare_failed` | No refused pair named a code, as when the server could not complete the request. |
| `team_share` | You tried to leave an item you hold only through a team. That access is the team's grant, not yours to drop; ask whoever shared it with the team, or leave the team. Returned with status `409`. If you also hold a share of your own, leaving drops that one and succeeds. |
## Who can withdraw what
@@ -127,19 +96,6 @@ Passing an email address that was **invited** but has not yet joined cancels the
</html>
```
### Withdraw several items and see which were refused
```js
const { revoked, failed } = await puter.fs.unshare({
paths: ['report.txt', 'budget.txt', 'notes.txt'],
recipient: 'friend',
});
console.log(`Removed ${revoked} share(s)`);
for (const pair of failed) {
console.log(`${pair.path} was not withdrawn from ${pair.recipient}: ${pair.message} (${pair.code})`);
}
```
### Leave a share someone gave you
```js
+14
View File
@@ -33,6 +33,20 @@ Sent on app startup, and whenever the user's locale on Puter is changed. The val
}
```
#### `themeChanged`
Sent on app startup, and whenever the user's desktop theme on Puter is changed. The value passed to `handler` is:
```js
{
palette: {
primaryHue, // (Float) Hue of the theme color
primarySaturation, // (String) Saturation of the theme color as a percentage, with % sign
primaryLightness, // (String) Lightness of the theme color as a percentage, with % sign
primaryAlpha, // (Float) Opacity of the theme color from 0 to 1
primaryColor, // (String) CSS color value for text
}
}
```
#### `connection`
Sent when another app requests a connection to your app. The value passed to `handler` is:
```js
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const Component = use('util.Component');
/**
* Allows a flex layout of composed components to be
* treated as a component.
*/
export default def(class Flexer extends Component {
static ID = 'ui.component.Flexer';
static PROPERTIES = {
children: {},
gap: { value: '20pt' },
};
static CSS = `
:host > div {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
`;
create_template ({ template }) {
// TODO: The way we handle loading assets doesn't work well
// with web components, so for now it goes in the template.
$(template).html(`
<div><slot name="inside"></slot></div>
`);
}
on_ready ({ listen }) {
for ( const child of this.get('children') ) {
child.setAttribute('slot', 'inside');
child.attach(this);
}
listen('gap', gap => {
$(this.dom_).find('div').first().css('gap', gap);
});
}
});
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const Component = use('util.Component');
/**
* Allows using an HTML string as a component.
*/
export default def(class JustHTML extends Component {
static ID = 'ui.component.JustHTML';
static PROPERTIES = { html: { value: '' } };
create_template ({ template }) {
$(template).html('<span></span>');
}
on_ready ({ listen }) {
listen('html', html => {
$(this.dom_).find('span').html(html);
});
}
_set_dom_based_on_render_mode ({ property_values }) {
if ( property_values.no_shadow ) {
this.dom_ = this;
return;
}
return super._set_dom_based_on_render_mode();
}
});
+5 -3
View File
@@ -204,8 +204,8 @@ async function UIDashboard (options) {
$item.addClass('active').attr('aria-current', 'page');
};
// Remove `?ref=...` from the URL, keeping the path and tab hash.
// Replaced, not pushed, so Back leaves the dashboard.
// Remove `?ref=...` from the URL, keeping the path and tab hash (mirrors
// UIDesktop). Replaced, not pushed, so Back leaves the dashboard.
if ( window.url_query_params?.has('ref') ) {
window.history.replaceState(null, document.title, window.location.pathname + window.location.hash);
}
@@ -272,6 +272,7 @@ async function UIDashboard (options) {
// =========================================================================
// Socket initialization
// In dashboard mode, UIDesktop is never loaded, so we create the socket here.
// This runs inside the function (not at module level) to ensure window.gui_origin
// and window.auth_token are already set.
// =========================================================================
@@ -366,7 +367,8 @@ async function UIDashboard (options) {
// =========================================================================
// Item event handlers
// Incremental DOM updates using UIDashboardFileItem for item creation and
// direct jQuery manipulation for removals/updates.
// direct jQuery manipulation for removals/updates. Mirrors UIDesktop's
// approach but adapted for Dashboard's list-view structure.
// =========================================================================
// A row taken away from elsewhere: keep the footer's count and size in
+7 -55
View File
@@ -672,30 +672,10 @@ export default function UIShareModal ({ items, path: item_path, name, owner, fse
return created;
};
// Same runs as grant_access. Resolves with the refused items, each with
// its error, and rejects with the first when every item was refused. A
// run that fails otherwise (rate limit, network) ends it there, rejecting
// with that error and the count withdrawn before it as `withdrawn`.
const revoke_access = async (recipient, paths) => {
const failed = [];
let attempted = 0;
for ( const run of chunk(paths, MAX_ITEMS_PER_REQUEST) ) {
try {
const result = await puter.fs.unshare({ paths: run, recipient });
failed.push(...(result?.failed ?? []));
} catch (err) {
// Only a rejection for refused pairs lists them.
if ( ! Array.isArray(err?.failed) ) {
const withdrawn = attempted - failed.length;
if ( withdrawn && err && typeof err === 'object' ) err.withdrawn = withdrawn;
throw err;
}
failed.push(...err.failed);
}
attempted += run.length;
await puter.fs.unshare({ paths: run, recipient });
}
if ( failed.length >= paths.length ) throw failed[0];
return failed;
};
/**
@@ -705,8 +685,6 @@ export default function UIShareModal ({ items, path: item_path, name, owner, fse
const set_link_access = async (mode, el_control) => {
$link_access.prop('disabled', true);
$link_mode.prop('disabled', true);
// Shown once the refresh settles, so its own notice can't replace it.
let outcome_error = null;
try {
if ( mode ) {
const created = await grant_access({ anyone: true }, mode, target_paths);
@@ -714,37 +692,26 @@ export default function UIShareModal ({ items, path: item_path, name, owner, fse
link_state = { access: 'anyone', mode };
show_success(i18n(`share_link_on_${mode === 'write' ? 'write' : 'read'}${is_multi ? '_items' : ''}`));
} else {
const failed = await revoke_access({ anyone: true }, target_paths);
if ( failed.length ) {
link_state = { access: 'mixed', mode: null };
outcome_error = `${i18n('share_link_off_partial', { count: total - failed.length, total })}. ${error_html(failed[0])}`;
} else {
link_state = { access: 'restricted', mode: null };
show_success(i18n(is_multi ? 'share_link_off_items' : 'share_link_off'));
}
await revoke_access({ anyone: true }, target_paths);
link_state = { access: 'restricted', mode: null };
show_success(i18n(is_multi ? 'share_link_off_items' : 'share_link_off'));
}
} catch (err) {
// A plan gate gets the flow that clears it, where the deployment
// has one; a refusal is otherwise reported like any other.
if ( is_plan_gate_error(err) ) {
if ( ! open_upgrade_flow() ) outcome_error = i18n('share_link_requires_plan');
} else if ( err?.withdrawn ) {
// Runs that landed before the failure closed the link all the same.
link_state = { access: 'mixed', mode: null };
outcome_error = `${i18n('share_link_off_partial', { count: err.withdrawn, total })}. ${error_html(err)}`;
if ( ! open_upgrade_flow() ) show_error(i18n('share_link_requires_plan'));
} else {
outcome_error = error_html(err);
show_error(error_html(err));
}
} finally {
$link_access.prop('disabled', false);
$link_mode.prop('disabled', false);
}
if ( outcome_error ) show_error(outcome_error);
// The listings are the truth either way, and they put the control
// back; a selection too large to list keeps what was just applied.
invalidate_shared_roots();
await refresh();
if ( outcome_error ) show_error(outcome_error);
render_link_access();
if ( el_control && $(el_control).is(':visible') ) el_control.focus({ preventScroll: true });
else focus_dialog();
@@ -1011,22 +978,7 @@ export default function UIShareModal ({ items, path: item_path, name, owner, fse
const revoke_paths = group.pending ? group.pendingPaths : group.directPaths;
$(this).closest('.share-modal-row-confirm').find('button').prop('disabled', true);
try {
const failed = await revoke_access(recipient_of(group), revoke_paths);
// Some items were refused: say how many went through, and stay
// open on what the listing now shows.
if ( failed.length ) {
invalidate_shared_roots();
await refresh();
// After the refresh: a refused item may not list any more,
// and that notice must not replace this one.
show_error(`${i18n('share_access_removed_partial', {
recipient: group.name,
count: revoke_paths.length - failed.length,
total: revoke_paths.length,
})}. ${error_html(failed[0])}`);
focus_list_control('.share-modal-row-mode', key) || focus_dialog();
return;
}
await revoke_access(recipient_of(group), revoke_paths);
// Leaving takes away the access this list is read with, and the
// items may leave the listing behind it (the Shared view) too.
if ( ! group.teamUid && ! group.pending && group.name === window.user.username ) {
@@ -43,7 +43,6 @@ globalThis.def = globalThis.def ?? (value => value);
globalThis.use = globalThis.use ?? (() => class {});
const { default: UIShareModal } = await import('./UIShareModal.js');
const { unshareAnswering, allRefused, refusing } = await import('../../../tests/fixtures/sdkUnshare.js');
const settle = async () => {
for ( let i = 0; i < 5; i++ ) await new Promise(resolve => setTimeout(resolve, 0));
@@ -83,126 +82,6 @@ describe('UIShareModal general access', () => {
expect($('.share-modal-link-access').val()).toBe('restricted');
});
it('shows the error when closing the link is refused', async () => {
puter.fs.getShares = vi.fn(async () => [{ holder: null, anyone: true, mode: 'read', issuer: 'alice' }]);
puter.fs.unshare = unshareAnswering(allRefused);
UIShareModal({ path: '/alice/a.txt' });
await settle();
expect($('.share-modal-link-access').val()).toBe('anyone');
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe('Held through a team');
expect($('.share-modal-link-access').val()).toBe('anyone');
});
it('says how many items the link was closed on when some were refused', async () => {
puter.fs.getShares = vi.fn(async () => [{ holder: null, anyone: true, mode: 'read', issuer: 'alice' }]);
puter.fs.unshare = unshareAnswering((request) => refusing(
request,
(path) => path === '/alice/f1.txt',
{ code: 'forbidden', message: 'Not allowed' },
));
UIShareModal({ items: items(3) });
await settle();
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe(
'Only people with access can open 2 of 3 items now. Not allowed',
);
});
it('keeps the count on screen when a refused item no longer lists, closing the link', async () => {
let gone = false;
puter.fs.getShares = vi.fn(async (path) => {
if ( gone && path === '/alice/f1.txt' ) throw { message: 'Subject does not exist' };
return [{ holder: null, anyone: true, mode: 'read', issuer: 'alice' }];
});
puter.fs.unshare = unshareAnswering((request) => refusing(
request,
(path) => path === '/alice/f1.txt',
{ code: 'subject_does_not_exist', message: 'Subject does not exist' },
));
UIShareModal({ items: items(3) });
await settle();
gone = true;
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect($('.share-modal-status').text()).toBe(
'Only people with access can open 2 of 3 items now. Subject does not exist',
);
});
it('goes on past a run that was refused whole, and counts every refused item', async () => {
const requests = [];
// Runs of 50: the second is refused whole, the third loses one item.
puter.fs.unshare = unshareAnswering((request) => {
requests.push(request.items.length);
const run = requests.length;
return refusing(
request,
(path) => run === 2 || path === '/alice/f119.txt',
{ code: 'forbidden', message: 'Not allowed' },
);
});
UIShareModal({ items: items(120) });
await settle();
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect(requests).toEqual([50, 50, 20]);
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe(
'Only people with access can open 69 of 120 items now. Not allowed',
);
expect($('.share-modal-link-access')[0].value).toBe('mixed');
});
it('stops at a run the server turned away whole, and counts only what was closed before it', async () => {
const requests = [];
// Runs of 50: the second is rate limited, so the third is never sent.
puter.fs.unshare = unshareAnswering((request, xhr) => {
requests.push(request.items.length);
if ( requests.length === 2 ) {
xhr.status = 429;
return { message: 'Too many requests', code: 'too_many_requests' };
}
return refusing(request, () => false);
});
UIShareModal({ items: items(120) });
await settle();
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect(requests).toEqual([50, 50]);
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe(
'Only people with access can open 50 of 120 items now. Too many requests',
);
expect($('.share-modal-link-access')[0].value).toBe('mixed');
});
it('reports a failed request as it is, with no item counted as refused', async () => {
const requests = [];
puter.fs.unshare = unshareAnswering((request, xhr) => {
requests.push(request.items.length);
xhr.status = 429;
return { message: 'Too many requests', code: 'too_many_requests' };
});
UIShareModal({ items: items(120) });
await settle();
$('.share-modal-link-access').val('restricted').trigger('change');
await settle();
expect(requests).toEqual([50]);
expect($('.share-modal-status').text()).toBe('Too many requests');
expect($('.share-modal-link-access')[0].value).toBe('unchecked');
});
it('shows a listed selection as the listings say', async () => {
UIShareModal({ items: items(2) });
await settle();
@@ -275,67 +154,6 @@ describe('UIShareModal removing access', () => {
expect(puter.fs.unshare).toHaveBeenCalledWith({ paths: ['/alice/a.txt'], recipient: 'bob' });
});
it('keeps the row and shows the error when the removal is refused', async () => {
puter.fs.getShares = vi.fn(async () => [{ holder: 'bob', mode: 'read', issuer: 'alice' }]);
puter.fs.unshare = unshareAnswering(allRefused);
UIShareModal({ path: '/alice/a.txt' });
await settle();
$('.share-modal-row-mode').val('__remove').trigger('change');
$('.share-modal-confirm-remove').trigger('click');
await settle();
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe('Held through a team');
expect($('.share-modal-row-mode').attr('data-key')).toBeTruthy();
expect($('.share-modal-row-mode').val()).toBe('read');
});
it('says how many items a person was removed from when one was refused', async () => {
puter.fs.getShares = vi.fn(async () => [{ holder: 'bob', mode: 'read', issuer: 'alice' }]);
puter.fs.unshare = unshareAnswering((request) => refusing(
request,
(path) => path === '/alice/f2.txt',
{ code: 'forbidden', message: 'Not allowed' },
));
UIShareModal({ items: [0, 1, 2].map((i) => ({ path: `/alice/f${i}.txt` })) });
await settle();
$('.share-modal-row-mode').val('__remove').trigger('change');
$('.share-modal-confirm-remove').trigger('click');
await settle();
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe('Removed bob from 2 of 3 items. Not allowed');
expect($('.share-modal-row-mode').length).toBe(1);
});
it('keeps the count on screen when a refused item no longer lists', async () => {
let removed = false;
puter.fs.getShares = vi.fn(async (path) => {
if ( removed && path === '/alice/f2.txt' ) throw { message: 'Subject does not exist' };
return removed ? [] : [{ holder: 'bob', mode: 'read', issuer: 'alice' }];
});
const answering = unshareAnswering((request) => refusing(
request,
(path) => path === '/alice/f2.txt',
{ code: 'subject_does_not_exist', message: 'Subject does not exist' },
));
puter.fs.unshare = async (...args) => {
removed = true;
return answering(...args);
};
UIShareModal({ items: [0, 1, 2].map((i) => ({ path: `/alice/f${i}.txt` })) });
await settle();
$('.share-modal-row-mode').val('__remove').trigger('change');
$('.share-modal-confirm-remove').trigger('click');
await settle();
expect($('.share-modal-status').hasClass('share-modal-status-error')).toBe(true);
expect($('.share-modal-status').text()).toBe(
'Removed bob from 2 of 3 items. Subject does not exist',
);
expect($('.share-modal-row-mode').length).toBe(0);
});
it('offers cancelling an invitation from its menu', async () => {
puter.fs.getShares = vi.fn(async () => [
{ holder: null, recipientEmail: '[email protected]', pending: true, mode: 'write', issuer: 'alice' },
+47
View File
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import UIWindow from './UIWindow.js';
import Placeholder from '../util/Placeholder.js';
import JustHTML from './Components/JustHTML.js';
/**
* @typedef {Object} UIComponentWindowOptions
* @property {Component} [component] A component to render in the window
* @property {string} [html] HTML string to render in the window (uses JustHTML component)
*/
/**
* Render a UIWindow that contains an instance of Component or HTML string
* @param {UIComponentWindowOptions} options
*/
export default async function UIComponentWindow (options) {
const component = options.component ?? new JustHTML({ html: options.html ?? '' });
const placeholder = Placeholder();
const win = await UIWindow({
...options,
body_content: placeholder.html,
});
component.attach(placeholder);
component.focus();
return win;
}
+925
View File
@@ -0,0 +1,925 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import path from '../lib/path.js';
import UIItem from './UIItem.js';
import UIAlert from './UIAlert.js';
import UIWindow from './UIWindow.js';
import { atPath, retargetNavHistory, retargetPaths, underPath } from '../helpers/pathElements.js';
import truncate_filename from '../helpers/truncateFilename.js';
import UINotification from './UINotification.js';
import launch_app from '../helpers/launchApp.js';
import { urlFileLaunchOptions } from '../helpers/confirmUrlFileAccess.js';
import item_icon from '../helpers/itemIcon.js';
import resolve_shared_item from '../helpers/resolveSharedItem.js';
import {
answerNotificationReceipts,
applyToastMark,
createNotificationFeed,
createReplayLog,
listUndismissed,
missedAfterReconnect,
notificationSocketAcks,
} from '../helpers/notificationFeed.js';
import { getNotification, markNotificationAcknowledged } from '../helpers/notificationApi.js';
import {
elementsWithData,
handleNotificationTap,
openAppForTap,
setPushTapHandler,
storedTapHandler,
} from '../helpers/notificationTap.js';
import { closeLocalBanner, startPushWorker } from '../helpers/pushWorker.js';
import { syncBrowserPush } from '../helpers/pushSync.js';
import { get_app_by_uid } from '../helpers/getAppByUid.js';
import { httpsIconFor, notificationTarget, senderNameFor } from './Dashboard/notificationCenter.js';
import apply_item_added_to_containers from '../helpers/applyItemAddedToContainers.js';
import parse_item_metadata from '../helpers/parseItemMetadata.js';
import { resolve_default_app } from '../helpers/defaultApp.js';
async function UIDesktop () {
// start a transaction if we're not in embedded or fullpage mode
let transaction;
if ( !window.is_embedded && !window.is_fullpage_mode ) {
transaction = new window.Transaction('desktop-is-ready');
transaction.start();
}
let h = '';
// connect socket.
window.socket = io(`${window.gui_origin }/`, {
auth: {
auth_token: window.auth_token,
acks: notificationSocketAcks(),
},
transports: ['websocket', 'polling'],
withCredentials: true,
});
answerNotificationReceipts(window.socket);
window.socket.on('error', (error) => {
console.error('GUI Socket Error:', error);
});
// Pick up reauth_required signals delivered via the socket.io
// handshake. SocketService emits `Error { data: { code:
// 'reauth_required', reason, auth_id } }` for legacy/revoked/expired
// tokens. Without this branch the disconnect would look like a
// silent network failure to the user.
window.socket.on('connect_error', (err) => {
const signal = err?.data;
if ( signal?.code === 'reauth_required' ) {
window.handleReauthRequired({
reason: signal.reason,
auth_id: signal.auth_id,
});
} else {
console.error('GUI Socket connect_error:', err);
}
});
window.socket.on('connect', function () {
// console.log('GUI Socket: Connected', window.socket.id);
window.socket.emit('puter_is_actually_open');
});
window.socket.on('reconnect', function () {
console.log('GUI Socket: Reconnected', window.socket.id);
});
window.socket.on('disconnect', () => {
console.log('GUI Socket: Disconnected');
});
window.socket.on('reconnect', (attempt) => {
console.log('GUI Socket: Reconnection', attempt);
});
window.socket.on('reconnect_attempt', (attempt) => {
console.log('GUI Socket: Reconnection Attemps', attempt);
});
window.socket.on('reconnect_error', (error) => {
console.log('GUI Socket: Reconnection Error', error);
});
window.socket.on('reconnect_failed', () => {
console.log('GUI Socket: Reconnection Failed');
});
window.socket.on('error', (error) => {
console.error('GUI Socket Error:', error);
});
window.socket.on('upload.progress', (msg) => {
if ( window.progress_tracker[msg.operation_id] ) {
window.progress_tracker[msg.operation_id].cloud_uploaded += msg.loaded_diff;
if ( window.progress_tracker[msg.operation_id][msg.item_upload_id] ) {
window.progress_tracker[msg.operation_id][msg.item_upload_id].cloud_uploaded = msg.loaded;
}
}
});
window.socket.on('download.progress', (msg) => {
if ( window.progress_tracker[msg.operation_id] ) {
if ( window.progress_tracker[msg.operation_id][msg.item_upload_id] ) {
window.progress_tracker[msg.operation_id][msg.item_upload_id].downloaded = msg.loaded;
window.progress_tracker[msg.operation_id][msg.item_upload_id].total = msg.total;
}
}
});
window.socket.on('trash.is_empty', async (msg) => {
window.update_trash_icons(msg.is_empty);
// empty trash windows if needed
if ( msg.is_empty )
{
// only the rows: the container also holds its empty, error and loading states
$(`.window[data-path="${html_encode(window.trash_path)}" i]`).each(function () {
$(this).find('.item-container .item').removeItems();
window.update_explorer_footer_item_count(this);
window.update_explorer_footer_selected_items_count(this);
});
}
});
/**
* Clicking a share notification opens the item, or Shared if grouped.
* Shares the notification center's predicate so a toast and a list entry
* never disagree about where a click goes.
*/
const share_notification_click = (notification) => {
const target = notificationTarget(notification);
if ( target === null ) return undefined;
if ( target.kind === 'shared-item' ) {
return () => {
open_shared_item(target.path);
};
}
// Grouped: open where they all landed rather than picking one.
return () => {
UIWindow({
path: window.shared_path,
title: i18n('shared'),
icon: window.icons['sidebar-folder-shared.svg'],
is_dir: true,
app: 'explorer',
});
};
};
// The desktop has no notification list, so other types only clear.
const tap_surface = {
share: (notification) => share_notification_click(notification)?.(),
openApp: (route) => openAppForTap(route, { getApp: get_app_by_uid, launch: launch_app }),
};
const tap_notification = (tap) => handleNotificationTap(tap, tap_surface);
const toasts_for = (uid) => $(elementsWithData($('.notification').get(), 'uid', uid));
setPushTapHandler(storedTapHandler({
fetchRow: getNotification,
surface: tap_surface,
found: (uid) => {
toasts_for(uid).remove();
update_tab_notif_count_badge();
void markNotificationAcknowledged(uid).catch((err) => {
console.warn('Could not acknowledge notification:', err);
});
},
}));
startPushWorker().then(() => syncBrowserPush());
/**
* Raise one notification, whichever path it arrived on. `replay` names
* what the feed already claimed as shown while catching up, so the same
* row isn't marked twice.
*/
const show_notification = ({ uid, notification, app_uid }, { replay = false } = {}) => {
// A notification can be re-sent under its own uid when what it says has
// grown — several people sharing with you is one notification that
// counts them. Refresh the one on screen rather than stacking a copy.
const $showing = toasts_for(uid);
if ( $showing.length ) {
$showing.find('.notification-title').text(notification.title);
$showing.find('.notification-text').text(notification.text ?? '');
return;
}
UINotification({
sender: senderNameFor(notification),
title: notification.title,
text: notification.text,
icon: window.icons[notification.icon] ?? httpsIconFor(notification) ?? undefined,
value: notification,
uid,
click: () => void tap_notification({ uid, notification, appUid: app_uid }),
close: () => applyToastMark('dismissed', uid, {
eventsPath: notification_feed.isActive(),
}),
});
if ( ! replay ) {
void applyToastMark('shown', uid, { eventsPath: notification_feed.isActive() });
}
};
/**
* Notifications over the events surface, where the server says it has
* them. It renders through the same path the socket wire does, and the
* listeners below stand down only while it is up.
*/
const replayLog = createReplayLog();
const notification_feed = createNotificationFeed({
deliver: (items, { replay }) => {
for ( const item of replayLog.admit(items, { replay }) ) show_notification(item, { replay });
},
});
void notification_feed.start();
// A replayed notification with no text of its own shows its title twice.
const showReplayed = ({ uid, notification }) => show_notification({
uid,
notification: { ...notification, text: notification.text ?? notification.title },
}, { replay: true });
// A frozen or sleeping tab reconnects on resume; raise what it missed.
const knownAtLoad = listUndismissed()
.then((rows) => new Set(rows.map((row) => row.uid)))
.catch(() => null);
window.socket.io?.on('reconnect', () => {
void Promise.all([knownAtLoad, listUndismissed()])
.then(([known, rows]) => {
if ( ! known ) return;
for ( const item of missedAfterReconnect(rows, { known, log: replayLog }) ) showReplayed(item);
})
.catch((err) => console.warn('Could not catch up on notifications:', err));
});
/**
* This event is triggered if a user receives a notification during
* an active session.
*/
window.socket.on('notif.message', async ({ uid, notification }) => {
if ( notification_feed.isActive() ) return;
for ( const item of replayLog.admit([{ uid, notification }]) ) show_notification(item);
});
/**
* This event is triggered at the beginning of the session, after a websocket
* connection is established, because the backend informs the frontend of all
* unread notifications.
*
* It is not necessary to query unreads separately. If this stops working,
* then this event should be fixed rather than querying unreads separately.
* Each reconnect brings one, whichever path is live; this page raises what it missed.
*/
window.socket.on('notif.unreads', async ({ unreads }) => {
for ( const item of replayLog.admit(unreads, { replay: true }) ) showReplayed(item);
});
// Acknowledgements also arrive when the notification feed is inactive.
window.socket.on('notif.ack', ({ uid }) => {
void closeLocalBanner(uid);
replayLog.dismissed(uid);
toasts_for(uid).remove();
update_tab_notif_count_badge();
});
// Removed from the notification history: its toast goes too.
window.socket.on('notif.removed', ({ uid }) => {
toasts_for(uid).remove();
update_tab_notif_count_badge();
});
window.socket.on('item.removed', async (item) => {
// don't update if this is the original client that initiated the action
if ( item.original_client_socket_id === window.socket.id )
{
return;
}
// don't remove items if this was a descendants_only operation
if ( item.descendants_only )
{
return;
}
// remove all UIItems at the removed path
atPath('.item', item.path).fadeOut(150, function () {
const $parent_window = $(this).closest('.window');
$(this).removeItems();
window.update_explorer_footer_item_count($parent_window);
window.update_explorer_footer_selected_items_count($parent_window);
});
// close the windows showing the removed folder or anything inside it,
// whether or not its own row is displayed anywhere
// todo this has to be case-insensitive
atPath('.window[data-app="explorer"]', item.path).add(underPath('.window', item.path)).close();
});
window.socket.on('item.updated', async (item) => {
// Don't update if this is the original client that initiated the action
if ( item.original_client_socket_id === window.socket.id )
{
return;
}
// Update matching items
// set new item name
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)));
// Set new icon
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
$(`.item[data-uid='${item.uid}']`).find('.item-icon-thumb').attr('src', new_icon);
$(`.item[data-uid='${item.uid}']`).find('.item-icon-icon').attr('src', new_icon);
// Set new data-name. Attributes and form values are stored raw
// (.attr()/.val() don't parse HTML), as rename_file writes them.
$(`.item[data-uid='${item.uid}']`).attr('data-name', item.name);
$(`.window-${item.uid}`).attr('data-name', item.name);
// Set new title attribute
$(`.item[data-uid='${item.uid}']`).attr('title', item.name);
$(`.window-${item.uid}`).attr('title', item.name);
// Set new value for item-name-editor
$(`.item[data-uid='${item.uid}'] .item-name-editor`).val(item.name);
$(`.item[data-uid='${item.uid}'] .item-name`).attr('title', item.name);
// An overwrite arrives as an update, with a new size and date
if ( item.size !== undefined && item.modified !== undefined ) {
const $updated_items = $(`.item[data-uid='${item.uid}']`);
$updated_items.attr({ 'data-size': item.size ?? '', 'data-modified': item.modified ?? '' });
$updated_items.find('.item-attr--size > span').text(item.size ? window.byte_format(item.size) : '-');
$updated_items.find('.item-attr--modified > span').text(item.modified === 0 ? '-' : timeago.format(item.modified * 1000));
}
// Set new data-path
const new_path = item.path;
$(`.item[data-uid='${item.uid}']`).attr('data-path', new_path);
$(`.window-${item.uid}`).attr('data-path', new_path);
retargetPaths(item.old_path, new_path, item.name);
// Update all exact-matching windows
$(`.window-${item.uid}`).each(function () {
window.update_window_path(this, new_path);
});
// Set new name for matching open windows
$(`.window-${item.uid} .window-head-title`).text(item.name);
// Re-sort all matching item containers
$(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function () {
window.sort_items(this, $(this).closest('.item-container').attr('data-sort_by'), $(this).closest('.item-container').attr('data-sort_order'));
});
});
window.socket.on('item.moved', async (resp) => {
let fsentry = resp;
// Notify all apps that are watching this item
window.sendItemChangeEventToWatchingApps(fsentry.uid, {
event: 'moved',
uid: fsentry.uid,
name: fsentry.name,
});
// don't update if this is the original client that initiated the action
if ( resp.original_client_socket_id === window.socket.id )
{
return;
}
let dest_path = path.dirname(fsentry.path);
// A JSON string on the wire; trash/restore reads its fields.
const metadata = parse_item_metadata(fsentry.metadata);
// update all shortcut_to_path
atPath('.item', resp.old_path, 'data-shortcut_to_path').attr('data-shortcut_to_path', fsentry.path);
// remove all items with matching uids
$(`.item[data-uid='${fsentry.uid}']`).fadeOut(150, function () {
// find all parent windows that contain this item
let parent_windows = $(`.item[data-uid='${fsentry.uid}']`).closest('.window');
// remove this item
$(this).removeItems();
// update parent windows' item counts
$(parent_windows).each(function (index) {
window.update_explorer_footer_item_count(this);
window.update_explorer_footer_selected_items_count(this);
});
});
// if trashing, close windows of trashed items and its descendants
if ( dest_path === window.trash_path ) {
atPath('.window', resp.old_path).close();
// todo this has to be case-insensitive
underPath('.window', resp.old_path).close();
}
// update all paths of its and its descendants' open windows
else {
// todo this has to be case-insensitive
underPath('.window', resp.old_path).add(atPath('.window', resp.old_path)).each(function () {
window.update_window_path(this, fsentry.path + $(this).attr('data-path').slice(resp.old_path.length));
});
retargetNavHistory(resp.old_path, fsentry.path);
}
if ( dest_path === window.trash_path ) {
// if trashing dir...
if ( fsentry.is_dir ) {
// remove the website badge from all instances of the dir
$(`.item[data-uid="${fsentry.uid}"]`).find('.item-has-website-badge').fadeOut(300);
// remove File Rrequest Token
// todo, some client-side check to see if this dir has an FR associated with it before sending a whole ajax req
}
}
// if replacing an existing item, remove the old item that was just replaced
if ( fsentry.overwritten_uid !== undefined )
{
$(`.item[data-uid=${fsentry.overwritten_uid}]`).removeItems();
}
// Trashing renames the entry to its uid; the real name is in metadata.
fsentry.name = metadata.original_name ?? fsentry.name;
const moved_item_icon = await item_icon(fsentry);
const $dest_containers = atPath('.item-container', dest_path);
// the tab that made this move renders the row itself, in either order
$dest_containers.find(`.item[data-uid='${fsentry.uid}']`).removeItems();
// create new item on matching containers
UIItem({
appendTo: $dest_containers,
immutable: fsentry.immutable || fsentry.writable === false,
uid: fsentry.uid,
path: fsentry.path,
icon: moved_item_icon,
name: fsentry.name,
is_dir: fsentry.is_dir,
size: fsentry.size,
type: fsentry.type,
modified: fsentry.modified,
is_selected: false,
is_shortcut: fsentry.is_shortcut,
shortcut_to: fsentry.shortcut_to,
shortcut_to_path: fsentry.shortcut_to_path,
// has_website: $(el_item).attr('data-has_website') === '1',
// Raw, as every other renderer stores it; re-encoding breaks restore.
metadata: fsentry.metadata ?? '',
});
if ( fsentry.parent_dirs_created && fsentry.parent_dirs_created.length > 0 ) {
// this operation may have created some missing directories,
// see if any of the directories in the path of this file is new AND
// if these new path have any open parents that need to be updated
fsentry.parent_dirs_created.forEach(async dir => {
let item_container = atPath('.item-container', path.dirname(dir.path));
if ( item_container.length > 0 && atPath('.item', dir.path).length === 0 ) {
UIItem({
appendTo: item_container,
immutable: false,
uid: dir.uid,
path: dir.path,
icon: await item_icon(dir),
name: dir.name,
size: dir.size,
type: dir.type,
modified: dir.modified,
is_dir: true,
is_selected: false,
has_website: false,
});
}
window.sort_items(item_container, $(item_container).attr('data-sort_by'), $(item_container).attr('data-sort_order'));
});
}
//sort each container
atPath('.item-container', dest_path).each(function () {
window.sort_items(this, $(this).attr('data-sort_by'), $(this).attr('data-sort_order'));
});
});
window.socket.on('user.email_confirmed', (msg) => {
// don't update if this is the original client that initiated the action
if ( msg.original_client_socket_id === window.socket.id )
{
return;
}
window.refresh_user_data(window.auth_token);
});
window.socket.on('user.phone_verified', (msg) => {
// don't update if this is the original client that initiated the action
if ( msg.original_client_socket_id === window.socket.id )
{
return;
}
window.refresh_user_data(window.auth_token);
});
window.socket.on('user.card_verified', (msg) => {
// don't update if this is the original client that initiated the action
if ( msg.original_client_socket_id === window.socket.id )
{
return;
}
window.refresh_user_data(window.auth_token);
});
window.socket.on('user.email_changed', (msg) => {
// don't update if this is the original client that initiated the action
if ( msg.original_client_socket_id === window.socket.id )
{
return;
}
window.refresh_user_data(window.auth_token);
});
window.socket.on('item.renamed', async (item) => {
// Notify all apps that are watching this item
window.sendItemChangeEventToWatchingApps(item.uid, {
event: 'rename',
uid: item.uid,
// path: item.path,
new_name: item.name,
// old_path: item.old_path,
});
// Don't update if this is the original client that initiated the action
if ( item.original_client_socket_id === window.socket.id )
{
return;
}
// Update matching items
// Set new item name
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)));
// Set new icon
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
$(`.item[data-uid='${item.uid}']`).find('.item-icon-icon').attr('src', new_icon);
// Set new data-name. Attributes and form values are stored raw
// (.attr()/.val() don't parse HTML), as rename_file writes them.
$(`.item[data-uid='${item.uid}']`).attr('data-name', item.name);
$(`.window-${item.uid}`).attr('data-name', item.name);
// Set new title attribute
$(`.item[data-uid='${item.uid}']`).attr('title', item.name);
$(`.window-${item.uid}`).attr('title', item.name);
// Set new value for item-name-editor
$(`.item[data-uid='${item.uid}'] .item-name-editor`).val(item.name);
$(`.item[data-uid='${item.uid}'] .item-name`).attr('title', item.name);
// Set new data-path
const new_path = item.path;
$(`.item[data-uid='${item.uid}']`).attr('data-path', new_path);
$(`.window-${item.uid}`).attr('data-path', new_path);
retargetPaths(item.old_path, new_path, item.name);
// Update all exact-matching windows
$(`.window-${item.uid}`).each(function () {
window.update_window_path(this, new_path);
});
// Set new name for matching open windows
$(`.window-${item.uid} .window-head-title`).text(item.name);
// Re-sort all matching item containers
$(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function () {
window.sort_items(this, $(this).closest('.item-container').attr('data-sort_by'), $(this).closest('.item-container').attr('data-sort_order'));
});
});
window.socket.on('item.added', async (item) => {
// if item is empty, don't proceed
if ( !item || Object.keys(item).length === 0 )
{
return;
}
// Notify all apps that are watching this item
window.sendItemChangeEventToWatchingApps(item.uid, {
event: 'write',
uid: item.uid,
// path: item.path,
new_size: item.size,
modified: item.modified,
// old_path: item.old_path,
});
// Don't update if this is the original client that initiated the action
if ( item.original_client_socket_id === window.socket.id )
{
return;
}
await apply_item_added_to_containers(item);
});
// Hidden file dialog
h += `<form name="upload-form" id="upload-form" style="display:hidden;">
<input type="hidden" name="name" id="upload-filename" value="">
<input type="hidden" name="path" id="upload-target-path" value="">
<input type="file" name="file" id="upload-file-dialog" style="display: none;" multiple="multiple">
</form>`;
h += '<div class="window-container"></div>';
// The surface windows open on. It holds no items.
h += '<div class="desktop disable-user-select"></div>';
// Get window sidebar width
puter.kv.get('window_sidebar_width').catch(() => null).then(async (val) => {
let value = parseInt(val);
// if value is a valid number
if ( !isNaN(value) && value > 0 ) {
window.window_sidebar_width = value;
}
});
// load window sidebar items from KV
puter.kv.get('sidebar_items').then(async (val) => {
// UIWindow parses this and reads `item.path` while building every
// explorer window, so a malformed value is dropped for the defaults.
let items = null;
try {
items = JSON.parse(val);
} catch { /* keep the defaults */ }
if ( Array.isArray(items) && items.every(item => typeof item?.path === 'string') ) {
window.sidebar_items = val;
}
// Catch on the chain rather than the read, so a failure leaves whatever is
// already there instead of overwriting it with a fallback.
}).catch(err => console.warn('Could not load sidebar_items:', err));
// Remove `?ref=...` from navbar URL, keeping the current path
if ( window.url_query_params.has('ref') ) {
window.history.pushState(null, document.title, window.location.pathname);
}
await window.load_user_preferences();
// Append to <body>
$('body').append(h);
const el_desktop = document.querySelector('.desktop');
window.active_element = el_desktop;
// The desktop has no menu of its own, and the browser's doesn't belong here.
$(el_desktop).on('contextmenu', function (event) {
if ( event.target === el_desktop ) event.preventDefault();
});
if ( !window.is_embedded && !window.is_fullpage_mode ) {
transaction.end();
// warm the home directory listing for the first Explorer window
puter.fs.readdir({ path: window.home_path, consistency: 'strong' });
}
// notification container
$('body').append(`<div class="notification-container"><div class="notifications-close-all">${i18n('close_all')}</div></div>`);
// adjust window container to take into account the toolbar height
$('.window-container').css('top', window.toolbar_height);
// track: checkpoint
//-----------------------------
// GUI is ready to launch apps!
//-----------------------------
window.dispatchEvent(new CustomEvent('desktop:ready'));
globalThis.services.emit('gui:ready');
//--------------------------------------------------------------------------------------
// Determine if an app was launched from URL
// i.e. https://puter.com/app/<app_name>
//--------------------------------------------------------------------------------------
if ( window.url_paths[0]?.toLocaleLowerCase() === 'app' && window.url_paths[1] ) {
// If app metadata was already fetched early (for fullpage detection), reuse it
if ( !window.app_launched_from_url?.name ) {
window.app_launched_from_url = window.url_paths[1];
// get app metadata
try {
window.app_launched_from_url = await puter.apps.get(window.url_paths[1], { icon_size: 64 });
window.is_fullpage_mode = window.app_launched_from_url.metadata?.fullpage_on_landing ?? window.is_fullpage_mode ?? false;
} catch (e) {
console.error('UIDesktop app path launch error', e);
}
}
// get query params, any param that doesn't start with 'puter.' will be passed to the app
window.app_query_params = {};
for ( let [key, value] of window.url_query_params ) {
if ( ! key.startsWith('puter.') )
{
window.app_query_params[key] = value;
}
}
}
// ---------------------------------------------
// load from direct app URLs: /app/app-name
// ---------------------------------------------
if ( window.app_launched_from_url ) {
if ( ! window.url_query_params.has('c') ) {
let posargs = undefined;
if ( window.app_query_params && window.app_query_params.posargs ) {
posargs = JSON.parse(window.app_query_params.posargs);
}
// `?file=<path or uid>` opens that file with the app, the same as
// double-clicking it would — but the link picked both, so the user
// is asked before the app is given the file.
launch_app({
app: window.app_launched_from_url.name,
app_obj: window.app_launched_from_url,
readURL: window.url_query_params.get('readURL'),
maximized: window.url_query_params.get('maximized'),
params: window.app_query_params ?? [],
...urlFileLaunchOptions(window.url_query_params.get('file')),
...(posargs ? {
args: {
command_line: { args: posargs },
},
} : {}),
is_fullpage: window.is_fullpage_mode,
window_options: {
stay_on_top: false,
},
});
}
}
$(el_desktop).on('mousedown touchstart', { passive: true }, function (e) {
// dimiss touchstart on regular devices
if ( e.type === 'taphold' && !isMobile.phone && !isMobile.tablet )
{
return;
}
$('.window-app-iframe').css('pointer-events', 'none');
$('.window').find('.item-selected').addClass('item-blurred');
// Keyboard shortcuts act on the active container, and a click here leaves every window's.
window.active_item_container = null;
});
$(el_desktop).on('click', function (e) {
// blur all windows
$('.window-active').removeClass('window-active');
// hide all global menubars
$('.window-menubar-global').hide();
});
/**
* Open a path as double-clicking would: the associated app for a file, an
* explorer window for a directory.
*
* TODO: DRY with open_item, which is coupled to a UIItem element and can't
* operate on a path alone.
*/
async function open_path_target (item_path, stat) {
if ( ! stat.is_dir ) {
if ( stat.associated_app ) {
launch_app({ name: stat.associated_app.name });
return;
}
const default_app = await resolve_default_app({ uid: stat.uid, path: item_path });
if ( default_app ) {
launch_app({
name: default_app.name,
app_obj: default_app,
file_path: item_path,
});
return;
}
const open_item_meta = await $.ajax({
url: `${window.api_origin }/open_item`,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
path: item_path,
}),
headers: {
'Authorization': `Bearer ${window.auth_token}`,
},
statusCode: {
401: function (xhr) {
window.handle401(xhr);
},
},
});
const suggested_apps = open_item_meta?.suggested_apps ?? await window.suggest_apps_for_fsentry({
path: item_path,
});
// Note: I'm not adding unzipping logic here. We'll wait until
// we've refactored open_item so that Puter can have a
// properly-reusable open function.
if ( suggested_apps.length !== 0 ) {
launch_app({
name: suggested_apps[0].name,
token: open_item_meta.token,
file_path: item_path,
app_obj: suggested_apps[0],
window_title: path.basename(item_path),
file_signature: open_item_meta.signature,
custom_path: window.location.pathname,
});
return;
}
await UIAlert({
message: 'Cannot find an app to open this file; ' +
'opening directory instead.',
});
item_path = item_path.split('/').slice(0, -1).join('/');
}
UIWindow({
path: item_path,
title: path.basename(item_path),
icon: await item_icon({ is_dir: true, path: item_path }),
is_dir: true,
app: 'explorer',
});
}
/** Open an item somebody shared, addressed as `/<owner>/<uuid>/<name>`. */
async function open_shared_item (shared_path) {
const stat = await resolve_shared_item(puter.fs, shared_path);
if ( ! stat ) {
UIAlert({
message: i18n('error_user_or_path_not_found'),
type: 'error',
});
return false;
}
// `stat` returns the path this viewer may use, which is the one to open.
await open_path_target(stat.path ?? shared_path, stat);
return true;
}
}
window.enter_fullpage_mode = (el_window) => {
$(el_window).find('.window-head').hide();
$('body').addClass('fullpage-mode');
$(el_window).css({
width: '100%',
height: '100%',
top: `${window.toolbar_height }px`,
left: 0,
'border-radius': 0,
});
};
window.exit_fullpage_mode = (el_window) => {
$('body').removeClass('fullpage-mode');
$(el_window).removeAttr('data-is_fullpage');
if ( el_window ) {
window.reset_window_size_and_position(el_window);
$(el_window).find('.window-head').show();
}
};
window.reset_window_size_and_position = (el_window) => {
$(el_window).css({
width: 680,
height: 380,
'border-radius': window.window_border_radius,
top: 'calc(50% - 190px)',
left: 'calc(50% - 340px)',
});
};
export default UIDesktop;
+4 -5
View File
@@ -318,8 +318,8 @@ async function UIItem (options) {
// Constrain item within desktop bounds
const minLeft = -50;
const maxLeft = window.desktop_width - 50;
const minTop = 0;
const maxTop = window.desktop_height;
const minTop = window.toolbar_height;
const maxTop = window.desktop_height + window.toolbar_height;
// Apply constraints to ui.position
ui.position.left = Math.max(minLeft, Math.min(maxLeft, ui.position.left));
@@ -1417,11 +1417,10 @@ async function UIItem (options) {
html: i18n('share_remove_from_shared'),
onClick: async function () {
try {
const left = await puter.fs.unshare(
await puter.fs.unshare(
$(el_item).attr('data-path'),
window.user.username,
);
if ( left?.failed?.length ) throw left.failed[0];
// Or mode lookups keep answering for a share we
// just walked away from.
invalidate_shared_roots();
@@ -1506,7 +1505,7 @@ async function UIItem (options) {
left = left > (window.innerWidth - window_width) ? (window.innerWidth - window_width) : left;
let top = $(el_item).position().top + $(el_item).height();
top = top > (window.innerHeight - window_height) ? (window.innerHeight - window_height) : top;
top = top > (window.innerHeight - (window_height + window.toolbar_height)) ? (window.innerHeight - (window_height + window.toolbar_height)) : top;
UIWindowItemProperties(
$(el_item).attr('data-name'),
+2 -32
View File
@@ -65,13 +65,10 @@ Object.assign(window, {
const { default: UIItem } = await import('./UIItem.js');
const { default: UIContextMenu } = await import('./UIContextMenu.js');
const { default: UIAlert } = await import('./UIAlert.js');
const { unshareAnswering, allRefused, goneRefused } =
await import('../../tests/fixtures/sdkUnshare.js');
const { default: refresh_item_container } =
await import('../helpers/refreshItemContainer.js');
const menuItems = async (options) => {
const menuLabels = async (options) => {
document.body.innerHTML =
'<div class="window"><div class="item-container"></div></div>';
await UIItem({
@@ -90,12 +87,9 @@ const menuItems = async (options) => {
UIContextMenu.mockClear();
$('.item').trigger('contextmenu');
await vi.waitFor(() => expect(UIContextMenu).toHaveBeenCalled());
return UIContextMenu.mock.calls[0][0].items;
return UIContextMenu.mock.calls[0][0].items.map((item) => item?.html);
};
const menuLabels = async (options) =>
(await menuItems(options)).map((item) => item?.html);
const removeFromShared = async (options) => {
await menuLabels(options);
await UIContextMenu.mock.calls[0][0].items
@@ -115,7 +109,6 @@ describe('UIItem Remove from Shared', () => {
};
globalThis.puter = window.puter;
refresh_item_container.mockClear();
UIAlert.mockClear();
});
it('is offered on an item shared with the user directly', async () => {
@@ -128,29 +121,6 @@ describe('UIItem Remove from Shared', () => {
expect(labels).not.toContain('share_remove_from_shared');
});
it('keeps the item and shows the error when leaving is refused', async () => {
puter.fs.unshare = unshareAnswering(allRefused);
const items = await menuItems({});
await items
.find((item) => item?.html === 'share_remove_from_shared')
.onClick();
expect(UIAlert).toHaveBeenCalledWith({
message: 'Held through a team',
});
expect($('.item').length).toBe(1);
});
it('keeps the item and shows why when the unshare resolves with the pair refused', async () => {
puter.fs.unshare = unshareAnswering(goneRefused);
await removeFromShared({});
expect(UIAlert).toHaveBeenCalledWith({
message: 'Subject does not exist',
});
expect($('.item').length).toBe(1);
});
it('takes the item away once the user has left it', async () => {
await removeFromShared({});
expect(puter.fs.unshare).toHaveBeenCalledWith('/bob/u-1/Photos', 'alice');
+15
View File
@@ -82,6 +82,21 @@ function UIQRCode (options) {
}
}
// Compatibility shim: Component-based containers (e.g. Flexer) call
// `.attach(parent)` on their children. Returning a plain DOM element with
// an `attach` method lets this work without making UIQRCode a Component.
el.attach = function (destination) {
if ( destination instanceof HTMLElement || destination instanceof ShadowRoot ) {
destination.appendChild(el);
return;
}
if ( destination && destination.$ === 'placeholder' ) {
destination.replaceWith(el);
return;
}
throw new Error(`Unknown destination type: ${destination}`);
};
return el;
}
+2 -1
View File
@@ -51,12 +51,13 @@ const headMenuLabels = (el_window) => {
};
beforeEach(() => {
document.body.innerHTML = '';
document.body.innerHTML = '<div class="desktop"></div>';
Object.assign(window, {
global_element_id: 0,
window_counter: 0,
last_window_zindex: 1,
window_stack: [],
toolbar_height: 0,
icons: {},
uuidv4: () => crypto.randomUUID(),
is_dashboard_mode: false,
+321 -33
View File
@@ -35,6 +35,7 @@ import { has_shared_roots } from '../helpers/sharedAccess.js';
import { is_window_hidden, is_unseen_background_window, user_facing_windows } from '../helpers/windowVisibility.js';
const el_body = document.getElementsByTagName('body')[0];
const SNAP_PLACEHOLDER_DELAY_MS = 600; // delay before showing placeholder in any snap zone
// Above any z-index an ordinary desktop window reaches in practice.
const DESKTOP_BACKDROP_MIN_ZINDEX = 99999;
@@ -176,9 +177,9 @@ async function UIWindow (options) {
if ( isMobile.phone && !options.center && !options.dominant ) {
options.left = 0;
options.top = 0;
options.top = `${window.toolbar_height }px`;
options.width = '100%';
options.height = '100%';
options.height = `calc(100% - ${ window.toolbar_height }px)`;
} else {
options.width += 'px';
options.height += 'px';
@@ -1669,6 +1670,12 @@ async function UIWindow (options) {
});
}
$(el_window_head).mousedown(function () {
if ( window_is_snapped ) {
$(el_window).draggable( 'option', 'cursorAt', { left: width_before_snap / 2 });
}
});
// --------------------------------------------------------
// Click On The `Scale` Button
// (the little rectangle in the window head)
@@ -1764,10 +1771,147 @@ async function UIWindow (options) {
// --------------------------------------------------------
// Draggable
// --------------------------------------------------------
let width_before_snap = 0;
let height_before_snap = 0;
let window_is_snapped = false;
let snap_placeholder_active = false;
let snap_trigger_timeout;
let last_snap_zone;
if ( options.is_draggable ) {
let window_snap_placeholder = $(`<div class="window-snap-placeholder animate__animated animate__zoomIn animate__faster">
<div class="window-snap-placeholder-inner"></div>
</div>`);
const showSnapPlaceholder = (zone) => {
if ( window_is_snapped || !zone ) {
return false;
}
const snapDims = getSnapDimensions();
let css = null;
if ( zone === 'w' ) {
css = {
'display': 'block',
'width': snapDims.available_width / 2,
'height': snapDims.available_height,
'top': snapDims.start_y,
'left': snapDims.start_x,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'nw' ) {
css = {
'display': 'block',
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
'top': snapDims.start_y,
'left': snapDims.start_x,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'ne' ) {
css = {
'display': 'block',
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
'top': snapDims.start_y,
'left': snapDims.start_x + snapDims.available_width / 2,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'e' ) {
css = {
'display': 'block',
'width': snapDims.available_width / 2,
'height': snapDims.available_height,
'top': snapDims.start_y,
'left': snapDims.start_x + snapDims.available_width / 2,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'n' ) {
css = {
'display': 'block',
'width': snapDims.available_width,
'height': snapDims.available_height,
'top': snapDims.start_y,
'left': snapDims.start_x,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'sw' ) {
css = {
'display': 'block',
'top': snapDims.start_y + snapDims.available_height / 2,
'left': snapDims.start_x,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
'z-index': window.last_window_zindex - 1,
};
} else if ( zone === 'se' ) {
css = {
'display': 'block',
'top': snapDims.start_y + snapDims.available_height / 2,
'left': snapDims.start_x + snapDims.available_width / 2,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
'z-index': window.last_window_zindex - 1,
};
}
if ( ! css ) {
return false;
}
window_snap_placeholder.css(css);
if ( ! snap_placeholder_active ) {
snap_placeholder_active = true;
$(el_body).append(window_snap_placeholder);
}
width_before_snap = $(el_window).width();
height_before_snap = $(el_window).height();
return true;
};
const hideSnapPlaceholder = () => {
if ( snap_placeholder_active ) {
snap_placeholder_active = false;
window_snap_placeholder.fadeOut(80);
}
};
$(el_window).draggable({
start: function (e, ui) {
window.a_window_is_being_dragged = true;
last_snap_zone = undefined;
if ( snap_trigger_timeout ) {
clearTimeout(snap_trigger_timeout);
snap_trigger_timeout = undefined;
}
hideSnapPlaceholder();
// if window is snapped, unsnap it and reset its position to where it was before snapping
if ( options.is_resizable && window_is_snapped ) {
window_is_snapped = false;
$(el_window).css({
'width': width_before_snap,
'height': `${height_before_snap }px`,
});
// if at any point the window's width is "too small", hide the sidebar
if ( $(el_window).width() < window.window_width_threshold_for_sidebar ) {
if ( width_before_snap >= window.window_width_threshold_for_sidebar && !sidebar_hidden ) {
$(el_window_sidebar).hide();
}
sidebar_hidden = true;
}
// if at any point the window's width is "big enough", show the sidebar
else if ( $(el_window).width() >= window.window_width_threshold_for_sidebar ) {
if ( sidebar_hidden ) {
$(el_window_sidebar).show();
}
sidebar_hidden = false;
}
}
$(el_window).addClass('window-dragging');
// rm window from original_window_position
@@ -1785,9 +1929,50 @@ async function UIWindow (options) {
// maximize icon
$(el_window_head_scale_btn).find('img').attr('src', window.icons['scale.svg']);
}
// --------------------------------------------------------
// Snap to screen edges
// --------------------------------------------------------
if ( options.is_resizable ) {
const activeZone = window.current_active_snap_zone;
if ( activeZone !== last_snap_zone ) {
if ( snap_trigger_timeout ) {
clearTimeout(snap_trigger_timeout);
snap_trigger_timeout = undefined;
}
hideSnapPlaceholder();
last_snap_zone = activeZone;
if ( activeZone ) {
const scheduledZone = activeZone;
snap_trigger_timeout = setTimeout(function () {
snap_trigger_timeout = undefined;
if ( ! $(el_window).hasClass('window-dragging') ) {
return;
}
if ( window.current_active_snap_zone !== scheduledZone ) {
return;
}
showSnapPlaceholder(scheduledZone);
}, SNAP_PLACEHOLDER_DELAY_MS);
}
}
if ( ! activeZone ) {
hideSnapPlaceholder();
}
}
},
stop: function () {
window.a_window_is_being_dragged = false;
if ( snap_trigger_timeout ) {
clearTimeout(snap_trigger_timeout);
snap_trigger_timeout = undefined;
}
last_snap_zone = undefined;
let window_will_snap = false;
$(el_window).draggable( 'option', 'cursorAt', false);
$(el_window).removeClass('window-dragging');
$(el_window).attr({
@@ -1798,24 +1983,114 @@ async function UIWindow (options) {
$(el_window_app_iframe).css('pointer-events', 'all');
$('.window').css('pointer-events', 'initial');
if ( options.is_resizable && snap_placeholder_active && !window_is_snapped ) {
window_will_snap = true;
$(window_snap_placeholder).css('padding', 0);
setTimeout(function () {
const snapDims = getSnapDimensions();
// snap to w
if ( window.current_active_snap_zone === 'w' ) {
$(el_window).css({
'top': snapDims.start_y,
'left': snapDims.start_x,
'width': snapDims.available_width / 2,
'height': snapDims.available_height - 6,
});
}
// snap to nw
else if ( window.current_active_snap_zone === 'nw' ) {
$(el_window).css({
'top': snapDims.start_y,
'left': snapDims.start_x,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
});
}
// snap to ne
else if ( window.current_active_snap_zone === 'ne' ) {
$(el_window).css({
'top': snapDims.start_y,
'left': snapDims.start_x + snapDims.available_width / 2,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
});
}
// snap to sw
else if ( window.current_active_snap_zone === 'sw' ) {
$(el_window).css({
'top': snapDims.start_y + snapDims.available_height / 2,
'left': snapDims.start_x,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
});
}
// snap to se
else if ( window.current_active_snap_zone === 'se' ) {
$(el_window).css({
'top': snapDims.start_y + snapDims.available_height / 2,
'left': snapDims.start_x + snapDims.available_width / 2,
'width': snapDims.available_width / 2,
'height': snapDims.available_height / 2,
});
}
// snap to e
else if ( window.current_active_snap_zone === 'e' ) {
$(el_window).css({
'top': snapDims.start_y,
'left': snapDims.start_x + snapDims.available_width / 2,
'width': snapDims.available_width / 2,
'height': snapDims.available_height - 6,
});
}
// snap to n
else if ( window.current_active_snap_zone === 'n' ) {
window.scale_window(el_window);
}
// snap placeholder is no longer active
snap_placeholder_active = false;
// hide snap placeholder
window_snap_placeholder.css('display', 'none');
window_snap_placeholder.css('padding', '10px');
// mark window as snapped
window_is_snapped = true;
// if at any point the window's width is "too small", hide the sidebar
if ( $(el_window).width() < window.window_width_threshold_for_sidebar ) {
if ( width_before_snap >= window.window_width_threshold_for_sidebar && !sidebar_hidden ) {
$(el_window_sidebar).hide();
}
sidebar_hidden = true;
}
// if at any point the window's width is "big enough", show the sidebar
else if ( $(el_window).width() >= window.window_width_threshold_for_sidebar ) {
if ( sidebar_hidden ) {
$(el_window_sidebar).show();
}
sidebar_hidden = false;
}
}, 100);
}
// if window is dropped outside the available area, move it back in
// the '- 30' is to account for the window head
const maxTop = window.innerHeight - 30;
if ( $(el_window).position().top > maxTop ) {
if ( $(el_window).position().top > maxTop && !window_will_snap ) {
$(el_window).animate({
top: maxTop - 30,
}, 100);
}
// if window is dropped too far to the right, move it left
const maxLeft = window.innerWidth - 50;
if ( $(el_window).position().left > maxLeft ) {
if ( $(el_window).position().left > maxLeft && !window_will_snap ) {
$(el_window).animate({
left: maxLeft,
}, 100);
}
// if window is dropped too far to the left, move it right
const minLeft = -$(el_window).width() + 150;
if ( $(el_window).position().left < minLeft ) {
if ( $(el_window).position().left < minLeft && !window_will_snap ) {
$(el_window).animate({
left: minLeft,
}, 100);
@@ -1831,6 +2106,7 @@ async function UIWindow (options) {
// document mousedown -> focusWindow path, which fires before any
// drag starts.
scroll: false,
containment: '.window-container',
});
}
@@ -1869,10 +2145,10 @@ async function UIWindow (options) {
}
// when resizing the top of the window, make sure the window head is not hidden behind the toolbar
if ( $(el_window).position().top < 0 ) {
var difference = -$(el_window).position().top;
if ( $(el_window).position().top < window.toolbar_height ) {
var difference = window.toolbar_height - $(el_window).position().top;
$(el_window).css({
'top': 0,
'top': window.toolbar_height,
'height': ui.size.height - difference, // Reduce the height by the difference
});
// don't resize
@@ -1939,9 +2215,10 @@ async function UIWindow (options) {
return;
}
const snap_dims = getSnapDimensions();
const head_height = options.has_head ? $(el_window_head).outerHeight() : 0;
const max_body_width = window.innerWidth;
const max_body_height = Math.max(0, window.innerHeight - head_height);
const max_body_width = snap_dims.available_width;
const max_body_height = Math.max(0, snap_dims.available_height - head_height);
if ( max_body_width <= 0 || max_body_height <= 0 ) {
return;
@@ -1960,8 +2237,8 @@ async function UIWindow (options) {
const window_width = Math.max(1, Math.floor(body_width));
const window_height = Math.max(1, Math.floor(body_height + head_height));
const left = Math.max(0, (window.innerWidth - window_width) / 2);
const top = Math.max(0, (window.innerHeight - window_height) / 2);
const left = snap_dims.start_x + Math.max(0, (snap_dims.available_width - window_width) / 2);
const top = snap_dims.start_y + Math.max(0, (snap_dims.available_height - window_height) / 2);
$(el_window).css({
width: `${window_width}px`,
@@ -1990,6 +2267,7 @@ async function UIWindow (options) {
'data-is_maximized': '0',
});
$(el_window_head_scale_btn).find('img').attr('src', window.icons['scale.svg']);
window_is_snapped = false;
};
// --------------------------------------------------------
// Head Context Menu
@@ -2299,7 +2577,7 @@ async function UIWindow (options) {
left = left > (window.innerWidth - window_width) ? (window.innerWidth - window_width) : left;
let top = window.mouseY;
top = top > (window.innerHeight - window_height) ? (window.innerHeight - window_height) : top;
top = top > (window.innerHeight - (window_height + window.toolbar_height)) ? (window.innerHeight - (window_height + window.toolbar_height)) : top;
UIWindowItemProperties(
options.title,
@@ -2477,15 +2755,7 @@ async function UIWindow (options) {
if ( options.is_fullpage ) {
$(el_window).hide();
setTimeout(function () {
$(el_window).find('.window-head').hide();
$('body').addClass('fullpage-mode');
$(el_window).css({
width: '100%',
height: '100%',
top: 0,
left: 0,
'border-radius': 0,
});
window.enter_fullpage_mode(el_window);
$(el_window).show();
}, 50);
}
@@ -2609,10 +2879,10 @@ $(document).on('dblclick', '.window .ui-resizable-handle', function (e) {
// top
else if ( $(this).hasClass('ui-resizable-n') ) {
let height = $(el_window).height() + $(el_window).position().top;
let height = $(el_window).height() + $(el_window).position().top - window.toolbar_height;
$(el_window).css({
height: height,
top: 0,
top: window.toolbar_height,
});
}
// right
@@ -2652,21 +2922,21 @@ $(document).on('dblclick', '.window .ui-resizable-handle', function (e) {
// top right
else if ( $(this).hasClass('ui-resizable-ne') ) {
let width = window.innerWidth - $(el_window).position().left;
let height = $(el_window).height() + $(el_window).position().top;
let height = $(el_window).height() + $(el_window).position().top - window.toolbar_height;
$(el_window).css({
width: width,
height: height,
top: 0,
top: window.toolbar_height,
});
}
// top left
else if ( $(this).hasClass('ui-resizable-nw') ) {
let width = $(el_window).width() + $(el_window).position().left;
let height = $(el_window).height() + $(el_window).position().top;
let height = $(el_window).height() + $(el_window).position().top - window.toolbar_height;
$(el_window).css({
width: width,
height: height,
top: 0,
top: window.toolbar_height,
left: 0,
});
}
@@ -3299,8 +3569,9 @@ $.fn.close = async function (options) {
let window_uuid = $(this).attr('data-element_uuid');
// remove all instances of win_id from window.window_stack
window.window_stack = window.window_stack.filter(id => id !== win_id);
// if a fullpage window is closed, show the desktop
if ( $(this).attr('data-is_fullpage') === '1' ) {
$('body').removeClass('fullpage-mode');
window.exit_fullpage_mode();
}
// FileDialog closed
@@ -3380,6 +3651,9 @@ $.fn.close = async function (options) {
// remove backdrop
$(this).closest('.window-backdrop').remove();
// remove global menubars
$(`.window-menubar-global[data-window-id="${win_id}"]`).remove();
// remove DOM element
if ( options?.shrink_to_target ) {
// get target location
@@ -3764,6 +4038,11 @@ $.fn.focusWindow = function (event) {
});
}
// hide other global menubars
$('.window-menubar-global').not(`.window-menubar-global[data-window-id="${win_id}"]`).hide();
// show this window's global menubar
$(`.window-menubar-global[data-window-id="${win_id}"]`).show();
// if a menubar or any of its items are clicked, don't focus the iframe. This is important to preserve the focus on the menubar
// and to enable keyboard navigation through the menubar items
if ( $(event?.target).hasClass('window-menubar') || $(event?.target).closest('.window-menubar').length > 0 ) {
@@ -5088,20 +5367,29 @@ async function saveSidebarOrder (order) {
window.update_maximized_window = function (el_window) {
if ( window.is_fullpage_mode ) {
$(el_window).css({
'top': 0,
'top': `${window.toolbar_height }px`,
'left': '0',
'width': '100%',
'height': '100%',
'height': `calc(100% - ${window.toolbar_height}px)`,
});
return;
}
$(el_window).css({
'top': 0,
'top': `${window.toolbar_height }px`,
'left': '0',
'width': '100%',
'height': `${window.innerHeight - 6 }px`,
'height': `${window.innerHeight - window.toolbar_height - 6 }px`,
});
};
function getSnapDimensions () {
return {
available_width: window.innerWidth,
available_height: window.innerHeight - window.toolbar_height,
start_x: 0,
start_y: window.toolbar_height,
};
}
export default UIWindow;
File diff suppressed because it is too large. Load diff
+7 -2
View File
@@ -110,6 +110,7 @@ if ( window.user_preferences === null ) {
}
window.window_stack = [];
window.toolbar_height = 0;
window.upload_progress_hide_delay = 500;
window.active_uploads = {};
window.copy_progress_hide_delay = 1000;
@@ -154,7 +155,7 @@ if ( window.location !== window.parent.location ) {
}
// calculate desktop height and width
window.desktop_height = window.innerHeight;
window.desktop_height = window.innerHeight - window.toolbar_height;
window.desktop_width = window.innerWidth;
// {id: {left: 0, top: 0}}
@@ -168,7 +169,7 @@ $(window).on( 'resize', function () {
if ( window.a_window_is_resizing ) return;
if ( window.a_window_sidebar_is_resizing ) return;
const new_desktop_height = window.innerHeight;
const new_desktop_height = window.innerHeight - window.toolbar_height;
const new_desktop_width = window.innerWidth;
window.desktop_height = new_desktop_height;
@@ -188,6 +189,10 @@ window.active_element = null;
// The number of recent apps to show in the launch menu
window.launch_recent_apps_count = 10;
// indicated if the mouse is in one of the window snap zones or not
// if yes, which one?
window.current_active_snap_zone = undefined;
//
window.is_fullpage_mode = false;
+7 -7
View File
@@ -19,18 +19,18 @@
/**
* Whether a page load boots the dashboard instead of the desktop. The root
* path and `/app/<name>` boot the dashboard unless the page is a popup, which
* the desktop still handles; `/dashboard` always does. The server matches
* these routes case-insensitively, so this does too.
* path and `/app/<name>` boot the dashboard unless the page is an iframe embed
* or a popup, which the desktop still handles; `/dashboard` always does.
*
* @param {Object} location
* @param {string} location.pathname
* @param {boolean} location.inIframe
* @param {boolean} location.embeddedInPopup
* @returns {boolean}
*/
export function bootsDashboard ({ pathname, embeddedInPopup }) {
if ( /^\/dashboard\/?$/i.test(pathname) ) return true;
const isAppLanding = /^\/app\/[^/]+\/?$/i.test(pathname);
export function bootsDashboard ({ pathname, inIframe, embeddedInPopup }) {
if ( pathname === '/dashboard' || pathname === '/dashboard/' ) return true;
const isAppLanding = /^\/app\/[^/]+\/?$/.test(pathname);
if ( pathname !== '/' && !isAppLanding ) return false;
return !embeddedInPopup;
return !embeddedInPopup && !inIframe;
}
+6 -13
View File
@@ -20,9 +20,9 @@
import { describe, it, expect } from 'vitest';
import { bootsDashboard } from './bootsDashboard.js';
const boots = (url, { embeddedInPopup = false } = {}) => {
const boots = (url, { inIframe = false, embeddedInPopup = false } = {}) => {
const { pathname } = new URL(url, 'https://puter.com');
return bootsDashboard({ pathname, embeddedInPopup });
return bootsDashboard({ pathname, inIframe, embeddedInPopup });
};
describe('bootsDashboard', () => {
@@ -33,24 +33,17 @@ describe('bootsDashboard', () => {
expect(boots('/app/editor')).toBe(true);
});
it('matches the paths in any letter case, as the server routes them', () => {
expect(boots('/Dashboard')).toBe(true);
expect(boots('/App/editor')).toBe(true);
expect(boots('/APP/Editor/')).toBe(true);
expect(boots('/App/editor', { embeddedInPopup: true })).toBe(false);
});
it('boots the desktop on action pages', () => {
expect(boots('/action/sign-in')).toBe(false);
});
it('boots the desktop in a popup', () => {
it('boots the desktop for flows only the desktop handles', () => {
expect(boots('/', { inIframe: true })).toBe(false);
expect(boots('/', { embeddedInPopup: true })).toBe(false);
expect(boots('/app/editor', { embeddedInPopup: true })).toBe(false);
});
it('keeps /dashboard on the dashboard even in a popup', () => {
expect(boots('/dashboard', { embeddedInPopup: true })).toBe(true);
it('keeps /dashboard on the dashboard even inside an iframe', () => {
expect(boots('/dashboard', { inIframe: true })).toBe(true);
});
it('boots the dashboard whatever the query asks for', () => {
@@ -357,11 +357,10 @@ const generate_file_context_menu = async function (options) {
html: i18n('share_remove_from_shared'),
onClick: async function () {
try {
const left = await puter.fs.unshare(
await puter.fs.unshare(
$(el_item).attr('data-path'),
window.user.username,
);
if ( left?.failed?.length ) throw left.failed[0];
// Or mode lookups keep answering for a share we just
// walked away from.
invalidate_shared_roots();
@@ -460,7 +459,7 @@ const generate_file_context_menu = async function (options) {
left = left > (window.innerWidth - window_width) ? (window.innerWidth - window_width) : left;
let top = $(el_item).position().top + $(el_item).height();
top = top > (window.innerHeight - window_height) ? (window.innerHeight - window_height) : top;
top = top > (window.innerHeight - (window_height + window.toolbar_height)) ? (window.innerHeight - (window_height + window.toolbar_height)) : top;
UIWindowItemProperties(
$(el_item).attr('data-name'),
@@ -48,7 +48,6 @@ const { default: generate_file_context_menu } =
await import('./generateFileContextMenu.js');
const { default: launch_app } = await import('./launchApp.js');
const { default: UIAlert } = await import('../UI/UIAlert.js');
const { unshareAnswering, allRefused, goneRefused } = await import('../../tests/fixtures/sdkUnshare.js');
const { can_share } = await import('./sharedAccess.js');
const { is_owned_by_me } = await import('./pathOwner.js');
@@ -196,29 +195,6 @@ describe('Remove from Shared', () => {
afterEach(() => {
document.body.innerHTML = '';
UIAlert.mockReset();
});
it.each([
['is refused', allRefused, 'Held through a team'],
['resolves with the pair refused', goneRefused, 'Subject does not exist'],
])('keeps the row and shows the error when leaving the share %s', async (_, answer, message) => {
const row = sharedRow();
document.body.append(row);
const onRemovedFromShared = vi.fn();
window.user = { username: 'alice' };
globalThis.puter = { fs: { unshare: unshareAnswering(answer) } };
const items = await generate_file_context_menu({
element: row,
fsentry: { name: 'notes.txt', path: '/ann/uid-1/notes.txt' },
associated_app_name: 'editor',
onRemovedFromShared,
});
await items.find((item) => item.html === 'share_remove_from_shared').onClick();
expect(UIAlert).toHaveBeenCalledWith({ message });
expect(row.isConnected).toBe(true);
expect(onRemovedFromShared).not.toHaveBeenCalled();
});
it('takes the row away once the user has left it', async () => {
-105
View File
@@ -1,105 +0,0 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { jwtPayload } from './jwtPayload.js';
/**
* A token's claims as key-sorted `[key, value]` pairs in JSON, without `iat`.
* Read without checking the signature, so it only says what the token claims.
*
* @param {unknown} token
* @returns {string | null} null when the token isn't a readable JWT
*/
export const tokenClaimsKey = (token) => {
const claims = typeof token === 'string' ? jwtPayload(token) : null;
if ( ! claims || Array.isArray(claims) ) return null;
return JSON.stringify(Object.keys(claims)
.filter(key => key !== 'iat')
.sort()
.map(key => [key, claims[key]]));
};
/**
* Whether two tokens claim exactly the same things apart from when they were
* signed. Two GUI tokens that do are for the same session, user and type.
*
* @param {unknown} a
* @param {unknown} b
* @returns {boolean}
*/
export const sameTokenClaims = (a, b) => {
const key = tokenClaimsKey(a);
return key !== null && key === tokenClaimsKey(b);
};
/**
* The digest the shell sends as `guiTokenDigest`: SHA-256 of
* {@link tokenClaimsKey}, first 32 hex chars. Must match
* `TokenService.claimsDigest` on the server.
*
* @param {unknown} token
* @param {SubtleCrypto | null} [subtle] - null on an insecure origin
* @returns {Promise<string | null>} null when the token isn't readable or
* there is no SubtleCrypto
*/
export const tokenClaimsDigest = async (token, subtle = globalThis.crypto?.subtle) => {
const key = tokenClaimsKey(token);
if ( key === null || ! subtle ) return null;
const hash = new Uint8Array(await subtle.digest('SHA-256', new TextEncoder().encode(key)));
return Array.from(hash, byte => byte.toString(16).padStart(2, '0')).join('').slice(0, 32);
};
/**
* Whether the server rendered this page for this load. A history navigation or
* a restored tab can be a cached copy, rendered for a cookie that has changed.
*
* @param {Performance} [perf]
* @returns {boolean}
*/
export const pageRenderedForThisLoad = (perf = globalThis.performance) => {
const nav = perf?.getEntriesByType?.('navigation')?.[0];
if ( ! nav ) return false;
return (nav.type === 'navigate' || nav.type === 'reload') && nav.transferSize > 0;
};
/**
* What boot does about `/get-gui-token`, which hands over a token for the
* session cookie:
* - `fetch`: ask for it.
* - `same-session`: the stored token is already the one it would hand over.
* - `no-session`: there is no session cookie, so it would refuse.
*
* Anything short of a `guiTokenDigest` from this very page load is `fetch`.
*
* @param {Object} opts
* @param {Record<string, unknown> | undefined} opts.params - gui_params
* @param {string | null} opts.storedToken
* @param {boolean} opts.sameOrigin - whether the page and `/get-gui-token` share an origin
* @param {boolean} opts.renderedForThisLoad - {@link pageRenderedForThisLoad}
* @param {SubtleCrypto | null} [opts.subtle]
* @returns {Promise<'fetch' | 'same-session' | 'no-session'>}
*/
export const guiTokenBootStep = async ({ params, storedToken, sameOrigin, renderedForThisLoad, subtle }) => {
if ( ! params || ! Object.hasOwn(params, 'guiTokenDigest') ) return 'fetch';
if ( ! sameOrigin || ! renderedForThisLoad ) return 'fetch';
const hint = params.guiTokenDigest;
if ( hint === null ) return 'no-session';
if ( typeof hint !== 'string' || ! storedToken ) return 'fetch';
return await tokenClaimsDigest(storedToken, subtle) === hint ? 'same-session' : 'fetch';
};
-134
View File
@@ -1,134 +0,0 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { createHash, webcrypto } from 'node:crypto';
import { describe, expect, it } from 'vitest';
import {
guiTokenBootStep,
pageRenderedForThisLoad,
sameTokenClaims,
tokenClaimsDigest,
tokenClaimsKey,
} from './guiToken.js';
const jwtWith = (claims) =>
`h.${Buffer.from(JSON.stringify(claims)).toString('base64url')}.s`;
const CLAIMS = { t: 'gui', v: '2', u: 'c2Vzc2lvbg==', su: 'c2Vzc2lvbg==', uu: 'dXNlcg==', ai: 'dXNlcg==' };
const TOKEN = jwtWith({ ...CLAIMS, iat: 1 });
const subtle = webcrypto.subtle;
describe('tokenClaimsKey', () => {
it('sorts the claims and leaves out iat', () => {
expect(tokenClaimsKey(jwtWith({ b: 1, a: 'x', iat: 5 }))).toBe('[["a","x"],["b",1]]');
});
it('is null for anything that is not a readable JWT', () => {
expect(tokenClaimsKey('not-a-token')).toBe(null);
expect(tokenClaimsKey(null)).toBe(null);
expect(tokenClaimsKey(`h.${Buffer.from('[1]').toString('base64url')}.s`)).toBe(null);
});
});
describe('sameTokenClaims', () => {
it('is true for two tokens signed at different times for the same session', () => {
expect(sameTokenClaims(TOKEN, jwtWith({ ...CLAIMS, iat: 2 }))).toBe(true);
});
it('is false when any other claim differs, is added or is missing', () => {
expect(sameTokenClaims(TOKEN, jwtWith({ ...CLAIMS, su: 'b3RoZXI=', iat: 2 }))).toBe(false);
expect(sameTokenClaims(TOKEN, jwtWith({ ...CLAIMS, uu: 'b3RoZXI=', iat: 2 }))).toBe(false);
expect(sameTokenClaims(TOKEN, jwtWith({ ...CLAIMS, t: 's', iat: 2 }))).toBe(false);
expect(sameTokenClaims(TOKEN, jwtWith({ ...CLAIMS, x: true, iat: 2 }))).toBe(false);
const { ai, ...withoutAuthId } = CLAIMS;
expect(sameTokenClaims(TOKEN, jwtWith({ ...withoutAuthId, iat: 2 }))).toBe(false);
});
it('is false when either token is unreadable', () => {
expect(sameTokenClaims('garbage', 'garbage')).toBe(false);
expect(sameTokenClaims(TOKEN, null)).toBe(false);
expect(sameTokenClaims(null, null)).toBe(false);
});
});
describe('tokenClaimsDigest', () => {
it('is the first 32 hex chars of SHA-256 over the claims key', async () => {
const expected = createHash('sha256').update(tokenClaimsKey(TOKEN)).digest('hex').slice(0, 32);
expect(await tokenClaimsDigest(TOKEN, subtle)).toBe(expected);
expect(await tokenClaimsDigest(jwtWith({ ...CLAIMS, iat: 9 }), subtle)).toBe(expected);
});
it('is null without SubtleCrypto or a readable token', async () => {
expect(await tokenClaimsDigest(TOKEN, null)).toBe(null);
expect(await tokenClaimsDigest('garbage', subtle)).toBe(null);
});
});
describe('pageRenderedForThisLoad', () => {
const perfWith = (entry) => ({ getEntriesByType: (type) => (type === 'navigation' && entry ? [entry] : []) });
it('is true for a navigation or reload the server answered', () => {
expect(pageRenderedForThisLoad(perfWith({ type: 'navigate', transferSize: 900 }))).toBe(true);
expect(pageRenderedForThisLoad(perfWith({ type: 'reload', transferSize: 300 }))).toBe(true);
});
it('is false for a history navigation, a cached copy, or no timing at all', () => {
expect(pageRenderedForThisLoad(perfWith({ type: 'back_forward', transferSize: 900 }))).toBe(false);
expect(pageRenderedForThisLoad(perfWith({ type: 'navigate', transferSize: 0 }))).toBe(false);
expect(pageRenderedForThisLoad(perfWith({ type: 'navigate' }))).toBe(false);
expect(pageRenderedForThisLoad(perfWith(null))).toBe(false);
expect(pageRenderedForThisLoad({})).toBe(false);
expect(pageRenderedForThisLoad(undefined)).toBe(false);
});
});
describe('guiTokenBootStep', () => {
const step = async (overrides) => guiTokenBootStep({
params: { guiTokenDigest: await tokenClaimsDigest(TOKEN, subtle) },
storedToken: jwtWith({ ...CLAIMS, iat: 3 }),
sameOrigin: true,
renderedForThisLoad: true,
subtle,
...overrides,
});
it('keeps the stored token when the shell names its session', async () => {
expect(await step({})).toBe('same-session');
});
it('skips the request when the shell says there is no session cookie', async () => {
expect(await step({ params: { guiTokenDigest: null } })).toBe('no-session');
expect(await step({ params: { guiTokenDigest: null }, storedToken: null })).toBe('no-session');
});
it('asks when the shell names another session or nothing is stored', async () => {
expect(await step({ storedToken: jwtWith({ ...CLAIMS, su: 'b3RoZXI=' }) })).toBe('fetch');
expect(await step({ storedToken: null })).toBe('fetch');
expect(await step({ params: { guiTokenDigest: 42 } })).toBe('fetch');
});
it('asks whenever the shell\'s word can\'t be taken', async () => {
// An older server, or one that couldn't tell.
expect(await step({ params: {} })).toBe('fetch');
expect(await step({ params: undefined })).toBe('fetch');
expect(await step({ sameOrigin: false })).toBe('fetch');
expect(await step({ renderedForThisLoad: false })).toBe('fetch');
expect(await step({ renderedForThisLoad: false, params: { guiTokenDigest: null } })).toBe('fetch');
expect(await step({ subtle: null })).toBe('fetch');
});
});
+2 -2
View File
@@ -622,14 +622,14 @@ const runLaunch = async (options) => {
window_height = parseFloat(app_info.metadata.window_size.height);
} if ( options.maximized )
{
window_height = 'calc(100% - 1px)';
window_height = `calc(100% - ${window.toolbar_height + 1}px)`;
}
// top
let top;
if ( app_info.metadata?.window_position?.top !== undefined && app_info.metadata?.window_position?.top !== '' )
{
top = parseFloat(app_info.metadata.window_position.top) + 1;
top = parseFloat(app_info.metadata.window_position.top) + window.toolbar_height + 1;
}
if ( options.maximized )
{
+1 -1
View File
@@ -323,7 +323,7 @@ Please try recreating the link.`);
app: 'explorer',
top: options.maximized ? 0 : undefined,
left: options.maximized ? 0 : undefined,
height: options.maximized ? 'calc(100% - 1px)' : undefined,
height: options.maximized ? `calc(100% - ${window.toolbar_height + 1}px)` : undefined,
width: options.maximized ? '100%' : undefined,
});
}
+12
View File
@@ -87,3 +87,15 @@ export const startPushWorker = async ({
console.warn('Could not update the service worker:', err);
}
};
/** Closes a browser banner that the desktop's worker showed for this uid. */
export const closeLocalBanner = async (uid, nav = globalThis.navigator) => {
try {
const registration = await nav?.serviceWorker?.getRegistration?.('/');
for ( const notification of await registration?.getNotifications?.() ?? [] ) {
if ( notification.data?.uid === uid ) notification.close();
}
} catch ( err ) {
console.warn('Could not close a browser notification:', err);
}
};
+26 -1
View File
@@ -18,7 +18,7 @@
*/
import { afterEach, describe, expect, it, vi } from 'vitest';
import { pushWorkerEnabled } from './pushWorker.js';
import { closeLocalBanner, pushWorkerEnabled } from './pushWorker.js';
afterEach(() => {
vi.resetModules();
@@ -149,3 +149,28 @@ describe('startPushWorker', () => {
expect(handler).not.toHaveBeenCalled();
});
});
describe('closeLocalBanner', () => {
it('closes only the desktop worker notification with the acknowledged uid', async () => {
const shown = [
{ data: { uid: 'one' }, close: vi.fn() },
{ data: { uid: 'two' }, close: vi.fn() },
{ data: { puter: { uid: 'one' } }, close: vi.fn() },
];
const getRegistration = vi.fn(async () => ({ getNotifications: async () => shown }));
await closeLocalBanner('one', { serviceWorker: { getRegistration } });
expect(getRegistration).toHaveBeenCalledWith('/');
expect(shown.map((n) => n.close.mock.calls.length)).toEqual([1, 0, 0]);
});
it('works without a registered worker', async () => {
await expect(closeLocalBanner('one', {})).resolves.toBeUndefined();
});
it('contains browser API failures', async () => {
vi.spyOn(console, 'warn').mockImplementation(() => {});
await expect(closeLocalBanner('one', {
serviceWorker: { getRegistration: async () => { throw new Error('unavailable'); } },
})).resolves.toBeUndefined();
});
});
@@ -21,6 +21,47 @@ const update_mouse_position = function (x, y) {
window.mouseX = x;
window.mouseY = y;
// mouse in top-left corner of screen
if ( (window.mouseX < 150 && window.mouseY < window.toolbar_height + 20) || (window.mouseX < 20 && window.mouseY < 150) )
{
window.current_active_snap_zone = 'nw';
}
// mouse in left edge of screen
else if ( window.mouseX < 20 && window.mouseY >= 150 && window.mouseY < window.desktop_height - 150 )
{
window.current_active_snap_zone = 'w';
}
// mouse in bottom-left corner of screen
else if ( window.mouseX < 20 && window.mouseY > window.desktop_height - 150 )
{
window.current_active_snap_zone = 'sw';
}
// mouse in right edge of screen
else if ( window.mouseX > window.desktop_width - 20 && window.mouseY >= 150 && window.mouseY < window.desktop_height - 150 )
{
window.current_active_snap_zone = 'e';
}
// mouse in top-right corner of screen
else if ( (window.mouseX > window.desktop_width - 150 && window.mouseY < window.toolbar_height + 20) || (window.mouseX > window.desktop_width - 20 && window.mouseY < 150) )
{
window.current_active_snap_zone = 'ne';
}
// mouse in bottom-right corner of screen
else if ( window.mouseX > window.desktop_width - 20 && window.mouseY >= window.desktop_height - 150 )
{
window.current_active_snap_zone = 'se';
}
// mouse in top edge of screen
else if ( window.mouseY < window.toolbar_height + 20 && window.mouseX >= 150 && window.mouseX < window.desktop_width - 150 )
{
window.current_active_snap_zone = 'n';
}
// not in any snap zone
else
{
window.current_active_snap_zone = undefined;
}
// mouseover_window
var windows = document.getElementsByClassName('window');
let active_win;
+52
View File
@@ -40,13 +40,20 @@ const ar = {
close_all_windows_and_log_out: 'إغلاق النوافذ وتسجيل الخروج',
change_always_open_with: 'هل تريد دائمًا فتح هذا النوع من الملفات باستخدام',
confirm: 'تأكيد',
confirm_2fa_setup: 'لقد أضفت الرمز إلى تطبيق المصادقة',
confirm_2fa_recovery: 'لقد حفظت رموز الاسترداد في مكان آمن',
confirm_account_for_free_referral_storage_c2a:
'.أنشئ حسابًا وقم بتأكيد عنوان بريدك الإلكتروني للحصول على 1 جيجابايت من مساحة التخزين المجانية. سيحصل صديقك أيضًا على 1 جيجابايت من مساحة التخزين المجانية',
confirm_code_generic_incorrect: 'رمز غير صحيح.',
confirm_code_generic_too_many_requests:
'.طلبات كثيرة جدًا. يرجى الانتظار بضع دقائق',
confirm_code_generic_submit: 'إرسال الرمز',
confirm_code_generic_try_again: 'حاول مرة أخرى',
confirm_code_generic_title: 'أدخل رمز التأكيد',
confirm_code_2fa_instruction:
'.أدخل الرمز المكون من 6 أرقام من تطبيق المصادقة الخاص بك',
confirm_code_2fa_submit_btn: 'إرسال',
confirm_code_2fa_title: 'أدخل رمز المصادقة الثنائية',
confirm_delete_multiple_items:
'هل أنت متأكد أنك تريد حذف هذه العناصر نهائيًا؟',
confirm_delete_single_item: 'هل تريد حذف هذا العنصر نهائيًا؟',
@@ -59,6 +66,8 @@ const ar = {
confirm_session_revoke: 'هل أنت متأكد أنك تريد إلغاء هذه الجلسة؟',
confirm_your_email_address: 'تأكيد عنوان بريدك الإلكتروني',
contact_us: 'اتصل بنا',
contact_us_verification_required:
'.يجب أن يكون لديك عنوان بريد إلكتروني مُؤكد لاستخدام هذه الخدمة',
continue: 'استمر',
copy: 'نسخ',
copy_link: 'نسخ الرابط',
@@ -80,8 +89,10 @@ const ar = {
deploy_as_app: 'نشر كتطبيق',
descending: 'تنازلي',
desktop: 'سطح المكتب',
desktop_background_fit: 'ملائمة',
developers: 'المطورين',
disable_2fa: 'تعطيل المصادقة الثنائية',
disable_2fa_confirm: 'هل أنت متأكد أنك تريد تعطيل المصادقة الثنائية؟',
disable_2fa_instructions: '.أدخل كلمة المرور لتعطيل المصادقة الثنائية',
documents: 'المستندات',
dont_allow: 'عدم السماح',
@@ -115,10 +126,13 @@ const ar = {
forgot_pass_c2a: 'هل نسيت كلمة المرور؟',
from: 'من',
general: 'عام',
get_a_copy_of_on_puter: "Puter.com! :احصل على نسخة من '%%' على",
get_copy_link: 'احصل على رابط النسخ',
home: 'الصفحة الرئيسية',
html_document: 'HTML مستند',
hue: 'درجة اللون',
incorrect_password: 'كلمة مرور غير صحيحة',
invite_link: 'رابط الدعوة',
item: 'عنصر',
items_in_trash_cannot_be_renamed:
'.لا يمكن إعادة تسمية هذا العنصر لأنه في سلة المهملات. لإعادة تسمية هذا العنصر، اسحبه أولاً خارج سلة المهملات',
@@ -130,6 +144,7 @@ const ar = {
loading: 'جارٍ التحميل',
log_in: 'تسجيل الدخول',
log_out: 'تسجيل الخروج',
looks_good: '!يبدو جيدًا',
manage_sessions: 'إدارة الجلسات',
modified: 'تم التعديل',
move: 'نقل',
@@ -154,6 +169,7 @@ const ar = {
open_with: 'فتح باستخدام',
original_name: 'الاسم الأصلي',
original_path: 'المسار الأصلي',
oss_code_and_content: 'برامج ومحتوى مفتوح المصدر',
password: 'كلمة المرور',
password_changed: '.تم تغيير كلمة المرور',
password_recovery_rate_limit:
@@ -169,20 +185,28 @@ const ar = {
paste: 'لصق',
paste_into_folder: 'لصق في المجلد',
path: 'المسار',
personalization: 'تخصيص',
pictures: 'الصور',
plural_suffix: 's', //this is not necessary for Arabic
powered_by_puter_js: '{{link=docs}}Puter.js{{/link}} مدعوم بواسطة ',
preparing: '...جارٍ التحضير',
preparing_for_upload: '...جارٍ التحضير للتحميل',
print: 'طباعة',
privacy: 'الخصوصية',
proceed_to_login: 'المتابعة لتسجيل الدخول',
proceed_with_account_deletion: 'المتابعة مع حذف الحساب',
properties: 'الخصائص',
public: 'عام',
publish: 'نشر',
publish_as_website: 'نشر كموقع إلكتروني',
puter_description:
'.هو سحابة شخصية تركز على الخصوصية للحفاظ على جميع ملفاتك، تطبيقاتك، وألعابك في مكان آمن واحد، متاحة من أي مكان وفي أي وقت Puter',
reading_file: '%strong% جارٍ قراءة',
recover_password: 'استعادة كلمة المرور',
refer_friends_c2a:
'!سيحصل صديقك على 1 جيجابايت أيضًا .Puter احصل على 1 جيجابايت عن كل صديق ينشئ حسابًا ويؤكده على',
refer_friends_social_media_c2a:
'Puter.com! احصل على 1 جيجابايت من التخزين المجاني على',
refresh: 'تحديث',
rename: 'إعادة تسمية',
replace: 'استبدال',
@@ -192,9 +216,11 @@ const ar = {
save: 'حفظ',
saturation: 'تشبع',
save_account: 'حفظ الحساب',
save_account_to_get_copy_link: '.يرجى إنشاء حساب للمتابعة',
save_account_to_publish: '.يرجى إنشاء حساب للمتابعة',
save_session: 'حفظ الجلسة',
save_session_c2a: '.أنشئ حسابًا لحفظ جلستك الحالية وتجنب فقدان عملك',
scan_qr_2fa: 'امسح رمز الاستجابة السريعة باستخدام تطبيق المصادقة الخاص بك',
search: 'بحث',
seconds: 'ثوانٍ',
security: 'الأمان',
@@ -212,11 +238,13 @@ const ar = {
show_hidden: 'إظهار المخفي',
sign_in_with_puter: 'Puter تسجيل الدخول باستخدام',
sign_up: 'تسجيل',
signing_in: '…جارٍ تسجيل الدخول',
size: 'الحجم',
skip: 'تخطي',
something_went_wrong: 'حدث خطأ ما.',
sort_by: 'فرز حسب',
status: 'الحالة',
storage_usage: 'استخدام التخزين',
storage_puter_used: 'Puter مستخدم بواسطة',
taking_longer_than_usual: '…يستغرق وقتًا أطول من المعتاد. يرجى الانتظار',
terms: 'الشروط',
@@ -245,18 +273,25 @@ const ar = {
videos: 'مقاطع الفيديو',
visibility: 'الرؤية',
yes: 'نعم',
you_have_been_referred_to_puter_by_a_friend:
'!بواسطة صديق Puter تم إحالتك إلى',
zip: 'ضغط',
zipping_file: '%strong% جارٍ ضغط',
// === 2FA Setup ===
setup2fa_1_step_heading: 'افتح تطبيق المصادقة الخاص بك',
setup2fa_1_instructions: '.هو خيار موثوق به لنظام Android و iOS ولكن إذا كنت غير متأكد،<a target="_blank" href="https://authy.com/download">Authy</a> :هناك العديد للاختيار من بينها .(TOTP) يمكنك استخدام أي تطبيق مصادقة يدعم بروتوكول كلمة المرور لمرة واحدة المعتمدة على الوقت ',
setup2fa_2_step_heading: ' (QR code)مسح رمز الاستجابة السريعة',
setup2fa_3_step_heading: 'أدخل الرمز المكون من 6 أرقام',
setup2fa_4_step_heading: 'انسخ رموز الاسترداد الخاصة بك',
setup2fa_4_instructions: `
.هذه رموز الاسترداد هي الطريقة الوحيدة للوصول إلى حسابك إذا فقدت هاتفك أو لم تتمكن من استخدام تطبيق المصادقة الخاص بك
.تأكد من حفظها في مكان آمن
`,
setup2fa_5_step_heading: '(2FA) تأكيد إعداد المصادقة الثنائية',
setup2fa_5_confirmation_1: 'لقد قمت بحفظ رموز الاسترداد في مكان آمن',
setup2fa_5_confirmation_2: '(2FA) أنا جاهز لتمكين المصادقة الثنائية',
setup2fa_5_button: ' (2FA) تمكين المصادقة الثنائية',
// === 2FA Login ===
login2fa_otp_title: '(2FA) أدخل رمز المصادقة الثنائية',
@@ -266,6 +301,7 @@ const ar = {
login2fa_recovery_instructions:
'.أدخل أحد رموز الاسترداد الخاصة بك للوصول إلى حسابك',
login2fa_use_recovery_code: 'استخدام رمز الاسترداد',
login2fa_recovery_back: 'الرجوع',
login2fa_recovery_placeholder: 'XXXXXXXX',
change: 'تغيير', // In English: "Change"
@@ -338,13 +374,21 @@ const ar = {
'billing.enjoy_msg':
'.بالإضافة إلى مزايا أخرى Cloud Storage استمتع بـ %% من', // In English: "Enjoy %% of Cloud Storage plus other benefits."
choose_publishing_option:
'اختر الطريقة التي تريد نشر موقع الويب الخاص بك بها', // In English: "Choose how you want to publish your website:"
create_desktop_shortcut: 'إنشاء اختصار (سطح المكتب)', // In English: "Create Shortcut (Desktop)"
create_desktop_shortcut_s: 'إنشاء اختصارات (سطح المكتب)', // In English: "Create Shortcuts (Desktop)"
create_shortcut_s: 'إنشاء اختصارات', // In English: "Create Shortcuts"
minimize: 'تصغير', // In English: "Minimize"
reload_app: 'إعادة تحميل التطبيق', // In English: "Reload App"
publish_as_serverless_worker: 'النشر كعامل', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'وضع ملء الشاشة', // In English: "Enter Full Screen"
'toolbar.github': 'GitHub', // In English: "GitHub"
'toolbar.refer': 'إحالة', // In English: "Refer"
used_of: '{{available}}محاولات مستخدمة من {{used}}', // In English: "{{used}} used of {{available}}"
worker: 'العامل', // In English: "Worker"
'billing.offering.basic': 'أساسي', // In English: "Basic"
too_many_attempts: '.محاولات كثيرة. يُرجى المحاولة لاحقًا', // In English: "Too many attempts. Please try again later."
server_timeout:
'.استغرق الخادم وقتًا طويلاً للاستجابة. يُرجى المحاولة مرة أخرى', // In English: "The server took too long to respond. Please try again."
signup_error: '.حدث خطأ أثناء التسجيل. يُرجى المحاولة مرة أخرى', // In English: "An error occurred during signup. Please try again."
@@ -363,10 +407,15 @@ const ar = {
window_title_open: 'فتح',
window_title_change_password: 'تغيير كلمة المرور',
window_title_select_font: '…اختر الخط',
window_title_session_list: '!قائمة الجلسات',
window_title_set_new_password: 'تعيين كلمة مرور جديدة',
window_title_publish_website: 'نشر الموقع',
window_title_publish_worker: 'نشر العامل',
window_title_authenticating: '…جارٍ التحقق',
window_title_refer_friend: '!أوصِ صديقًا',
desktop_exit_full_screen: 'الخروج من وضع ملء الشاشة',
desktop_enter_full_screen: 'وضع ملء الشاشة',
item_shared_with_you: '.قام مستخدم بمشاركة هذا العنصر معك',
item_shared_by_you: '.لقد قمت بمشاركة هذا العنصر مع مستخدم آخر على الأقل',
item_shortcut: 'اختصار',
item_associated_websites: 'الموقع المرتبط',
@@ -375,6 +424,9 @@ const ar = {
window_click_to_go_back: 'انقر للرجوع.',
window_click_to_go_forward: 'انقر للتقدم.',
window_click_to_go_up: '.انقر للصعود مجلد واحد',
window_title_public: 'عام',
window_title_videos: 'فيديوهات',
window_title_pictures: 'صور',
window_title_puter: 'بيوتر',
window_folder_empty: 'هذا المجلد فارغ',
},
+51
View File
@@ -41,13 +41,20 @@ const bg = {
close: 'Затвори',
close_all_windows_and_log_out: 'Затвори прозорците и излез',
confirm: 'Потвърди',
confirm_2fa_setup: 'Добавих кода към приложението си за удостоверяване',
confirm_2fa_recovery: 'Запазих кодовете за възстановяване на сигурно място',
confirm_account_for_free_referral_storage_c2a:
'Създайте акаунт и потвърдете имейл адреса си, за да получите 1 GB безплатно пространство. Вашият приятел също ще получи 1 GB безплатно пространство.',
confirm_code_generic_incorrect: 'Неправилен код.',
confirm_code_generic_too_many_requests:
'Твърде много заявки. Моля, изчакайте няколко минути.',
confirm_code_generic_submit: 'Изпрати код',
confirm_code_generic_try_again: 'Опитай отново',
confirm_code_generic_title: 'Въведете код за потвърждение',
confirm_code_2fa_instruction:
'Въведете 6-цифрения код от приложението си за удостоверяване.',
confirm_code_2fa_submit_btn: 'Изпрати',
confirm_code_2fa_title: 'Въведете 2FA код',
confirm_delete_multiple_items:
'Сигурни ли сте, че искате да изтриете завинаги тези елементи?',
confirm_delete_single_item: 'Искате ли да изтриете завинаги този елемент?',
@@ -60,7 +67,10 @@ const bg = {
confirm_session_revoke:
'Сигурни ли сте, че искате да прекратите тази сесия?',
confirm_your_email_address: 'Потвърдете имейл адреса си',
choose_publishing_option: 'Изберете как искате да публикувате уебсайта си:',
contact_us: 'Свържете се с нас',
contact_us_verification_required:
'Трябва да имате потвърден имейл адрес, за да използвате това.',
continue: 'Продължи',
copy: 'Копирай',
copy_link: 'Копирай връзката',
@@ -68,6 +78,8 @@ const bg = {
copying_file: 'Копиране на %%',
create_account: 'Създай акаунт',
create_free_account: 'Създай безплатен акаунт',
create_desktop_shortcut: 'Създай пряк път (Работен плот)',
create_desktop_shortcut_s: 'Създай преки пътища (Работен плот)',
create_shortcut: 'Създай пряк път',
create_shortcut_s: 'Създай преки пътища',
credits: 'Благодарности',
@@ -83,8 +95,10 @@ const bg = {
deploy_as_app: 'Разгърни като приложение',
descending: 'Низходящ',
desktop: 'Работен плот',
desktop_background_fit: 'Побери',
developers: 'Разработчици',
disable_2fa: 'Изключи 2FA',
disable_2fa_confirm: 'Сигурни ли сте, че искате да изключите 2FA?',
disable_2fa_instructions: 'Въведете паролата си, за да изключите 2FA.',
documents: 'Документи',
dont_allow: 'Не разрешавай',
@@ -119,10 +133,13 @@ const bg = {
forgot_pass_c2a: 'Забравена парола?',
from: 'От',
general: 'Общи',
get_a_copy_of_on_puter: 'Вземете копие на %% в Puter.com!',
get_copy_link: 'Вземи връзка за копие',
home: 'Начало',
html_document: 'HTML документ',
hue: 'Нюанс',
incorrect_password: 'Грешна парола',
invite_link: 'Линк за покана',
item: 'елемент',
items_in_trash_cannot_be_renamed:
'Този елемент не може да бъде преименуван, защото е в Кошчето. За да го преименувате, първо го извадете от Кошчето.',
@@ -134,6 +151,7 @@ const bg = {
loading: 'Зареждане',
log_in: 'Вход',
log_out: 'Изход',
looks_good: 'Изглежда добре!',
manage_sessions: 'Управление на сесиите',
modified: 'Променено',
move: 'Премести',
@@ -160,6 +178,7 @@ const bg = {
open_with: 'Отвори с',
original_name: 'Оригинално име',
original_path: 'Оригинален път',
oss_code_and_content: 'Софтуер и съдържание с отворен код',
password: 'Парола',
password_changed: 'Паролата е променена.',
password_recovery_rate_limit:
@@ -175,22 +194,30 @@ const bg = {
paste: 'Постави',
paste_into_folder: 'Постави в папката',
path: 'Път',
personalization: 'Персонализация',
pictures: 'Снимки',
plural_suffix: 'и',
powered_by_puter_js: 'Работи с {{link=docs}}Puter.js{{/link}}',
preparing: 'Подготовка…',
preparing_for_upload: 'Подготовка за качване…',
print: 'Принтирай',
privacy: 'Поверителност',
proceed_to_login: 'Продължи към вход',
proceed_with_account_deletion: 'Продължи с изтриването на акаунта',
properties: 'Свойства',
public: 'Публична',
publish: 'Публикувай',
publish_as_website: 'Публикувай като уебсайт',
publish_as_serverless_worker: 'Публикувай като Worker',
puter_description:
'Puter е личен облак с приоритет на поверителността, който съхранява всичките ви файлове, приложения и игри на едно сигурно място, достъпно отвсякъде и по всяко време.',
reading: 'Четене на %strong%',
writing: 'Записване на %strong%',
recover_password: 'Възстанови паролата',
refer_friends_c2a:
'Получете 1 GB за всеки приятел, който създаде и потвърди акаунт в Puter. Вашият приятел също ще получи 1 GB!',
refer_friends_social_media_c2a:
'Получете 1 GB безплатно пространство в Puter.com!',
refresh: 'Опресни',
rename: 'Преименувай',
replace: 'Замени',
@@ -200,10 +227,12 @@ const bg = {
save: 'Запази',
saturation: 'Наситеност',
save_account: 'Запазване на акаунт',
save_account_to_get_copy_link: 'Моля, създайте акаунт, за да продължите.',
save_account_to_publish: 'Моля, създайте акаунт, за да продължите.',
save_session: 'Запазване на сесия',
save_session_c2a:
'Създайте акаунт, за да запазите текущата си сесия и да избегнете загуба на работата си.',
scan_qr_2fa: 'Сканирайте QR кода с приложението си за удостоверяване',
search: 'Търсене',
seconds: 'секунди',
security: 'Сигурност',
@@ -222,16 +251,21 @@ const bg = {
show_hidden: 'Покажи скритите',
sign_in_with_puter: 'Влез с Puter',
sign_up: 'Регистрирай се',
signing_in: 'Влизане…',
size: 'Размер',
skip: 'Пропусни',
something_went_wrong: 'Нещо се обърка.',
sort_by: 'Сортиране по',
status: 'Статус',
storage_usage: 'Използване на място за съхранение',
storage_puter_used: 'използвано от Путер',
taking_longer_than_usual:
'Отнема малко повече време от обикновено. Моля, изчакайте...',
terms: 'Условия',
text_document: 'Текстов документ',
'toolbar.enter_fullscreen': 'Вход в режим на цял екран',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Препоръчай',
tos_fineprint:
"С натискане на 'Създай безплатен акаунт' вие се съгласявате с {{link=terms}}Условията за ползване{{/link}} и {{link=privacy}}Политиката за поверителност{{/link}} на Puter.",
transparency: 'Прозрачност',
@@ -261,6 +295,8 @@ const bg = {
videos: 'Видеоклипове',
visibility: 'Видимост',
yes: 'Да',
you_have_been_referred_to_puter_by_a_friend:
'Били сте препоръчани в Puter от приятел!',
zip: 'ZIP архивиране',
tar: 'TAR архивиране',
download_as_tar: 'Изтегли като TAR',
@@ -270,20 +306,25 @@ const bg = {
tarring: 'TAR архивиране на %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Отворете приложението си за удостоверяване',
setup2fa_1_instructions: `
Можете да използвате всяко приложение за удостоверяване, което поддържа протокола Time-based One-Time Password (TOTP).
Има много варианти, но ако не сте сигурни,
<a target="_blank" href="https://authy.com/download">Authy</a>
е отлично решение за Android и iOS.
`,
setup2fa_2_step_heading: 'Сканирайте QR кода',
setup2fa_3_step_heading: 'Въведете 6-цифрения код',
setup2fa_4_step_heading: 'Копирайте кодовете за възстановяване',
setup2fa_4_instructions: `
Тези кодове за възстановяване са единственият начин да получите достъп до акаунта си, ако загубите телефона си или не можете да използвате приложението за удостоверяване.
Уверете се, че ги съхранявате на сигурно място.
`,
setup2fa_5_step_heading: 'Потвърдете настройката на 2FA',
setup2fa_5_confirmation_1:
'Запазих кодовете за възстановяване на сигурно място',
setup2fa_5_confirmation_2: 'Готов съм да включа 2FA',
setup2fa_5_button: 'Включи 2FA',
// === 2FA Login ===
login2fa_otp_title: 'Въведете 2FA код',
@@ -293,6 +334,7 @@ const bg = {
login2fa_recovery_instructions:
'Въведете един от кодовете си за възстановяване, за да получите достъп до акаунта си.',
login2fa_use_recovery_code: 'Използвай код за възстановяване',
login2fa_recovery_back: 'Назад',
login2fa_recovery_placeholder: 'XXXXXXXX',
// Sharing
@@ -362,6 +404,7 @@ const bg = {
'billing.accelerated': 'Ускорен',
'billing.enjoy_msg':
'Насладете се на %% облачно хранилище и други предимства.',
too_many_attempts: 'Твърде много опити. Моля, опитайте отново по-късно.',
server_timeout:
'Сървърът отне твърде много време за отговор. Моля, опитайте отново.',
signup_error:
@@ -391,14 +434,19 @@ const bg = {
window_title_open: 'Отвори',
window_title_change_password: 'Промяна на парола',
window_title_select_font: 'Изберете шрифт…',
window_title_session_list: 'Списък със сесии!',
window_title_set_new_password: 'Задайте нова парола',
window_title_publish_website: 'Публикуване на уебсайт',
window_title_publish_worker: 'Публикуване на Worker',
window_title_authenticating: 'Удостоверяване…',
window_title_refer_friend: 'Препоръчайте приятел!',
// Desktop UI
desktop_exit_full_screen: 'Изход от режим на цял екран',
desktop_enter_full_screen: 'Вход в режим на цял екран',
// Item UI
item_shared_with_you: 'Потребител е споделил този елемент с вас.',
item_shared_by_you:
'Споделили сте този елемент с поне един друг потребител.',
item_shortcut: 'Пряк път',
@@ -410,6 +458,9 @@ const bg = {
window_click_to_go_back: 'Кликнете, за да се върнете назад.',
window_click_to_go_forward: 'Кликнете, за да продължите напред.',
window_click_to_go_up: 'Кликнете, за да отидете една папка нагоре.',
window_title_public: 'Публична',
window_title_videos: 'Видеоклипове',
window_title_pictures: 'Снимки',
window_title_puter: 'Puter',
window_folder_empty: 'Тази папка е празна',
},
+47
View File
@@ -40,10 +40,17 @@ const bn = {
close_all_windows_and_log_out: 'উইন্ডো বন্ধ এবং লগ আউট করুন',
change_always_open_with: 'আপনি কি এই ধরনের ফাইলটি সবসময় এই সাথে খোলা রাখতে চান',
confirm: 'অনুমোদন',
confirm_2fa_setup: '২ ফেক্টর অথেন্টিকেশন সেটাপ নিশ্চিত করুন',
confirm_2fa_recovery: 'আমি আমার পুনরুদ্ধার কোডগুলি একটি নিরাপদ স্থানে সংরক্ষণ করতে চাই',
confirm_account_for_free_referral_storage_c2a: 'একটি অ্যাকাউন্ট তৈরি করুন এবং আপনার ইমেল ঠিকানা নিশ্চিত করুন যাতে ফ্রি ১ জিবি স্টোরেজ পান। আপনার বন্ধুও ১ জিবি ফ্রি স্টোরেজ পাবেন',
confirm_code_generic_incorrect: 'কোডটি সঠিক নয় নিশ্চিত করুন।',
confirm_code_generic_too_many_requests: 'অনুরোধের সংখ্যা বেশি হয়েছে, দয়া করে পরে আবার চেষ্টা করুন।',
confirm_code_generic_submit: 'কোডটি নিশ্চিত করুন',
confirm_code_generic_try_again: 'আবার চেষ্টা করুন',
confirm_code_generic_title: 'শিরোনাম অনুমোদন দিন',
confirm_code_2fa_instruction: 'আপনার অথেন্টিকেশন অ্যাপ্লিকেশন থেকে ৬-ডিজিটের কোডটি প্রবেশ করুন।',
confirm_code_2fa_submit_btn: 'জমা দিন',
confirm_code_2fa_title: '2FA কোড প্রবেশ করুন',
confirm_delete_multiple_items: 'আপনি কি নিশ্চিত যে আপনি এই আইটেমগুলি স্থায়ীভাবে মুছতে চান?',
confirm_delete_single_item: 'আপনি কি এই আইটেমটি স্থায়ীভাবে মুছতে চান?',
confirm_open_apps_log_out: 'আপনার খোলা অ্যাপ আছে। আপনি কি নিশ্চিত যে আপনি লগ আউট করতে চান?',
@@ -53,6 +60,7 @@ const bn = {
confirm_session_revoke: 'আপনি কি নিশ্চিত যে আপনি এই সেশনটি প্রত্যাহার করতে চান?',
confirm_your_email_address: 'আপনার ইমেল ঠিকানা নিশ্চিত করুন',
contact_us: 'যোগাযোগ করুন',
contact_us_verification_required: 'যোগাযোগের জন্য যাচাইকরণ প্রয়োজন',
continue: 'চালিয়ে যান',
copy: 'কপি',
copy_link: 'লিংক কপি করুন',
@@ -74,8 +82,10 @@ const bn = {
deploy_as_app: 'অ্যাপ্লিকেশন হিসেবে ডিপ্লয়',
descending: 'নিম্নক্রমে',
desktop: 'ডেস্কটপ',
desktop_background_fit: 'ফিট',
developers: 'ডেভেলপারগণ',
disable_2fa: '2FA অক্ষম করুন',
disable_2fa_confirm: 'আপনি কি নিশ্চিত যে আপনি 2FA অক্ষম করতে চান?',
disable_2fa_instructions: '2FA অক্ষম করতে আপনার পাসওয়ার্ড লিখুন।',
documents: 'ডকুমেন্টস',
dont_allow: 'অনুমতি নেই',
@@ -105,10 +115,13 @@ const bn = {
forgot_pass_c2a: 'পাসওয়ার্ড ভুলে গেছেন?',
from: 'থেকে',
general: 'সাধারণ',
get_a_copy_of_on_puter: 'পিউটার ডটকমে \'%%\' এর একটি অনুলিপি পান!',
get_copy_link: 'কপি লিংক নিন',
home: 'হোম',
html_document: 'এইচটিএমএল ডকুমেন্ট',
hue: 'হিউ',
incorrect_password: 'ভুল পাসওয়ার্ড',
invite_link: 'আমন্ত্রণ লিংক',
item: 'আইটেম',
items_in_trash_cannot_be_renamed: 'এই আইটেমটি নাম পরিবর্তন করা যাবে না কারণ এটি ট্র্যাশে রয়েছে। এই আইটেমটির নাম পরিবর্তন করতে, প্রথমে এটি ট্র্যাশ থেকে তুলে নিন।',
jpeg_image: 'জেপিইজি ইমেজ',
@@ -119,6 +132,7 @@ const bn = {
loading: 'লোড হচ্ছে',
log_in: 'লগ ইন করুন',
log_out: 'লগ আউট',
looks_good: 'ভাল দেখা যাচ্ছে!',
manage_sessions: 'সেশন পরিচালনা করুন',
modified: 'পরিবর্তিত',
move: 'চলুন',
@@ -143,6 +157,7 @@ const bn = {
open_with: 'দিয়ে খোলুন',
original_name: 'মূল নাম',
original_path: 'মূল পথ',
oss_code_and_content: 'ওপেন সোর্স সফটওয়্যার এবং কন্টেন্ট',
password: 'পাসওয়ার্ড',
password_changed: 'পাসওয়ার্ড পরিবর্তন করা হয়েছে।',
password_recovery_rate_limit: 'আপনি আমাদের রেকভারি সিস্টেমে প্রতি দিনে অধিকতর পাঁচবার ব্যবহার করতে পারবেন না। দয়া করে কয়েক ঘণ্টা অপেক্ষা করুন এবং পুনরায় চেষ্টা করুন।',
@@ -157,19 +172,25 @@ const bn = {
paste: 'পেস্ট',
paste_into_folder: 'ফোল্ডারে পেস্ট করুন',
path: 'পথ',
personalization: 'ব্যক্তিগতীকরণ',
pictures: 'চিত্র',
plural_suffix: 'গুলি',
powered_by_puter_js: '{{link=docs}}Puter.js{{/link}} দ্বারা প্রচালিত',
preparing: 'প্রস্তুতি চলছে...',
preparing_for_upload: 'আপলোডের জন্য প্রস্তুতি চলছে...',
print: 'প্রিন্ট',
privacy: 'গোপনীয়তা',
proceed_to_login: 'লগইনে অগ্রসর হোন',
proceed_with_account_deletion: 'অ্যাকাউন্ট মোছার জন্য অগ্রসর হন',
properties: 'বৈশিষ্ট্য',
public: 'পাবলিক',
publish: 'প্রকাশ করুন',
publish_as_website: 'ওয়েবসাইট হিসাবে প্রকাশ করুন',
puter_description: 'Puter হল একটি গোপনীয়তা-প্রথম ব্যক্তিগত ক্লাউড, যেখানে আপনার সমস্ত ফাইল, অ্যাপ্লিকেশন এবং গেম একটি নিরাপদ জায়গায় রাখা হয়, যেখান থেকে যে কোনো সময় অ্যাক্সেস করা যায়।',
reading_file: '%strong% পড়া হচ্ছে',
recover_password: 'পাসওয়ার্ড পুনরুদ্ধার করুন',
refer_friends_c2a: 'Puter তে অ্যাকাউন্ট তৈরি এবং নিশ্চিতকরণ করে ১ জিবি পান। আপনার বন্ধুও ১ জিবি পাবে!',
refer_friends_social_media_c2a: 'Puter.com এ 1 GB বিনামূল্যের সংরক্ষণ পান!',
refresh: 'রিফ্রেশ',
rename: 'পুনঃনামকরণ',
replace: 'বদলান',
@@ -179,9 +200,11 @@ const bn = {
save: 'সংরক্ষণ করুন',
saturation: 'সম্পৃক্তি',
save_account: 'অ্যাকাউন্ট সংরক্ষণ করুন',
save_account_to_get_copy_link: 'অগ্রসর হতে অ্যাকাউন্ট তৈরি করুন।',
save_account_to_publish: 'অগ্রসর হতে অ্যাকাউন্ট তৈরি করুন।',
save_session: 'সেশন সংরক্ষণ করুন',
save_session_c2a: 'আপনার বর্তমান সেশনটি সংরক্ষণ করতে একটি অ্যাকাউন্ট তৈরি করুন যাতে আপনার কাজ হারাতে না হয়।',
scan_qr_2fa: 'আপনার প্রামাণিকতা অ্যাপ্লিকেশন দিয়ে QR কোডটি স্ক্যান করুন',
search: 'অনুসন্ধান',
seconds: 'সেকেন্ড',
security: 'নিরাপত্তা',
@@ -199,11 +222,13 @@ const bn = {
show_hidden: 'লুকানো দেখান',
sign_in_with_puter: 'Puter দিয়ে সাইন ইন করুন',
sign_up: 'নিবন্ধন করুন',
signing_in: 'সাইন ইন হচ্ছে...',
size: 'আকার',
skip: 'এড়িয়ে যান',
something_went_wrong: 'কিছু সমস্যা হয়েছে।',
sort_by: 'অনুযায়ী সাজান',
status: 'অবস্থা',
storage_usage: 'স্টোরেজ ব্যবহার',
storage_puter_used: 'Puter দ্বারা ব্যবহৃত',
taking_longer_than_usual: 'স্বাভাবিক চেয়ে বেশি সময় নিচ্ছে। অনুগ্রহ করে অপেক্ষা করুন...',
terms: 'শর্তাবলী',
@@ -231,23 +256,29 @@ const bn = {
videos: 'ভিডিও',
visibility: 'দৃশ্যমানতা',
yes: 'হ্যাঁ',
you_have_been_referred_to_puter_by_a_friend: 'আপনাকে একটি বন্ধুর মাধ্যমে পিউটার-এ রেফার করা হয়েছে',
zip: 'জিপ',
zipping_file: '%strong% জিপিং হচ্ছে',
// === 2FA Setup ===
setup2fa_1_step_heading: 'আপনার প্রামাণিকতা অ্যাপ খুলুন',
setup2fa_1_instructions: `
আপনি যেকোনো প্রামাণিকতা অ্যাপ ব্যবহার করতে পারেন যা Time-based One-Time Password (TOTP) প্রোটোকল সমর্থন করে।
অনেক বিকল্প রয়েছে, তবে যদি আপনি নিশ্চিত না হন
<a target="_blank" href="https://authy.com/download">Authy</a>
একটি ভালো পছন্দ Android এবং iOS এর জন্য।
`,
setup2fa_2_step_heading: 'QR কোড স্ক্যান করুন',
setup2fa_3_step_heading: '৬-টি অংকের কোড লিখুন',
setup2fa_4_step_heading: 'আপনার পুনরুদ্ধার কোড কপি করুন',
setup2fa_4_instructions: `
এই পুনরুদ্ধার কোডগুলি আপনার অ্যাকাউন্টে অ্যাক্সেস পাওয়ার একমাত্র উপায় যদি আপনি আপনার ফোন হারান বা আপনার প্রামাণিকতা অ্যাপ ব্যবহার করতে না পারেন।
নিশ্চিত করুন যে আপনি তাদের একটি নিরাপদ জায়গায় সংরক্ষণ করেছেন।
`,
setup2fa_5_step_heading: '2FA সেটআপ নিশ্চিত করুন',
setup2fa_5_confirmation_1: 'আমি আমার পুনরুদ্ধার কোডগুলি একটি নিরাপদ অবস্থানে সংরক্ষণ করেছি',
setup2fa_5_confirmation_2: 'আমি 2FA সক্ষম করার জন্য প্রস্তুত',
setup2fa_5_button: '2FA সক্ষম করুন',
// === 2FA Login ===
login2fa_otp_title: '2FA কোড লিখুন',
@@ -255,6 +286,7 @@ const bn = {
login2fa_recovery_title: 'একটি পুনরুদ্ধার কোড লিখুন',
login2fa_recovery_instructions: 'আপনার অ্যাকাউন্টে অ্যাক্সেস পাওয়ার জন্য আপনার পুনরুদ্ধার কোডগুলির মধ্য থেকে একটি লিখুন।',
login2fa_use_recovery_code: 'একটি পুনরুদ্ধার কোড ব্যবহার করুন',
login2fa_recovery_back: 'পিছনে',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'পরিবর্তন করুন',
@@ -323,13 +355,20 @@ const bn = {
'billing.accelerated': 'ত্বরান্বিত',
'billing.enjoy_msg': '%% ক্লাউড স্টোরেজ এবং অন্যান্য সুবিধা উপভোগ করুন।',
'choose_publishing_option': 'কিভাবে আপনি ওয়েবসাইট পাবলিশ করবেন সেটা বেছে নিনঃ',
'create_desktop_shortcut': 'শর্টকাট তৈরি করুন (ডেস্কটপ)',
'create_desktop_shortcut_s': 'শর্টকাটগুলো তৈরি করুন (ডেস্কটপ)',
'create_shortcut_s': 'শর্টকাটগুলো তৈরি করুন',
'minimize': 'আড়াল করুন',
'reload_app': 'অ্যাপ রিলোড করুন',
'publish_as_serverless_worker': 'কর্মী হিসেবে পাবলিশ করুন',
'toolbar.enter_fullscreen': 'পরিপূর্ণ পর্দায় প্রবেশ করুন',
'toolbar.github': 'গিটহাব',
'toolbar.refer': 'রেফার',
'used_of': '{{used}} ব্যবহৃত হয়েছে {{available}} এর মধ্যে',
'worker': 'কর্মী',
'billing.offering.basic': 'মৌলিক',
'too_many_attempts': 'অনেক বেশী প্রচেষ্টা করা হয়েছে। দয়া করে পরে আবার চেষ্টা করুন।',
'server_timeout': 'সার্ভারটি অনেক বেশী সময় নিয়েছে উত্তর দিতে। দয়া করে আবার চেষ্টা করুন।',
'signup_error': 'সাইনআপ করার সময় একটি ত্রুটি ঘটেছে। দয়া করে আবার চেষ্টা করুন।',
'alert_error_title': 'ত্রুটি!',
@@ -347,10 +386,15 @@ const bn = {
'window_title_open': 'খুলুন',
'window_title_change_password': 'পাসওয়ার্ড পরিবর্তন করুন',
'window_title_select_font': 'ফন্ট নির্বাচন করুন...',
'window_title_session_list': 'সেশন তালিকা!',
'window_title_set_new_password': 'নতুন পাসওয়ার্ড সেট করুন',
'window_title_publish_website': 'ওয়েবসাইট পাবলিশ করুন',
'window_title_publish_worker': 'কর্মী পাবলিশ করুন',
'window_title_authenticating': 'প্রমানীকরণ চলমান...',
'window_title_refer_friend': 'বন্ধুকে রেফার করুন!',
'desktop_exit_full_screen': 'পরিপূর্ণ পর্দা থেকে বের হয়ে যান',
'desktop_enter_full_screen': 'পরিপূর্ণ পর্দায় প্রবেশ করুন',
'item_shared_with_you': 'একজন ব্যবহারকারী এটি আপনার সাথে শেয়ার করেছে।',
'item_shared_by_you': 'আপনি এই বস্তুটি কমপক্ষে একজন ব্যবহারকারীর সাথে শেয়ার করেছেন।',
'item_shortcut': 'শর্টকাট',
'item_associated_websites': 'সংশ্লিষ্ট ওয়েবসাইট',
@@ -359,6 +403,9 @@ const bn = {
'window_click_to_go_back': 'ফিরে যেতে ক্লিক করুন।',
'window_click_to_go_forward': 'এগিয়ে যেতে ক্লিক করুন।',
'window_click_to_go_up': 'এক ডিরেক্টরি উপরে যেতে ক্লিক করুন।',
'window_title_public': 'প্রকাশ্য',
'window_title_videos': 'ভিডিও',
'window_title_pictures': 'ছবি',
'window_title_puter': 'পিউটার',
'window_folder_empty': 'এই ফোল্ডারটি খালি আছে',
+47
View File
@@ -40,10 +40,17 @@ const br = {
close_all_windows_and_log_out: 'Fechar Janelas e Sair',
change_always_open_with: 'Deseja sempre abrir este tipo de arquivo com',
confirm: 'Confirmar',
confirm_2fa_setup: 'Adicionei o código ao meu aplicativo autenticador',
confirm_2fa_recovery: 'Salvei meus códigos de recuperação em um local seguro',
confirm_account_for_free_referral_storage_c2a: 'Crie uma conta e confirme seu endereço de e-mail para receber 1 GB de armazenamento gratuito. Seu amigo também receberá 1 GB de armazenamento gratuito.',
confirm_code_generic_incorrect: 'Código Incorreto.',
confirm_code_generic_too_many_requests: 'Muitas solicitações. Por favor, aguarde alguns minutos.',
confirm_code_generic_submit: 'Enviar Código',
confirm_code_generic_try_again: 'Tente Novamente',
confirm_code_generic_title: 'Digite o Código de Confirmação',
confirm_code_2fa_instruction: 'Digite o código de 6 dígitos do seu aplicativo autenticador.',
confirm_code_2fa_submit_btn: 'Enviar',
confirm_code_2fa_title: 'Digite o Código 2FA',
confirm_delete_multiple_items: 'Tem certeza de que deseja excluir permanentemente estes itens?',
confirm_delete_single_item: 'Deseja excluir permanentemente este item?',
confirm_open_apps_log_out: 'Você tem aplicativos abertos. Tem certeza de que deseja sair?',
@@ -53,6 +60,7 @@ const br = {
confirm_session_revoke: 'Tem certeza de que deseja revogar esta sessão?',
confirm_your_email_address: 'Confirme Seu Endereço de Email',
contact_us: 'Fale Conosco',
contact_us_verification_required: 'Você deve ter um endereço de e-mail verificado para usar isto.',
continue: 'Continuar',
copy: 'Copiar',
copy_link: 'Copiar Link',
@@ -74,8 +82,10 @@ const br = {
deploy_as_app: 'Implantar como aplicativo',
descending: 'Descendente',
desktop: 'Área de Trabalho',
desktop_background_fit: 'Ajustar',
developers: 'Desenvolvedores',
disable_2fa: 'Desativar 2FA',
disable_2fa_confirm: 'Tem certeza de que deseja desativar 2FA?',
disable_2fa_instructions: 'Digite sua senha para desativar 2FA.',
documents: 'Documentos',
dont_allow: 'Não Permitir',
@@ -105,10 +115,13 @@ const br = {
forgot_pass_c2a: 'Esqueceu a senha?',
from: 'De',
general: 'Geral',
get_a_copy_of_on_puter: 'Obtenha uma cópia de \'%%\' em Puter.com!',
get_copy_link: 'Obter Link de Cópia',
home: 'Início',
html_document: 'Documento HTML',
hue: 'Matiz',
incorrect_password: 'Senha incorreta',
invite_link: 'Link de Convite',
item: 'item',
items_in_trash_cannot_be_renamed: 'Este item não pode ser renomeado porque está na lixeira. Para renomear este item, primeiro arraste-o para fora da Lixeira.',
jpeg_image: 'Imagem JPEG',
@@ -119,6 +132,7 @@ const br = {
loading: 'Carregando',
log_in: 'Entrar',
log_out: 'Sair',
looks_good: 'Parece bom!',
manage_sessions: 'Gerenciar Sessões',
modified: 'Modificado',
move: 'Mover',
@@ -143,6 +157,7 @@ const br = {
'open_with': 'Abrir com',
'original_name': 'Nome Original',
'original_path': 'Caminho Original',
'oss_code_and_content': 'Software e Conteúdo de Código Aberto',
'password': 'Senha',
'password_changed': 'Senha alterada.',
'password_recovery_rate_limit': 'Você atingiu nosso limite de tentativas; por favor, aguarde alguns minutos. Para evitar isso no futuro, evite recarregar a página muitas vezes.',
@@ -154,19 +169,25 @@ const br = {
'paste': 'Colar',
'paste_into_folder': 'Colar na Pasta',
'path': 'Caminho',
'personalization': 'Personalização',
'pictures': 'Imagens',
'plural_suffix': 's',
'powered_by_puter_js': 'Desenvolvido por {{link=docs}}Puter.js{{/link}}',
'preparing': 'Preparando...',
'preparing_for_upload': 'Preparando para upload...',
'print': 'Imprimir',
'privacy': 'Privacidade',
'proceed_to_login': 'Prossiga para o login',
'proceed_with_account_deletion': 'Prosseguir com a Exclusão da Conta',
'properties': 'Propriedades',
'public': 'Público',
'publish': 'Publicar',
'publish_as_website': 'Publicar como site',
'puter_description': 'Puter é uma nuvem pessoal que prioriza a privacidade para manter todos os seus arquivos, aplicativos e jogos em um lugar seguro, acessível de qualquer lugar a qualquer momento.',
'reading_file': 'Lendo %strong%',
'recover_password': 'Recuperar Senha',
'refer_friends_c2a': 'Ganhe 1 GB para cada amigo que criar e confirmar uma conta no Puter. Seu amigo também ganhará 1 GB!',
'refer_friends_social_media_c2a': 'Ganhe 1 GB de armazenamento gratuito no Puter.com!',
'refresh': 'Atualizar',
'rename': 'Renomear',
'replace': 'Substituir',
@@ -176,9 +197,11 @@ const br = {
'save': 'Salvar',
'saturation': 'Saturação',
'save_account': 'Salvar conta',
'save_account_to_get_copy_link': 'Por favor, crie uma conta para prosseguir.',
'save_account_to_publish': 'Por favor, crie uma conta para prosseguir.',
'save_session': 'Salvar sessão',
'save_session_c2a': 'Crie uma conta para salvar sua sessão atual e evitar perder seu trabalho.',
'scan_qr_2fa': 'Escaneie o código QR com seu aplicativo autenticador',
'search': 'Buscar',
'seconds': 'segundos',
'security': 'Segurança',
@@ -197,11 +220,13 @@ const br = {
'show_hidden': 'Mostrar ocultos',
'sign_in_with_puter': 'Entrar com Puter',
'sign_up': 'Cadastrar-se',
'signing_in': 'Entrando...',
'size': 'Tamanho',
'skip': 'Pular',
'something_went_wrong': 'Algo deu errado.',
'sort_by': 'Ordenar por',
'status': 'Status',
'storage_usage': 'Uso de Armazenamento',
'storage_puter_used': 'usado pelo Puter',
'taking_longer_than_usual': 'Levando um pouco mais de tempo do que o normal. Por favor, aguarde...',
'terms': 'Termos',
@@ -229,23 +254,29 @@ const br = {
'videos': 'Vídeos',
'visibility': 'Visibilidade',
'yes': 'Sim',
'you_have_been_referred_to_puter_by_a_friend': 'Você foi indicado ao Puter por um amigo!',
'zip': 'Compactar',
'zipping_file': 'Compactando %strong%',
// === 2FA Setup ===
'setup2fa_1_step_heading': 'Abra seu aplicativo autenticador',
'setup2fa_1_instructions': `
Você pode usar qualquer aplicativo autenticador que suporte o protocolo de Senha de Uso Único com Base em Tempo (TOTP).
Existem muitas opções, mas se você não tiver certeza
<a target='_blank' href='https://authy.com/download'>Authy</a>
é uma escolha sólida para Android e iOS.
`,
'setup2fa_2_step_heading': 'Escaneie o código QR',
'setup2fa_3_step_heading': 'Digite o código de 6 dígitos',
'setup2fa_4_step_heading': 'Copie seus códigos de recuperação',
'setup2fa_4_instructions': `
Esses códigos de recuperação são a única maneira de acessar sua conta se você perder seu telefone ou não puder usar seu aplicativo autenticador.
Certifique-se de armazená-los em um lugar seguro.
`,
'setup2fa_5_step_heading': 'Confirme a configuração do 2FA',
'setup2fa_5_confirmation_1': 'Salvei meus códigos de recuperação em um local seguro',
'setup2fa_5_confirmation_2': 'Estou pronto para ativar o 2FA',
'setup2fa_5_button': 'Ativar 2FA',
// === 2FA Login ===
'login2fa_otp_title': 'Digite o Código 2FA',
@@ -253,6 +284,7 @@ const br = {
'login2fa_recovery_title': 'Digite um código de recuperação',
'login2fa_recovery_instructions': 'Digite um dos seus códigos de recuperação para acessar sua conta.',
'login2fa_use_recovery_code': 'Usar um código de recuperação',
'login2fa_recovery_back': 'Voltar',
'login2fa_recovery_placeholder': 'XXXXXXXX',
'change': 'Alterar', // In English: "Change"
@@ -317,13 +349,20 @@ const br = {
'billing.accelerated': 'Aprimorado', // In English: "Accelerated"
'billing.enjoy_msg': 'Aproveite %% de Armazenamento em Nuvem, além de outros benefícios.', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'Escolha como você gostaria de publicar seu site', // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': 'Criar atalho (Área de Trabalho)', // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'Criar atalhos (Área de Trabalho)', // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'Criar atalhos', // In English: "Create Shortcuts"
'minimize': 'Minimizar', // In English: "Minimize"
'reload_app': 'Recarregar App', // In English: "Reload App"
'publish_as_serverless_worker': 'Publicar como Worker', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'Entrar em Tela Cheia', // In English: "Enter Full Screen"
'toolbar.github': 'GitHub', // In English: "GitHub"
'toolbar.refer': 'Indicar', // In English: "Refer"
'used_of': '{{used}} utilizado de {{available}} disponível', // In English: "{{used}} used of {{available}}"
'worker': 'Worker', // In English: "Worker"
'billing.offering.basic': 'Básico', // In English: "Basic"
'too_many_attempts': 'Muitas tentativas. Por favor, tente novamente mais tarde.', // In English: "Too many attempts. Please try again later."
'server_timeout': 'O servidor demorou muito para responder. Por favor, tente novamente mais tarde.', // In English: "The server took too long to respond. Please try again."
'signup_error': 'Ocorreu um erro durante o registro. Por favor, tente novamente mais tarde.', // In English: "An error occurred during signup. Please try again."
'alert_error_title': 'Erro!', // In English: "Error!"
@@ -341,10 +380,15 @@ const br = {
'window_title_open': 'Abrir', // In English: "Open"
'window_title_change_password': 'Mudar Senha', // In English: "Change Password"
'window_title_select_font': 'Selecionar', // In English: "Select font…"
'window_title_session_list': 'Lista de Sessões!', // In English: "Session List!"
'window_title_set_new_password': 'Definir Nova Senha', // In English: "Set New Password"
'window_title_publish_website': 'Publicar site', // In English: "Publish Website"
'window_title_publish_worker': 'Publicar Worker', // In English: "Publish Worker"
'window_title_authenticating': 'Autenticando...', // In English: "Authenticating..."
'window_title_refer_friend': 'Indicar um amigo!', // In English: "Refer a friend!"
'desktop_exit_full_screen': 'Sair de Tela Cheia', // In English: "Exit Full Screen"
'desktop_enter_full_screen': 'Entrar em Tela Cheia', // In English: "Enter Full Screen"
'item_shared_with_you': 'Um usuário compartilhou este item com você.', // In English: "A user has shared this item with you."
'item_shared_by_you': 'Você compartilhou este item com pelo menos um usuário.', // In English: "You have shared this item with at least one other user."
'item_shortcut': 'Atalho', // In English: "Shortcut"
'item_associated_websites': 'Site associado', // In English: "Associated website"
@@ -353,6 +397,9 @@ const br = {
'window_click_to_go_back': 'Clique para retornar.', // In English: "Click to go back."
'window_click_to_go_forward': 'Clique para avançar.', // In English: "Click to go forward."
'window_click_to_go_up': 'Clique para voltar uma pasta.', // In English: "Click to go one directory up."
'window_title_public': 'Público', // In English: "Public"
'window_title_videos': 'Vídeos', // In English: "Videos"
'window_title_pictures': 'Imagens', // In English: "Pictures"
'window_title_puter': 'Puter', // In English: "Puter"
'window_folder_empty': 'Esta pasta está vazia', // In English: "This folder is empty"
+91
View File
@@ -62,6 +62,7 @@ const cs = {
"app_group_remove_from_folder": "Odebrat ze složky",
"associated_websites": "Přidružené weby",
"app_feedback_sent": "Zpětná vazba byla odeslána. Děkujeme!",
"browser_version": "Verze prohlížeče",
"change_language": "Změnit jazyk",
"captcha_required": "Dokončete prosím ověření CAPTCHA",
"change_username": "Změnit uživatelské jméno",
@@ -72,19 +73,29 @@ const cs = {
"close": "Zavřít",
"change_email": "Změnit e-mail",
"revalidated": "Znovu ověřeno.",
"color_depth": "Barevná hloubka",
"revalidate_with_google": "Znovu ověřte pomocí Googlu",
"confirm": "Potvrdit",
"revalidate_sign_in_popup": "Ve vyskakovacím okně se přihlaste pomocí svého propojeného účtu.",
"confirm_code_generic_try_again": "Zkuste to znovu",
"confirm_code_generic_submit": "Odeslat kód",
"confirm_code_generic_title": "Zadejte potvrzovací kód",
"confirm_code_generic_incorrect": "Nesprávný kód.",
"confirm_code_2fa_submit_btn": "Potvrdit",
"confirm_2fa_recovery": "Uložil jsem své kódy pro obnovení na bezpečné místo",
"confirm_code_2fa_instruction": "Zadejte 6místný kód z aplikace pro ověřování.",
"confirm_continue_as": "Pokračovat jako <strong>{{username}}</strong>?<p>Tento odkaz vás přihlásí k danému účtu. Vše, co vytvoříte – soubory, nahraná videa, chaty – tam bude uloženo a viditelné pro každého, kdo to vlastní. Pokračujte, pouze pokud je účet váš.</p>",
"confirm_new_password": "Potvrďte nové heslo",
"confirm_code_generic_too_many_requests": "Příliš mnoho požadavků. Počkejte prosím několik minut.",
"confirm_2fa_setup": "Přidal jsem kód do své aplikace pro ověřování",
"close_all_windows_and_log_out": "Zavřít všechna okna a odhlásit se",
"confirm_delete_user_title": "Smazat účet?",
"confirm_delete_multiple_items": "Opravdu chcete tyto položky trvale smazat?",
"confirm_code_2fa_title": "Zadejte 2FA kód",
"contact_us": "Kontaktujte nás",
"confirm_open_apps_log_out": "Máte otevřené aplikace. Opravdu se chcete odhlásit?",
"confirm_delete_user": "Opravdu chcete trvale smazat svůj účet? Všechny vaše soubory a data budou odstraněny. Tuto akci nelze vrátit zpět.",
"choose_publishing_option": "Vyberte, jak chcete svůj web publikovat:",
"confirm_delete_single_item": "Chcete tuto položku trvale smazat?",
"confirm_revoke_all_other_sessions": "Zrušit všechny ostatní relace? Zde zůstanete přihlášeni.",
"confirm_your_email_address": "Potvrďte svou e-mailovou adresu",
@@ -94,12 +105,16 @@ const cs = {
"create_account": "Vytvořit účet",
"continue": "Pokračovat",
"cpu": "CPU",
"contact_us_verification_required": "Abyste to mohli používat, musíte mít ověřenou e-mailovou adresu.",
"create_desktop_shortcut": "Vytvořit zástupce na ploše",
"copying_file": "Kopírování %%",
"create_desktop_shortcut_s": "Vytvořit zástupce na ploše",
"credits": "Kredity",
"current_password": "Aktuální heslo",
"cut": "Vyjmout",
"close_all": "Zavřít vše",
"created": "Vytvořeno",
"cpu_cores": "CPU jádra",
"change_icon": "Změnit ikonu",
"create_free_account": "Vytvořit bezplatný účet",
"create_shortcut": "Vytvořit zástupce",
@@ -108,20 +123,24 @@ const cs = {
"delete_permanently": "Trvale smazat",
"delete_account": "Smazat účet",
"desktop": "Plocha",
"desktop_background_fit": "Přizpůsobit",
"descending": "Klesající",
"developers": "Vývojáři",
"disable_2fa": "Zakázat 2FA",
"deleting_file": "Mazání %%",
"directory_depth_limit_exceeded": "Tato složka je vnořena příliš hluboko. Než do ní přidáte další složky, přesuňte ji někam blíže ke kořeni.",
"disable_2fa_confirm": "Opravdu chcete deaktivovat 2FA?",
"documents": "Dokumenty",
"dont_allow": "Nepovolit",
"date_modified": "Datum změny",
"create_shortcut_s": "Vytvořte zástupce",
"deploy_as_app": "Nasadit jako aplikaci",
"client_information": "Informace o klientovi",
"download": "Stáhnout",
"download_file": "Stáhnout soubor",
"email": "E-mail",
"email_change_confirmation_sent": "Na novou e-mailovou adresu byl odeslán potvrzovací e-mail. Zkontrolujte doručenou poštu a dokončete postup podle pokynů.",
"disk_storage": "Diskové úložiště",
"email_invalid": "E-mail je neplatný.",
"disable_2fa_instructions": "Pro deaktivaci 2FA zadejte své heslo.",
"email_required": "E-mail je povinný.",
@@ -145,6 +164,7 @@ const cs = {
"home": "Domů",
"hue": "Odstín",
"incorrect_password": "Nesprávné heslo",
"get_a_copy_of_on_puter": "Získejte kopii '%%' na Puter.com!",
"enter_password_to_confirm_delete_user": "Pro potvrzení smazání účtu zadejte své heslo",
"error_unknown_cause": "Došlo k neznámé chybě.",
"error_message_is_missing": "Chybí chybová zpráva.",
@@ -156,10 +176,13 @@ const cs = {
"link_copied": "Odkaz zkopírován",
"loading": "Načítání",
"jpeg_image": "obrázek JPEG",
"get_copy_link": "Získat odkaz ke kopírování",
"keep_both": "Nechte si obojí",
"html_document": "HTML dokument",
"invite_link": "Odkaz na pozvánku",
"log_in": "Přihlásit se",
"log_out": "Odhlásit se",
"looks_good": "Vypadá to dobře!",
"move": "Přesunout",
"minimize": "Minimalizovat",
"modified": "Upraveno",
@@ -187,6 +210,8 @@ const cs = {
"open_with_ai": "Otevřít pomocí AI",
"os": "Operační systém",
"name_must_be_string": "Název může být pouze řetězec.",
"oss_code_and_content": "Software a obsah s otevřeným zdrojovým kódem",
"os_version": "Verze OS",
"password": "Heslo",
"password_changed": "Heslo bylo změněno.",
"password_recovery_unknown_error": "Došlo k neznámé chybě. Zkuste to znovu později.",
@@ -195,6 +220,7 @@ const cs = {
"password_required": "Heslo je povinné.",
"open_with": "Otevřít pomocí",
"path": "Cesta",
"personalization": "Personalizace",
"paste": "Vložit",
"password_strength_error": "Heslo musí mít alespoň 8 znaků a obsahovat alespoň jedno velké písmeno, jedno malé písmeno, jednu číslici a jeden speciální znak.",
"phone_country_label": "Země",
@@ -225,17 +251,23 @@ const cs = {
"preparing": "Příprava...",
"print": "Vytisknout",
"privacy": "Soukromí",
"powered_by_puter_js": "Používá technologii {{link=docs}}Puter.js{{/link}}",
"proceed_with_account_deletion": "Pokračujte ve smazání účtu",
"phone_code_sent_whatsapp": "Zadejte 6místný kód odeslaný přes WhatsApp na",
"phone_code_sent_to": "Zadejte 6místný kód odeslaný na",
"properties": "Vlastnosti",
"publish": "Publikovat",
"public": "Veřejné",
"ram": "RAM",
"preparing_for_upload": "Příprava na nahrání...",
"pixel_ratio": "Poměr pixelů",
"proceed_to_login": "Pokračovat k přihlášení",
"publish_as_website": "Publikovat jako web",
"refresh": "Obnovit",
"puter_description": "Puter je osobní cloud zaměřený na ochranu soukromí, který uchovává všechny vaše soubory, aplikace a hry na jednom bezpečném místě, které jsou dostupné odkudkoli a kdykoli.",
"rename": "Přejmenovat",
"replace": "Nahradit",
"refer_friends_social_media_c2a": "Získejte 1 GB úložného prostoru zdarma na Puter.com!",
"reading": "Čtení %strong%",
"writing": "Psaní %strong%",
"Resources": "Zdroje",
@@ -246,27 +278,53 @@ const cs = {
"recover_password": "Obnovit heslo",
"publish_as_serverless_worker": "Publikovat jako pracovník",
"save_session": "Uložit relaci",
"save_account_to_get_copy_link": "Chcete-li pokračovat, vytvořte si účet.",
"resend_confirmation_code": "Znovu odeslat potvrzovací kód",
"scan_qr_2fa": "Naskenujte QR kód pomocí aplikace pro ověřování",
"save_account_to_publish": "Chcete-li pokračovat, vytvořte si účet.",
"seconds": "sekundy",
"search": "Hledat",
"save_session_c2a": "Vytvořte si účet pro uložení aktuální relace a vyhněte se ztrátě své práce.",
"security": "Zabezpečení",
"screen_resolution": "Rozlišení obrazovky",
"select": "Vybrat",
"send": "Odeslat",
"sessions": "Relace",
"selected": "vybráno",
"server_information": "Informace o serveru",
"settings": "Nastavení",
"keyboard_shortcuts": "Klávesové zkratky",
"keyboard_shortcuts_action": "Akce",
"session_saved": "Děkujeme za vytvoření účtu. Tato relace byla uložena.",
"send_password_recovery_email": "Odeslat e-mail pro obnovení hesla",
"save_account": "Uložit účet",
"keyboard_shortcuts_shortcut": "Zkratka",
"keyboard_shortcuts_navigation": "Navigace",
"keyboard_shortcuts_general": "Obecné",
"keyboard_shortcuts_search": "Otevřít vyhledávání",
"keyboard_shortcuts_select_all": "Vybrat všechny položky",
"keyboard_shortcuts_intro": "Naučte se nejužitečnější zkratky pro rychlejší navigaci v Puteru.",
"keyboard_shortcuts_files": "Soubory a schránka",
"keyboard_shortcuts_undo": "Vrátit zpět poslední akci",
"keyboard_shortcuts_open_item": "Otevřít vybranou položku",
"keyboard_shortcuts_close_window": "Zavřít aktivní okno",
"keyboard_shortcuts_arrow_navigation": "Procházet nabídky a výběry",
"keyboard_shortcuts_type_to_select": "Zadat název položky a přejít na ni",
"keyboard_shortcuts_open_help": "Otevřít tuto příručku klávesových zkratek",
"keyboard_shortcuts_close_menus": "Zavřít dialogová okna, nabídky a vyskakovací okna",
"share": "Sdílet",
"share_ellipsis": "Sdílet…",
"keyboard_shortcuts_copy": "Kopírovat vybrané položky",
"keyboard_shortcuts_type_to_select_keys": "Zadat písmena nebo čísla",
"keyboard_shortcuts_cut": "Vyjmout vybrané položky",
"keyboard_shortcuts_paste": "Vložit položky",
"share_to": "Sdílet s",
"set_new_password": "Nastavit nové heslo",
"shared": "Sdíleno",
"share_access_level": "Úroveň přístupu",
"keyboard_shortcuts_permanent_delete": "Trvale smazat (po potvrzení)",
"share_access_level_for": "Úroveň přístupu pro {{recipient}}",
"keyboard_shortcuts_delete": "Přesunout vybrané položky do koše",
"shared_by": "Sdíleno uživatelem",
"shared_with_me": "Sdíleno se mnou",
"share_access_write": "Může upravovat",
@@ -276,9 +334,11 @@ const cs = {
"share_owner": "Majitel",
"share_done": "Hotovo",
"share_no_one": "Zatím s nikým nesdíleno.",
"share_remove_access_for": "Odebrat přístup pro {{recipient}}",
"share_shared_with": "Sdíleno s {{recipient}}",
"share_failed": "Tuto položku nelze sdílet.",
"share_add_people": "Přidejte lidi pomocí e-mailu nebo uživatelského jména",
"share_nothing_shared": "Zatím s vámi nebylo nic sdíleno.",
"share_awaiting_signup": "Pozván",
"share_invited": "Pozván {{recipient}} – přístup získá po registraci",
"share_cancel_invite": "Zrušit pozvánku",
@@ -290,6 +350,7 @@ const cs = {
"share_confirm_remove": "Odebrat uživateli {{recipient}} přístup k této položce?",
"share_invite_cancelled": "Pozvánka do {{recipient}} byla zrušena",
"share_access_removed": "Odebráno {{recipient}}",
"share_cancel_invite_for": "Zrušit pozvánku do {{recipient}}",
"share_access_updated": "Aktualizován přístup pro {{recipient}}",
"share_confirm_cancel_invite": "Zrušit pozvánku odeslanou uživateli {{recipient}}?",
"manage": "Spravovat",
@@ -311,6 +372,7 @@ const cs = {
"share_inherited_via": "přes {{folder}}",
"sign_in": "Přihlásit se",
"size": "Velikost",
"signing_in": "Přihlašování…",
"sign_up": "Vytvořit účet",
"skip": "Přeskočit",
"something_went_wrong": "Něco se pokazilo. Zkuste to prosím znovu.",
@@ -318,11 +380,15 @@ const cs = {
"Storage": "Úložiště",
"blocked_added": "Blokováno {{username}}",
"storage_puter_used": "používá Puter",
"storage_usage": "Využití úložiště",
"sign_in_with_puter": "Přihlásit se pomocí Puteru",
"your_plan": "Váš plán",
"show_hidden": "Zobrazit skryté",
"sort_by": "Seřadit podle",
"terms": "Podmínky",
"toolbar.enter_fullscreen": "Přejít na celou obrazovku",
"toolbar.github": "GitHub",
"toolbar.refer": "Odkázat",
"transparency": "Průhlednost",
"taking_longer_than_usual": "Trvá to trochu déle než obvykle. Čekejte prosím...",
"trash": "Koš",
@@ -334,10 +400,13 @@ const cs = {
"text_document": "Textový dokument",
"two_factor_disabled": "2FA vypnuto",
"ui_revoke": "Zrušit",
"ui_session_app": "Aplikace",
"ui_session_client": "Klient",
"tos_fineprint": "Registrací vyjadřujete souhlas s {{link=terms}}smluvními podmínkami{{/link}} a {{link=privacy}}zásadami ochrany soukromí{{/link}} společnosti Puter.",
"ui_session_created": "Vytvořeno",
"ui_session_current": "Aktuální",
"ui_session_expires": "Platnost vyprší",
"ui_session_ip": "IP",
"ui_manage_sessions": "Spravovat relace",
"ui_search": "Hledat relace…",
"ui_session_count_one": "1 aktivní relace",
@@ -372,19 +441,26 @@ const cs = {
"worker": "Pracovník",
"tar": "Archiv TAR",
"sequencing": "Sekvenování %strong%",
"you_have_been_referred_to_puter_by_a_friend": "Přítel vás doporučil do Puteru!",
"setup2fa_1_step_heading": "Otevřít ověřovací aplikaci",
"zipping": "Komprimování %strong%",
"used_of": "{{used}} využito z {{available}}",
"username_changed": "Uživatelské jméno bylo úspěšně změněno.",
"tarring": "Vytváření archivu TAR %strong%",
"setup2fa_2_step_heading": "Naskenujte QR kód",
"setup2fa_5_confirmation_1": "Uložil jsem své kódy pro obnovení na bezpečné místo",
"setup2fa_5_button": "Povolit 2FA",
"login2fa_otp_title": "Zadejte 2FA kód",
"setup2fa_1_instructions": "Naskenujte QR kód pomocí ověřovací aplikace a poté zadejte 6místný kód, který aplikace vygeneruje.",
"login2fa_otp_instructions": "Zadejte 6místný kód z aplikace pro ověřování.",
"login2fa_recovery_title": "Zadejte kód pro obnovení",
"login2fa_use_recovery_code": "Použijte kód pro obnovení",
"download_as_tar": "Stáhnout jako archiv TAR",
"setup2fa_4_step_heading": "Zkopírujte své kódy pro obnovení",
"setup2fa_3_step_heading": "Zadejte 6místný kód",
"setup2fa_5_confirmation_2": "Jsem připraven povolit 2FA",
"setup2fa_5_step_heading": "Potvrďte nastavení 2FA",
"login2fa_recovery_back": "Zpět",
"Editor": "Editor",
"Owner": "Majitel",
"login2fa_recovery_instructions": "Chcete-li získat přístup k účtu, zadejte jeden ze svých obnovovacích kódů.",
@@ -450,6 +526,7 @@ const cs = {
"billing.download_receipt": "Stáhnout potvrzení",
"billing.current_plan": "Aktuální plán",
"auth_error_generic": "Ověření se nezdařilo. Zkuste to prosím znovu.",
"too_many_attempts": "Příliš mnoho pokusů. Zkuste to znovu později.",
"welcome": "Vítejte",
"signup_blocked_message": "Váš účet se nepodařilo vytvořit.",
"signup_error": "Při registraci došlo k chybě. Zkuste to prosím znovu.",
@@ -485,12 +562,20 @@ const cs = {
"window_title_select_font": "Vybrat písmo…",
"window_title_publish_website": "Publikovat webové stránky",
"sign_up_with_email": "Zaregistrujte se pomocí e-mailu",
"window_title_refer_friend": "Doporučte příteli!",
"window_title_session_list": "Seznam relací!",
"desktop_enter_full_screen": "Přejít na celou obrazovku",
"item_shortcut": "Zkratka",
"item_shared_by_you": "Tuto položku jste sdíleli s alespoň jedním dalším uživatelem.",
"item_shared_with_you": "Tuto položku s vámi sdílí uživatel.",
"window_click_to_go_up": "Kliknutím přejdete o jeden adresář nahoru.",
"window_title_public": "Veřejné",
"window_title_videos": "Videa",
"window_title_pictures": "Obrázky",
"window_folder_empty": "Tato složka je prázdná",
"item_associated_websites": "Přidružený web",
"window_click_to_go_back": "Kliknutím se vrátíte zpět.",
"desktop_exit_full_screen": "Ukončit režim celé obrazovky",
"no_suitable_apps_found": "Nebyly nalezeny žádné vhodné aplikace",
"window_title_puter": "Puter",
"item_associated_websites_plural": "Přidružené webové stránky",
@@ -512,12 +597,16 @@ const cs = {
"perm_app_data_store_all": "číst, měnit a mazat {{subject}}.",
"perm_app_data_all": "číst, měnit a mazat vše, co pro vás {{app}} uložil, včetně všech uložených přihlašovacích údajů.",
"approve": "Schválit",
"copy_token_message": "Váš ověřovací token je zobrazen níže. Uchovejte jej v tajnosti – kdokoli s tímto tokenem má přístup k vašemu účtu.",
"perm_dialog_footnote": "Toto můžete kdykoli změnit v Nastavení.",
"auth_token": "Ověřovací token",
"error_user_or_path_not_found": "Uživatel nebo cesta nenalezena.",
"token_copied": "Token zkopírován",
"copy_auth_token": "Kopírovat ověřovací token",
"perm_dialog_wants_to": "chce povolení",
"token_label": "Označení",
"token_label_required": "Zadejte štítek pro tento token.",
"copy_token_description": "Zobrazit a zkopírovat ověřovací token",
"create_api_token": "Vytvořit token API",
"token_label_placeholder": "např. Moje CLI, akce GitHubu",
"create_token": "Vytvořit token",
@@ -538,8 +627,10 @@ const cs = {
"redirect_destination": "Cíl přesměrování",
"authorization_cancelled_desc": "Zamítli jste žádost o autorizaci.",
"external_site_auth_request": "Aplikace požaduje přístup k vašemu účtu.",
"your_auth_token": "Váš ověřovací token",
"authorization_cancelled_message": "Aplikace nezíská přístup k vašemu účtu. Toto okno můžete bezpečně zavřít.",
"token_manage_hint": "Tento token můžete kdykoli odvolat pod",
"authme_security_warning": "Váš ověřovací token bude sdílen s touto aplikací za účelem dokončení přihlášení.",
"authme_full_token_request": "Aplikace požaduje token s úplným přístupem k vašemu účtu.",
"shared_full_token_item_account": "Změňte své heslo, e-mailovou adresu a dvoufaktorová nastavení",
"shared_full_token_note": "Toto není omezený token API. Pokračujte pouze v případě, že jste s tím začali sami a zcela důvěřujete výše uvedenému cíli. Můžete jej zrušit v Nastavení → Zabezpečení → Spravovat relace.",
+47
View File
@@ -40,10 +40,17 @@ const da = {
close_all_windows_and_log_out: 'Luk vinduer og log ud',
change_always_open_with: 'Vil du altid åbne denne filtype med',
confirm: 'Bekræft',
confirm_2fa_setup: 'Jeg har tilføjet koden til min autentifikator-app',
confirm_2fa_recovery: 'Jeg har gemt mine gendannelseskoder på et sikkert sted',
confirm_account_for_free_referral_storage_c2a: 'Opret en konto og bekræft din e-mailadresse for at modtage 1 GB gratis lagerplads. Din ven vil også få 1 GB gratis lagerplads.',
confirm_code_generic_incorrect: 'Forkert kode.',
confirm_code_generic_too_many_requests: 'For mange anmodninger. Vent et par minutter.',
confirm_code_generic_submit: 'Indsend kode',
confirm_code_generic_try_again: 'Prøv igen',
confirm_code_generic_title: 'Indtast bekræftelseskode',
confirm_code_2fa_instruction: 'Indtast den 6-cifrede kode fra din autentifikator-app.',
confirm_code_2fa_submit_btn: 'Indsend',
confirm_code_2fa_title: 'Indtast 2FA-kode',
confirm_delete_multiple_items: 'Er du sikker på, at du vil slette disse elementer permanent?',
confirm_delete_single_item: 'Vil du slette dette element permanent?',
confirm_open_apps_log_out: 'Du har åbne apps. Er du sikker på, at du vil logge ud?',
@@ -53,6 +60,7 @@ const da = {
confirm_session_revoke: 'Er du sikker på, at du vil tilbagekalde denne session?',
confirm_your_email_address: 'Bekræft din e-mailadresse',
contact_us: 'Kontakt os',
contact_us_verification_required: 'Du skal have en verificeret e-mailadresse for at bruge dette.',
continue: 'Fortsæt',
copy: 'Kopier',
copy_link: 'Kopier link',
@@ -74,8 +82,10 @@ const da = {
deploy_as_app: 'Implementer som app',
descending: 'Faldende',
desktop: 'Skrivebord',
desktop_background_fit: 'Tilpas',
developers: 'Udviklere',
disable_2fa: 'Deaktiver 2FA',
disable_2fa_confirm: 'Er du sikker på, at du vil deaktivere 2FA?',
disable_2fa_instructions: 'Indtast din adgangskode for at deaktivere 2FA.',
documents: 'Dokumenter',
dont_allow: 'Tillad ikke',
@@ -105,10 +115,13 @@ const da = {
forgot_pass_c2a: 'Glemt adgangskode?',
from: 'Fra',
general: 'Generelt',
get_a_copy_of_on_puter: 'Få en kopi af \'%%\' på Puter.com!',
get_copy_link: 'Få kopi-link',
home: 'Hjem',
html_document: 'HTML-dokument',
hue: 'Farvetone',
incorrect_password: 'Forkert adgangskode',
invite_link: 'Inviter link',
item: 'element',
items_in_trash_cannot_be_renamed: 'Dette element kan ikke omdøbes, fordi det er i papirkurven. For at omdøbe dette element, skal du først trække det ud af papirkurven.',
jpeg_image: 'JPEG-billede',
@@ -119,6 +132,7 @@ const da = {
loading: 'Indlæser',
log_in: 'Log ind',
log_out: 'Log ud',
looks_good: 'Ser godt ud!',
manage_sessions: 'Administrer sessioner',
modified: 'Ændret',
move: 'Flyt',
@@ -143,6 +157,7 @@ const da = {
open_with: 'Åbn med',
original_name: 'Originalt navn',
original_path: 'Original sti',
oss_code_and_content: 'Open Source Software og indhold',
password: 'Adgangskode',
password_changed: 'Adgangskode ændret.',
password_recovery_rate_limit: 'Du har nået vores rate-limit; vent venligst et par minutter. For at undgå dette i fremtiden, undgå at genindlæse siden for mange gange.',
@@ -154,19 +169,25 @@ const da = {
paste: 'Sæt ind',
paste_into_folder: 'Sæt ind i mappe',
path: 'Sti',
personalization: 'Personalisering',
pictures: 'Billeder',
plural_suffix: 's',
powered_by_puter_js: 'Udviklet af {{link=docs}}Puter.js{{/link}}',
preparing: 'Forbereder...',
preparing_for_upload: 'Forbereder til upload...',
print: 'Udskriv',
privacy: 'Privatliv',
proceed_to_login: 'Fortsæt til login',
proceed_with_account_deletion: 'Fortsæt med sletning af konto',
properties: 'Egenskaber',
public: 'Offentlig',
publish: 'Offentliggør',
publish_as_website: 'Offentliggør som websted',
puter_description: 'Puter er en privatlivsorienteret personlig sky til at opbevare alle dine filer, apps og spil på ét sikkert sted, tilgængeligt fra hvor som helst, når som helst.',
reading_file: 'Læser %strong%',
recover_password: 'Gendan adgangskode',
refer_friends_c2a: 'Få 1 GB for hver ven, der opretter og bekræfter en konto på Puter. Din ven vil også få 1 GB!',
refer_friends_social_media_c2a: 'Få 1 GB gratis lagerplads på Puter.com!',
refresh: 'Opdater',
rename: 'Omdøb',
replace: 'Erstat',
@@ -176,9 +197,11 @@ const da = {
save: 'Gem',
saturation: 'Mætning',
save_account: 'Gem konto',
save_account_to_get_copy_link: 'Opret venligst en konto for at fortsætte.',
save_account_to_publish: 'Opret venligst en konto for at fortsætte.',
save_session: 'Gem session',
save_session_c2a: 'Opret en konto for at gemme din nuværende session og undgå at miste dit ændringer.',
scan_qr_2fa: 'Scan QR-koden med din autentifikator-app',
search: 'Søg',
seconds: 'sekunder',
security: 'Sikkerhed',
@@ -196,11 +219,13 @@ const da = {
show_hidden: 'Vis skjulte',
sign_in_with_puter: 'Log ind med Puter',
sign_up: 'Tilmeld dig',
signing_in: 'Logger ind…',
size: 'Størrelse',
skip: 'Spring over',
something_went_wrong: 'Noget gik galt.',
sort_by: 'Sorter efter',
status: 'Status',
storage_usage: 'Lagerforbrug',
storage_puter_used: 'brugt af Puter',
taking_longer_than_usual: 'Tager lidt længere tid end normalt. Vent venligst...',
terms: 'Vilkår',
@@ -228,23 +253,29 @@ const da = {
videos: 'Videoer',
visibility: 'Synlighed',
yes: 'Ja',
you_have_been_referred_to_puter_by_a_friend: 'Du er blevet henvist til Puter af en ven!',
zip: 'Zip',
zipping_file: 'Zipper %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Åbn din autentifikator-app',
setup2fa_1_instructions: `
Du kan bruge enhver autentifikator-app, der understøtter Time-based One-Time Password (TOTP) protokollen.
Der er mange at vælge imellem, men hvis du er usikker
<a target="_blank" href="https://authy.com/download">Authy</a>
er et solidt valg til Android og iOS.
`,
setup2fa_2_step_heading: 'Scan QR-koden',
setup2fa_3_step_heading: 'Indtast den 6-cifrede kode',
setup2fa_4_step_heading: 'Kopier dine gendannelseskoder',
setup2fa_4_instructions: `
Disse gendannelseskoder er den eneste måde at få adgang til din konto, hvis du mister din telefon eller ikke kan bruge din autentifikator-app.
Sørg for at opbevare dem på et sikkert sted.
`,
setup2fa_5_step_heading: 'Bekræft 2FA-opsætning',
setup2fa_5_confirmation_1: 'Jeg har gemt mine gendannelseskoder på et sikkert sted',
setup2fa_5_confirmation_2: 'Jeg er klar til at aktivere 2FA',
setup2fa_5_button: 'Aktivér 2FA',
// === 2FA Login ===
login2fa_otp_title: 'Indtast 2FA-kode',
@@ -252,6 +283,7 @@ const da = {
login2fa_recovery_title: 'Indtast en gendannelseskode',
login2fa_recovery_instructions: 'Indtast en af dine gendannelseskoder for at få adgang til din konto.',
login2fa_use_recovery_code: 'Brug en gendannelseskode',
login2fa_recovery_back: 'Tilbage',
login2fa_recovery_placeholder: 'XXXXXXXX',
change: 'Skift',
@@ -317,10 +349,16 @@ const da = {
// =============================================================
// Missing translations
// =============================================================
'choose_publishing_option': undefined, // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': undefined, // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': undefined, // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': undefined, // In English: "Create Shortcuts"
'minimize': undefined, // In English: "Minimize"
'reload_app': undefined, // In English: "Reload App"
'publish_as_serverless_worker': undefined, // In English: "Publish as Worker"
'toolbar.enter_fullscreen': undefined, // In English: "Enter Full Screen"
'toolbar.github': undefined, // In English: "GitHub"
'toolbar.refer': undefined, // In English: "Refer"
'used_of': undefined, // In English: "{{used}} used of {{available}}"
'worker': undefined, // In English: "Worker"
'People with access': undefined, // In English: "People with access"
@@ -375,6 +413,7 @@ const da = {
'billing.expanded': undefined, // In English: "Expanded"
'billing.accelerated': undefined, // In English: "Accelerated"
'billing.enjoy_msg': undefined, // In English: "Enjoy %% of Cloud Storage plus other benefits."
'too_many_attempts': undefined, // In English: "Too many attempts. Please try again later."
'server_timeout': undefined, // In English: "The server took too long to respond. Please try again."
'signup_error': undefined, // In English: "An error occurred during signup. Please try again."
'alert_error_title': undefined, // In English: "Error!"
@@ -392,10 +431,15 @@ const da = {
'window_title_open': undefined, // In English: "Open"
'window_title_change_password': undefined, // In English: "Change Password"
'window_title_select_font': undefined, // In English: "Select font…"
'window_title_session_list': undefined, // In English: "Session List!"
'window_title_set_new_password': undefined, // In English: "Set New Password"
'window_title_publish_website': undefined, // In English: "Publish Website"
'window_title_publish_worker': undefined, // In English: "Publish Worker"
'window_title_authenticating': undefined, // In English: "Authenticating..."
'window_title_refer_friend': undefined, // In English: "Refer a friend!"
'desktop_exit_full_screen': undefined, // In English: "Exit Full Screen"
'desktop_enter_full_screen': undefined, // In English: "Enter Full Screen"
'item_shared_with_you': undefined, // In English: "A user has shared this item with you."
'item_shared_by_you': undefined, // In English: "You have shared this item with at least one other user."
'item_shortcut': undefined, // In English: "Shortcut"
'item_associated_websites': undefined, // In English: "Associated website"
@@ -404,6 +448,9 @@ const da = {
'window_click_to_go_back': undefined, // In English: "Click to go back."
'window_click_to_go_forward': undefined, // In English: "Click to go forward."
'window_click_to_go_up': undefined, // In English: "Click to go one directory up."
'window_title_public': undefined, // In English: "Public"
'window_title_videos': undefined, // In English: "Videos"
'window_title_pictures': undefined, // In English: "Pictures"
'window_title_puter': undefined, // In English: "Puter"
'window_folder_empty': undefined, // In English: "This folder is empty"
+47
View File
@@ -39,10 +39,17 @@ const de = {
close: 'Schließen',
close_all_windows_and_log_out: 'Fenster schließen und abmelden',
change_always_open_with: 'Öffnen Sie diesen Dateityp immer mit',
confirm_2fa_setup: 'Ich habe den Code in meine Authentifizierungs-App eingegeben',
confirm_2fa_recovery: 'Ich habe meine Wiederherstellungscodes an einem sicheren Ort gespeichert',
confirm_account_for_free_referral_storage_c2a: 'Erstellen Sie ein Konto und bestätigen Sie Ihre E-Mail-Adresse, um 1 GB kostenlosen Speicherplatz zu erhalten. Ihr Freund erhält ebenfalls 1 GB kostenlosen Speicherplatz.',
confirm_code_generic_incorrect: 'Falscher Code.',
confirm_code_generic_too_many_requests: 'Zu viele Anfragen. Bitte warten Sie ein paar Minuten.',
confirm_code_generic_submit: 'Code einreichen',
confirm_code_generic_try_again: 'Erneut versuchen',
confirm_code_generic_title: 'Bestätigungscode eingeben',
confirm_code_2fa_instruction: 'Geben Sie den 6-stelligen Code aus Ihrer Authentifizierungs-App ein.',
confirm_code_2fa_submit_btn: 'Einreichen',
confirm_code_2fa_title: '2FA-Code eingeben',
confirm_delete_multiple_items: 'Möchten Sie diese Elemente dauerhaft löschen?',
confirm_delete_single_item: 'Möchten Sie dieses Element dauerhaft löschen?',
confirm_open_apps_log_out: 'Sie haben geöffnete Apps. Möchten Sie sich wirklich abmelden?',
@@ -52,6 +59,7 @@ const de = {
confirm_session_revoke: 'Möchten Sie diese Sitzung wirklich widerrufen?',
confirm_your_email_address: 'Bestätigen Sie Ihre E-Mail-Adresse',
contact_us: 'Kontaktieren Sie uns',
contact_us_verification_required: 'Sie müssen eine verifizierte E-Mail-Adresse haben, um dies zu verwenden.',
continue: 'Weiter',
copy: 'Kopieren',
copy_link: 'Link kopieren',
@@ -73,8 +81,10 @@ const de = {
deploy_as_app: 'Als App bereitstellen',
descending: 'Absteigend',
desktop: 'Desktop',
desktop_background_fit: 'Passend',
developers: 'Entwickler',
disable_2fa: '2FA deaktivieren',
disable_2fa_confirm: 'Möchten Sie 2FA wirklich deaktivieren?',
disable_2fa_instructions: 'Geben Sie Ihr Passwort ein, um 2FA zu deaktivieren.',
documents: 'Dokumente',
dont_allow: 'Nicht erlauben',
@@ -104,10 +114,13 @@ const de = {
forgot_pass_c2a: 'Passwort vergessen?',
from: 'Von',
general: 'Allgemein',
get_a_copy_of_on_puter: 'Holen Sie sich eine Kopie von \'%%\' auf Puter.com!',
get_copy_link: 'Kopierlink erhalten',
home: 'Startseite',
html_document: 'HTML-Dokument',
hue: 'Farbton',
incorrect_password: 'Falsches Passwort',
invite_link: 'Einladungslink',
item: 'Element',
items_in_trash_cannot_be_renamed: 'Dieses Element kann nicht umbenannt werden, da es sich im Papierkorb befindet. Um dieses Element umzubenennen, ziehen Sie es zunächst aus dem Papierkorb.',
jpeg_image: 'JPEG-Bild',
@@ -118,6 +131,7 @@ const de = {
loading: 'Laden',
log_in: 'Anmelden',
log_out: 'Abmelden',
looks_good: 'Sieht gut aus!',
manage_sessions: 'Sitzungen verwalten',
modified: 'Geändert',
move: 'Verschieben',
@@ -142,6 +156,7 @@ const de = {
open_with: 'Öffnen mit',
original_name: 'Originalname',
original_path: 'Originalpfad',
oss_code_and_content: 'Open-Source-Software und Inhalte',
password: 'Passwort',
password_changed: 'Passwort geändert.',
password_recovery_rate_limit: 'Sie haben unser Limit erreicht; bitte warten Sie ein paar Minuten. Um dies in Zukunft zu vermeiden, laden Sie die Seite nicht zu oft neu.',
@@ -153,19 +168,25 @@ const de = {
paste: 'Einfügen',
paste_into_folder: 'In Ordner einfügen',
path: 'Pfad',
personalization: 'Personalisierung',
pictures: 'Bilder',
plural_suffix: 's',
powered_by_puter_js: 'Betrieben von {{link=docs}}Puter.js{{/link}}',
preparing: 'Bereite vor...',
preparing_for_upload: 'Vorbereiten zum Hochladen...',
print: 'Drucken',
privacy: 'Datenschutz',
proceed_to_login: 'Zum Login fortfahren',
proceed_with_account_deletion: 'Konto löschen',
properties: 'Eigenschaften',
public: 'Öffentlich',
publish: 'Veröffentlichen',
publish_as_website: 'Als Webseite veröffentlichen',
puter_description: 'Puter ist eine datenschutzorientierte persönliche Cloud, um alle Ihre Dateien, Apps und Spiele an einem sicheren Ort zu speichern, von überall und jederzeit zugänglich.',
reading_file: 'Lesen von %strong%',
recover_password: 'Passwort wiederherstellen',
refer_friends_c2a: 'Erhalten Sie 1 GB für jeden Freund, der ein Konto auf Puter erstellt und bestätigt. Ihr Freund erhält ebenfalls 1 GB!',
refer_friends_social_media_c2a: 'Erhalten Sie 1 GB kostenlosen Speicherplatz auf Puter.com!',
refresh: 'Aktualisieren',
rename: 'Umbenennen',
replace: 'Ersetzen',
@@ -175,9 +196,11 @@ const de = {
save: 'Speichern',
saturation: 'Sättigung',
save_account: 'Konto speichern',
save_account_to_get_copy_link: 'Bitte erstellen Sie ein Konto, um fortzufahren.',
save_account_to_publish: 'Bitte erstellen Sie ein Konto, um fortzufahren.',
save_session: 'Sitzung speichern',
save_session_c2a: 'Erstellen Sie ein Konto, um Ihre aktuelle Sitzung zu speichern um den Verlust Ihrer Arbeit zu verhindern.',
scan_qr_2fa: 'Scannen Sie den QR-Code mit Ihrer Authentifizierungs-App',
search: 'Suchen',
seconds: 'Sekunden',
security: 'Sicherheit',
@@ -195,11 +218,13 @@ const de = {
show_hidden: 'Zeige versteckte',
sign_in_with_puter: 'Mit Puter anmelden',
sign_up: 'Registrieren',
signing_in: 'Anmelden…',
size: 'Größe',
skip: 'Überspringen',
something_went_wrong: 'Etwas ist schief gelaufen.',
sort_by: 'Sortieren nach',
status: 'Status',
storage_usage: 'Speichernutzung',
storage_puter_used: 'Verwendet von Puter',
taking_longer_than_usual: 'Es dauert etwas länger als gewöhnlich. Bitte warten...',
terms: 'Bedingungen',
@@ -227,23 +252,29 @@ const de = {
videos: 'Videos',
visibility: 'Sichtbarkeit',
yes: 'Ja',
you_have_been_referred_to_puter_by_a_friend: 'Sie wurden von einem Freund an Puter verwiesen!',
zip: 'Verpacken',
zipping_file: 'Verpacken von %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Öffnen Sie Ihre Authentifizierungs-App',
setup2fa_1_instructions: `
Sie können jede Authentifizierungs-App verwenden, die das Time-based One-Time Password (TOTP) Protokoll unterstützt.
Es gibt viele zur Auswahl, aber wenn Sie unsicher sind, ist
<a target="_blank" href="https://authy.com/download">Authy</a>
eine solide Wahl für Android und iOS.
`,
setup2fa_2_step_heading: 'Scannen Sie den QR-Code',
setup2fa_3_step_heading: 'Geben Sie den 6-stelligen Code ein',
setup2fa_4_step_heading: 'Kopieren Sie Ihre Wiederherstellungscodes',
setup2fa_4_instructions: `
Diese Wiederherstellungscodes sind die einzige Möglichkeit, auf Ihr Konto zuzugreifen, wenn Sie Ihr Telefon verlieren oder Ihre Authentifizierungs-App nicht verwenden können.
Stellen Sie sicher, dass Sie sie an einem sicheren Ort aufbewahren.
`,
setup2fa_5_step_heading: 'Bestätigen Sie die 2FA-Einrichtung',
setup2fa_5_confirmation_1: 'Ich habe meine Wiederherstellungscodes an einem sicheren Ort gespeichert',
setup2fa_5_confirmation_2: 'Ich bin bereit, 2FA zu aktivieren',
setup2fa_5_button: '2FA aktivieren',
// === 2FA Login ===
login2fa_otp_title: 'Geben Sie den 2FA-Code ein',
@@ -251,6 +282,7 @@ const de = {
login2fa_recovery_title: 'Geben Sie einen Wiederherstellungscode ein',
login2fa_recovery_instructions: 'Geben Sie einen Ihrer Wiederherstellungscodes ein, um auf Ihr Konto zuzugreifen.',
login2fa_use_recovery_code: 'Verwenden Sie einen Wiederherstellungscode',
login2fa_recovery_back: 'Zurück',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'Ändern', // In English: "Change"
@@ -315,13 +347,20 @@ const de = {
'billing.expanded': 'Erweitert', // In English: "Expanded"
'billing.accelerated': 'Beschleunigt', // In English: "Accelerated"
'billing.enjoy_msg': 'Genießen Sie %% des Cloud-Speichers und weitere Vorteile.', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'Wählen Sie, wie Sie Ihre Website veröffentlichen möchten', // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': 'Verknüpfung erstellen (Desktop)', // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'Verknüpfungen erstellen (Desktop)', // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'Verknüpfungen erstellen', // In English: "Create Shortcuts"
'minimize': 'Minimieren', // In English: "Minimize"
'reload_app': 'App neu laden', // In English: "Reload App"
'publish_as_serverless_worker': 'Als Worker veröffentlichen', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'Vollbildmodus aktivieren', // In English: "Enter Full Screen"
'toolbar.github': 'GitHub', // In English: "GitHub"
'toolbar.refer': 'Empfehlen', // In English: "Refer"
'used_of': '{{used}} verwendet von {{available}} ', // In English: "{{used}} used of {{available}}"
'worker': 'Worker', // In English: "Worker"
'billing.offering.basic': 'Basic', // In English: "Basic"
'too_many_attempts': 'Zu viele Versuche. Bitte versuchen Sie es später erneut.', // In English: "Too many attempts. Please try again later."
'server_timeout': 'Die Antwort des Servers hat zu lange gedauert. Bitte versuchen Sie es erneut.', // In English: "The server took too long to respond. Please try again."
'signup_error': 'Bei der Anmeldung ist ein Fehler aufgetreten. Versuchen Sie es bitte noch einmal.', // In English: "An error occurred during signup. Please try again."
'alert_error_title': 'Fehler', // In English: "Error!"
@@ -339,10 +378,15 @@ const de = {
'window_title_open': 'Öffnen', // In English: "Open"
'window_title_change_password': 'Kennwort ändern', // In English: "Change Password"
'window_title_select_font': 'Schriftart auswählen…', // In English: "Select font…"
'window_title_session_list': 'Sitzungsliste!', // In English: "Session List!"
'window_title_set_new_password': 'Neues Passwort festlegen', // In English: "Set New Password"
'window_title_publish_website': 'Website veröffentlichen', // In English: "Publish Website"
'window_title_publish_worker': 'Veröffentlichungsmitarbeiter', // In English: "Publish Worker"
'window_title_authenticating': 'Authentifizierung...', // In English: "Authenticating..."
'window_title_refer_friend': 'Empfehlen Sie uns weiter!', // In English: "Refer a friend!"
'desktop_exit_full_screen': 'Vollbildmodus beenden', // In English: "Exit Full Screen"
'desktop_enter_full_screen': 'Vollbildmodus aktivieren', // In English: "Enter Full Screen"
'item_shared_with_you': 'Ein Benutzer hat diesen Artikel mit Ihnen geteilt.', // In English: "A user has shared this item with you."
'item_shared_by_you': 'Sie haben diesen Artikel mit mindestens einem anderen Benutzer geteilt.', // In English: "You have shared this item with at least one other user."
'item_shortcut': 'Verknüpfung', // In English: "Shortcut"
'item_associated_websites': 'Zugehörige Website', // In English: "Associated website"
@@ -351,6 +395,9 @@ const de = {
'window_click_to_go_back': 'Klicken Sie hier, um zurückzugehen.', // In English: "Click to go back."
'window_click_to_go_forward': 'Klicken Sie, um fortzufahren.', // In English: "Click to go forward."
'window_click_to_go_up': 'Klicken Sie, um ein Verzeichnis nach oben zu gehen.', // In English: "Click to go one directory up."
'window_title_public': 'Öffentlich', // In English: "Public"
'window_title_videos': 'Videos', // In English: "Videos"
'window_title_pictures': 'Bilder', // In English: "Pictures"
'window_title_puter': 'Puter', // In English: "Puter"
'window_folder_empty': 'Dieser Ordner ist leer', // In English: "This folder is empty"
},
+10
View File
@@ -51,6 +51,7 @@ const emoji = {
delete_permanently: '🗑️🔚',
deploy_as_app: '🚀📱',
descending: '🔽',
desktop_background_fit: '🖥️🖼️',
download: '⬇️',
download_file: '⬇️📄',
email: '📧',
@@ -64,7 +65,10 @@ const emoji = {
forgot_pass_c2a: '🔑❓📧',
from: '📩',
general: '⚙️',
get_a_copy_of_on_puter: '📩🔄📂',
get_copy_link: '🔗🔄',
html_document: '📄🌐',
invite_link: '🔗📩',
item: '📂',
items_in_trash_cannot_be_renamed: '🗑️🆓❌',
jpeg_image: '🖼️',
@@ -95,7 +99,9 @@ const emoji = {
passwords_do_not_match: '🔑❌🔑',
paste: '📋➡️',
paste_into_folder: '📋➡️📂',
powered_by_puter_js: '⚙️🔌🔗',
preparing: '🔄🔜',
preparing_for_upload: '🔄🔜',
proceed_to_login: '👤🔍',
properties: '⚙️',
publish: '📰',
@@ -103,6 +109,7 @@ const emoji = {
plural_suffix: '🅰️',
recover_password: '📧🔑🔄', // Flow correction
refer_friends_c2a: '👤📞📧👤',
refer_friends_social_media_c2a: '📲👤🆓',
refresh: '🔄🔄',
rename: '🔄📛',
replace: '🔄🔄',
@@ -110,6 +117,7 @@ const emoji = {
resend_confirmation_code: '📧🔁',
restore: '🔄🔙',
save_account: '👤💾',
save_account_to_get_copy_link: '💾👤🔗',
save_account_to_publish: '💾👤📰',
save_session: '💾📂',
save_session_c2a: '💾👤🔄',
@@ -123,6 +131,7 @@ const emoji = {
show_hidden: '👁️🔄',
sign_in_with_puter: '👤🆔',
sign_up: '👤🆕',
signing_in: '🔄👤',
size: '📏',
skip: '⏩',
sort_by: '🔢🔄',
@@ -139,6 +148,7 @@ const emoji = {
username_changed: '👤✅',
versions: '🔄📃',
yes: '✅',
you_have_been_referred_to_puter_by_a_friend: '👤👫🔁🆓',
zip: '📂🔒',
},
};
+94 -4
View File
@@ -70,6 +70,7 @@ const en = {
back: 'Back',
bio: 'Bio',
browser: 'Browser',
browser_version: 'Browser Version',
captcha_required: 'Please complete the CAPTCHA verification',
cancel: 'Cancel',
change: 'Change',
@@ -81,19 +82,28 @@ const en = {
change_username: 'Change Username',
username_set_by_team: 'Set by {{team}}. Ask an admin to change it.',
username_set_by_team_generic: 'Set by your team. Ask an admin to change it.',
revalidate_with_google: 'Re-validate with Google',
revalidated: 'Re-validated.',
revalidate_sign_in_popup: 'Sign in with your linked account in the popup.',
revalidate_flow_notice: 'You will be asked to sign in with your linked account when you continue.',
revalidate_failed: 'Signing in with your linked account didn\u2019t finish. Please try again.',
reauth_required_message: 'Your session was updated for security — please sign in again.',
color_depth: 'Color Depth',
close: 'Close',
close_all_windows_and_log_out: 'Close Windows and Log Out',
close_menu: 'Close menu',
collapse_sidebar: 'Collapse sidebar',
confirm: 'Confirm',
confirm_2fa_setup: 'I have added the code to my authenticator app',
confirm_2fa_recovery: 'I have saved my recovery codes in a secure location',
confirm_code_generic_incorrect: 'Incorrect Code.',
confirm_code_generic_too_many_requests: 'Too many requests. Please wait a few minutes.',
confirm_code_generic_submit: 'Submit Code',
confirm_code_generic_try_again: 'Try Again',
confirm_code_generic_title: 'Enter Confirmation Code',
confirm_code_2fa_instruction: 'Enter the 6-digit code from your authenticator app.',
confirm_code_2fa_submit_btn: 'Submit',
confirm_code_2fa_title: 'Enter 2FA Code',
confirm_continue_as: 'Continue as <strong>{{username}}</strong>?<p>This link signs you in to that account. Anything you create — files, uploads, chats — will be saved there and visible to whoever owns it. Only continue if the account is yours.</p>',
confirm_delete_multiple_items: 'Are you sure you want to permanently delete these items?',
confirm_delete_single_item: 'Do you want to permanently delete this item?',
@@ -106,6 +116,7 @@ const en = {
confirm_events_worker_destroy: 'Are you sure you want to destroy this background worker? Its published event handlers will be removed, and any subscriptions using them will be suspended.',
confirm_revoke_all_other_sessions: 'Revoke all other sessions? You will stay signed in here.',
confirm_your_email_address: 'Confirm Your Email Address',
choose_publishing_option: 'Choose how you want to publish your website:',
contact_us: 'Contact Us',
contact_us_attach: 'Attach Files',
contact_us_attach_or_drop: 'Attach files or drop them here',
@@ -123,6 +134,7 @@ const en = {
contact_us_message_placeholder: 'How can we help? For a bug, the steps that lead to it help us most.',
contact_us_message_required: 'Please write a message before sending.',
contact_us_rate_limited: 'You have sent a lot of messages recently. Please try again later.',
contact_us_verification_required: 'You must have a verified email address to use this.',
continue: 'Continue',
copied: 'Copied',
copy: 'Copy',
@@ -130,10 +142,13 @@ const en = {
copying: 'Copying',
copying_file: 'Copying %%',
cost: 'Cost',
cpu_cores: 'CPU Cores',
cpu: 'CPU',
create_account: 'Create Account',
create_free_account: 'Create Free Account',
change_icon: 'Change Icon',
create_desktop_shortcut: 'Create Shortcut (Desktop)',
create_desktop_shortcut_s: 'Create Shortcuts (Desktop)',
create_shortcut: 'Create Shortcut',
create_shortcut_s: 'Create Shortcuts',
credits: 'Credits',
@@ -186,6 +201,7 @@ const en = {
custom_domain_use: 'Use',
custom_domain_verify_and_add: 'Verify and Add',
cut: 'Cut',
client_information: 'Client Information',
close_all: 'Close All',
created: 'Created',
date_modified: 'Date modified',
@@ -196,14 +212,17 @@ const en = {
deploy_as_app: 'Deploy as app',
descending: 'Descending',
desktop: 'Desktop',
desktop_background_fit: 'Fit',
developers: 'Developers',
directory_depth_limit_exceeded: 'This folder is nested too deeply. Move it somewhere closer to the top before adding more folders inside it.',
disable_2fa: 'Disable 2FA',
disable_2fa_confirm: 'Are you sure you want to disable 2FA?',
disable_2fa_instructions: 'Confirm your identity and enter an authenticator code or an unused recovery code to disable 2FA.',
disable_2fa_code_instruction: 'Enter a 6-digit authenticator code or an unused recovery code.',
display_name: 'Display Name',
directory: 'Directory',
disassociate: 'disassociate',
disk_storage: 'Disk Storage',
documents: 'Documents',
done: 'Done',
dont_allow: 'Don\'t Allow',
@@ -241,11 +260,14 @@ const en = {
forgot_pass_c2a: 'Forgot password?',
from: 'From',
general: 'General',
get_a_copy_of_on_puter: 'Get a copy of \'%%\' on Puter.com!',
get_copy_link: 'Get Copy Link',
hide_password: 'Hide password',
home: 'Home',
html_document: 'HTML document',
hue: 'Hue',
incorrect_password: 'Incorrect password',
invite_link: 'Invite Link',
item: 'item',
items_count_one: '1 item',
items_count_other: '{{count}} items',
@@ -272,6 +294,7 @@ const en = {
log_in: 'Log In',
log_out: 'Log Out',
logging_in_as: 'Logging in as <strong>{{identity}}</strong>',
looks_good: 'Looks good!',
manage_sessions: 'Manage Sessions',
manage_sessions_hint: 'Manage active sessions',
account_subtitle: 'Manage your account settings and profile',
@@ -345,6 +368,8 @@ const en = {
original_name: 'Original Name',
original_path: 'Original Path',
os: 'Operating System',
oss_code_and_content: 'Open Source Software and Content',
os_version: 'OS Version',
password: 'Password',
password_changed: 'Password changed.',
password_recovery_rate_limit: "You've reached our rate-limit; please wait a few minutes. To prevent this in the future, avoid reloading the page too many times.",
@@ -362,6 +387,7 @@ const en = {
paste: 'Paste',
paste_into_folder: 'Paste Into Folder',
path: 'Path',
personalization: 'Personalization',
phone_verify_title: 'Verify your phone number',
phone_verify_subtitle: "We'll text you a verification code to confirm it's really you.",
phone_country_label: 'Country',
@@ -389,11 +415,15 @@ const en = {
phone_card_fallback_note: "We only check that the card is valid \u2014 you won't be charged.",
phone_card_fallback_unavailable: "Card verification isn't available right now. Please try your phone number again, or email [email protected] and we'll help you finish setting up your account.",
pictures: 'Pictures',
pixel_ratio: 'Pixel Ratio',
plural_suffix: 's',
powered_by_puter_js: 'Powered by {{link=docs}}Puter.js{{/link}}',
preparing: 'Preparing...',
preparing_for_upload: 'Preparing for upload...',
print: 'Print',
privacy: 'Privacy',
proceed_to_login: 'Proceed to login',
proceed_with_account_deletion: 'Proceed with Account Deletion',
profile: 'Profile',
profile_empty: 'Add a display name and bio',
profile_picture_adjust_hint: 'Drag to reposition. Scroll or use the slider to zoom.',
@@ -403,6 +433,7 @@ const en = {
profile_picture_remove_failed: 'Your photo could not be removed. Please try again.',
profile_picture_save_failed: 'Your photo could not be saved. Please try again.',
profile_save_failed: 'Your profile could not be saved. Please try again.',
profile_saved: 'Profile saved.',
properties: 'Properties',
public: 'Public',
publish: 'Publish',
@@ -457,10 +488,12 @@ const en = {
push_this_browser: 'This browser',
push_turn_off: 'Turn off',
push_turn_on: 'Turn on',
puter_description: 'Puter is a privacy-first personal cloud to keep all your files, apps, and games in one secure place, accessible from anywhere at any time.',
ram: 'RAM',
reading: 'Reading %strong%',
writing: 'Writing %strong%',
recover_password: 'Recover Password',
refer_friends_social_media_c2a: 'Get 1 GB of free storage on Puter.com!',
refresh: 'Refresh',
remove_profile_picture: 'Remove photo',
rename: 'Rename',
@@ -478,10 +511,13 @@ const en = {
save: 'Save',
saturation: 'Saturation',
save_account: 'Save account',
save_account_to_get_copy_link: 'Please create an account to proceed.',
save_account_to_proceed: 'Please create an account to proceed.',
save_account_to_publish: 'Please create an account to proceed.',
save_session: 'Save session',
save_session_c2a: 'Create an account to save your current session and avoid losing your work.',
scan_qr_2fa: 'Scan the QR code with your authenticator app',
screen_resolution: 'Screen Resolution',
search: 'Search',
seconds: 'seconds',
security: 'Security',
@@ -490,8 +526,31 @@ const en = {
sessions: 'Sessions',
send: 'Send',
send_password_recovery_email: 'Send Password Recovery Email',
server_information: 'Server Information',
session_saved: 'Thank you for creating an account. This session has been saved.',
settings: 'Settings',
keyboard_shortcuts: 'Keyboard Shortcuts',
keyboard_shortcuts_intro: 'Learn the most useful shortcuts for navigating Puter faster.',
keyboard_shortcuts_action: 'Action',
keyboard_shortcuts_shortcut: 'Shortcut',
keyboard_shortcuts_general: 'General',
keyboard_shortcuts_navigation: 'Navigation',
keyboard_shortcuts_files: 'Files & Clipboard',
keyboard_shortcuts_open_help: 'Open this keyboard shortcuts guide',
keyboard_shortcuts_search: 'Open search',
keyboard_shortcuts_close_window: 'Close the active window',
keyboard_shortcuts_undo: 'Undo last action',
keyboard_shortcuts_select_all: 'Select all items',
keyboard_shortcuts_open_item: 'Open selected item',
keyboard_shortcuts_close_menus: 'Close dialogs, menus, and popovers',
keyboard_shortcuts_arrow_navigation: 'Navigate menus and selections',
keyboard_shortcuts_type_to_select: 'Type to jump to an item by name',
keyboard_shortcuts_type_to_select_keys: 'Type letters or numbers',
keyboard_shortcuts_copy: 'Copy selected items',
keyboard_shortcuts_cut: 'Cut selected items',
keyboard_shortcuts_paste: 'Paste items',
keyboard_shortcuts_delete: 'Move selected items to Trash',
keyboard_shortcuts_permanent_delete: 'Permanently delete (after confirmation)',
set_new_password: 'Set New Password',
share: 'Share',
share_ellipsis: 'Share…',
@@ -523,7 +582,9 @@ const en = {
share_no_one: 'Not shared with anyone yet.',
share_owner: 'Owner',
share_remove_access: 'Remove access',
share_remove_access_for: 'Remove access for {{recipient}}',
share_remove_from_shared: 'Remove from Shared',
share_nothing_shared: 'Nothing has been shared with you yet.',
share_done: 'Done',
share_failed: 'Could not share this item.',
share_shared_with: 'Shared with {{recipient}}',
@@ -533,6 +594,7 @@ const en = {
share_awaiting_signup: 'Invited',
share_invited_someone: 'Someone by email',
share_cancel_invite: 'Cancel invitation',
share_cancel_invite_for: 'Cancel the invitation to {{recipient}}',
share_confirm_cancel_invite:
'Cancel the invitation sent to {{recipient}}?',
share_invite_cancelled: 'Invitation to {{recipient}} cancelled',
@@ -568,8 +630,6 @@ const en = {
share_access_updated_items:
'Updated access for {{recipient}} on {{count}} items',
share_access_removed_items: 'Removed {{recipient}} from {{count}} items',
share_access_removed_partial:
'Removed {{recipient}} from {{count}} of {{total}} items',
block: 'Block',
unblock: 'Unblock',
manage: 'Manage',
@@ -616,8 +676,6 @@ const en = {
share_link_on_write_items: 'Anyone with the link can now edit these items',
share_link_off: 'Only people with access can open this item now',
share_link_off_items: 'Only people with access can open these items now',
share_link_off_partial:
'Only people with access can open {{count}} of {{total}} items now',
share_link_requires_plan:
'Sharing with anyone who has the link requires a subscription.',
share_copy_link: 'Copy link',
@@ -628,12 +686,14 @@ const en = {
sign_in: 'Sign in',
sign_in_with_puter: 'Sign in with Puter',
sign_up: 'Sign Up',
signing_in: 'Signing in…',
size: 'Size',
skip: 'Skip',
something_went_wrong: 'Something went wrong.',
sort_by: 'Sort by',
status: 'Status',
'Storage': 'Storage',
storage_usage: 'Storage Usage',
storage_puter_used: 'used by Puter',
'your_plan': 'Your Plan',
teams_account_of: 'This account belongs to %%',
@@ -676,6 +736,9 @@ const en = {
terms: 'Terms',
text_document: 'Text document',
toggle_view: 'Toggle view',
'toolbar.enter_fullscreen': 'Enter Full Screen',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Refer',
tos_fineprint: 'By signing up, you agree to Puter\'s {{link=terms}}Terms of Service{{/link}} and {{link=privacy}}Privacy Policy{{/link}}.',
transparency: 'Transparency',
trash: 'Trash',
@@ -689,11 +752,14 @@ const en = {
ui_revoke: 'Revoke',
ui_revoke_all_other_sessions: 'Revoke all other sessions',
ui_search: 'Search sessions…',
ui_session_app: 'App',
ui_session_client: 'Client',
ui_session_count_one: '1 active session',
ui_session_count_other: '%% active sessions',
ui_session_created: 'Created',
ui_session_current: 'Current',
ui_session_expires: 'Expires',
ui_session_ip: 'IP',
ui_session_kind_access_token: 'Access token',
ui_session_kind_app: 'App session',
ui_session_kind_web: 'Browser session',
@@ -729,6 +795,7 @@ const en = {
videos: 'Videos',
visibility: 'Visibility',
yes: 'Yes',
you_have_been_referred_to_puter_by_a_friend: 'You have been referred to Puter by a friend!',
zip: 'Zip',
zoom: 'Zoom',
zoom_in: 'Zoom in',
@@ -745,15 +812,21 @@ const en = {
tarring: 'Tarring %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Open your authenticator app',
setup2fa_1_instructions: 'Scan the QR code with your authenticator app.',
setup2fa_2_step_heading: 'Scan the QR code',
setup2fa_3_step_heading: 'Enter the 6-digit code',
setup2fa_4_step_heading: 'Copy your recovery codes',
setup2fa_4_instructions: `
These recovery codes are the only way to access your account if you lose your phone or can't use your authenticator app.
Make sure to store them in a safe place.
`,
setup2fa_5_step_heading: 'Confirm 2FA setup',
setup2fa_5_confirmation_1: 'I have saved my recovery codes in a secure location',
setup2fa_5_confirmation_2: 'I am ready to enable 2FA',
setup2fa_5_button: 'Enable 2FA',
setup2fa_password_instructions: 'Enter your password to set up 2FA.',
setup2fa_code_expired: 'That code has expired. Enter the current code from your authenticator app to finish.',
setup2fa_step_scan: 'Scan',
setup2fa_step_backup: 'Backup',
setup2fa_step_verify: 'Verify',
@@ -768,6 +841,7 @@ const en = {
login2fa_recovery_title: 'Enter a recovery code',
login2fa_recovery_instructions: 'Enter one of your recovery codes to access your account.',
login2fa_use_recovery_code: 'Use a recovery code',
login2fa_recovery_back: 'Back',
login2fa_recovery_placeholder: 'XXXXXXXX',
// Sharing
@@ -836,6 +910,7 @@ const en = {
'billing.accelerated': 'Accelerated',
'billing.enjoy_msg': 'Enjoy %% of Cloud Storage plus other benefits.',
'too_many_attempts': 'Too many attempts. Please try again later.',
'server_timeout': 'The server took too long to respond. Please try again.',
'signup_error': 'An error occurred during signup. Please try again.',
'auth_error_generic': 'Authentication failed. Please try again.',
@@ -886,13 +961,18 @@ const en = {
'window_title_open': 'Open',
'window_title_change_password': 'Change Password',
'window_title_select_font': 'Select font…',
'window_title_session_list': 'Session List!',
'window_title_set_new_password': 'Set New Password',
'window_title_publish_website': 'Publish Website',
'window_title_publish_worker': 'Publish Worker',
'window_title_authenticating': 'Authenticating...',
'window_title_refer_friend': 'Refer a friend!',
// Desktop UI
'desktop_exit_full_screen': 'Exit Full Screen',
'desktop_enter_full_screen': 'Enter Full Screen',
// Item UI
'item_shared_with_you': 'A user has shared this item with you.',
'item_shared_by_you': 'You have shared this item with at least one other user.',
'item_shortcut': 'Shortcut',
'item_already_exists': '%strong% already exists.',
@@ -910,6 +990,9 @@ const en = {
'window_click_to_go_forward': 'Click to go forward.',
'window_click_to_go_up': 'Click to go one directory up.',
'window_click_to_change_layout': 'Click to change the layout.',
'window_title_public': 'Public',
'window_title_videos': 'Videos',
'window_title_pictures': 'Pictures',
'window_title_puter': 'Puter',
'window_folder_empty': 'This folder is empty',
@@ -962,10 +1045,15 @@ const en = {
'enable_push_not_now': 'Not now',
'enable_push_footnote': 'You can turn them off anytime in Settings.',
'error_user_or_path_not_found': 'User or path not found.',
// Auth token
auth_token: 'Auth Token',
token_copied: 'Token copied',
copy_auth_token: 'Copy Auth Token',
approve: 'Approve',
copy_token_message: 'Your authentication token is shown below. Keep it secret \u2014 anyone with this token can access your account.',
copy_token_description: 'View and copy your authentication token',
// API tokens (named, revocable, full API access \u2014 no account management)
api_token: 'API Token',
@@ -991,8 +1079,10 @@ const en = {
// AuthMe dialog
authorization_required: 'Authorization Required',
external_site_auth_request: 'An app is requesting access to your account.',
authme_security_warning: 'Your authentication token will be shared with this app to complete sign-in.',
redirect_destination: 'Redirect Destination',
will_be_shared: 'Will be shared',
your_auth_token: 'Your authentication token',
authorization_cancelled: 'Authorization Cancelled',
authorization_cancelled_desc: 'You have declined the authorization request.',
authorization_cancelled_message: 'The app will not receive access to your account. You can close this window safely.',
+50
View File
@@ -47,13 +47,21 @@ const es = {
close_all_windows_and_log_out: 'Cerrar ventanas y cerrar sesión',
change_always_open_with: '¿Quieres abrir siempre este tipo de archivos con',
confirm: 'Confirmar',
confirm_2fa_setup: 'He añadido el código a mi aplicación de autenticación',
confirm_2fa_recovery:
'He guardado mis códigos de recuperación en un lugar seguro',
confirm_account_for_free_referral_storage_c2a:
'Crea una cuenta y confirma tu correo electrónico para recibir 1 GB de almacenamiento gratuito. Tu amigo recibirá 1 GB de almacenamiento gratuito también.',
confirm_code_generic_incorrect: 'Código incorrecto.',
confirm_code_generic_too_many_requests:
'Too many requests. Please wait a few minutes.',
confirm_code_generic_submit: 'Enviar código',
confirm_code_generic_try_again: 'Intenta nuevamente',
confirm_code_generic_title: 'Enter Confirmation Code',
confirm_code_2fa_instruction:
'Ingresa los 6 dígitos de tu aplicación de autenticación.',
confirm_code_2fa_submit_btn: 'Enviar',
confirm_code_2fa_title: 'Ingrese el código de 2FA',
confirm_delete_multiple_items:
'¿Estás seguro de que quieres eliminar permanentemente estos elementos?',
confirm_delete_single_item:
@@ -67,6 +75,8 @@ const es = {
confirm_session_revoke: '¿Estás seguro de que quieres revocar esta sesión?',
confirm_your_email_address: 'Confirma tu dirección de correo electrónico',
contact_us: 'Contáctanos',
contact_us_verification_required:
'Debes tener un correo electrónico verificado para usar esto.',
continue: 'Continuar',
copy: 'Copiar',
copy_link: 'Copiar Enlace',
@@ -88,8 +98,10 @@ const es = {
deploy_as_app: 'Desplegar como una aplicación',
descending: 'Descendiente',
desktop: 'Escritorio',
desktop_background_fit: 'Ajustar',
developers: 'Desarrolladores',
disable_2fa: 'Deshabilitar 2FA',
disable_2fa_confirm: '¿Estás seguro que quieres deshabilitar 2FA?',
disable_2fa_instructions: 'Ingresa tu contraseña para deshabilitar 2FA.',
documents: 'Documentos',
dont_allow: 'No permitir',
@@ -123,10 +135,13 @@ const es = {
forgot_pass_c2a: '¿Olvidaste tu contraseña?',
from: 'De',
general: 'General',
get_a_copy_of_on_puter: '¡Consigue una copia de \'%%\' en Puter.com!',
get_copy_link: 'Copiar el enlace',
home: 'Inicio',
html_document: 'Documento HTML',
hue: 'Hue',
incorrect_password: 'Contraseña incorrecta',
invite_link: 'Enlace de invitación',
item: 'elemento',
items_in_trash_cannot_be_renamed: 'Este elemento no se puede renombrar porque está en la papelera. Para cambiar el nombre de este archivo, primero extráelo fuera de la misma.',
jpeg_image: 'Imagen JPEG',
@@ -137,6 +152,7 @@ const es = {
loading: 'Cargando',
log_in: 'Iniciar sesión',
log_out: 'Cerrar sesión',
looks_good: 'Se ve bien!',
manage_sessions: 'Administrar sesión',
modified: 'Modified',
move: 'Mover',
@@ -162,6 +178,7 @@ const es = {
open_with: 'Abrir con',
original_name: 'Nombre original',
original_path: 'Ruta original',
oss_code_and_content: 'Software y contenido de código abierto',
password: 'Contraseña',
password_changed: 'Contraseña cambiada.',
password_recovery_rate_limit:
@@ -178,20 +195,26 @@ const es = {
paste: 'Pegar',
paste_into_folder: 'Pegar en la Carpeta',
path: 'Ruta',
personalization: 'Personalización',
pictures: 'Imagenes',
plural_suffix: 's',
powered_by_puter_js: 'Creado por {{link=docs}}Puter.js{{/link}}',
preparing: 'Preparando...',
preparing_for_upload: 'Preparando para la subida...',
print: 'Imprimir',
privacy: 'Privacidad',
proceed_to_login: 'Procede a iniciar sesión',
proceed_with_account_deletion: 'Procede con la eliminación de la cuenta',
properties: 'Propiedades',
public: 'Publico',
publish: 'Publicar',
publish_as_website: 'Publicar como página web',
puter_description: 'Puter es un servicio de nube personal enfocado en privacidad que mantiene tus archivos, aplicaciónes, y juegos en un solo lugar, accesible desde cualquier lugar en cualquier momento.',
reading_file: 'Leyendo %strong%',
recover_password: 'Recuperar Contraseña',
refer_friends_c2a:
'Consigue 1 GB por cada amigo que cree y confirme una cuenta en Puter ¡Tu amigo recibirá 1GB también!',
refer_friends_social_media_c2a: '¡Consigue 1 GB de almacenamiento gratuito en Puter.com!',
refresh: 'Refrescar',
rename: 'Renombrar',
replace: 'Remplazar',
@@ -201,10 +224,12 @@ const es = {
save: 'Guardar',
saturation: 'Saturación',
save_account: 'Guardar cuenta',
save_account_to_get_copy_link: 'Por favor, crea una cuenta para continuar.',
save_account_to_publish: 'Por favor, crea una cuenta para continuar.',
save_session: 'Guardar sesión',
save_session_c2a:
'Crea una cuenta para guardar tu sesión actual y evitar así perder tu trabajo.',
scan_qr_2fa: 'Escanee el codigo QR con su aplicación de autenticación',
search: 'Buscar',
seconds: 'segundos',
security: 'Seguridad',
@@ -223,11 +248,13 @@ const es = {
show_hidden: 'Mostrar ocultos',
sign_in_with_puter: 'Inicia sesión con Puter',
sign_up: 'Registrarse',
signing_in: 'Registrándose…',
size: 'Tamaño',
skip: 'Saltar',
something_went_wrong: 'Algo salió mal.',
sort_by: 'Ordenar Por',
status: 'Estado',
storage_usage: 'Uso del almacenamiento',
storage_puter_used: 'Usado por Puter',
taking_longer_than_usual:
'Tardando un poco más de lo habitual. Por favor, espere...',
@@ -257,24 +284,31 @@ const es = {
videos: 'Videos',
visibility: 'Visibilidad',
yes: 'Si',
you_have_been_referred_to_puter_by_a_friend:
'¡Has sido invitado a Puter por un amigo!',
zip: 'Zip',
zipping_file: 'Compriminendo %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Abre tu aplicación de autenticación',
setup2fa_1_instructions: `
Puedes usar cualquier aplicación de autenticación que soporte el protocolo de Time-based One-time (TOTP).
Hay muchos para elegir, pero si no estas seguro
<a target="_blank" href="https://authy.com/download">Authy</a>
es una opción segura para Android y iOS.
`,
setup2fa_2_step_heading: 'Escanea el código QR',
setup2fa_3_step_heading: 'Ingresa el código de 6 dígitos',
setup2fa_4_step_heading: 'Copiar tus códigos de recuperación',
setup2fa_4_instructions: `
Estos códigos de recuperación son la única forma de acceder a tu cuenta, si pierdes tu teléfono o no puedes usar la aplicación de autenticación.
Asegurate de guardarlos en un lugar seguro.
`,
setup2fa_5_step_heading: 'Confirmar la configuración de 2FA',
setup2fa_5_confirmation_1:
'He guardado mis códigos de recuperación en un lugar seguro',
setup2fa_5_confirmation_2: 'Estoy listo para habilitar 2FA',
setup2fa_5_button: 'Habilitar 2FA',
// === 2FA Login ===
login2fa_otp_title: 'Ingresar el código 2FA',
@@ -284,6 +318,7 @@ const es = {
login2fa_recovery_instructions:
'Ingresa uno de tus códigos de recuperación para acceder a tu cuenta.',
login2fa_use_recovery_code: 'Usar un código de recuperación',
login2fa_recovery_back: 'Atras',
login2fa_recovery_placeholder: 'XXXXXXXX',
change: 'cambiar', // In English: "Change"
@@ -360,13 +395,20 @@ const es = {
'billing.enjoy_msg':
'Disfruta %% de almacenamiento en la nube junto con otros beneficios.', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'Elige cómo quieres publicar tu sitio web:', // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': 'Crear un atajo (Escritorio)', // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'Crear atajos (Escritorio)', // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'Crear atajos', // In English: "Create Shortcuts"
'minimize': 'Minimizar', // In English: "Minimize"
'reload_app': 'Recargar la Aplicación', // In English: "Reload App"
'publish_as_serverless_worker': 'Publicar como un Worker', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'Abrir pantalla completa', // In English: "Enter Full Screen"
'toolbar.github': 'GitHub', // In English: "GitHub"
'toolbar.refer': 'Invitar', // In English: "Refer"
'used_of': '{{used}} en uso. {{available}} disponible', // In English: "{{used}} used of {{available}}"
'worker': 'Worker', // In English: "Worker"
'billing.offering.basic': 'Básico', // In English: "Basic"
'too_many_attempts': 'Demasiados intentos. Por favor, intenta más tarde', // In English: "Too many attempts. Please try again later."
'server_timeout': 'El servidor ha tardado mucho en responder. Intenta nuevamente', // In English: "The server took too long to respond. Please try again."
'signup_error': 'Ocurrió un error durante el registro. Intente nuevamente', // In English: "An error occurred during signup. Please try again."
'alert_error_title': '¡Error!', // In English: "Error!"
@@ -384,10 +426,15 @@ const es = {
'window_title_open': 'Abrir', // In English: "Open"
'window_title_change_password': 'Cambiar contraseña', // In English: "Change Password"
'window_title_select_font': 'Seleccionar fuente…', // In English: "Select font…"
'window_title_session_list': '¡Lista de sesiones!', // In English: "Session List!"
'window_title_set_new_password': 'Establecer nueva contraseña', // In English: "Set New Password"
'window_title_publish_website': 'Publicar sitio web', // In English: "Publish Website"
'window_title_publish_worker': 'Publicar Worker', // In English: "Publish Worker"
'window_title_authenticating': 'Autenticando...', // In English: "Authenticating..."
'window_title_refer_friend': '¡Invitar a un amigo!', // In English: "Refer a friend!"
'desktop_exit_full_screen': 'Salir de Pantalla Completa', // In English: "Exit Full Screen"
'desktop_enter_full_screen': 'Abrir Pantalla Completa', // In English: "Enter Full Screen"
'item_shared_with_you': 'Un usuario compartió este elemento contigo.', // In English: "A user has shared this item with you."
'item_shared_by_you': 'Has compartido este elemento con otro usuario', // In English: "You have shared this item with at least one other user."
'item_shortcut': 'Atajo', // In English: "Shortcut"
'item_associated_websites': 'Sitio web Asociado', // In English: "Associated website"
@@ -396,6 +443,9 @@ const es = {
'window_click_to_go_back': 'Click para regresar', // In English: "Click to go back."
'window_click_to_go_forward': 'Click para avanzar', // In English: "Click to go forward."
'window_click_to_go_up': 'Click para ir al directorio superior', // In English: "Click to go one directory up."
'window_title_public': 'Público', // In English: "Public"
'window_title_videos': 'Videos', // In English: "Videos"
'window_title_pictures': 'Imágenes', // In English: "Pictures"
'window_title_puter': 'Puter', // In English: "Puter"
'window_folder_empty': 'Esta carpeta está vacía', // In English: "This folder is empty"
},
+51
View File
@@ -41,13 +41,19 @@ const fa = {
close: 'بستن',
close_all_windows_and_log_out: 'بستن پنجره‌ها و خروج',
confirm: 'تایید',
confirm_2fa_setup: 'کد را به برنامه تأیید هویت خود اضافه کرده‌ام',
confirm_2fa_recovery: 'کدهای بازیابی خود را در یک مکان امن ذخیره کرده‌ام',
confirm_account_for_free_referral_storage_c2a:
'حساب کاربری خود را ایجاد کرده و آدرس ایمیل خود را تأیید کنید تا 1 گیگابایت فضای ذخیره سازی رایگان دریافت کنید. دوست شما هم 1 گیگابایت فضای ذخیره سازی رایگان دریافت خواهد کرد.',
confirm_code_generic_incorrect: 'کد نادرست است',
confirm_code_generic_too_many_requests:
'تعداددرخواست‌ها زیاداست. لطفاً چند دقیقه صبر کنید',
confirm_code_generic_submit: 'ثبت کد',
confirm_code_generic_try_again: 'دوباره امتحان کنید',
confirm_code_2fa_instruction:
'کد ۶ رقمی را از برنامه تأیید هویت خود وارد کنید',
confirm_code_2fa_submit_btn: 'ثبت',
confirm_code_2fa_title: 'کد احراز هویت دو مرحله ای را وارد کنید',
confirm_delete_multiple_items:
'آیا مطمئن هستید که می‌خواهید این موارد را برای همیشه حذف کنید؟',
confirm_delete_single_item:
@@ -62,6 +68,8 @@ const fa = {
'آیا مطمئن هستید که می خواهید این نشست را لغو کنید؟', // TN: It's better to use session instead ofنشست
confirm_your_email_address: 'ایمیل خود را تأیید کنید',
contact_us: 'تماس با ما',
contact_us_verification_required:
'شما باید یک آدرس ایمیل تأیید شده داشته باشید تا بتوانید از این استفاده کنید ',
continue: 'ادامه',
copy: 'کپی',
copy_link: 'کپی لینک',
@@ -83,8 +91,11 @@ const fa = {
deploy_as_app: 'نصب به عنوان برنامه',
descending: 'نزولی',
desktop: 'دسکتاپ',
desktop_background_fit: 'متناسب',
developers: 'تولیدکنندگان نرم افزار',
disable_2fa: 'غیر فعال کردن احراز هویت دو مرحله ای',
disable_2fa_confirm:
'آیا مطمئن هستید که می‌خواهید احراز هویت دو مرحله ای را غیرفعال کنید؟',
disable_2fa_instructions:
'برای غیرفعال کردن احراز هویت دو مرحله ای ،رمز عبور خود را وارد کنید',
documents: 'اسناد',
@@ -119,10 +130,13 @@ const fa = {
forgot_pass_c2a: 'رمز عبور را فراموش کرده اید؟',
from: 'از',
general: 'عمومی',
get_a_copy_of_on_puter: 'یک نسخه از \'%%\' را در Puter.com بگیرید!',
get_copy_link: 'گرفتن لینک کپی',
home: 'خانه',
html_document: 'سند HTML',
hue: 'رنگ',
incorrect_password: 'رمز عبور نادرست است',
invite_link: 'لینک دعوت',
item: 'مورد',
items_in_trash_cannot_be_renamed: 'این مورد نمی تواند تغییر نام دهد زیرا در سطل زباله است. برای تغییر نام این مورد، ابتدا آن را از سطل زباله بیرون بکشید.',
jpeg_image: 'تصویر JPEG',
@@ -133,6 +147,7 @@ const fa = {
loading: 'در حال بارگذاری',
log_in: 'ورود',
log_out: 'خروج',
looks_good: 'خوب به نظر می‌رسد!',
manage_sessions: 'مدیریت نشست‌ها',
modified: 'تغییر داده شده',
move: 'انتقال',
@@ -157,6 +172,7 @@ const fa = {
open_with: 'باز کردن با',
original_name: 'نام اصلی',
original_path: 'مسیر اصلی',
oss_code_and_content: 'نرم‌افزار و محتوای متن‌باز',
password: 'رمز عبور',
password_changed: 'رمز عبور تغییر یافت.',
password_recovery_rate_limit:
@@ -173,21 +189,28 @@ const fa = {
paste: 'چسباندن',
paste_into_folder: 'چسباندن در پوشه',
path: 'مسیر',
personalization: 'شخصی سازی',
pictures: 'تصاویر',
plural_suffix: 'ها',
powered_by_puter_js: 'پشتیبانی شده توسط {{link=docs}}Puter.js{{/link}}',
preparing: 'در حال آماده سازی...',
preparing_for_upload: 'آماده سازی برای بارگذاری...',
print: 'چاپ',
privacy: 'حریم خصوصی',
proceed_to_login: 'ادامه به ورود',
proceed_with_account_deletion: 'ادامه به حذف حساب کاربری',
properties: 'ویژگی ها',
public: 'عمومی',
publish: 'انتشار',
publish_as_website: 'انتشار به عنوان وبسایت',
puter_description:
'پیوتر یک کلاود با اولویت حفظ حریم خصوصی است که همه فایل‌ها، برنامه‌ها و بازی‌های شما را در یک فضای امن نگه می‌دارد که از هر جا و هر زمان قابل دسترسی است',
reading: '%strong%درحال خواندن',
writing: '%strong%درحال نوشتن',
recover_password: 'بازیابی رمز عبور',
refer_friends_c2a:
'برای هر دوستی که حساب کاربری Puter ایجاد و تأیید کند، 1 گیگابایت دریافت کنید. دوست شما هم 1 گیگابایت دریافت خواهد کرد!',
refer_friends_social_media_c2a: '1 گیگابایت فضای ذخیره سازی رایگان را در Puter.com بگیرید!',
refresh: 'تازه کردن',
rename: 'تغییر نام',
replace: 'جایگزین کردن',
@@ -197,10 +220,12 @@ const fa = {
save: 'ذخیره',
saturation: 'اشباع رنگ',
save_account: 'ذخیره حساب',
save_account_to_get_copy_link: 'لطفا برای ادامه یک حساب کاربری ایجاد کنید.',
save_account_to_publish: 'لطفا برای ادامه یک حساب کاربری ایجاد کنید.',
save_session: 'ذخیره نشست', // TN:better to use session instead of نشست
save_session_c2a:
'برای ذخیره جلسه فعلی و جلوگیری از از دست دادن کار خود یک حساب کاربری ایجاد کنید.',
scan_qr_2fa: ' بارکد را با برنامه تایید هویت خود اسکن کنید',
search: 'جستجو',
seconds: 'ثانیه',
security: 'امنیت',
@@ -218,11 +243,13 @@ const fa = {
show_hidden: 'نمایش مخفی',
sign_in_with_puter: 'ورود با Puter',
sign_up: 'ثبت نام',
signing_in: 'ورود…',
size: 'اندازه',
skip: 'رد کردن',
something_went_wrong: 'مشکلی پیش آمد',
sort_by: 'مرتب سازی بر اساس',
status: 'وضعیت',
storage_usage: 'میزان استفاده شده از فضای ذخیره سازی',
storage_puter_used: 'استفاده شده توسط Puter',
taking_longer_than_usual: 'کمی بیشتر از معمول طول می کشد. لطفا صبر کنید...',
terms: 'شرایط',
@@ -252,19 +279,26 @@ const fa = {
videos: 'ویدیو ها',
visibility: 'قابلیت دیده شدن',
yes: 'بله',
you_have_been_referred_to_puter_by_a_friend:
'شما توسط یک دوست به Puter معرفی شده اید!',
zip: 'فشرده سازی',
sequencing: '%strong%ترتیب بندی',
zipping: '%strong%درحال فشرده سازی',
// === 2FA Setup ===
setup2fa_1_step_heading: 'برنامه تأیید هویت خود را باز کنید',
setup2fa_1_instructions:
"شما می‌توانید از هر برنامه تأیید هویتی که از پروتکل رمز یکبار مصرف مبتنی بر زمان (TOTP) پشتیبانی می‌کند استفاده کنید. اگر مطمئن نیستید، <a target='_blank' href='https://authy.com/download'>Authy</a> یک انتخاب مناسب برای اندروید و iOS است.",
setup2fa_2_step_heading: ' بارکد را اسکن کنید ',
setup2fa_3_step_heading: 'کد ۶ رقمی را وارد کنید',
setup2fa_4_step_heading: 'کدهای بازیابی خود را کپی کنید',
setup2fa_4_instructions:
'این کدهای بازیابی تنها راه دسترسی به حساب شما هستند در صورتی که تلفن خود را گم کنید یا نتوانید از برنامه تأیید هویت استفاده کنید. مطمئن شوید که آنها را در مکانی امن ذخیره کرده‌اید.',
setup2fa_5_step_heading: 'تنظیمات احراز هویت دو مرحله ای را تایید کنید',
setup2fa_5_confirmation_1:
'من کدهای بازیابی خود را در مکانی امن ذخیره کرده‌ام',
setup2fa_5_confirmation_2: 'آماده فعال کردن احراز هویت دو مرحله ای هستم',
setup2fa_5_button: 'فعال‌سازی احراز هویت دو مرحله‌ای',
// === 2FA Login ===
login2fa_otp_title: 'کد احراز هویت دو مرحله‌ای را وارد کنید',
login2fa_otp_instructions:
@@ -273,6 +307,7 @@ const fa = {
login2fa_recovery_instructions:
'یکی از کدهای بازیابی خود را برای دسترسی به حساب خود وارد کنید',
login2fa_use_recovery_code: 'از کد بازیابی استفاده کنید',
login2fa_recovery_back: 'بازگشت',
login2fa_recovery_placeholder: 'XXXXXXX',
// Sharing
@@ -333,13 +368,21 @@ const fa = {
'billing.expanded': 'گسترش یافته',
'billing.accelerated': 'تسریع شده',
'billing.enjoy_msg': 'از %% فضای ذخیره‌سازی ابری به همراه سایر مزایا لذت ببرید.',
'confirm_code_generic_title': 'کد تأیید را وارد کنید',
'choose_publishing_option': 'انتخاب کنید که چگونه می‌خواهید وب‌سایت خود را منتشر کنید:',
'create_desktop_shortcut': 'ایجاد میانبر (دسکتاپ)',
'create_desktop_shortcut_s': 'ایجاد میانبرها (دسکتاپ)',
'create_shortcut_s': 'ایجاد میانبرها',
'minimize': 'کوچک‌کردن',
'reload_app': 'بارگذاری دوباره برنامه',
'publish_as_serverless_worker': 'انتشار به‌عنوان کارگر',
'toolbar.enter_fullscreen': 'ورود به تمام‌صفحه',
'toolbar.github': 'گیت‌هاب',
'toolbar.refer': 'معرفی',
'used_of': '{{used}} استفاده شده از {{available}}',
'worker': 'کارگر',
'billing.offering.basic': 'پایه',
'too_many_attempts': 'تعداد تلاش‌ها بیش از حد است. لطفاً بعداً دوباره امتحان کنید.',
'server_timeout': 'پاسخ سرور بیش از حد طول کشید. لطفاً دوباره امتحان کنید.',
'signup_error': 'خطایی هنگام ثبت‌نام رخ داد. لطفاً دوباره امتحان کنید.',
'alert_error_title': 'خطا!',
@@ -357,10 +400,15 @@ const fa = {
'window_title_open': 'باز کردن',
'window_title_change_password': 'تغییر رمز عبور',
'window_title_select_font': 'انتخاب فونت…',
'window_title_session_list': 'لیست نشست‌ها!',
'window_title_set_new_password': 'تنظیم رمز عبور جدید',
'window_title_publish_website': 'انتشار وب‌سایت',
'window_title_publish_worker': 'انتشار کارگر',
'window_title_authenticating': 'در حال احراز هویت...',
'window_title_refer_friend': 'معرفی یک دوست!',
'desktop_exit_full_screen': 'خروج از تمام‌صفحه',
'desktop_enter_full_screen': 'ورود به تمام‌صفحه',
'item_shared_with_you': 'یک کاربر این مورد را با شما به اشتراک گذاشته است.',
'item_shared_by_you': 'شما این مورد را با حداقل یک کاربر دیگر به اشتراک گذاشته‌اید.',
'item_shortcut': 'میانبر',
'item_associated_websites': 'وب‌سایت مرتبط',
@@ -369,6 +417,9 @@ const fa = {
'window_click_to_go_back': 'برای بازگشت کلیک کنید.',
'window_click_to_go_forward': 'برای رفتن به جلو کلیک کنید.',
'window_click_to_go_up': 'برای رفتن به یک پوشه بالاتر کلیک کنید.',
'window_title_public': 'عمومی',
'window_title_videos': 'ویدئوها',
'window_title_pictures': 'تصاویر',
'window_title_puter': 'Puter',
'window_folder_empty': 'این پوشه خالی است',
},
+52
View File
@@ -47,13 +47,21 @@ const fi = {
change_always_open_with:
'Haluatko aina avata tämän tyyppisen tiedoston sovelluksella',
confirm: 'Vahvista',
confirm_2fa_setup: 'Olen lisännyt koodin todennussovellukseeni',
confirm_2fa_recovery:
'Olen tallentanut palautuskoodini turvalliseen paikkaan',
confirm_account_for_free_referral_storage_c2a:
'Luo tili ja vahvista sähköpostiosoitteesi saadaksesi 1 Gt ilmaista tallennustilaa. Myös kaverisi saa 1 Gt:n ilmaista tallennustilaa.',
confirm_code_generic_incorrect: 'Väärä koodi.',
confirm_code_generic_too_many_requests:
'Liikaa pyyntöjä. Ole hyvä ja odota muutama minuutti.',
confirm_code_generic_submit: 'Lähetä koodi',
confirm_code_generic_try_again: 'Yritä uudelleen',
confirm_code_generic_title: 'Syötä vahvistuskoodi',
confirm_code_2fa_instruction:
'Syötä kuusinumeroinen koodi todennussovelluksestasi.',
confirm_code_2fa_submit_btn: 'Lähetä',
confirm_code_2fa_title: 'Syötä kaksivaiheisen tunnistautumisen koodi',
confirm_delete_multiple_items:
'Haluatko varmasti poistaa nämä kohteet pysyvästi?',
confirm_delete_single_item: 'Haluatko poistaa tämän kohteen pysyvästi?',
@@ -66,6 +74,8 @@ const fi = {
confirm_session_revoke: 'Haluatko varmasti peruuttaa tämän istunnon?',
confirm_your_email_address: 'Vahvista sähköpostiosoitteesi',
contact_us: 'Ota yhteyttä',
contact_us_verification_required:
'Sinulla on oltava vahvistettu sähköpostiosoite, jotta voit käyttää tätä.',
// "inside(a house)" => "Sisällä" - probably more appropriate
// "contain within" => "Sisältää"
@@ -99,8 +109,11 @@ const fi = {
deploy_as_app: 'Ota käyttöön sovelluksena',
descending: 'Laskeva',
desktop: 'Työpöytä',
desktop_background_fit: 'Sovita',
developers: 'Kehittäjät',
disable_2fa: 'Ota kaksivaiheinen tunnistautuminen pois käytöstä',
disable_2fa_confirm:
'Haluatko varmasti poistaa kaksivaiheisen tunnistautumisen käytöstä?',
disable_2fa_instructions:
'Syötä salasanasi poistaaksesi kaksivaihesen tunnistautumisen käytöstä.',
documents: 'Dokumentit',
@@ -144,7 +157,9 @@ const fi = {
// "general (about something)" => "Yleistä" or
// "military general" => "Kenraali"
get_a_copy_of_on_puter: 'Hanki \'%%\' -kopio Puter.com-sivustolta!', // TODO: Very difficult ambiguity due to different case suffix for any possible word that you can substitue here. Can stay as is, but it's not exactly correct.
get_copy_link: 'Hanki kopiolinkki', // TODO: Ambiguous meaning
// 'get a copy of a link' => 'Ota Kopio Linkkiin' or
// 'get a link to the copy' => 'Ota Linkki Kopioon' - More probable, just want to be sure
@@ -152,6 +167,7 @@ const fi = {
html_document: 'HTML-dokumentti',
hue: 'Sävy',
incorrect_password: 'Väärä salasana',
invite_link: 'Kutsulinkki',
item: 'kohde',
items_in_trash_cannot_be_renamed: 'Tätä kohdetta ei voi nimetä uudelleen, koska se on roskakorissa. Jos haluat nimetä kohteen uudelleen, palauta se ensin roskakorista.',
jpeg_image: 'JPEG-kuva',
@@ -162,6 +178,7 @@ const fi = {
loading: 'Ladataan',
log_in: 'Kirjaudu Sisään',
log_out: 'Kirjaudu ulos',
looks_good: 'Näyttää hyvältä!',
manage_sessions: 'Hallitse istuntoja',
modified: 'Muokattu',
move: 'Siirrä',
@@ -197,6 +214,7 @@ const fi = {
original_name: 'Alkuperäinen nimi',
original_path: 'Alkuperäinen polku',
oss_code_and_content: 'Avoimen lähdekoodin ohjelmisto ja sisältö',
password: 'Salasana',
password_changed: 'Salasana vaihdettu.',
password_recovery_rate_limit:
@@ -213,20 +231,26 @@ const fi = {
paste: 'Liitä',
paste_into_folder: 'Liitä kansioon',
path: 'Polku',
personalization: 'Personointi',
pictures: 'Kuvat',
plural_suffix: 't',
powered_by_puter_js: 'Palvelun tarjoaa {{link=docs}}Puter.js{{/link}}',
preparing: 'Valmistellaan...',
preparing_for_upload: 'Valmistellaan latausta...',
print: 'Tulosta',
privacy: 'Yksityisyys',
proceed_to_login: 'Jatka sisäänkirjautumiseen',
proceed_with_account_deletion: 'Jatka tilin poistamista',
properties: 'Ominaisuudet',
public: 'Julkinen',
publish: 'Julkaise',
publish_as_website: 'Julkaise verkkosivustona',
puter_description: 'Puter on yksityisyyttä korostava henkilökohtainen pilvipalvelu, jossa voit säilyttää kaikki tiedostosi, sovelluksesi ja pelisi yhdessä turvallisessa paikassa, ja jotka ovat saatavilla mistä tahansa milloin tahansa.',
reading_file: 'Luetaan %strong%',
recover_password: 'Palauta salasanasi',
refer_friends_c2a:
'Saat 1 Gt ilmaista tallennustilaa jokaisesta ystävästä, joka luo ja vahvistaa tilin Puterissa. Myös ystäväsi saa 1 Gt:n ilmaista tallennustilaa!',
refer_friends_social_media_c2a: 'Hanki 1 Gt ilmaista tallennustilaa Puter.comista!',
refresh: 'Päivitä',
// "get rid of" => "Oletko varma, että haluat luovuttaa tämän osoitteen?" or
@@ -240,10 +264,12 @@ const fi = {
save: 'Tallenna',
saturation: 'Kylläisyys',
save_account: 'Tallenna tili',
save_account_to_get_copy_link: 'Luo tili jatkaaksesi.',
save_account_to_publish: 'Luo tili jatkaaksesi.',
save_session: 'Tallenna istunto',
save_session_c2a:
'Luo tili tallentaaksesi nykyisen istuntosi ja välttääksesi työsi menettämisen.',
scan_qr_2fa: 'Skannaa QR-koodi todennussovelluksellasi',
search: 'Etsi',
seconds: 'sekuntia',
security: 'Turvallisuus',
@@ -265,11 +291,13 @@ const fi = {
show_hidden: 'Näytä piilotetut',
sign_in_with_puter: 'Kirjaudu sisään Puterilla',
sign_up: 'Rekisteröidy',
signing_in: 'Kirjaudutaan sisään…',
size: 'Koko',
skip: 'Ohita',
something_went_wrong: 'Jokin meni pieleen.',
sort_by: 'Lajittele',
status: 'Tila',
storage_usage: 'Tallennustilan käyttö',
storage_puter_used: 'Puterin käyttämä',
taking_longer_than_usual:
'Kestää hieman tavallista kauemmin. Ole hyvä ja odota...',
@@ -306,24 +334,32 @@ const fi = {
videos: 'Videot',
visibility: 'Näkyvyys',
yes: 'Kyllä',
you_have_been_referred_to_puter_by_a_friend:
'Kaverisi on kutsunut sinut Puteriin!',
zip: 'Zip',
zipping_file: 'Zipataan %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Avaa todennussovelluksesi',
setup2fa_1_instructions: `
Voit käyttää mitä tahansa todennussovellusta, joka tukee aikaperusteista kertakirjautumissalasanaa (TOTP-protokollaa).
Valittavanasi on monia sovelluksia, mutta jos et ole varma,
<a target="_blank" href="https://authy.com/download">Authy</a> on hyvä valinta Androidille ja iOS:lle.
`,
setup2fa_2_step_heading: 'Skannaa QR-koodi',
setup2fa_3_step_heading: 'Syötä kuusinumeroinen koodi',
setup2fa_4_step_heading: 'Kopioi palautuskoodisi',
setup2fa_4_instructions: `
Nämä palautuskoodit ovat ainoa tapa päästä tiliisi, jos menetät puhelimesi tai et voi käyttää todennussovellustasi.
Varmista, että säilytät ne turvallisessa paikassa.
`,
setup2fa_5_step_heading:
'Vahvista kaksivaiheisen tunnistautumisen asetukset',
setup2fa_5_confirmation_1:
'Olen tallentanut palautuskoodini turvalliseen paikkaan',
setup2fa_5_confirmation_2:
'Olen valmis ottamaan kaksivaiheisen tunnistautumisen käyttöön',
setup2fa_5_button: 'Ota kaksivaiheinen tunnistautuminen käyttöön',
// === 2FA Login ===
login2fa_otp_title: 'Syötä kaksivaiheisen tunnistautumisen koodi',
@@ -333,6 +369,7 @@ const fi = {
login2fa_recovery_instructions:
'Syötä yksi palautuskoodeistasi saadaksesi pääsy tilillesi.',
login2fa_use_recovery_code: 'Käytä palautuskoodi',
login2fa_recovery_back: 'Takaisin',
login2fa_recovery_placeholder: 'XXXXXXXX',
change: 'muutos', // In English: "Change"
@@ -398,13 +435,20 @@ const fi = {
'billing.accelerated': 'Nopeutettu', // In English: "Accelerated"
'billing.enjoy_msg': 'Nauti %% pilvitallennustilasta ja muista eduista.', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'Valitse, miten haluat julkaista verkkosivustosi:',
'create_desktop_shortcut': 'Luo pikakuvake (Työpöydälle)',
'create_desktop_shortcut_s': 'Luo pikakuvakkeita (Työpöydälle)',
'create_shortcut_s': 'Luo pikakuvakkeita',
'minimize': 'Pienennä',
'reload_app': 'Lataa sovellus uudelleen',
'publish_as_serverless_worker': 'Julkaise työntekijänä',
'toolbar.enter_fullscreen': 'Koko näyttöön',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Suosittele',
'used_of': '{{used}} käytetty {{available}}:sta',
'worker': 'Työntekijä',
'billing.offering.basic': 'Perus',
'too_many_attempts': 'Liian monta yritystä. Yritä myöhemmin uudelleen.',
'server_timeout': 'Palvelimen vastaus kesti liian kauan. Yritä uudelleen.',
'signup_error': 'Rekisteröitymisen aikana tapahtui virhe. Yritä uudelleen.',
'alert_error_title': 'Virhe!',
@@ -422,10 +466,15 @@ const fi = {
'window_title_open': 'Avaa',
'window_title_change_password': 'Vaihda salasana',
'window_title_select_font': 'Valitse fontti…',
'window_title_session_list': 'Istuntolista',
'window_title_set_new_password': 'Aseta uusi salasana',
'window_title_publish_website': 'Julkaise verkkosivusto',
'window_title_publish_worker': 'Julkaise työntekijä',
'window_title_authenticating': 'Todennetaan...',
'window_title_refer_friend': 'Suosittele ystävälle!',
'desktop_exit_full_screen': 'Poistu koko näytöstä',
'desktop_enter_full_screen': 'Koko näyttöön',
'item_shared_with_you': 'Käyttäjä on jakanut tämän kohteen kanssasi.',
'item_shared_by_you': 'Olet jakanut tämän kohteen ainakin yhden muun käyttäjän kanssa.',
'item_shortcut': 'Pikakuvake',
'item_associated_websites': 'Liittyvä verkkosivusto',
@@ -434,6 +483,9 @@ const fi = {
'window_click_to_go_back': 'Napsauta palataksesi takaisin.',
'window_click_to_go_forward': 'Napsauta siirtyäksesi eteenpäin.',
'window_click_to_go_up': 'Napsauta siirtyäksesi yhtä kansiotasoa ylöspäin.',
'window_title_public': 'Julkinen',
'window_title_videos': 'Videot',
'window_title_pictures': 'Kuvat',
'window_title_puter': 'Puter',
'window_folder_empty': 'Tämä kansio on tyhjä',
},
+49
View File
@@ -40,11 +40,18 @@ const fil = {
close_all_windows_and_log_out: 'Isara ang mga window at mag-log out',
change_always_open_with: 'Gusto mo bang laging buksan ang ganitong file gamit ang',
confirm: 'Kumpirmahin',
confirm_2fa_setup: 'Naidagdag ko na ang code sa authenticator app ko',
confirm_2fa_recovery: 'Naitago ko na ang mga recovery code sa ligtas na lugar',
confirm_code_generic_incorrect: 'Maling code.',
confirm_code_generic_too_many_requests:
'Sobrang daming request. Maghintay ng ilang minuto.',
confirm_code_generic_submit: 'Isumite ang code',
confirm_code_generic_try_again: 'Subukan ulit',
confirm_code_generic_title: 'Ilagay ang confirmation code',
confirm_code_2fa_instruction:
'Ilagay ang 6-digit na code mula sa authenticator app mo.',
confirm_code_2fa_submit_btn: 'Isumite',
confirm_code_2fa_title: 'Ilagay ang 2FA code',
confirm_delete_multiple_items:
'Permanenteng tatanggalin mo ba ang mga item na ito?',
confirm_delete_single_item: 'Permanenteng tatanggalin mo ba ang item na ito?',
@@ -57,6 +64,8 @@ const fil = {
confirm_session_revoke: 'Sigurado ka bang babawiin ang session na ito?',
confirm_your_email_address: 'Kumpirmahin ang email mo',
contact_us: 'Makipag-ugnayan',
contact_us_verification_required:
'Kailangan ng naberipikang email para magamit ito.',
continue: 'Magpatuloy',
copy: 'Kopyahin',
copy_link: 'Kopyahin ang link',
@@ -78,8 +87,10 @@ const fil = {
deploy_as_app: 'I-deploy bilang app',
descending: 'Pababa',
desktop: 'Desktop',
desktop_background_fit: 'Pagkakasya',
developers: 'Mga developer',
disable_2fa: 'I-disable ang 2FA',
disable_2fa_confirm: 'I-disable mo ba ang 2FA?',
disable_2fa_instructions: 'Ilagay ang password mo para i-disable ang 2FA.',
documents: 'Mga dokumento',
dont_allow: 'Huwag payagan',
@@ -113,10 +124,13 @@ const fil = {
forgot_pass_c2a: 'Nakalimutan ang password?',
from: 'Mula kay',
general: 'Pangkalahatan',
get_a_copy_of_on_puter: 'Kumuha ng kopya ng \'%%\' sa Puter.com!',
get_copy_link: 'Kunin ang copy link',
home: 'Home',
html_document: 'HTML na dokumento',
hue: 'Hue',
incorrect_password: 'Maling password',
invite_link: 'Invite link',
item: 'item',
items_in_trash_cannot_be_renamed: 'Hindi mapalitan ang pangalan ng item na ito dahil nasa Trash. Ilabas muna ito sa Trash.',
jpeg_image: 'JPEG na larawan',
@@ -127,6 +141,7 @@ const fil = {
loading: 'Naglo-load',
log_in: 'Mag-log in',
log_out: 'Mag-log out',
looks_good: 'Ayos na!',
manage_sessions: 'Pamahalaan ang mga session',
modified: 'Binago',
move: 'Ilipat',
@@ -151,6 +166,7 @@ const fil = {
open_with: 'Buksan gamit ang',
original_name: 'Orihinal na pangalan',
original_path: 'Orihinal na lokasyon',
oss_code_and_content: 'Open source na software at content',
password: 'Password',
password_changed: 'Napalitan na ang password.',
password_recovery_rate_limit:
@@ -166,17 +182,23 @@ const fil = {
paste: 'I-paste',
paste_into_folder: 'I-paste sa folder',
path: 'Lokasyon',
personalization: 'Personalization',
pictures: 'Mga larawan',
plural_suffix: '',
powered_by_puter_js: 'Pinapagana ng {{link=docs}}Puter.js{{/link}}',
preparing: 'Inihahanda...',
preparing_for_upload: 'Inihahanda ang pag-upload...',
print: 'I-print',
privacy: 'Privacy',
proceed_to_login: 'Magpatuloy sa pag-log in',
proceed_with_account_deletion: 'Ituloy ang pagbura ng account',
properties: 'Mga katangian',
public: 'Pampubliko',
publish: 'I-publish',
publish_as_website: 'I-publish bilang website',
puter_description: 'Ang Puter ay isang privacy-first na personal cloud para sa mga file, app, at laro mo, sa isang ligtas na lugar, kahit saan at kahit kailan.',
recover_password: 'I-recover ang password',
refer_friends_social_media_c2a: 'Makakuha ng 1 GB na libreng storage sa Puter.com!',
refresh: 'I-refresh',
rename: 'Palitan ang pangalan',
replace: 'Palitan',
@@ -186,10 +208,12 @@ const fil = {
save: 'I-save',
saturation: 'Saturation',
save_account: 'I-save ang account',
save_account_to_get_copy_link: 'Gumawa ng account para makakuha ng copy link.',
save_account_to_publish: 'Gumawa ng account para makapagpatuloy.',
save_session: 'I-save ang session',
save_session_c2a:
'Gumawa ng account para ma-save ang session na ito at hindi mawala ang ginagawa mo.',
scan_qr_2fa: 'I-scan ang QR code gamit ang authenticator app mo',
search: 'Hanapin',
seconds: 'segundo',
security: 'Seguridad',
@@ -207,11 +231,13 @@ const fil = {
show_hidden: 'Ipakita ang nakatago',
sign_in_with_puter: 'Mag-sign in gamit ang Puter',
sign_up: 'Mag-sign up',
signing_in: 'Nagla-log in…',
size: 'Laki',
skip: 'Laktawan',
something_went_wrong: 'May nangyaring mali.',
sort_by: 'Ayusin ayon sa',
status: 'Status',
storage_usage: 'Gamit na storage',
storage_puter_used: 'ginagamit ng Puter',
taking_longer_than_usual:
'Medyo mas matagal kaysa karaniwan. Maghintay...',
@@ -240,8 +266,11 @@ const fil = {
videos: 'Mga video',
visibility: 'Visibility',
yes: 'Oo',
you_have_been_referred_to_puter_by_a_friend:
'Ni-refer ka ng isang kaibigan sa Puter!',
zip: 'I-zip',
setup2fa_1_step_heading: 'Buksan ang authenticator app mo',
setup2fa_1_instructions: `
Puwede ang kahit anong authenticator app na sumusuporta sa Time-based One-Time Password (TOTP).
Maraming pagpipilian, pero kung hindi ka sigurado,
@@ -249,14 +278,18 @@ const fil = {
<a target="_blank" href="https://authy.com/download">Authy</a>
para sa Android at iOS.
`,
setup2fa_2_step_heading: 'I-scan ang QR code',
setup2fa_3_step_heading: 'Ilagay ang 6 na digit',
setup2fa_4_step_heading: 'Kopyahin ang mga recovery code mo',
setup2fa_4_instructions: `
Ang mga recovery code na ito ang tanging paraan para makapasok sa account mo kung mawala ang phone mo o hindi mo magamit ang authenticator app.
Itago ang mga ito sa ligtas na lugar.
`,
setup2fa_5_step_heading: 'Kumpirmahin ang setup ng 2FA',
setup2fa_5_confirmation_1:
'Naitago ko na ang mga recovery code sa ligtas na lugar',
setup2fa_5_confirmation_2: 'Handa na akong i-enable ang 2FA',
setup2fa_5_button: 'I-enable ang 2FA',
login2fa_otp_title: 'Ilagay ang 2FA code',
login2fa_otp_instructions: 'Ilagay ang 6 na digit mula sa authenticator app mo.',
@@ -264,6 +297,7 @@ const fil = {
login2fa_recovery_instructions:
'Ilagay ang isa sa mga recovery code mo para makapasok sa account.',
login2fa_use_recovery_code: 'Gumamit ng recovery code',
login2fa_recovery_back: 'Bumalik',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'Baguhin',
@@ -328,13 +362,20 @@ const fil = {
'billing.accelerated': 'Pinabilis',
'billing.enjoy_msg': 'Sulitin ang %% na Cloud Storage at ang iba pang benepisyo.',
'choose_publishing_option': 'Piliin kung paano i-publish ang website mo:',
'create_desktop_shortcut': 'Gumawa ng shortcut (Desktop)',
'create_desktop_shortcut_s': 'Gumawa ng mga shortcut (Desktop)',
'create_shortcut_s': 'Gumawa ng mga shortcut',
'minimize': 'I-minimize',
'reload_app': 'I-reload ang app',
'publish_as_serverless_worker': 'I-publish bilang worker',
'toolbar.enter_fullscreen': 'Pumunta sa full screen',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Mag-refer',
'used_of': '{{used}} ang nagamit sa {{available}}',
'worker': 'Worker',
'billing.offering.basic': 'Basic',
'too_many_attempts': 'Sobrang daming pagsubok. Subukan ulit mamaya.',
'server_timeout': 'Matagal sumagot ang server. Subukan ulit.',
'signup_error': 'May error habang nag-sign up. Subukan ulit.',
'alert_error_title': 'Error!',
@@ -352,10 +393,15 @@ const fil = {
'window_title_open': 'Buksan',
'window_title_change_password': 'Baguhin ang password',
'window_title_select_font': 'Pumili ng font…',
'window_title_session_list': 'Listahan ng session',
'window_title_set_new_password': 'Magtakda ng bagong password',
'window_title_publish_website': 'I-publish ang website',
'window_title_publish_worker': 'I-publish ang worker',
'window_title_authenticating': 'Nag-a-authenticate...',
'window_title_refer_friend': 'Mag-refer ng kaibigan!',
'desktop_exit_full_screen': 'Lumabas sa full screen',
'desktop_enter_full_screen': 'Pumunta sa full screen',
'item_shared_with_you': 'May user na nagbahagi ng item na ito sa iyo.',
'item_shared_by_you': 'Ibinahagi mo ang item na ito sa kahit isang ibang user.',
'item_shortcut': 'Shortcut',
'item_associated_websites': 'Kaugnay na website',
@@ -364,6 +410,9 @@ const fil = {
'window_click_to_go_back': 'I-click para bumalik.',
'window_click_to_go_forward': 'I-click para sumulong.',
'window_click_to_go_up': 'I-click para umakyat ng isang directory.',
'window_title_public': 'Pampubliko',
'window_title_videos': 'Mga video',
'window_title_pictures': 'Mga larawan',
'window_title_puter': 'Puter',
'window_folder_empty': 'Walang laman ang folder na ito',
},
+63
View File
@@ -32,6 +32,7 @@ const fr = {
ascending: 'Ascendant',
associated_websites: 'Sites associés',
browser: 'Navigateur',
browser_version: 'Version du navigateur',
captcha_required: 'Veuillez compléter la vérification CAPTCHA',
cancel: 'Annuler',
change: 'Changer',
@@ -40,13 +41,21 @@ const fr = {
change_language: 'Changer de langue',
change_password: 'Changer le mot de passe',
change_username: "Changer le nom d'utilisateur",
color_depth: 'Profondeur de couleur',
close: 'Fermer',
close_all_windows_and_log_out: 'Fermer les fenêtres et se déconnecter',
confirm: 'Confirmer',
confirm_2fa_setup: "J'ai ajouté le code à mon application d'authentification",
confirm_2fa_recovery: "J'ai enregistré mes codes de récupération dans un emplacement sécurisé",
confirm_account_for_free_referral_storage_c2a: 'Créez un compte et confirmez votre adresse e-mail pour recevoir 1 Go de stockage gratuit. Votre ami bénéficiera également de 1 Go de stockage gratuit.',
confirm_code_generic_incorrect: 'Code incorrect.',
confirm_code_generic_too_many_requests: 'Trop de demandes. Veuillez patienter quelques minutes.',
confirm_code_generic_submit: 'Envoyer le code',
confirm_code_generic_try_again: 'Réessayer',
confirm_code_generic_title: 'Entrez le code de confirmation',
confirm_code_2fa_instruction: "Saisissez le code à 6 chiffres de votre application d'authentification.",
confirm_code_2fa_submit_btn: 'Valider',
confirm_code_2fa_title: 'Entrez le code A2F',
confirm_delete_multiple_items: 'Êtes-vous sûr de vouloir supprimer définitivement ces éléments ?',
confirm_delete_single_item: 'Voulez-vous supprimer définitivement cet élément ?',
confirm_open_apps_log_out: 'Vous avez des applications ouvertes. Êtes-vous sûr de vouloir vous déconnecter ?',
@@ -55,20 +64,26 @@ const fr = {
confirm_delete_user_title: 'Supprimer le compte ?',
confirm_session_revoke: 'Êtes-vous sûr de vouloir révoquer cette session ?',
confirm_your_email_address: 'Confirmez votre adresse e-mail',
choose_publishing_option: 'Choisissez comment vous voulez publier votre site web:',
contact_us: 'Nous contacter',
contact_us_verification_required: "Vous devez disposer d'une adresse e-mail vérifiée pour pouvoir utiliser ceci.",
continue: 'Continuer',
copy: 'Copier',
copy_link: 'Copier le lien',
copying: 'Copie...',
copying_file: 'Copie de %%...',
cpu_cores: 'Cœurs CPU',
cpu: 'CPU',
create_account: 'Créer un compte',
create_free_account: 'Créer un compte gratuitement',
create_desktop_shortcut: 'Créer un raccourci (Bureau)',
create_desktop_shortcut_s: 'Créer des raccourcis (Bureau)',
create_shortcut: 'Créer un raccourci',
create_shortcut_s: 'Créer des raccourcis',
credits: 'Crédits',
current_password: 'Mot de passe actuel',
cut: 'Couper',
client_information: 'Informations client',
close_all: 'Fermer tout',
created: 'Créé',
date_modified: 'Date de modification',
@@ -79,9 +94,12 @@ const fr = {
deploy_as_app: "Déployer en tant qu'application",
descending: 'Descendant',
desktop: 'Bureau',
desktop_background_fit: 'Ajuster',
developers: 'Développeurs',
disable_2fa: "Désactiver l'A2F",
disable_2fa_confirm: "Êtes-vous sûr de vouloir désactiver l'A2F ?",
disable_2fa_instructions: "Entrez votre mot de passe pour désactiver l'A2F.",
disk_storage: 'Stockage disque',
documents: 'Documents',
dont_allow: 'Ne pas autoriser',
download: 'Télécharger',
@@ -110,10 +128,13 @@ const fr = {
forgot_pass_c2a: 'Mot de passe oublié ?',
from: 'Depuis',
general: 'Général',
get_a_copy_of_on_puter: 'Obtenez une copie de \'%%\' sur Puter.com !',
get_copy_link: 'Obtenir le lien de copie',
home: 'Accueil',
html_document: 'Document HTML',
hue: 'Teinte',
incorrect_password: 'Mot de passe incorrect',
invite_link: "Lien d'invitation",
item: 'élément',
items_in_trash_cannot_be_renamed: 'Cet élément ne peut pas être renommé car il se trouve dans la corbeille. Pour renommer cet élément, faites-le d\'abord glisser hors de la corbeille.',
jpeg_image: 'Image JPEG',
@@ -124,6 +145,7 @@ const fr = {
loading: 'Chargement',
log_in: 'Se connecter',
log_out: 'Se déconnecter',
looks_good: "Ça a l'air bien !",
manage_sessions: 'Gérer les sessions',
modified: 'Modifié',
move: 'Déplacer',
@@ -152,6 +174,8 @@ const fr = {
original_name: "Nom d'origine",
original_path: "Chemin d'origine",
os: 'Système d\'exploitation',
oss_code_and_content: 'Logiciels et contenu open source',
os_version: 'Version du système d\'exploitation',
password: 'Mot de passe',
password_changed: 'Mot de passe modifié.',
password_recovery_rate_limit: "Vous avez atteint notre limite de débit ; veuillez patienter quelques minutes. Pour éviter cela à l'avenir, évitez de recharger la page trop de fois.",
@@ -163,22 +187,29 @@ const fr = {
paste: 'Coller',
paste_into_folder: 'Coller dans le dossier',
path: 'Chemin',
personalization: 'Personnalisation',
pictures: 'Images',
pixel_ratio: 'Ratio de pixels',
plural_suffix: 's',
powered_by_puter_js: 'Propulsé par {{link=docs}}Puter.js{{/link}}',
preparing: 'Préparation...',
preparing_for_upload: "Préparation de l'importation...",
print: 'Imprimer',
privacy: 'Confidentialité',
proceed_to_login: 'Procéder à la connexion',
proceed_with_account_deletion: 'Procéder à la suppression du compte',
properties: 'Propriétés',
public: 'Publique',
publish: 'Publier',
publish_as_website: 'Publier en tant que site internet',
publish_as_serverless_worker: 'Publier en tant que Worker',
puter_description: 'Puter est un cloud personnel axé sur la confidentialité pour conserver tous vos fichiers, applications et jeux en un seul endroit sécurisé, accessible de partout et à tout moment.',
ram: 'RAM',
reading: 'lecture de %strong%',
writing: 'écriture de %strong%',
recover_password: 'Récupérer le mot de passe',
refer_friends_c2a: 'Obtenez 1 Go pour chaque ami qui crée et confirme un compte sur Puter. Votre ami recevra également 1 Go !',
refer_friends_social_media_c2a: 'Obtenez 1 Go de stockage gratuit sur Puter.com !',
refresh: 'Actualiser',
rename: 'Renommer',
replace: 'Remplacer',
@@ -189,9 +220,12 @@ const fr = {
save: 'Sauvegarder',
saturation: 'Saturation',
save_account: 'Enregistrer le compte',
save_account_to_get_copy_link: 'Veuillez créer un compte pour continuer.',
save_account_to_publish: 'Veuillez créer un compte pour continuer.',
save_session: 'Sauvegarder la session',
save_session_c2a: 'Créez un compte pour enregistrer votre session actuelle et éviter de perdre votre travail.',
scan_qr_2fa: 'Scannez le code QR avec votre application d\'authentification',
screen_resolution: 'Résolution d\'écran',
search: 'Rechercher',
seconds: 'secondes',
security: 'Sécurité',
@@ -200,6 +234,7 @@ const fr = {
sessions: 'Sessions',
send: 'Envoyer',
send_password_recovery_email: 'Envoyer un e-mail de récupération de mot de passe',
server_information: 'Informations serveur',
session_saved: "Merci d'avoir créé un compte. Cette session a été sauvegardée.",
settings: 'Paramètres',
set_new_password: 'Definir un nouveau mot de passe',
@@ -209,17 +244,22 @@ const fr = {
show_hidden: 'Afficher les fichiers cachés',
sign_in_with_puter: 'Se connecter avec Puter',
sign_up: "S'inscrire",
signing_in: 'Connexion…',
size: 'Taille',
skip: 'Passer',
something_went_wrong: "Quelque chose s'est mal passé.",
sort_by: 'Trier par',
status: 'Statut',
'Storage': 'Stockage',
storage_usage: 'Utilisation du stockage',
storage_puter_used: 'utilisé par Puter',
'your_plan': 'Votre plan',
taking_longer_than_usual: "Cela prend un peu plus de temps que d'habitude. Veuillez patienter...",
terms: 'Termes',
text_document: 'Document texte',
'toolbar.enter_fullscreen': 'Passer en plein écran',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Parrainer',
tos_fineprint: 'En cliquant sur "Créer un compte gratuit", vous acceptez les {{link=terms}}Conditions d\'utilisation{{/link}} et la {{link=privacy}}Politique de confidentialité{{/link}} de Puter.',
transparency: 'Transparence',
trash: 'Corbeille',
@@ -249,6 +289,7 @@ const fr = {
videos: 'Vidéos',
visibility: 'Visibilité',
yes: 'Oui',
you_have_been_referred_to_puter_by_a_friend: 'Vous avez été recommandé à Puter par un ami !',
zip: 'Compresser',
tar: 'Tar',
download_as_tar: 'Télécharger comme Tar',
@@ -258,19 +299,24 @@ const fr = {
tarring: 'Compression en .tar de %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Ouvrez votre application d\'authentification',
setup2fa_1_instructions: `
Vous pouvez utiliser n'importe quelle application d'authentification prenant en charge le protocole TOTP (Time-based One-Time Password).
Il y a beaucoup de choix, mais si vous n'êtes pas sûr
<a target="_blank" href="https://authy.com/download">Authy</a>
est un choix solide pour Android et iOS.
`,
setup2fa_2_step_heading: 'Scannez le code QR',
setup2fa_3_step_heading: 'Entrez le code à 6 chiffres',
setup2fa_4_step_heading: 'Copiez vos codes de récupération',
setup2fa_4_instructions: `
Ces codes de récupération sont le seul moyen d'accéder à votre compte si vous perdez votre téléphone ou si vous ne pouvez pas utiliser votre application d'authentification.
Assurez-vous de les conserver dans un endroit sûr.
`,
setup2fa_5_step_heading: 'Confirmer la configuration de l\'A2F',
setup2fa_5_confirmation_1: "J'ai enregistré mes codes de récupération dans un emplacement sécurisé",
setup2fa_5_confirmation_2: "Je suis prêt à activer l'A2F",
setup2fa_5_button: "Activer l'A2F",
// === 2FA Login ===
login2fa_otp_title: 'Entrez le code A2F',
@@ -278,6 +324,7 @@ const fr = {
login2fa_recovery_title: 'Entrez un code de récupération',
login2fa_recovery_instructions: "Entrez l'un de vos codes de récupération pour accéder à votre compte.",
login2fa_use_recovery_code: 'Utiliser un code de récupération',
login2fa_recovery_back: 'Retour',
login2fa_recovery_placeholder: 'XXXXXXXX',
// Sharing
@@ -338,6 +385,7 @@ const fr = {
'billing.expanded': 'Étendu',
'billing.accelerated': 'Accéléré',
'billing.enjoy_msg': "Profitez de %% de stockage Cloud ainsi que d'autres avantages.",
'too_many_attempts': 'Trop de tentatives. Veuillez réessayer plus tard.',
'server_timeout': 'Le serveur a mis trop de temps à répondre. Veuillez réessayer.',
'signup_error': 'Une erreur est survenue lors de l\'inscription. Veuillez réessayer.',
@@ -365,14 +413,19 @@ const fr = {
'window_title_open': 'Ouvrir',
'window_title_change_password': 'Changer le mot de passe',
'window_title_select_font': 'Sélectionner la police…',
'window_title_session_list': 'Liste des sessions !',
'window_title_set_new_password': 'Définir un nouveau mot de passe',
'window_title_publish_website': 'Publier le site web',
'window_title_publish_worker': 'Publier le worker',
'window_title_authenticating': 'Authentification en cours...',
'window_title_refer_friend': 'Parrainer un ami !',
// Desktop UI
'desktop_exit_full_screen': 'Quitter le mode plein écran',
'desktop_enter_full_screen': 'Passer en plein écran',
// Item UI
'item_shared_with_you': 'Un utilisateur a partagé cet élément avec vous.',
'item_shared_by_you': 'Vous avez partagé cet élément avec au moins un autre utilisateur.',
'item_shortcut': 'Raccourci',
'item_associated_websites': 'Site web associé',
@@ -383,6 +436,9 @@ const fr = {
'window_click_to_go_back': 'Cliquez pour revenir en arrière.',
'window_click_to_go_forward': 'Cliquez pour avancer.',
'window_click_to_go_up': 'Cliquez pour remonter d\'un répertoire.',
'window_title_public': 'Publique',
'window_title_videos': 'Vidéos',
'window_title_pictures': 'Images',
'window_title_puter': 'Puter',
'window_folder_empty': 'Ce dossier est vide',
@@ -396,16 +452,23 @@ const fr = {
'perm_subdomains_read': 'voir vos sous-domaines',
'perm_subdomains_write': 'gérer vos sous-domaines',
'error_user_or_path_not_found': 'Utilisateur ou chemin introuvable.',
// Auth token
auth_token: 'Jeton d\'authentification',
token_copied: 'Jeton copié',
copy_auth_token: 'Copier le jeton d\'auth',
approve: 'Approuver',
copy_token_message: 'Votre jeton d\'authentification est affiché ci-dessous. Gardez-le secret — toute personne possédant ce jeton peut accéder à votre compte.',
copy_token_description: 'Voir et copier votre jeton d\'authentification',
// AuthMe dialog
authorization_required: 'Autorisation requise',
external_site_auth_request: 'Une application demande l\'accès à votre compte.',
authme_security_warning: 'Votre jeton d\'authentification sera partagé avec cette application pour terminer la connexion.',
redirect_destination: 'Destination de redirection',
will_be_shared: 'Sera partagé',
your_auth_token: 'Votre jeton d\'authentification',
authorization_cancelled: 'Autorisation annulée',
authorization_cancelled_desc: 'Vous avez refusé la demande d\'autorisation.',
authorization_cancelled_message: 'L\'application ne recevra pas l\'accès à votre compte. Vous pouvez fermer cette fenêtre en toute sécurité.',
+48
View File
@@ -40,12 +40,19 @@ const he = {
close_all_windows_and_log_out: 'סגור את החלונות והתנתק',
change_always_open_with: 'האם אתה רוצה תמיד לפתוח סוג זה של קובץ עם',
confirm: 'לאשר',
confirm_2fa_setup: 'הוספתי את הקוד לאפליקצית האימות שלי',
confirm_2fa_recovery: 'שמרתי את קודי השחזור שלי במיקום מאובטח',
confirm_account_for_free_referral_storage_c2a:
'צור חשבון ואשר את כתובת הדוא"ל שלך כדי לקבל 1 גיגה בייט של אחסון בחינם. חברך יקבל גם 1 גיגה בייט של אחסון בחינם.',
confirm_code_generic_incorrect: 'קוד שגוי.',
confirm_code_generic_too_many_requests:
'יותר מדי בקשות. אנא המתינו מספר דקות.',
confirm_code_generic_submit: 'שלח קוד',
confirm_code_generic_try_again: 'נסה שוב',
confirm_code_generic_title: 'הזן קוד אישור',
confirm_code_2fa_instruction: 'הזינו את הקוד בן 6 הספרות מאפליקציית המאמת.',
confirm_code_2fa_submit_btn: 'שלח',
confirm_code_2fa_title: 'הזינו קוד אימות דו-שלבי',
confirm_delete_multiple_items:
'האם אתה בטוח שברצונך למחוק פריטים אלה לצמיתות?',
confirm_delete_single_item: 'האם ברצונך למחוק פריט זה לצמיתות?',
@@ -58,6 +65,8 @@ const he = {
confirm_session_revoke: '?האם אתה בטוח שברצונך לבטל חיבור פעיל זה',
confirm_your_email_address: 'אשר את כתובת האימייל שלך',
contact_us: 'צור קשר',
contact_us_verification_required:
'עליך להיות בעל כתובת אימייל מאומתת כדי להשתמש בזה.',
continue: 'המשיך',
copy: 'העתק',
copy_link: 'העתק קישור',
@@ -79,8 +88,10 @@ const he = {
deploy_as_app: 'לפרוס כאפליקציה',
descending: 'בסדר יורד',
desktop: 'שולחן העבודה ',
desktop_background_fit: 'התאים',
developers: 'מפתחים',
disable_2fa: 'השבתת אימות דו-שלבי',
disable_2fa_confirm: 'האם אתם בטוחים שברצונכם להשבית אימות דו-שלבי?',
disable_2fa_instructions: 'הזינו את הסיסמה שלכם כדי להשבית אימות דו-שלבי.',
documents: 'מסמכים',
dont_allow: 'אל תאפשר',
@@ -114,10 +125,13 @@ const he = {
forgot_pass_c2a: 'שכחת את הסיסמא?',
from: 'טופס',
general: 'כללי',
get_a_copy_of_on_puter: 'קבל עותק של \'%%\' ב Puter.com!',
get_copy_link: 'קבל העתק קישור',
home: 'בית',
html_document: 'מסמך HTML',
hue: 'דרגת צבע',
incorrect_password: 'סיסמה שגויה',
invite_link: 'קישור הזמנה',
item: 'פריט',
items_in_trash_cannot_be_renamed: 'לא ניתן לשנות את שם הפריט הזה כי הוא נמצא באשפה. כדי לשנות את שם הפריט הזה, תחילה גרור אותו מחוץ לאשפה.',
jpeg_image: 'JPEG תמונת',
@@ -128,6 +142,7 @@ const he = {
loading: 'טוען',
log_in: 'התחברות',
log_out: 'התנתק',
looks_good: 'נראה טוב!',
manage_sessions: 'ניהול חיבורים פעילים',
modified: 'שונה',
move: 'לעבור',
@@ -152,6 +167,7 @@ const he = {
open_with: 'לפתוח באמצעות',
original_name: 'שם מקורי',
original_path: 'מסלול מקורי',
oss_code_and_content: 'תוכנה ותוכן בקוד פתוח',
password: 'סיסמה',
password_changed: 'הסיסמה השתנתה.',
password_recovery_rate_limit:
@@ -166,20 +182,26 @@ const he = {
paste: 'הדבק',
paste_into_folder: 'הדבק בתיקיה',
path: 'מסלול',
personalization: 'התאמה אישית',
pictures: 'תמונות',
plural_suffix: 's',
powered_by_puter_js: 'מונע ע"י {{link=docs}}Puter.js{{/link}}',
preparing: 'מכין...',
preparing_for_upload: 'מתכוננים להעלאה...',
print: 'הדפס',
privacy: 'פרטיות',
proceed_to_login: 'המשך לכניסה',
proceed_with_account_deletion: 'המשך למחיקת חשבון',
properties: 'תכונות',
public: 'ציבורי',
publish: 'פרסם',
publish_as_website: 'פרסום כאתר אינטרנט',
puter_description: 'הוא ענן אישי ששם את הפרטיות בראש סדר העדיפויות כדי לשמור על כל הקבצים, המשחקים, והיישומים שלך במקום מאובטח אחד, נגיש מכל מקום ובכל זמן Puter',
reading_file: 'קורא %strong%',
recover_password: 'שחזור סיסמה',
refer_friends_c2a:
'קבל 1 גיגה בייט עבור כל חבר שיוצר ומאשר חשבון ב Puter. גם החבר שלך יקבל 1 גיגה בייט!',
refer_friends_social_media_c2a: 'קבל שטח אחסון של 1 גיגה בייט בחינם Puter.com!',
refresh: 'רענן',
rename: 'שנה שם',
replace: 'החלף',
@@ -189,10 +211,12 @@ const he = {
save: 'שמירה',
saturation: 'סטורציה',
save_account: 'שמירת חשבון',
save_account_to_get_copy_link: 'אנא צור חשבון כדי להמשיך.',
save_account_to_publish: 'אנא צור חשבון כדי להמשיך.',
save_session: 'שמירת חיבור',
save_session_c2a:
'צור חשבון כדי לשמור את החיבור הנוכחי שלך ולהימנע מאובדן העבודה שלך.',
scan_qr_2fa: 'סרוק את קוד ה- QR באמצעות אפליקציית האימות שלך',
search: 'חיפוש',
seconds: 'שניות',
security: 'אבטחה',
@@ -210,11 +234,13 @@ const he = {
show_hidden: 'הצג מוסתר',
sign_in_with_puter: 'להתחבר עם Puter',
sign_up: 'הרשמה',
signing_in: 'התחברות…',
size: 'גודל',
skip: 'דלג',
something_went_wrong: 'משהו השתבש.',
sort_by: 'מיין לפי',
status: 'סטטוס',
storage_usage: 'שימוש באחסון',
storage_puter_used: 'Puter בשימוש על ידי',
taking_longer_than_usual: 'לוקח קצת יותר זמן מהרגיל. חכה בבקשה...',
terms: 'תנאים',
@@ -242,23 +268,29 @@ const he = {
videos: 'סרטונים',
visibility: 'נראות',
yes: 'כן',
you_have_been_referred_to_puter_by_a_friend: 'הופנית אל Puter על ידי חבר!',
zip: 'מכווץ',
zipping_file: 'מכווץ קובץ %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'פתחו את אפליקציית המאמת',
setup2fa_1_instructions: `
אתה יכול להשתמש בכל אפליקציית אימות התומכת בפרוטוקול סיסמה חד פעמית מבוססת זמן (TOTP).
יש הרבה לבחירה, אבל אם אתה לא בטוח
<a target="_blank" href="https://authy.com/download">Authy</a>
היא בחירה סולידית עבור אנדרואיד ו- iOS.
`,
setup2fa_2_step_heading: 'סרוק את קוד ה- QR',
setup2fa_3_step_heading: 'הזן את הקוד בן 6 הספרות',
setup2fa_4_step_heading: 'העתק את קודי השחזור שלך',
setup2fa_4_instructions: `
קודי שחזור אלו הם הדרך היחידה לגשת לחשבון שלך במידה של איבוד הטלפון או אי יכולת שימוש באפליקציית המאמת .
הקפד לאחסן אותם במקום בטוח.
`,
setup2fa_5_step_heading: 'אשר את הגדרת האימות הדו-שלבי',
setup2fa_5_confirmation_1: 'שמרתי את קודי השחזור שלי במיקום מאובטח',
setup2fa_5_confirmation_2: 'אני מוכן להפעיל אימות דו-שלבי',
setup2fa_5_button: 'הפעלת אימות דו-שלבי',
// === 2FA Login ===
login2fa_otp_title: 'הזינו קוד אימות דו-שלבי',
@@ -267,6 +299,7 @@ const he = {
login2fa_recovery_instructions:
'הזן אחד מקודי השחזור שלך כדי לגשת לחשבון שלך.',
login2fa_use_recovery_code: 'שימוש בקוד שחזור',
login2fa_recovery_back: 'לאחור',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'שנה', // In English: "Change"
@@ -330,13 +363,20 @@ const he = {
'billing.expanded': 'מורחב', // In English: "Expanded"
'billing.accelerated': 'מואץ', // In English: "Accelerated"
'billing.enjoy_msg': 'תהנו מ %% של אחסון ענן בנוסף להטבות נוספות', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'בחר כיצד לפרסם את האתר שלך', // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': 'צור קיצור דרך (שולחן עבודה)', // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'צור קיצורי דרך (שולחן עבודה)', // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'צור קיצורי דרך', // In English: "Create Shortcuts"
'minimize': 'מזער', // In English: "Minimize"
'reload_app': 'טען מחדש', // In English: "Reload App"
'publish_as_serverless_worker': 'פרסם כעובד', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'מסך מלא', // In English: "Enter Full Screen"
'toolbar.github': 'גיטהאב', // In English: "GitHub"
'toolbar.refer': 'הפנה', // In English: "Refer"
'used_of': '{{available}} משומש מתוך {{used}}', // In English: "{{used}} used of {{available}}"
'worker': 'עובד', // In English: "Worker"
'billing.offering.basic': 'בסיסי', // In English: "Basic"
'too_many_attempts': '.יותר מדי נסיונות. אנא נסה מאוחר יותר', // In English: "Too many attempts. Please try again later."
'server_timeout': '.לשרת לקח זמן רב מדי להגיב. אנא נסה שנית', // In English: "The server took too long to respond. Please try again."
'signup_error': '.ארעה תקלה בעת ההרשמה. אנא נסה שנית', // In English: "An error occurred during signup. Please try again."
'alert_error_title': '!תקלה', // In English: "Error!"
@@ -354,10 +394,15 @@ const he = {
'window_title_open': 'פתח', // In English: "Open"
'window_title_change_password': 'שנה סיסמא', // In English: "Change Password"
'window_title_select_font': '...בחר גופן', // In English: "Select font…"
'window_title_session_list': 'רשימת חיבורים', // In English: "Session List!"
'window_title_set_new_password': 'בחר סיסמא חדשה', // In English: "Set New Password"
'window_title_publish_website': 'פרסם אתר', // In English: "Publish Website"
'window_title_publish_worker': 'פרסם עובד', // In English: "Publish Worker"
'window_title_authenticating': 'מאמת', // In English: "Authenticating..."
'window_title_refer_friend': '!הפנה חבר', // In English: "Refer a friend!"
'desktop_exit_full_screen': 'בטל מסך מלא', // In English: "Exit Full Screen"
'desktop_enter_full_screen': 'הפעל מסך מלא', // In English: "Enter Full Screen"
'item_shared_with_you': 'משתמש שיתף עמך פריט זה', // In English: "A user has shared this item with you."
'item_shared_by_you': 'שיתפת פריט זה עם לפחות משתמש אחד נוסף', // In English: "You have shared this item with at least one other user."
'item_shortcut': 'קיצור דרך', // In English: "Shortcut"
'item_associated_websites': 'אתר משויך', // In English: "Associated website"
@@ -366,6 +411,9 @@ const he = {
'window_click_to_go_back': 'לחץ כדי לחזור', // In English: "Click to go back."
'window_click_to_go_forward': 'לחץ כדי להתקדם', // In English: "Click to go forward."
'window_click_to_go_up': 'לחץ כדי לעלות ספרייה אחת מעלה', // In English: "Click to go one directory up."
'window_title_public': 'ציבורי', // In English: "Public"
'window_title_videos': 'סרטונים', // In English: "Videos"
'window_title_pictures': 'תמונות', // In English: "Pictures"
'window_title_puter': 'Puter', // In English: "Puter"
'window_folder_empty': 'תיקייה זו ריקה', // In English: "This folder is empty"
},
+47
View File
@@ -39,10 +39,17 @@ const hi = {
close: 'बंद ',
close_all_windows_and_log_out: 'विंडोज़ बंद करें और लॉग आउट करें',
change_always_open_with: 'क्या आप इस प्रकार की फ़ाइल को हमेशा खोलना चाहते हैं?',
confirm_2fa_setup: 'मैंने अपने प्रमाणक ऐप में कोड जोड़ दिया है',
confirm_2fa_recovery: 'मैंने अपने पुनर्प्राप्ति कोड सुरक्षित स्थान पर सहेजे हैं',
confirm_account_for_free_referral_storage_c2a: 'एक खाता बनाएं और 1 जीबी निःशुल्क संग्रहण प्राप्त करने के लिए अपने ईमेल पते की पुष्टि करें। आपके दोस्त को भी 1 जीबी मुफ्त स्टोरेज मिलेगा।',
confirm_code_generic_incorrect: 'गलत कोड़।',
confirm_code_generic_too_many_requests: 'बहुत सारे अनुरोध. कृपया कुछ मिनट प्रतीक्षा करें.',
confirm_code_generic_submit: 'कोड जमा करें',
confirm_code_generic_try_again: 'पुनः प्रयास करें',
confirm_code_generic_title: 'पुष्टि कोड दर्ज करें',
confirm_code_2fa_instruction: 'अपने प्रमाणक ऐप से 6 अंकों का कोड दर्ज करें।',
confirm_code_2fa_submit_btn: 'जमा करें',
confirm_code_2fa_title: '2FA कोड दर्ज करें',
confirm_delete_multiple_items: 'क्या आप वाकई इन वस्तुओं को स्थायी रूप से हटाना चाहते हैं?',
confirm_delete_single_item: 'क्या आप वाकई इस वस्तु को स्थायी रूप से हटाना चाहते हैं?',
confirm_open_apps_log_out: 'आपके पास ऐप्स खुला हैं. क्या आप लॉग आउट करना चाहते हैं?',
@@ -52,6 +59,7 @@ const hi = {
confirm_session_revoke: 'क्या आप वाकई इस सत्र को रद्द करना चाहते हैं?',
confirm_your_email_address: 'अपने ईमेल पते की पुष्टि करें',
contact_us: 'संपर्क करें',
contact_us_verification_required: 'इसका उपयोग करने के लिए आपके पास एक सत्यापित ईमेल पता होना चाहिए।',
continue: 'निरंतर',
copy: 'प्रतिलिपि',
copy_link: 'लिंक की प्रतिलिपि करें',
@@ -73,8 +81,10 @@ const hi = {
deploy_as_app: 'ऐप के रूप में तैनात करें',
descending: 'अवरोही',
desktop: 'डेस्कटॉप',
desktop_background_fit: 'उपयुक्त',
developers: 'डेवलपर्स',
disable_2fa: '2एफए गायब करें',
disable_2fa_confirm: 'क्या आप वाकई 2एफए को गायब करना चाहते हैं?',
disable_2fa_instructions: '2एफए को गायब करने के लिए अपना पासवर्ड दर्ज करें।',
documents: 'दस्तावेज़',
dont_allow: 'अनुमति न दें',
@@ -104,10 +114,13 @@ const hi = {
forgot_pass_c2a: 'पासवर्ड भूल गए?',
from: 'से',
general: 'सामान्य',
get_a_copy_of_on_puter: "Purer.com पर '%%' की एक कॉपी प्राप्त करें!",
get_copy_link: 'कॉपी लिंक प्राप्त करें',
home: 'घर',
html_document: 'एचटीएमएल दस्तावेज़',
hue: 'रंग',
incorrect_password: 'गलत पासवर्ड',
invite_link: 'लिंक आमंत्रित करें',
item: 'वस्तु',
items_in_trash_cannot_be_renamed: 'इस वस्तु का नाम नहीं बदला जा सकता क्योंकि यह कूड़ेदान में है। इस वस्तु का नाम बदलने के लिए, पहले इसे ट्रैश से बाहर खींचें।',
jpeg_image: 'जेपीईजी छवि',
@@ -118,6 +131,7 @@ const hi = {
loading: 'लोड हो रहा है',
log_in: 'लॉग इन करें',
log_out: 'लॉग आउट',
looks_good: 'अच्छा लग रहा है!',
manage_sessions: 'सत्र प्रबंधित करें',
modified: 'संशोधित',
move: 'बदले',
@@ -142,6 +156,7 @@ const hi = {
open_with: 'के साथ खोलें',
original_name: 'वास्तविक नाम',
original_path: 'वास्तविक पथ',
oss_code_and_content: 'ओपन सोर्स सॉफ्टवेयर और सामग्री',
password: 'पासवर्ड',
password_changed: 'पासवर्ड बदला गया।',
password_recovery_rate_limit: 'आप हमारी दर-सीमा तक पहुंच गए हैं; कृपया कुछ मिनट प्रतीक्षा करें. भविष्य में इसे रोकने के लिए, पृष्ठ को कई बार पुनः लोड करने से बचें।',
@@ -153,19 +168,25 @@ const hi = {
paste: 'पेस्ट करें',
paste_into_folder: 'फ़ोल्डर में पेस्ट करें',
path: 'पथ',
personalization: 'वैयक्तिकरण',
pictures: 'चित्रों',
plural_suffix: 'एस',
powered_by_puter_js: '{{link=docs}}Puter.js{{/link}} द्वारा संचालित',
preparing: 'तैयार कर रहे हैं...',
preparing_for_upload: 'अपलोड करने की तैयारी है...',
print: 'छाप',
privacy: 'गोपनीयता',
proceed_to_login: 'लॉगिन करने के लिए आगे बढ़ें',
proceed_with_account_deletion: 'खाता हटाने के साथ आगे बढ़ें',
properties: 'गुण',
public: 'लोग',
publish: 'प्रकाशित',
publish_as_website: 'वेबसाइट के रूप में प्रकाशित करें',
puter_description: 'पुटर एक गोपनीयता-प्रथम व्यक्तिगत क्लाउड है जो आपकी सभी फ़ाइलों, ऐप्स और गेम को एक सुरक्षित स्थान पर रखता है, जिसे किसी भी समय कहीं से भी एक्सेस किया जा सकता है।',
reading_file: 'पढ़ना %strong%',
recover_password: 'पासवर्ड वापस लाये',
refer_friends_c2a: 'पुटर पर खाता बनाने और पुष्टि करने वाले प्रत्येक मित्र के लिए 1 जीबी प्राप्त करें। आपके दोस्त को भी मिलेगा 1 जीबी!',
refer_friends_social_media_c2a: 'Purer.com पर 1 जीबी निःशुल्क स्टोरेज प्राप्त करें!',
refresh: 'ताजा करना ',
rename: 'नाम बदलें',
replace: 'प्रतिस्थापित करें',
@@ -175,9 +196,11 @@ const hi = {
save: 'सहेजें',
saturation: 'परिपूर्णता',
save_account: 'खाता सहेजें',
save_account_to_get_copy_link: 'कृपया आगे बढ़ने के लिए एक खाता बनाएँ।',
save_account_to_publish: 'कृपया आगे बढ़ने के लिए एक खाता बनाएँ।',
save_session: 'सत्र को बचाए',
save_session_c2a: 'अपने वर्तमान सत्र को सहेजने और अपना काम खोने से बचने के लिए एक खाता बनाएं।',
scan_qr_2fa: 'अपने प्रमाणक ऐप से क्यूआर कोड को स्कैन करें',
search: 'खोजे',
seconds: 'सेकंड',
security: 'सुरक्षा',
@@ -195,11 +218,13 @@ const hi = {
show_hidden: 'छिपा हुआ दिखाएं',
sign_in_with_puter: 'पुटर के साथ साइन इन करें',
sign_up: 'साइन अप करें',
signing_in: 'साइन कर रहे हैं…',
size: 'आकार',
skip: 'छोडना',
something_went_wrong: 'कुछ गलत हो गया।',
sort_by: 'इसके अनुसार क्रमबद्ध करें',
status: 'स्थिति',
storage_usage: 'भंडारण उपयोग',
storage_puter_used: 'पुटर द्वारा उपयोग किया गया',
taking_longer_than_usual: 'सामान्य से थोड़ा अधिक समय लग रहा है. कृपया प्रतीक्षा करें...',
terms: 'Terms',
@@ -227,15 +252,21 @@ const hi = {
videos: 'वीडियो',
visibility: 'दृश्यता',
yes: 'हाँ',
you_have_been_referred_to_puter_by_a_friend: 'आपको एक मित्र ने पुटर के बारे में बताया है!',
zip: 'ज़िप',
zipping_file: 'ज़िपिंग %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'अपना प्रमाणक ऐप खोलें',
setup2fa_1_instructions: "आप किसी भी प्रमाणक ऐप का उपयोग कर सकते हैं जो टाइम-आधारित वन-टाइम पासवर्ड (टीओटीपी) प्रोटोकॉल का समर्थन करता है।चुनने के लिए बहुत कुछ है, लेकिन यदि आप अनिश्चित हैं <a target='_blank' href='https://authy.com/download'>Authy</a>Android और iOS के लिए एक ठोस विकल्प है",
setup2fa_2_step_heading: 'क्यूआर कोड को स्कैन करें',
setup2fa_3_step_heading: '6 अंकीय कोड दर्ज करें',
setup2fa_4_step_heading: 'अपने पुनर्प्राप्ति कोड कॉपी करें',
setup2fa_4_instructions: 'यदि आप अपना फ़ोन खो देते हैं या अपने प्रमाणक ऐप का उपयोग नहीं कर पाते हैं तो ये पुनर्प्राप्ति कोड आपके खाते तक पहुंचने का एकमात्र तरीका हैं।उन्हें सुरक्षित स्थान पर संग्रहित करना सुनिश्चित करें।',
setup2fa_5_step_heading: '2एफए सेटअप की पुष्टि करें',
setup2fa_5_confirmation_1: 'मैंने अपने पुनर्प्राप्ति कोड सुरक्षित स्थान पर सहेजे हैं',
setup2fa_5_confirmation_2: 'मैं 2एफए सक्षम करने के लिए तैयार हूं',
setup2fa_5_button: '2एफए सक्षम करें',
// === 2FA Login ===
login2fa_otp_title: '2एफए कोड दर्ज करें',
@@ -243,6 +274,7 @@ const hi = {
login2fa_recovery_title: 'एक पुनर्प्राप्ति कोड दर्ज करें',
login2fa_recovery_instructions: 'अपने खाते तक पहुंचने के लिए अपना एक पुनर्प्राप्ति कोड दर्ज करें।',
login2fa_use_recovery_code: 'पुनर्प्राप्ति कोड का उपयोग करें',
login2fa_recovery_back: 'पीछे',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'बदलें', // In English: "Change"
@@ -308,13 +340,20 @@ const hi = {
'billing.accelerated': 'त्वरित ', // In English: "Accelerated"
'billing.enjoy_msg': '%% क्लाउड स्टोरेज का आनंद लें और अन्य लाभ प्राप्त करें।', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'अपनी वेबसाइट को कैसे प्रकाशित करना चाहते हैं, चुनें:', // In English: "Choose how you want to publish your website:"
'create_desktop_shortcut': 'शॉर्टकट बनाएँ (डेस्कटॉप)', // In English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'शॉर्टकट्स बनाएँ (डेस्कटॉप)', // In English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'शॉर्टकट्स बनाएँ', // In English: "Create Shortcuts"
'minimize': 'मिनिमाइज़ करें', // In English: "Minimize"
'reload_app': 'ऐप पुनः लोड करें', // In English: "Reload App"
'publish_as_serverless_worker': 'वर्कर के रूप में प्रकाशित करें', // In English: "Publish as Worker"
'toolbar.enter_fullscreen': 'पूर्ण स्क्रीन में जाएँ', // In English: "Enter Full Screen"
'toolbar.github': 'GitHub', // In English: "GitHub"
'toolbar.refer': 'रेफ़र', // In English: "Refer"
'used_of': '{{available}} में से {{used}} उपयोग', // In English: "{{used}} used of {{available}}"
'worker': 'वर्कर', // In English: "Worker"
'billing.offering.basic': 'मूल', // In English: "Basic"
'too_many_attempts': 'बहुत अधिक प्रयास। कृपया बाद में पुनः प्रयास करें।', // In English: "Too many attempts. Please try again later."
'server_timeout': 'सर्वर को उत्तर देने में बहुत समय लगा। कृपया फिर से प्रयास करें।', // In English: "The server took too long to respond. Please try again."
'signup_error': 'साइन अप करते समय एक त्रुटि हुई। कृपया पुनः प्रयास करें।', // In English: "An error occurred during signup. Please try again."
'alert_error_title': 'त्रुटि!', // In English: "Error!"
@@ -332,10 +371,15 @@ const hi = {
'window_title_open': 'खोलें', // In English: "Open"
'window_title_change_password': 'पासवर्ड बदलें', // In English: "Change Password"
'window_title_select_font': 'फ़ॉन्ट चुनें…', // In English: "Select font…"
'window_title_session_list': 'सत्र सूची!', // In English: "Session List!"
'window_title_set_new_password': 'नया पासवर्ड सेट करें', // In English: "Set New Password"
'window_title_publish_website': 'वेबसाइट प्रकाशित करें', // In English: "Publish Website"
'window_title_publish_worker': 'वर्कर प्रकाशित करें', // In English: "Publish Worker"
'window_title_authenticating': 'प्रमाणित किया जा रहा है...', // In English: "Authenticating..."
'window_title_refer_friend': 'मित्र को रेफ़र करें!', // In English: "Refer a friend!"
'desktop_exit_full_screen': 'पूर्ण स्क्रीन से बाहर निकलें', // In English: "Exit Full Screen"
'desktop_enter_full_screen': 'पूर्ण स्क्रीन में जाएँ', // In English: "Enter Full Screen"
'item_shared_with_you': 'एक उपयोगकर्ता ने यह वस्तु आपके साथ साझा की है।', // In English: "A user has shared this item with you."
'item_shared_by_you': 'आपने यह वस्तु कम से कम एक अन्य उपयोगकर्ता के साथ साझा की है।', // In English: "You have shared this item with at least one other user."
'item_shortcut': 'शॉर्टकट', // In English: "Shortcut"
'item_associated_websites': 'संबद्ध वेबसाइट', // In English: "Associated website"
@@ -344,6 +388,9 @@ const hi = {
'window_click_to_go_back': 'वापस जाने के लिए क्लिक करें।', // In English: "Click to go back."
'window_click_to_go_forward': 'आगे जाने के लिए क्लिक करें।', // In English: "Click to go forward."
'window_click_to_go_up': 'एक निर्देशिका ऊपर जाने के लिए क्लिक करें।', // In English: "Click to go one directory up."
'window_title_public': 'सार्वजनिक', // In English: "Public"
'window_title_videos': 'वीडियो', // In English: "Videos"
'window_title_pictures': 'चित्र', // In English: "Pictures"
'window_title_puter': 'Puter', // In English: "Puter"
'window_folder_empty': 'यह फ़ोल्डर खाली है', // In English: "This folder is empty"
},
+47
View File
@@ -40,10 +40,17 @@ const hu = {
close_all_windows_and_log_out: 'Ablakok bezárása és kijelentkezés',
change_always_open_with: 'Mindig ezzel az alkalmazással nyitja meg ezt a fájlt?',
confirm: 'Megerősít',
confirm_2fa_setup: 'A kódot hozzáadtam a hitelesítő alkalmazásomhoz',
confirm_2fa_recovery: 'A helyreállítási kódokat biztonságos helyen tároltam',
confirm_account_for_free_referral_storage_c2a: 'Hozz létre egy fiókot és erősítsd meg email címedet, hogy 1 GB ingyenes tárhelyet kapj. A barátod is kap 1 GB ingyenes tárhelyet.',
confirm_code_generic_incorrect: 'Hibás kód.',
confirm_code_generic_too_many_requests: 'Túl sok kérés. Kérlek, várj néhány percet.',
confirm_code_generic_submit: 'Kód beküldése',
confirm_code_generic_try_again: 'Próbáld újra',
confirm_code_generic_title: 'Megerősítő kód megadása',
confirm_code_2fa_instruction: 'Add meg a 6-jegyű kódot a hitelesítő alkalmazásodból.',
confirm_code_2fa_submit_btn: 'Beküldés',
confirm_code_2fa_title: '2FA kód megadása',
confirm_delete_multiple_items: 'Biztosan véglegesen törölni akarod ezeket az elemeket?',
confirm_delete_single_item: 'Biztosan véglegesen törölni akarod ezt az elemet?',
confirm_open_apps_log_out: 'Nyitott alkalmazásaid vannak. Biztosan ki akarsz jelentkezni?',
@@ -53,6 +60,7 @@ const hu = {
confirm_session_revoke: 'Biztosan visszavonod ezt a munkamenetet?',
confirm_your_email_address: 'Email címed megerősítése',
contact_us: 'Kapcsolat',
contact_us_verification_required: 'A használathoz érvényesített email címmel kell rendelkezned.',
continue: 'Folytatás',
copy: 'Másolás',
copy_link: 'Link másolása',
@@ -74,8 +82,10 @@ const hu = {
deploy_as_app: 'Alkalmazásként telepít',
descending: 'Csökkenő',
desktop: 'Asztal',
desktop_background_fit: 'Illesztés',
developers: 'Fejlesztők',
disable_2fa: '2FA letiltása',
disable_2fa_confirm: 'Biztosan letiltod a 2FA-t?',
disable_2fa_instructions: 'Add meg a jelszavad a 2FA letiltásához.',
documents: 'Dokumentumok',
dont_allow: 'Nem engedélyez',
@@ -105,10 +115,13 @@ const hu = {
forgot_pass_c2a: 'Elfelejtetted a jelszavad?',
from: 'Tól',
general: 'Általános',
get_a_copy_of_on_puter: "Szerezz egy példányt a(z) '%%' Puter.com-on!",
get_copy_link: 'Másolási link megszerzése',
home: 'Otthon',
html_document: 'HTML dokumentum',
hue: 'Színárnyalat',
incorrect_password: 'Helytelen jelszó',
invite_link: 'Meghívó link',
item: 'elem',
items_in_trash_cannot_be_renamed: 'Ez az elem nem nevezhető át, mert a kukában van. A név megváltoztatásához először húzd ki a Kukából.',
jpeg_image: 'JPEG kép',
@@ -119,6 +132,7 @@ const hu = {
loading: 'Betöltés',
log_in: 'Bejelentkezés',
log_out: 'Kijelentkezés',
looks_good: 'Jól néz ki!',
manage_sessions: 'Munkamenetek kezelése',
modified: 'Módosítva',
move: 'Mozgatás',
@@ -143,6 +157,7 @@ const hu = {
open_with: 'Megnyitás ezzel',
original_name: 'Eredeti név',
original_path: 'Eredeti útvonal',
oss_code_and_content: 'Nyílt forráskódú szoftver és tartalom',
password: 'Jelszó',
password_changed: 'Jelszó megváltoztatva.',
password_recovery_rate_limit: 'Elérted a korlátunkat; kérlek, várj néhány percet. A jövőben kerüld az oldal túl sokszori újratöltését.',
@@ -154,19 +169,25 @@ const hu = {
paste: 'Beillesztés',
paste_into_folder: 'Beillesztés a mappába',
path: 'Útvonal',
personalization: 'Személyre szabás',
pictures: 'Képek',
plural_suffix: 'k',
powered_by_puter_js: 'A Puter.js hajtja',
preparing: 'Előkészítés...',
preparing_for_upload: 'Feltöltés előkészítése...',
print: 'Nyomtatás',
privacy: 'Adatvédelem',
proceed_to_login: 'Folytatás a bejelentkezéshez',
proceed_with_account_deletion: 'Fiók törlésének folytatása',
properties: 'Tulajdonságok',
public: 'Nyilvános',
publish: 'Közzététel',
publish_as_website: 'Közzététel weboldalként',
puter_description: 'A Puter egy adatvédelmi elsőként kezelt személyes felhő, amelyben minden fájlodat, alkalmazásodat és játékodat egy biztonságos helyen tárolhatod, bárhonnan, bármikor elérhetően.',
reading_file: 'Fájl olvasása: %strong%',
recover_password: 'Jelszó visszaállítása',
refer_friends_c2a: 'Kapj 1 GB-ot minden barátodért, aki létrehoz és megerősít egy fiókot a Puteren. A barátod is kap 1 GB-ot!',
refer_friends_social_media_c2a: 'Kapj 1 GB ingyenes tárhelyet a Puter.com-on!',
refresh: 'Frissítés',
rename: 'Átnevezés',
replace: 'Csere',
@@ -176,9 +197,11 @@ const hu = {
save: 'Mentés',
saturation: 'Telítettség',
save_account: 'Fiók mentése',
save_account_to_get_copy_link: 'A folytatáshoz kérlek, hozz létre egy fiókot.',
save_account_to_publish: 'A folytatáshoz kérlek, hozz létre egy fiókot.',
save_session: 'Munkamenet mentése',
save_session_c2a: 'Hozz létre egy fiókot, hogy mentsd az aktuális munkamenetedet és elkerüld a munkád elvesztését.',
scan_qr_2fa: 'Olvasd be a QR-kódot a hitelesítő alkalmazásoddal',
search: 'Keresés',
seconds: 'másodperc',
security: 'Biztonság',
@@ -196,11 +219,13 @@ const hu = {
show_hidden: 'Rejtett megjelenítése',
sign_in_with_puter: 'Bejelentkezés Puterrel',
sign_up: 'Regisztráció',
signing_in: 'Bejelentkezés...',
size: 'Méret',
skip: 'Kihagyás',
something_went_wrong: 'Valami hiba történt.',
sort_by: 'Rendezés',
status: 'Állapot',
storage_usage: 'Tárhely használat',
storage_puter_used: 'Puter által használt',
taking_longer_than_usual: 'Kicsit tovább tart, mint általában. Kérlek várj...',
terms: 'Feltételek',
@@ -228,15 +253,21 @@ const hu = {
videos: 'Videók',
visibility: 'Láthatóság',
yes: 'Igen',
you_have_been_referred_to_puter_by_a_friend: 'Egy barátod ajánlott téged a Puterhez!',
zip: 'Zip',
zipping_file: 'Tömörítés: %strong%',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Nyisd meg a hitelesítő alkalmazásod',
setup2fa_1_instructions: "Bármely hitelesítő alkalmazást használhatod, amely támogatja az időalapú egyszeri jelszó (TOTP) protokollt. Sok választási lehetőség van, de ha nem vagy biztos benne, az <a target='_blank' href='https://authy.com/download'>Authy</a> jó választás Android és iOS rendszeren.",
setup2fa_2_step_heading: 'Olvasd be a QR-kódot',
setup2fa_3_step_heading: 'Add meg a 6-jegyű kódot',
setup2fa_4_step_heading: 'Másold le a helyreállítási kódjaidat',
setup2fa_4_instructions: 'Ezek a helyreállítási kódok az egyetlen módja annak, hogy hozzáférj a fiókodhoz, ha elveszíted a telefonodat vagy nem tudod használni a hitelesítő alkalmazásodat. Ügyelj arra, hogy biztonságos helyen tárold őket.',
setup2fa_5_step_heading: '2FA beállítás megerősítése',
setup2fa_5_confirmation_1: 'A helyreállítási kódokat biztonságos helyen tároltam',
setup2fa_5_confirmation_2: 'Készen állok a 2FA engedélyezésére',
setup2fa_5_button: '2FA engedélyezése',
// === 2FA Login ===
login2fa_otp_title: '2FA kód megadása',
@@ -244,6 +275,7 @@ const hu = {
login2fa_recovery_title: 'Add meg egy helyreállítási kódot',
login2fa_recovery_instructions: 'Add meg az egyik helyreállítási kódodat a fiókhoz való hozzáféréshez.',
login2fa_use_recovery_code: 'Használj helyreállítási kódot',
login2fa_recovery_back: 'Vissza',
login2fa_recovery_placeholder: 'XXXXXXXX',
'change': 'Módosítás', // In English: "Change"
@@ -309,13 +341,20 @@ const hu = {
'billing.expanded': 'Bővített', // In English: "Expanded"
'billing.accelerated': 'Gyorsított', // In English: "Accelerated"
'billing.enjoy_msg': 'Élvezd a %% Felhőtárhelyet és további előnyöket.', // In English: "Enjoy %% of Cloud Storage plus other benefits."
'choose_publishing_option': 'Válassza ki, hogyan szeretné közzétenni a webhelyét', // English: "Choose how you want to publish your website"
'create_desktop_shortcut': 'Parancsikon létrehozása (Asztal)', // English: "Create Shortcut (Desktop)"
'create_desktop_shortcut_s': 'Parancsikonok létrehozása (Asztal)', // English: "Create Shortcuts (Desktop)"
'create_shortcut_s': 'Parancsikonok létrehozása', // English: "Create Shortcuts"
'minimize': 'Minimalizálás', // English: "Minimize"
'reload_app': 'Alkalmazás újratöltése', // English: "Reload App"
'publish_as_serverless_worker': 'Munkás közzététele', // English: "Publish as Worker"
'toolbar.enter_fullscreen': 'Teljes képernyő', // English: "Enter Full Screen"
'toolbar.github': 'GitHub', // English: "GitHub"
'toolbar.refer': 'Ajánlás', // English: "Refer"
'used_of': '{{used}} használt a {{available}}-ból', // English: "{{used}} used of {{available}}"
'worker': 'Munkás', // English: "Worker"
'billing.offering.basic': 'Alap', // English: "Basic"
'too_many_attempts': 'Túl sok próbálkozás. Kérjük, próbálja meg később.', // English: "Too many attempts. Please try again later."
'server_timeout': 'A szerver túl sokáig válaszolt. Kérjük, próbálja meg újra.', // English: "The server took too long to respond. Please try again."
'signup_error': 'Hiba történt a regisztráció során. Kérjük, próbálja újra.', // English: "An error occurred during signup. Please try again."
'alert_error_title': 'Hiba!', // English: "Error!"
@@ -333,10 +372,15 @@ const hu = {
'window_title_open': 'Megnyitás', // English: "Open"
'window_title_change_password': 'Jelszó módosítása', // English: "Change Password"
'window_title_select_font': 'Betű kiválasztása…', // English: "Select font…"
'window_title_session_list': 'Munkamenet lista!', // English: "Session List!"
'window_title_set_new_password': 'Új jelszó beállítása', // English: "Set New Password"
'window_title_publish_website': 'Webhely közzététele', // English: "Publish Website"
'window_title_publish_worker': 'Munkás közzététele', // English: "Publish Worker"
'window_title_authenticating': 'Hitelesítés...', // English: "Authenticating..."
'window_title_refer_friend': 'Barát ajánlása!', // English: "Refer a friend!"
'desktop_exit_full_screen': 'Kilépés teljes képernyőből', // English: "Exit Full Screen"
'desktop_enter_full_screen': 'Teljes képernyő', // English: "Enter Full Screen"
'item_shared_with_you': 'Egy felhasználó megosztotta Önnel ezt az elemet.', // English: "A user has shared this item with you."
'item_shared_by_you': 'Legalább egy másik felhasználóval megosztotta ezt az elemet.', // English: "You have shared this item with at least one other user."
'item_shortcut': 'Parancsikon', // English: "Shortcut"
'item_associated_websites': 'Kapcsolódó webhely', // English: "Associated website"
@@ -345,6 +389,9 @@ const hu = {
'window_click_to_go_back': 'Kattintson a visszalépéshez.', // English: "Click to go back."
'window_click_to_go_forward': 'Kattintson a továbblépéshez.', // English: "Click to go forward."
'window_click_to_go_up': 'Kattintson a szülőmappa megnyitásához.', // English: "Click to go one directory up."
'window_title_public': 'Nyilvános', // English: "Public"
'window_title_videos': 'Videók', // English: "Videos"
'window_title_pictures': 'Képek', // English: "Pictures"
'window_title_puter': 'Puter', // English: "Puter"
'window_folder_empty': 'Ez a mappa üres', // English: "This folder is empty"
+51
View File
@@ -40,13 +40,20 @@ const hy = {
close_all_windows_and_log_out: 'Փակել պատուհաններն ու դուրս գալ',
change_always_open_with: 'Ցանկանու՞մ եք այս տեսակի ֆայլը միշտ բացել',
confirm: 'Հաստատել',
confirm_2fa_setup: 'Ես ավելացրել եմ կոդը իմ իսկորոշիչ հավելվածում',
confirm_2fa_recovery: 'Ես պահել եմ վերականգնման կոդերը ապահով վայրում',
confirm_account_for_free_referral_storage_c2a:
'Ստեղծեք հաշիվ և հաստատեք ձեր էլ. հասցեն 1 ԳԲ անվճար պահեստ ստանալու համար: Ձեր ընկերը նույնպես կստանա 1 ԳԲ անվճար պահեստ:',
confirm_code_generic_incorrect: 'Սխալ կոդ:',
confirm_code_generic_too_many_requests:
'Չափազանց շատ հարցումներ: Խնդրում ենք սպասել մի քանի րոպե:',
confirm_code_generic_submit: 'Հաստատել կոդը',
confirm_code_generic_try_again: 'Կրկին փորձեք',
confirm_code_generic_title: 'Մուտքագրեք հաստատման կոդը',
confirm_code_2fa_instruction:
'Մուտքագրեք 6 նիշանոց կոդը ձեր իսկորոշիչ հավելվածից:',
confirm_code_2fa_submit_btn: 'Հաստատել',
confirm_code_2fa_title: 'Մուտքագրեք 2FA կոդը',
confirm_delete_multiple_items:
'Վստա՞հ եք, որ ցանկանում եք ընդմիշտ ջնջել այս տարրերը:',
confirm_delete_single_item: 'Ցանկանու՞մ եք ընդմիշտ ջնջել այս տարրը:',
@@ -59,6 +66,8 @@ const hy = {
confirm_session_revoke: 'Վստա՞հ եք, որ ցանկանում եք չեղարկել այս սեսիան:',
confirm_your_email_address: 'Հաստատեք ձեր էլ. փոստի հասցեն',
contact_us: 'Հետադարձ կապ',
contact_us_verification_required:
'Սա օգտագործելու համար դուք պետք է ունենաք հաստատված էլ․ հասցե։:',
continue: 'Շարունակել',
copy: 'Պատճենել',
copy_link: 'Պատճենել հղումը',
@@ -80,8 +89,10 @@ const hy = {
deploy_as_app: 'Տեղադրել որպես հավելված',
descending: 'Նվազող',
desktop: 'Աշխատասեղան',
desktop_background_fit: 'Հարմարեցնել',
developers: 'Ծրագրավորողներ',
disable_2fa: 'Անջատել 2FA',
disable_2fa_confirm: 'Վստա՞հ եք, որ ցանկանում եք անջատել 2FA-ն:',
disable_2fa_instructions:
'Մուտքագրեք ձեր գաղտնաբառը՝ 2FA-ն անջատելու համար:',
documents: 'Փաստաթղթեր',
@@ -117,10 +128,13 @@ const hy = {
forgot_pass_c2a: 'Մոռացե՞լ եք գաղտնաբառը',
from: 'Ումից՝',
general: 'Ընդհանուր',
get_a_copy_of_on_puter: "Ստանալ '%%'-ի պատճենը Puter.com-ում!",
get_copy_link: 'Ստանալ պատճենված հղումը',
home: 'Գլխավոր',
html_document: 'HTML փաստաթուղթ',
hue: 'Երանգ',
incorrect_password: 'Սխալ գաղտնաբառ',
invite_link: 'Հրավերի հղում',
item: 'տարր',
items_in_trash_cannot_be_renamed:
'Այս տարրը չի կարող վերանվանվել, քանի որ այն աղբարկղում է: Այս տարրը վերանվանելու համար նախ տեղափոխեք այն աղբարկղից:',
@@ -132,6 +146,7 @@ const hy = {
loading: 'Բեռնում',
log_in: 'Մուտք գործել',
log_out: 'Դուրս գալ',
looks_good: 'Լավ է նայվում!',
manage_sessions: 'Սեսիաների կառավարում',
modified: 'Փոփոխված',
move: 'Տեղափոխել',
@@ -156,6 +171,7 @@ const hy = {
open_with: 'Բացել հավելվածով',
original_name: 'սկզբնական անուն',
original_path: 'սկզբնական ուղի',
oss_code_and_content: 'Բաց կոդով ծրագրակազմ և բովանդակություն',
password: 'Գաղտնաբառ',
password_changed: 'Գաղտնաբառը փոփոխված է',
password_recovery_rate_limit:
@@ -172,20 +188,27 @@ const hy = {
paste: 'Տեղադրել',
paste_into_folder: 'Տեղադրել պանակում',
path: 'Ուղի',
personalization: 'Անհատականացում',
pictures: 'Նկարներ',
plural_suffix: 'ներ',
powered_by_puter_js: 'Աջակցվում է {{link=docs}}Puter.js{{/link}}-ի կողմից',
preparing: 'Պատրաստվում է...',
preparing_for_upload: 'Պատրաստվում է վերբեռնել...',
print: 'Տպել',
privacy: 'Գաղտնիություն',
proceed_to_login: 'Շարունակել մուտք գործելը',
proceed_with_account_deletion: 'Շարունակել հաշվի ջնջումը',
properties: 'Հատկություններ',
public: 'Հանրային',
publish: 'Հրապարակել',
publish_as_website: 'Հրապարակել որպես կայք',
puter_description:
'Փութերը գաղտնիության առաջնահերթություն ունեցող անձնական ամպ է՝ ձեր բոլոր ֆայլերը, հավելվածները և խաղերը մեկ անվտանգ տեղում պահելու համար, որը հասանելի է ցանկացած վայրից ցանկացած ժամանակ:',
reading_file: 'Ընթերցում է %strong%',
recover_password: 'Վերականգնել գաղտնաբառը',
refer_friends_c2a:
'Ստացեք 1 ԳԲ յուրաքանչյուր ընկերոջ համար, ով ստեղծում և հաստատում է հաշիվ Փութերում: Ձեր ընկերը նույնպես կստանա 1 ԳԲ!',
refer_friends_social_media_c2a: 'Ստացեք 1 ԳԲ անվճար պահեստ Puter.com-ում!',
refresh: 'Թարմացնել',
rename: 'Վերանվանել',
replace: 'Փոխարինել',
@@ -195,10 +218,13 @@ const hy = {
save: 'Պահպանել',
saturation: 'Հագեցվածություն',
save_account: 'Պահպանել հաշիվը',
save_account_to_get_copy_link:
'Շարունակելու համար խնդրում ենք ստեղծել հաշիվ:',
save_account_to_publish: 'Շարունակելու համար խնդրում ենք ստեղծել հաշիվ:',
save_session: 'Պահպանել սեսիան',
save_session_c2a:
'Ստեղծեք հաշիվ՝ ձեր ընթացիկ սեսիան պահպանելու և աշխատանքը չկորցնելու համար:',
scan_qr_2fa: 'Սկանավորեք QR-կոդը ձեր իսկորոշիչ հավելվածով',
search: 'Որոնել',
seconds: 'վայրկյաններ',
security: 'Անվտանգություն',
@@ -218,11 +244,13 @@ const hy = {
show_hidden: 'Ցույց տալ թաքնված տարրերը',
sign_in_with_puter: 'Մուտք գործել Փութերի միջոցով',
sign_up: 'Գրանցվել',
signing_in: 'Մուտք է գործում…',
size: 'Չափ',
skip: 'Բաց թողնել',
something_went_wrong: 'Ինչ-որ բան սխալ գնաց:',
sort_by: 'Տեսակավորել ըստ՝',
status: 'Կարգավիճակ',
storage_usage: 'Պահեստի օգտագործում',
storage_puter_used: 'օգտագործվում է Փութերի կողմից',
taking_longer_than_usual:
'Սովորականից մի փոքր ավելի երկար է տևում: Խնդրում ենք սպասել...',
@@ -252,24 +280,31 @@ const hy = {
videos: 'Տեսանյութեր',
visibility: 'Տեսանելիություն',
yes: 'Այո',
you_have_been_referred_to_puter_by_a_friend:
'Դուք ուղղորդվել եք Փութեր ձեր ընկերոջ կողմից!',
zip: 'Ավելացնել արխիվում',
zipping_file: 'Ավելացվում է արխիվում %strong%-ը',
// === 2FA Setup ===
setup2fa_1_step_heading: 'Բացեք ձեր իսկորոշիչ հավելվածը',
setup2fa_1_instructions: `
Դուք կարող եք օգտագործել ցանկացած իսկորոշիչ հավելված, որն աջակցում է ժամանակի վրա հիմնված միանգամյա գաղտնաբառ (TOTP) պրոտոկոլը:
Կան բազմաթիվ տարբերակներ, բայց եթե վստահ չեք,
<a target="_blank" href="https://authy.com/download">Authy</a>
լավ ընտրություն է Android-ի և iOS-ի համար:
`,
setup2fa_2_step_heading: 'Սկանավորեք QR-կոդը',
setup2fa_3_step_heading: 'Մուտքագրեք 6 նիշանոց կոդը',
setup2fa_4_step_heading: 'Պատճենեք ձեր վերականգնման կոդերը',
setup2fa_4_instructions: `
Այս վերականգնման կոդերը միակ միջոցն են մուտք գործելու ձեր հաշիվ, եթե կորցնեք ձեր հեռախոսը կամ չկարողանաք օգտագործել ձեր իսկորոշիչ հավելվածը:
Պարտադիր դրանք պահեք ապահով վայրում:
`,
setup2fa_5_step_heading: 'Հաստատեք 2FA կարգավորումը',
setup2fa_5_confirmation_1:
'Ես իմ վերականգնման կոդերը պահել եմ ապահով վայրում',
setup2fa_5_confirmation_2: 'Ես պատրաստ եմ միացնել 2FA',
setup2fa_5_button: 'Միացնել 2FA',
// === 2FA Login ===
login2fa_otp_title: 'Մուտքագրեք 2FA կոդը',
@@ -279,6 +314,7 @@ const hy = {
login2fa_recovery_instructions:
'Մուտքագրեք ձեր վերականգնման կոդերից մեկը ձեր հաշիվ մուտք գործելու համար:',
login2fa_use_recovery_code: 'Օգտագործել վերականգնման կոդը',
login2fa_recovery_back: 'Հետ',
login2fa_recovery_placeholder: 'XXXXXXXX',
change: 'Փոփոխել',
@@ -354,13 +390,20 @@ const hy = {
'billing.accelerated': 'Արագացված',
'billing.enjoy_msg':
'Վայելեք %% ամպային պահեստավորում և այլ առավելություններ',
choose_publishing_option: 'Ընտրեք ձեր կայքը հրապարակելու եղանակը։',
create_desktop_shortcut: 'Ստեղծել դյուրանցում (Աշխատասեղան)',
create_desktop_shortcut_s: 'Ստեղծել դյուրանցումներ (Աշխատասեղան)',
create_shortcut_s: 'Ստեղծել դյուրանցումներ',
minimize: 'Փոքրացնել',
reload_app: 'Վերաբեռնել հավելվածը',
publish_as_serverless_worker: 'Հրապարակել որպես Worker',
'toolbar.enter_fullscreen': 'Լիաէկրան ռեժիմ',
'toolbar.github': 'GitHub',
'toolbar.refer': 'Հրավիրել',
used_of: '{{used}} օգտագործված է {{available}}-ից',
worker: 'Worker',
'billing.offering.basic': 'Հիմնական',
too_many_attempts: 'Չափազանց շատ փորձեր։ Խնդրում ենք փորձել ավելի ուշ։',
server_timeout:
'Սերվերը չի պատասխանել ժամանակին։ Խնդրում ենք կրկին փորձել։',
signup_error:
@@ -380,10 +423,15 @@ const hy = {
window_title_open: 'Բացել',
window_title_change_password: 'Փոխել գաղտնաբառը',
window_title_select_font: 'Ընտրել տառատեսակ…',
window_title_session_list: 'Սեսիաների ցանկ',
window_title_set_new_password: 'Սահմանել նոր գաղտնաբառ',
window_title_publish_website: 'Հրապարակել կայք',
window_title_publish_worker: 'Հրապարակել Worker',
window_title_authenticating: 'Նույնականացում…',
window_title_refer_friend: 'Հրավիրել ընկերոջը',
desktop_exit_full_screen: 'Ելք լիաէկրան ռեժիմից',
desktop_enter_full_screen: 'Լիաէկրան ռեժիմ',
item_shared_with_you: 'Օգտատերը կիսվել է այս տարրով ձեզ հետ.',
item_shared_by_you:
'Դուք կիսվել եք այս տարրով առնվազն մեկ այլ օգտատիրոջ հետ.',
item_shortcut: 'Դյուրանցում',
@@ -393,6 +441,9 @@ const hy = {
window_click_to_go_back: 'Սեղմեք՝ վերադառնալու համար.',
window_click_to_go_forward: 'Սեղմեք՝ առաջ անցնելու համար.',
window_click_to_go_up: 'Սեղմեք՝ մեկ պանակ վեր բարձրանալու համար.',
window_title_public: 'Հրապարակային',
window_title_videos: 'Տեսանյութեր',
window_title_pictures: 'Նկարներ',
window_title_puter: 'Puter',
window_folder_empty: 'Այս պանակը դատարկ է',
},
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff. Show more