Skip to content
/ proxy Public

Este projeto é um componente auxiliar de segurança entre o frontend e o backend, reduzindo exposição direta da VPS.

License

Notifications You must be signed in to change notification settings

CertyBR/proxy

Repository files navigation

Certy Proxy

Proxy do Certy em Cloudflare Workers.

Este projeto é um componente auxiliar de segurança entre o frontend e o backend, reduzindo exposição direta da VPS.

Links

Mantenedores Chefes

O que o proxy faz

  • Encaminha somente rotas permitidas:
    • /health
    • /api/v1/certificates/*
  • Permite somente métodos GET, POST, OPTIONS.
  • Aplica CORS por allowlist (ALLOWED_ORIGINS).
  • Encaminha cabeçalhos essenciais para o backend.
  • Injeta token compartilhado opcional (X-Certy-Proxy-Token) para bloquear acesso direto ao backend.
  • Força Cache-Control: no-store nas respostas proxied.

Variáveis

Use .dev.vars no ambiente local (não versionado):

cp .dev.vars.example .dev.vars

Campos:

  • BACKEND_ORIGIN: origem do backend (ex.: http://127.0.0.1:8080 em dev)
  • ALLOWED_ORIGINS: origens permitidas do frontend (separadas por vírgula)
  • PROXY_SHARED_TOKEN: token opcional (recomendado)

Desenvolvimento

bun install
bun run dev

Deploy

bunx wrangler login
bunx wrangler secret put PROXY_SHARED_TOKEN
bun run deploy

Scripts

bun run dev     # wrangler dev
bun run check   # tsc --noEmit
bun run deploy  # wrangler deploy

Integração com backend

Defina o mesmo token no backend:

PROXY_SHARED_TOKEN=<mesmo token do worker>

Se o backend estiver sem token, acesso direto continua possível.

Contribuições

Guia rápido em CONTRIBUTING.md.

Licença

MIT. Veja LICENSE.

About

Este projeto é um componente auxiliar de segurança entre o frontend e o backend, reduzindo exposição direta da VPS.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors