Il repo resta al sito: app in radice, piattaforme nel loro repo

apps/sito passa in radice, apps/platforms si toglie: vive in
gitea:Adriano/InsanityLab-platforms, con la storia del repo comune. I piani e
le specifiche di Longevity e Campus lasciano docs/ e seguono le piattaforme.
README e compose: deploy da /opt/docker/insanitylab/src; al primo deploy .env
va spostato da apps/sito/.env alla radice.

Refs #20

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 14:25:12 +00:00
parent 9efd9a7680
commit 3fff3cd2f8
608 changed files with 14 additions and 104131 deletions
+23
View File
@@ -0,0 +1,23 @@
import { describe, it, expect, vi, afterEach } from 'vitest';
import { rateLimit, _resetBuckets } from '../src/lib/rate-limit';
afterEach(() => { _resetBuckets(); vi.useRealTimers(); });
describe('rateLimit', () => {
it('consente fino a max richieste', () => {
expect(rateLimit('a', 2, 1000)).toBe(true);
expect(rateLimit('a', 2, 1000)).toBe(true);
expect(rateLimit('a', 2, 1000)).toBe(false);
});
it('chiavi indipendenti', () => {
expect(rateLimit('a', 1, 1000)).toBe(true);
expect(rateLimit('b', 1, 1000)).toBe(true);
});
it('la finestra scade', () => {
vi.useFakeTimers();
expect(rateLimit('a', 1, 1000)).toBe(true);
expect(rateLimit('a', 1, 1000)).toBe(false);
vi.advanceTimersByTime(1100);
expect(rateLimit('a', 1, 1000)).toBe(true);
});
});