All case studies
~/cases/censura-digital
Platforms & CRMsIntelligence and AIOct 2026Completed

P-16

Censura Digital

A public reporting channel with a triage panel where authorization lives in the database: role-based RLS, contacts only through an audited function, instant session revocation and a bot that saves evidence before it expires.

clientDigital committee of a national majoritarian election campaign

Developer responsible for backend, database, security, internal panel, links and QR codes, evidence bot, tests and deployment

A static site with a four-step form to report takedowns, reach loss and account blocks on digital platforms during a campaign, plus an internal panel with triage, dashboard, traceable PDF reports, short links with QR codes and an access audit. Deno Edge Functions, Postgres with 17 RLS policies and 43 functions, passwordless 8-digit code login, per-IP limits enforced inside the transaction, automatic LGPD retention and a bot that streams WeTransfer evidence into a private bucket. Live in three days, with two security audits fixed in production.

1,558
reports in the first 3 days
20
audit findings fixed
3 days
active period
5/h · 20/day per IP
form rate limit
  • supabase
  • postgres
  • rls
  • edge
  • cloudflare
  • anti-bot
  • rate-limiting
  • lgpd
  • audit-log
  • pg-cron
  • vanilla-js
  • tests
architecture.en.svgenlarge ↓

01Overview

During a national campaign, supporters started reporting that posts were being removed, losing reach or getting accounts blocked on social networks. The digital team needed a public channel to collect those reports in an organized way, with evidence, and a small staff to triage, validate and consolidate numbers solid enough to back formal questions to the platforms.

Censura Digital is that channel. On one side, a public site with a four-step form that returns a protocol number at the end. On the other, an internal panel where the team triages reports, follows a dashboard, generates traceable PDF reports, creates short links with QR codes for outreach and audits every access. A bot keeps a copy of evidence sent through links that expire.

Everything was designed around one fact: each report contains personal data and may reveal political opinion, which Brazil's data protection law (LGPD) treats as sensitive data. So access rules do not live in the panel. They live in the database, and the panel merely hides buttons. The system went live after three days of development and went through two security audits, with fixes applied in production before launch.

02The problem

  • Short deadline, unpredictable volume. The channel had to be live within days, a few weeks before the end of the election, and handle any volume without going down or letting bots inflate the numbers.
  • Sensitive data, rotating staff. E-mail, phone and the report itself are personal data. The triage team changes over the campaign. Whoever leaves must lose access immediately, and everything anyone viewed or exported must be on record.
  • Evidence that disappears. Reporters send evidence as a link. Free WeTransfer links expire after three days, measured against the service's API, and the evidence is gone before the team gets to it.
  • Lean operations. No infrastructure team. The system had to be static at the edge, with no build step and as few moving parts as possible.

03The solution

A four-step public form. Contact, what happened, how the platform reacted and what came next. Eleven categories of restriction and ten platforms in closed lists, an "Other" field required exactly when that option is checked, Brazilian date format, phone validated against the national numbering plan and e-mail with domain checks. At the end, a random eight-character protocol with no ambiguous letters.

An internal panel with five tabs, accessed with an eight-digit code sent by e-mail, no passwords:

  • Reports: queue of new cases, keyboard shortcuts to accept, validate or discard, duplicate marking, category reclassification, notes, contact details shown on demand and always logged, CSV export.
  • Dashboard: totals, change against the previous period, the reporter's journey per platform (notified, given a reason, appealed, got an answer, content restored), daily series, hour and weekday heatmaps, recurring themes in the reports, evidence expiring within 48 h, triage pace. Filters by period, platform and "validated only". PDF report with a traceable code.
  • Team: invitation by e-mail with a role (reader, analyst or admin), role changes, removal and LGPD erasure requests.
  • Audit: a timeline of every code request, login, inactivity logout, contact view, export and team change, with IP and browser read server-side.
  • Links: short links with UTM parameters, custom QR codes as PNG and SVG, click and scan counts, daily uniques and conversion into reports, by campaign, source and influencer.

