Skip to content

Open-source prep + Phase 2 hardening - #1

Merged
yh12-10 merged 11 commits into
mainfrom
oss-prep-and-hardening
Jun 8, 2026
Merged

yh12-10 merged 11 commits into
mainfrom
oss-prep-and-hardening

Conversation

@yh12-10

@yh12-10 yh12-10 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Prepares AuthentiGen for a public open-source release and adds a round of production hardening. 11 focused commits; pnpm check, pnpm test (34 tests, server + client), and pnpm build all pass. Docker cold-boot verified end-to-end (HTTP 200, migrations applied, no crash-restart).

Phase 1 — OSS readiness

  • Removed all Manus platform coupling (vite plugins, OAuth dialog, allowed-hosts, debug collector, localStorage key, broken analytics tag) and dead code. Runs standalone on native email/password auth.
  • Docs + license: LICENSE (MIT), README, ARCHITECTURE, CONTRIBUTING, SECURITY, with an intended-use/ethics note.
  • Clone-and-run: multi-stage Dockerfile + docker compose up (MySQL + app); entrypoint generates a per-deploy JWT secret and retries migrations through MySQL's first-boot race.
  • CI: GitHub Actions — format check, type-check, test, build.
  • Honest positioning: softened unverifiable "undetectable / defeats every detector / 99.7%" claims into accurate camera-realism language; fixed factual errors (claimed S3 when storage was local, vestigial "Forge", fake metrics).

Phase 2 — hardening

  • Pluggable storage (STORAGE_BACKEND=local|s3): S3 / S3-compatible (R2/MinIO/B2) behind the same API; AWS SDK imported lazily. Batch ZIP now reads buffers directly (fixes local downloads).
  • SMTP email via nodemailer (optional): real notifyOwner + best-effort job-completion emails; console fallback when unset.
  • Rate limiting on /api/trpc (configurable; TRUST_PROXY aware).
  • Job durability (no new infra): startup recovery re-queues pending and fails+refunds interrupted processing jobs; global image concurrency cap.
  • Frontend tests: Vitest split into server (node) + client (jsdom) projects with @testing-library/react; added cn, stepStateAt, and CompletionConfetti tests.
  • Dev tooling: optional Mailhog + MinIO under a Compose dev profile; repo-wide Prettier pass enforced in CI.

All new integrations are off by default and degrade gracefully when unconfigured.

