Something went wrong. Try again.
🌿 Collaborative wiki on ATProto forked from juprodh.me/lichen.wiki
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576/** * Central size limits, mirroring the `maxLength` / `maxSize` values declared in * the `wiki.lichen.*` lexicons. These are the hard ceilings enforced by a * conforming PDS; we re-declare them here so the appview can: * * - surface friendly validation errors before hitting the PDS * - reject oversized records at firehose ingestion (other PDSes may be lax) * - later introduce per-tier sub-limits (paid users get higher ceilings, * lexicon max remains the absolute cap) * * Keep in sync with `lexicons/wiki.lichen.*.json`. */export const LIMITS = { wiki: { name: 256, visibility: 32, language: 16, description: 300, // Appview-only — no lexicon constraint. Generous cap; matches a long // markdown page. Tighten later if abuse surfaces. sidebar: 100_000, }, note: { slug: 256, title: 256, }, revision: { diff: 1_000_000, diffFormat: 32, message: 1024, blobCount: 32, }, membership: { memberDid: 2048, role: 32, }, image: { bytes: 2 * 1024 * 1024, }, blobProxy: { timeoutMs: 10_000, maxBytes: 2 * 1024 * 1024, }, page: { home: 6, explore: 12, searchDefault: 6, searchMax: 12, }, snippetRadius: 60, profileCacheHours: 24, sessionMaxAgeSecs: 604800, // 7 days /** Per-IP rate limits: { max requests, window in ms } */ rateLimit: { upload: { limit: 10, windowMs: 60_000 }, blobProxy: { limit: 60, windowMs: 60_000 }, login: { limit: 5, windowMs: 60_000 }, search: { limit: 30, windowMs: 60_000 }, }, historyPageSize: 25, linkSuggestLimit: 20, snapshotCap: 25, zipImport: { maxUncompressedBytes: 50 * 1024 * 1024, maxZipEntries: 500, maxMdFiles: 100, }, cacheTtl: { ogCard: 3600, sitemap: 3600, blobLocal: 86400, blobImmutable: 31536000, cookie: 31536000, },} as const;