Evidence bot. Every report with a WeTransfer link enters a queue. A database job calls an Edge Function only when there is work. The function streams the file into a private bucket, classifies what cannot be copied (expired, password-protected, over 1 GB) and marks the evidence as saved.

Automatic retention. A daily job wipes the IP hash and browser string after 30 days, deletes the access audit after 180 days and removes all contact details on a fixed date, 180 days after the election ends.

  • Authorization lives entirely in the database: 17 RLS policies, column-level grants and a tem_papel function that also demands a live session in auth.sessions, under 12 h and a passwordless login. The panel only hides buttons.
  • Reporter contact details are never read directly: ver_contato returns one at a time, requires analyst, logs the access in the same transaction and stops at 60 per hour.
  • A limit of 5 submissions per hour and 20 per day counted inside the insert transaction, with an advisory lock on the IP hash and a key taken from the header Cloudflare controls.
  • History not even an admin can forge: the team only inserts notes; status, creation, deletion, IP and browser are written by triggers from the request headers.
  • A bot that streams WeTransfer evidence into a private bucket before it expires in 3 days, with anti-SSRF, backoff and automatic removal on LGPD erasure requests.
  • Traceable PDF report: a REL-XXXX-XXXX code and the requester's identity, both from the server, in the watermark of every page and in the audit log.
  • No framework, no build: site and panel in plain HTML, CSS and JavaScript, a CSP with no CDN, 68 network-free unit tests and 3 Playwright end-to-end tests.

04Architecture

real architecture · hover over the nodes
Read the diagram as a list (14 components, 18 connections)

Components

  • Cloudflare: Worker<br>HTTPS 301 · headers · /r/slug, Static assets<br>site + panel, Turnstile
  • Supabase: enviar-denuncia, registrar-acesso, convidar-membro, copiar-provas, Auth · 8-digit code, Postgres<br>RLS · 43 functions · pg_cron, Storage · private bucket, Vault

Connections

  • Reporter → Worker<br>HTTPS 301 · headers · /r/slug
  • Worker<br>HTTPS 301 · headers · /r/slug → Static assets<br>site + panel
  • Team → Worker<br>HTTPS 301 · headers · /r/slug
  • Reporter → enviar-denuncia (JSON + token)
  • enviar-denuncia → Turnstile (siteverify)
  • enviar-denuncia → Postgres<br>RLS · 43 functions · pg_cron (rpc registrar_denuncia)
  • Team → Auth · 8-digit code (OTP)
  • Auth · 8-digit code → Postgres<br>RLS · 43 functions · pg_cron (hook_token)
  • Team → Postgres<br>RLS · 43 functions · pg_cron (PostgREST with JWT)
  • Team → registrar-acesso
  • registrar-acesso → Postgres<br>RLS · 43 functions · pg_cron
  • Team → convidar-membro
  • convidar-membro → Auth · 8-digit code
  • Worker<br>HTTPS 301 · headers · /r/slug → Postgres<br>RLS · 43 functions · pg_cron (rpc abrir_link<br>dedicated key)
  • Postgres<br>RLS · 43 functions · pg_cron → copiar-provas (pg_cron + pg_net)
  • copiar-provas → WeTransfer (public API)
  • copiar-provas → Storage · private bucket
  • Vault → Postgres<br>RLS · 43 functions · pg_cron (bot secret)

Three pieces, none of them a server to maintain:

  • Edge (Cloudflare Workers). A Worker runs before the static assets: forces HTTPS, redirects the old domain, applies the security headers, marks the panel as no-cache and no-index, and resolves short links. A second Worker answers 301 for www.
  • Backend (Supabase). Four Edge Functions in Deno, Postgres with RLS and 43 functions, code-based Auth, private Storage, Vault for the bot secret, pg_cron and pg_net for jobs.
  • Client. HTML, CSS and JavaScript with no framework and no build. The panel talks directly to PostgREST with the publishable key; authorization is entirely the database's job.

05Under the hood

Backend and data

Schema. Eleven public tables and two private ones, created across 23 migrations. The report lives in denuncias, with no contact data. E-mail and phone live in denuncia_contatos, with tighter access and their own purge. History is in denuncia_eventos, an insert-only table. The team and its changes are in equipe and equipe_eventos. Links, clicks, report-to-link attribution, panel access logs and the evidence copy queue complete the model. A private schema, outside the Data API, holds security configuration and helper functions.

Integrity in the database, not the client. 55 CHECK constraints. Category and platform lists are closed in the database and mirrored in the form and the Edge Function. "Other" fields exist exactly when the option was checked. Conditional questions are consistent with each other (nobody "got an answer" without having appealed). Phone numbers are always stored as area code plus number, 10 or 11 digits. The restriction date must fall within the year and never in the future, in Brasília time.

Atomic write. registrar_denuncia can only run under the service key. It checks consent, takes an advisory lock on the IP hash, enforces the limit of 5 submissions per hour and 20 per day, inserts report, contact, creation event and attribution in one transaction and returns the protocol. A protocol collision, unlikely as it is, is retried.

Roles as an ordered enum. reader < analyst < admin. A single tem_papel(minimum) function answers whether the caller holds at least that role, and every policy and function consults it.

The dashboard is one function. dashboard(days, platform, validated_only) returns a JSON document with roughly twenty blocks computed in a single read: totals, journey per platform, daily series, lag between the restriction and the report, themes by word frequency, evidence about to expire, triage pace and, for admins only, origin by link and campaign.

Evidence queue. provas_copias holds state, attempts, next attempt and the real expiry date. The bot takes one item at a time with for update skip locked, at most two in flight, in order of soonest expiry. Transient failures return to the queue with a 15 min, 30 min, 1 h and 2 h backoff and give up on the fifth. An item stuck for 10 minutes goes back to the queue.

Jobs. expurgar-contatos runs daily at 3 a.m. Brasília time. copiar-provas runs every minute, but the SQL command only fires the HTTP call when there is a due item in the queue or a file to delete.

Frontend
  • No framework, no build. The site has 484 lines of JavaScript. The panel has three files, about 2,600 lines, one per group of tabs. The CSP allows no CDN, so supabase-js 2.49.1 and qr-code-styling 1.9.2 are served from the site's own domain.
  • A stepped form with validation mirrored from the server: the same phone rule exists in the browser, in the Edge Function and in a database function. Invisible characters pasted along with an e-mail are stripped before validation.
  • Attribution. If the visit came through a short link or UTM parameters, the site keeps that in session storage, cleans the address bar and sends it along with the report.
  • Panel session in sessionStorage: close the browser and the session is gone. Thirty idle minutes end the session and log the reason.
  • Hand-drawn SVG charts on the dashboard, no charting library. The PDF report is produced through the browser's print flow, with a repeated watermark and a footer on every page.
  • End-to-end tests with Playwright: form, dashboard and links run under the production CSP with Turnstile and Supabase simulated. The generated QR code is read back with zbarimg. The form test pushes the payload the browser built through the function's real validation, in Deno.
Infrastructure and deploy
  • Cloudflare Workers with static assets (run_worker_first), published with wrangler deploy. A second Worker, with no workers.dev route, answers 301 for www.
  • Secrets. Two in the Edge Functions (the Turnstile secret and the IP hash salt) and two in the Worker (a dedicated API key that can only execute abrir_link, and the salt for the daily visitor hash). The bot secret lives in Vault and never leaves the database: cron reads it and the function verifies it through an RPC.
  • Versioned migrations kept in sync with the remote history; the last one was renamed to match the applied version.

06Security

8 attacks considered, 8 defenses in production.

attackdefense
Bots and fake sign-ups

Scripts that flood forms, inflate numbers or sweep the site for openings.

  • A bot floods the form to inflate the numbers

    Honeypot with a fake 200, Turnstile verified server-side with hostname and action, and a 5/h and 20/day per-IP limit counted inside the transaction under an advisory lock.

API shortcut

Skipping the interface to talk straight to the database or API with the public key in hand.

  • Using the panel's publishable key to read reports or contacts through the API

    anon has no grants at all; authenticated reads only allowed columns and only with a team role; the contacts table has no select, only the audited ver_contato function, capped at 60 per hour.