Commits

  1. Remove Manus platform coupling and dead code
  2. Add open-source documentation and MIT license
  3. Add Docker, Compose, and CI
  4. Reframe product copy to honest, accurate positioning
  5. Add pluggable storage backend (local | S3)
  6. Add SMTP email via nodemailer
  7. Add rate limiting to the API
  8. Add lightweight job durability (no new infra)
  9. Add frontend tests (Vitest jsdom project)
  10. Document Phase 2 config and add dev compose profile
  11. Apply Prettier across the repo and enforce it in CI (isolated formatting pass — skim, don't review line-by-line)

Verification

  • pnpm check → 0 type errors · pnpm test → 34 tests pass · pnpm build → clean
  • docker compose up --build → MySQL up, migrations applied, HTTP 200, RestartCount 0

Still open (Roadmap)

Distributed job queue for multi-instance, on-read presigned URLs, broader test coverage, email verification.

yh12-10 and others added 11 commits June 8, 2026 13:07
Decouple the app from the proprietary Manus platform so it runs as a
standalone, self-hostable project on its native email/password auth:

- vite.config: drop vite-plugin-manus-runtime, the debug-collector plugin,
  and .manus.computer allowed-hosts
- delete dead files: ManusDialog.tsx, __manus__/debug-collector.js,
  server/_core/types/manusTypes.ts, and unused Map.tsx (+ @types/google.maps)
- remove the manus-runtime-user-info localStorage write and Manus account
  copy; strip a broken %VITE_ANALYTICS% script from index.html
- switch test fixtures to loginMethod "email"; fix stale "Forge" comments
- gitignore .claude/ and local storage contents

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- LICENSE (MIT), README with quick start + intended-use/ethics note,
  ARCHITECTURE (request flow, pipeline stages, data model),
  CONTRIBUTING, and SECURITY (reporting + hardening limitations)
- remove the stale internal todo.md (folded into ARCHITECTURE/README)
- note in .env.example that docker compose supplies DATABASE_URL

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- multi-stage Dockerfile (glibc base for sharp/ffmpeg) and docker-compose
  bringing up MySQL + the app; entrypoint generates a per-deploy JWT secret
  in the storage volume and retries migrations through MySQL's first-boot race
- .dockerignore and .gitattributes (LF for shell scripts so the entrypoint
  runs in Linux containers from any checkout)
- GitHub Actions CI: install, type-check, test, build
- keep the storage/ dir on clone via .gitkeep

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lead with what the pipeline actually does (camera/photographic realism)
instead of guaranteeing detector evasion, and fix inaccurate claims:

- soften "Undetectable / defeats every detector / 99.7%" and the fabricated
  stats row into accurate realism language
- correct FAQ errors: it is local self-hosted storage (not S3), remove the
  vestigial "Forge" reference and the fake weekly-tracking/subscription claim
- add a responsible-use disclaimer to the footer

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refactor storage.ts behind a backend interface, keeping the same public API
and key shape so no call site changes:

- local filesystem backend (default, unchanged behavior)
- S3 / S3-compatible backend (R2/MinIO/B2 via S3_ENDPOINT) using the already-
  present AWS SDK, imported lazily so local deploys never load it; returns a
  public (S3_PUBLIC_URL) or 7-day presigned URL
- selected via STORAGE_BACKEND, guarded by isS3Configured()
- batch ZIP now reads objects via storageGetBuffer instead of fetching a
  (possibly relative/expiring) URL, fixing local downloads and supporting S3

Also scaffolds env/config for the remaining Phase 2 features.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- new server/_core/email.ts: lazy nodemailer transport behind isSmtpConfigured(),
  with sendMail() and a best-effort sendJobCompletionEmail() helper
- notifyOwner() now delivers via SMTP when configured (OWNER_EMAIL), and keeps
  the console.log fallback otherwise — call site unchanged
- image and video jobs send the user a "result is ready" email on completion,
  wrapped so it never blocks or fails the job

All disabled gracefully when SMTP env is unset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- express-rate-limit applied to /api/trpc (configurable via RATE_LIMIT_WINDOW_MS
  and RATE_LIMIT_MAX); /storage, the Stripe webhook, and batch download are exempt
- honor TRUST_PROXY so client IPs are correct behind a reverse proxy
- update SECURITY.md accordingly

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- server/recovery.ts: on startup, reconcile jobs left pending/processing after
  a crash — re-queue pending jobs, mark interrupted processing jobs failed and
  refund any unrefunded credit deduction. Pure classifyOrphan() is unit-tested.
- global in-process image concurrency cap (MAX_CONCURRENT_IMAGE_JOBS, default 4)
  so a flood of uploads can't exhaust the box; excess jobs queue
- wire recoverOrphanedJobs() into startup next to the temp-dir sweep

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- split Vitest into two projects: server (node) and client (jsdom) via
  vitest.workspace.ts; client uses @testing-library/react + jest-dom
- automatic JSX runtime for tests; client test setup with auto-cleanup
- tests: cn() utility, StepIndicators.stepStateAt() logic (now exported),
  and CompletionConfetti render with canvas-confetti mocked

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- .env.example: storage (S3), SMTP, rate-limit, and concurrency vars
- docker-compose: pass the new env through; add optional Mailhog + MinIO under
  a "dev" profile (docker compose --profile dev up) for local email/S3 testing
- README: config rows + Storage/Email sections; refresh the Roadmap
- ARCHITECTURE: pluggable storage, image concurrency cap, and job recovery

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
One-time formatting pass (prettier --write) over the codebase, plus a
prettier --check gate in CI. Drizzle-generated migration artifacts and the
local storage dir are excluded via .prettierignore. No behavior changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yh12-10
yh12-10 merged commit 119daac into main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant