Skip to content

esc: SSO enterprise-bypass overlay (reproducible build + upgrade path) - #1

Open
AmirMamd wants to merge 1 commit into
emobility-unityfrom
esc/sso-overlay
Open

esc: SSO enterprise-bypass overlay (reproducible build + upgrade path)#1
AmirMamd wants to merge 1 commit into
emobility-unityfrom
esc/sso-overlay

Conversation

@AmirMamd

Copy link
Copy Markdown

What

Commits the ESC enterprise-bypass overlay under esc/ so the SSO patch that is already live on CT 175 (twenty-esc-sso:v2.0.0, running since 2026-06-05) is finally reproducible, documented, and upgrade-safe. Until now it existed only as loose files in /root/twenty-esc-sso-build/ on the server — a single-machine artifact with no source of truth.

Why

Twenty gates SSO behind a paid Enterprise key. ESC staff email is self-hosted (mail.voltnation.pl), so Google/MS OAuth isn't an option — Keycloak (premium) is the only path. Patryk authorised forking Twenty to remove the gate (WhatsApp, 2026-06-04: "fork twenty plz, remove the enterprise limitations… mainly after SSO… but fork it smartly"), pointing at the docuseal-full overlay pattern as the template. This is the "fork it smartly" part.

How (option B — thin overlay on the official image)

  • patch-enterprise.cjs rewrites 4 methods in the compiled enterprise-plan.service.js (isValid, hasValidEnterpriseValidityToken, getLicenseInfo, getSubscriptionStatus). isValid()→true unlocks the SSO guard; the other three keep the licence-aware UI/cron self-consistent so the daily enterprise-key-validation cron can't flip the gate back.
  • The patch self-asserts all 4 applied or fails the image build — an upstream-drift tripwire, so an upgrade can never silently re-enable the gate.
  • esc-build.sh / esc-deploy.sh / esc-upgrade.sh make build, snapshotted cutover (one-step rollback), and re-apply-on-upgrade one-command each.
  • PATCH_MANIFEST.md + README.md document authorisation, the AGPLv3 position, the per-method table, and the live deployed state.

Live state captured

  • Image twenty-esc-sso:v2.0.0 runs the twenty-esc stack → https://esc.crm.fiszu.com (healthy).
  • SSO IdP twenty-esc (issuer https://auth.fiszu.com/realms/fiszu) is Active in the workspace.
  • twenty-rc (v1.17.0) is a separate stack and is not touched.

Test plan

  • node --check esc/patch-enterprise.cjs — valid
  • bash -n on all three scripts — valid
  • Patch already proven: the running CT 175 image was built from these exact files; isValid() { return true confirmed in the running container's compiled service.
  • Next upstream bump: ./esc/esc-upgrade.sh <ver> should rebuild green (or fail loudly if the enterprise service changed).

Refs twentyhq#6151.

Captures the CT 175 twenty-esc-sso:v2.0.0 build (live since 2026-06-05) as a
self-contained, upgrade-resilient overlay under esc/, mirroring the
docuseal-full pattern Patryk pointed at.

- patch-enterprise.cjs: rewrites 4 methods in compiled enterprise-plan.service.js
  (isValid / hasValidEnterpriseValidityToken / getLicenseInfo /
  getSubscriptionStatus); self-asserts all 4 applied or fails the build
  (upstream-drift tripwire).
- Dockerfile: FROM twentycrm/twenty:TWENTY_VERSION + patch.
- esc-build/deploy/upgrade.sh: one-command build, snapshotted cutover with
  one-step rollback, and re-apply-on-upgrade.
- PATCH_MANIFEST.md + README.md: authorisation, legal (AGPLv3), per-method
  table, deployed state, upgrade procedure.

Authorised by Patryk 2026-06-04. Previously the patch lived only as loose
files in /root/twenty-esc-sso-build on CT 175 - not reproducible, not
upgrade-safe. Refs twentyhq#6151.
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