Accounts and login

Brute force, rogue account creation, password reset and account takeover.

  • A team member sets a password and logs in without the e-mail code

    tem_papel reads the JWT's amr claim and rejects password sessions; convidar-membro repeats the check; invitations reject pre-existing accounts.

  • Reusing a JWT after the person leaves the team or logs out

    The session must exist in auth.sessions and be under 12 h; a trigger deletes the sessions of anyone removed or reassigned, and access drops on the next request.

Forged origin and requests

CSRF, fake webhooks, reused tokens, signed links and open redirects.

  • Forging X-Forwarded-For or rotating IPv6 addresses to dodge the limit

    The key is CF-Connecting-IP, set by Cloudflare and verified in production against a forged header; IPv6 is counted by /64; the hash is salted and the function refuses everything without the salt.

  • An evidence link pointing at an internal network (SSRF) or a huge file

    The bot only talks to WeTransfer hosts over HTTPS with no custom port, follows redirects manually checking every hop and cancels past 1 GB; the file name is normalized before Storage.

  • A short link used as an open redirect or a QR code landing on an error page

    The destination must start with a single slash and contain no '..', the Worker rebuilds the URL on its own domain and any failure goes to the home page; the Worker's key can only execute abrir_link.

Tampering and audit trail

Fiddling with counts, wiping the base, editing history or denying what was authorized.

  • An admin forges or backdates history events

    The team only has insert grants on denuncia_id, autor, tipo and nota, with tipo restricted to notes and exports; status, creation, deletion, timestamp, IP and browser come from security definer triggers and the request headers.

Edge

  • Seven headers on every response: a CSP with no inline and no CDN, one-year HSTS with subdomains, nosniff, X-Frame-Options: DENY, Referrer-Policy, Permissions-Policy and COOP. The panel additionally gets Cache-Control: no-store, X-Robots-Tag: noindex and CORP same-origin.
  • HTTP becomes a 301 to HTTPS before any asset is served. The old domain redirects and was removed from the origins accepted by the functions.
  • The same headers are in _headers as a second layer.

Public form

The enviar-denuncia Edge Function processes in this order: origin, method, size, JSON, honeypot, Turnstile, validation, e-mail DNS and only then the RPC.

  • Origin: a browser on another site does not even get CORS headers.
  • Size: the body is read as a stream and cancelled past 32 KB, without trusting Content-Length.
  • Honeypot: a filled hidden field gets a fake 200 so the bot does not retry.
  • Turnstile verified server-side with the client IP, and the response must carry the site's hostname and the denuncia action. A failed or unavailable verification rejects the submission.
  • Per-IP limit: 5 per hour and 20 per day. The key comes from CF-Connecting-IP, which Cloudflare sets and prevents the client from forging, measured in production with a forged X-Forwarded-For. IPv6 is counted by /64 prefix. The IP is never stored: only sha256(key + salt), and the function refuses everything if the salt is shorter than 32 characters.
  • Validation and normalization: NFC, removal of control characters, text-direction marks and zero-width invisibles, < and > forbidden in short fields, links with no credentials, IP or localhost. Strict e-mail format, a disposable-domain list, 70 common typos with a suggested fix and an MX or A lookup for unknown domains, with an emergency switch to disable DNS.
  • Client metadata only when it makes sense: the origin must be the site's own domain and the client timestamp within a day.
  • Logs with no personal data: status, reason and protocol.

