Sharing a toolbox meant exporting a JSON file and passing it around by hand. A toolbox can now be sent from the site while staying local first: the browser compresses and encrypts the v2 export with AES-GCM, and the key lives only in the link fragment, so the server keeps for at most 24 hours a copy it cannot read. - Add the /api/shares service: upload, metadata, download and revoke, with files in SHARES_DIR, a purge every 10 minutes, and single-use links (the default) deleted only once fully downloaded. - Cap the server load: 50 MiB per share, total storage, free disk space, daily volume, concurrent and stalled uploads, reads per link, plus a wide per-connection cap kept in memory without storing IPs. - Limit each browser to 2 shares and 100 MiB per day and 2 active links, and show the existing link of a toolbox already shared. - Add the send dialog (card and game drawer) and the /receive page, which previews or directly imports through the existing import path. - Move shared HTTP helpers to services/http.js for both APIs. - Document the format, delivery, server layout and privacy wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
// Rôle : configure les diagnostics navigateur Playwright sans les intégrer au check de prod.
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
import { tmpdir } from "node:os";
|
|
import { join } from "node:path";
|
|
|
|
const port = Number(process.env.E2E_PORT || 5173);
|
|
const baseURL = `http://localhost:${port}`;
|
|
// Un dossier d'envois propre à chaque port : une exécution isolée ne relit pas les envois du serveur de développement.
|
|
const isolatedCardsEnvironment = process.env.E2E_PORT ? `CARDS_DB_PATH=:memory: CARDS_DEV_AUTH=true SHARES_DIR=${join(tmpdir(), `sokko-e2e-shares-${port}`)} ` : "";
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
testIgnore: ["**/production/**", "**/nebula-cards.spec.js"],
|
|
fullyParallel: true,
|
|
// Le serveur Vite partagé compile les outils lazy à la première visite.
|
|
workers: 2,
|
|
reporter: [["list"], ["html", { open: "never" }]],
|
|
use: {
|
|
baseURL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure"
|
|
},
|
|
webServer: {
|
|
command: `${isolatedCardsEnvironment}npm run dev -- --port ${port}`,
|
|
url: baseURL,
|
|
reuseExistingServer: !process.env.E2E_PORT,
|
|
timeout: 120000
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] }
|
|
}
|
|
]
|
|
});
|