Database

  • Zero grants by default. anon has access to nothing. authenticated gets only what the panel uses, column by column. Default privileges are revoked so new objects are born closed. The private schema is outside the Data API.
  • 17 active RLS policies, all backed by tem_papel. Readers read reports and history. Analysts can update only status and duplicada_de (column-level grant). Admins manage the team and links.
  • Contacts are never read directly. The table has no select for the team. ver_contato(id) returns one contact per call, requires analyst, writes a contato_lido event in the same transaction and stops at 60 per hour per person. exportar_contatos requires admin, accepts up to a thousand reports and logs the export.
  • Columns invisible to the team: ip_hash, user_agent, origem, enviado_em_cliente and the visitor hash on link clicks.
  • History the team cannot forge. denuncia_eventos only accepts inserts of nota and the export record, with autor = auth.uid(). Status changes, creation and deletion are written by security definer triggers. IP and browser for each action come from the request headers read inside Postgres, not from the client.
  • Deletion only with a record. The team cannot delete reports. excluir_dados_titular(email) requires admin, leaves an event with the protocol and no personal data, deletes notes (which may mention the data subject) and queues the removal of the evidence copy.
  • Team protected by trigger: never without an admin, user_id is immutable and every role change becomes an event.
  • security definer functions with an empty search_path, and revoke execute from public on everything the panel does not call.

Authentication and sessions

  • No passwords. Sign-up and anonymous login are off. An eight-digit code by e-mail, valid for 10 minutes, with Turnstile on the request and a minimum interval between e-mails.
  • Password sessions are not accepted. tem_papel inspects the JWT's amr claim and rejects any session opened with the password method. convidar-membro repeats the check before accepting an admin.
  • A JWT is not enough. The session must exist in auth.sessions and be younger than 12 hours (configurable). Logout, removal from the team or a role change fire a trigger that deletes the person's sessions: access drops on the next request.
  • Safe invitations. convidar-membro validates the admin against the Auth server, rejects pre-existing accounts (which might have a password), confirms the e-mail without a clickable link (mail antivirus "clicks" and burns those links) and deletes the user if the team insert fails.

Audit

  • Three sources in one timeline, admins only: the registrar-acesso Edge Function (code requested, refused, wrong, login, logout, inactivity, expired session), the Auth token hook (hook_token, logs every issued token and never blocks) and the actions on reports and team.
  • The panel only says which event happened. IP, country, browser and identity come from the server. An e-mail typed before login is marked as unconfirmed.
  • Alerts: failures per IP in the last 24 h, logins outside the panel (an Auth token with no panel login in the same session), contact views and exports.
  • registrar-acesso accepts 2 KB and 60 events per IP every 10 minutes.
  • Traceable PDF report. Before generating, the server records the export under a REL-XXXX-XXXX code and returns the requester's name and e-mail from the team table. That code and identity go into the watermark and footer of every page. If the record fails, nothing is generated. Ctrl+P straight on the dashboard prints only a notice.

LGPD

  • Consent stored per report with the policy version.
  • Contact separated from the report, read on demand and logged.
  • Right to erasure served by a function that logs without personal data and deletes the evidence copy.
  • Automatic retention: IP hash and browser gone after 30 days, team audit after 180 days, daily visitor hash on links after 30 days, contacts on a fixed date.
  • Function logs with no PII.

Evidence bot and short links

  • Anti-SSRF: the link comes from the reporter. The bot only talks to WeTransfer hosts, over HTTPS, no custom port, and follows redirects manually while checking every hop. Downloads are capped at 1 GB and cancelled past that. File names are normalized before reaching Storage.
  • Bot authorization: cron sends the Vault secret in a header; the function verifies it in the database and answers 202 before working in the background. The robo_provas_* functions only execute under the service key.
  • Copy and LGPD: if the report was deleted during the copy, the file is removed at the end.
  • Short links with no open redirect: the destination must start with a single slash, contain no .., and the Worker rebuilds the URL on its own domain. Any failure leads to the home page: a printed QR code never lands on an error page. Link-preview bots are not counted. At most 20 clicks per visitor per link per day. The Worker uses its own API key that can only execute abrir_link.

Audits and tests

  • Audit of Oct 10: two confirmed findings (analysts could read contacts without a record; history could be forged) and six configuration-dependent ones. Fixed in the correcoes_auditoria migration.
  • Launch audit, Oct 11: twelve findings, from HTTP without redirect to sessions with no expiry, all fixed in production and documented with rollback steps.
  • 60 Deno unit tests and 8 Node tests pass locally with no network. Thirteen SQL test files cover constraints, RLS, sessions, audit, dashboard, links and evidence, rolling back at the end. Three Playwright end-to-end tests.

07Technical challenges

A per-IP limit that cannot be bypassed and has no race

Rate limiting in an Edge Function with no shared state is easy to bypass and hard to count correctly. The fix was to move the count into the insert transaction: registrar_denuncia takes an advisory lock on the IP hash, counts the last hour and the last day and only then inserts. The hash uses a secret salt, IPv6 is reduced to its /64 and the key comes from the header Cloudflare controls, verified in production. Without the salt, the function fails closed.

Instant session revocation with stateless JWTs

A JWT is valid until it expires, which would leave someone removed from the team with access for up to an hour. tem_papel now requires the token's session to exist in auth.sessions and be younger than 12 hours, on top of rejecting password sessions. A trigger on equipe deletes the sessions of anyone removed or reassigned. Because every policy and function goes through tem_papel, the rule applies to the whole system without touching the panel.

Evidence that expires in three days

Free WeTransfer links expire before triage gets to them. Instead of asking for uploads (a form change in the middle of a campaign), a trigger queues each link, cron calls the function only when there is work, and the function streams the file straight from the service's public API into Storage without buffering in memory. Whatever cannot be copied is classified and shown on the dashboard for manual download. In its first hours the bot copied 26 files in about three minutes, in expiry order.

History that not even an admin can forge

The first audit showed an admin could insert status and deletion events with fake dates. The fix removed the team's insert grant on the date, from and to columns: today the team only inserts nota and export records, and everything else is written by security definer triggers that stamp IP and browser read from the request headers inside Postgres.

08Results

  • Live on the same day as the backend's first commit. Three days of development, 61 commits.
  • 1,558 reports received in the first three days, 480 with an evidence link and 140 on WeTransfer, measured on Oct 13 and documented in the bot's plan.
  • Two security audits before launch, with 20 findings fixed in production.
  • 68 automated tests passing with no network, plus 13 SQL suites and 3 end-to-end tests.
  • Zero build dependencies. Two third-party libraries in the panel, served from the site's own domain.
61
commits
how we measured

git rev-list --count HEAD

3 days
active period
how we measured

git log: commits on 2026-10-10, 2026-10-11 and 2026-10-13

2
authors
how we measured

git log --format=%an | sort -u (52 + 9 commits)

23
migrations
how we measured

ls supabase/migrations/*.sql | wc -l

13
tables
how we measured

create table in the migrations: 11 in public, 2 in private

17
active RLS policies
how we measured

23 create policy minus 6 drop policy in the migrations (includes 1 on storage.objects)

43
database functions
how we measured

unique names in create function in the migrations (19 in private, 24 in public)

11
triggers
how we measured

create trigger in the migrations

55
CHECK constraints
how we measured

named constraint ... check in the migrations

4
edge functions
how we measured

supabase/functions/: enviar-denuncia, registrar-acesso, convidar-membro, copiar-provas

2
pg_cron jobs
how we measured

cron.schedule in the migrations: expurgar-contatos (daily) and copiar-provas (every minute, conditional)

7 + 3
security headers
how we measured

SEGURANCA in worker/index.js; plus 3 only on /painel

5/h · 20/day per IP
form rate limit
how we measured

limite_hora and limite_dia in registrar_denuncia (funcoes_registro migration)

68
unit tests
how we measured

deno test enviar-denuncia (55) + copiar-provas (5) + node --test worker (8), run locally without network

13
SQL suites
how we measured

supabase/tests/*.test.sql

3
e2e tests
how we measured

tests/e2e/formulario.mjs, painel-dashboard.mjs, painel-links.mjs (Playwright)

20
audit findings fixed
how we measured

docs/BACKEND.md: 2 confirmed + 6 configuration findings (Oct 10) and 12 from the launch (Oct 11)

1,558
reports in the first 3 days
how we measured

docs/PLANO_PROVAS.md, measured on Oct 13, 2026

4,764
SQL lines
how we measured

wc -l supabase/migrations and supabase/tests (36 files)

1,671
TypeScript lines
how we measured

wc -l supabase/functions and tests/e2e/servidor.ts (17 files)

3,386
JavaScript lines
how we measured

wc -l site, panel, worker and tests/e2e, excluding vendor (8 files)

0
build dependencies
how we measured

no package.json at the root; only playwright-core in tests/e2e

09Timeline

  1. 10 Oct 2026

    Landing page and four-step form published on Cloudflare Workers.

  2. 10 Oct 2026

    The whole backend in one day, in 8 phases: schema, role-based RLS, registrar_denuncia with per-IP limit, Edge Function with Turnstile, code login, panel and LGPD purge.

  3. 10 Oct 2026

    First security audit; contacts now leave only through an audited function and history can no longer be forged.

  4. 11 Oct 2026

    Launch audit with 12 findings fixed: forced HTTPS, session expiry and revocation, Audit tab, token hook, strict e-mail and phone validation.

  5. 11 Oct 2026

    /r/<slug> short links with UTM, custom QR codes, report attribution and admin-only metrics.

  6. 11 Oct 2026

    Dashboard tab with journey per platform, themes, expiring evidence, quick triage and traceable PDF report.

  7. 13 Oct 2026

    Copiar-provas bot live: database queue, conditional pg_cron, streamed copy into Storage and the real 3-day deadline.

10Stack

Frontend
  • HTML
  • CSS
  • JavaScript sem framework e sem build
  • supabase-js 2.49.1 (local)
  • qr-code-styling 1.9.2 (local)
  • SVG desenhado à mão
  • Impressão para PDF
Backend
  • Supabase Edge Functions (Deno)
  • PostgREST
  • Cloudflare Workers
Data
  • Postgres
  • RLS por papel
  • pg_cron
  • pg_net
  • Supabase Vault
  • Supabase Storage (bucket privado)
Infra
  • Cloudflare Workers + assets estáticos
  • Wrangler
  • Supabase CLI
  • SMTP próprio
Security
  • Cloudflare Turnstile validado no servidor
  • Honeypot
  • Rate limit por IP com advisory lock na transação
  • Hash de IP com sal (IPv6 por /64)
  • CSP sem inline e sem CDN
  • HSTS, nosniff, X-Frame-Options, COOP, CORP
  • Login por código de 8 dígitos, sem senha
  • Sessão checada em auth.sessions (12 h) e revogada por trigger
  • Grants por coluna e funções security definer
  • Auditoria com IP e navegador lidos no servidor
  • Relatório PDF com código rastreável
  • Anti-SSRF no robô de provas
  • Retenção automática (LGPD)

11Tech sheet

node@censura-digital: ~/cases/censura-digital
node@censura-digital ─────────────
type
public form + internal panel
stack
html · css · vanilla js · deno
edge
cloudflare workers + turnstile
db
postgres · rls · 43 functions · pg_cron
auth
8-digit code · passwordless · 12 h session
jobs
daily purge · evidence bot
tests
68 unit · 13 sql · 3 e2e
status
completed
$ ls supabase/migrations | wc -l && ls supabase/functions
23
convidar-membro copiar-provas enviar-denuncia registrar-acesso
$ deno test supabase/functions/enviar-denuncia/
e-mails reais passam ... ok
IPv6 vira prefixo /64 ... ok
caracteres de controle são removidos dos textos ... ok
ok | 55 passed | 0 failed (246ms)
$ curl -s -X POST $FUNCTIONS/enviar-denuncia -H 'Content-Type: application/json' -d '{"website":"http://spam"}'
{"ok":true} # 200 falso: honeypot preenchido, nada gravado
$ psql -c "select jobname, schedule from cron.job"
jobname | schedule
------------------+-------------
expurgar-contatos | 0 6 * * *
copiar-provas | * * * * *
$ node --test worker/
✔ robô e HEAD não contam, mas recebem o destino
✔ slug inválido, banco fora ou sem segredo: página inicial
ℹ tests 8 ℹ pass 8 ℹ fail 0

© 2026 NODE. All rights reserved.