Repository navigation
Report usage on licence verify and gate File Search trial on a key - #1466
Merged
Merged
Conversation
Self-hosted licence verification now sends active users, connector and MCP server counts and the app version (opt out with LICENSE_USAGE_REPORT=false; never on Cloud). On Community, a trial started from this release opens File Search only with a registered licence key, the free Community key included; running trials keep it. Cloud verification now names the workspace (organizationId) so the licence site can refuse a self-hosted key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Self-hosted is sold as Community (free, up to 3 active users) and Enterprise. To see which Community instances outgrow Community, and to get more of them registered:
GET /api/license/verifynow also carriesactiveUsers,connectors,mcpServersandversion. Never sent from Cloud.LICENSE_USAGE_REPORT=falseturns it off. If counting fails, verification goes out without the counts.verifyLicense(key, organizationId)sendsorganizationId, so the licence site (website PR chore(deps): bump next from 16.3.0 to 16.3.1 in the next group across 1 directory #485) can refuse a self-hosted licence that is not bound to that workspace. Its error (This licence is for a self-hosted AnythingMCP instance. On AnythingMCP Cloud, choose a Cloud plan on the License page.) reaches the user throughsetLicenseKey.Changes
license/usage-report.ts(new): opt-out check, the instance-wide counts, andcountActiveSeats.EditionService.countSeatsnow callscountActiveSeats, so the reportedactiveUsersis exactly the seat count behind the Community limit. That is a one-line change underee/, authorised by the owner.LicenseService.verifyLicense: on self-hosted it adds the usage params. On Cloud it addsorganizationIdwhen it has one; self-hosted never sends it. The key stays in the params as before. The verify call has never sent the instance id; activation and registration still do.setLicenseKey(licence page activation), the periodicreverifyPaidLicenses,refreshLicense, the trial-extension re-verify, andLicenseReleaseService.assertNoLiveSubscription.GET /api/license/verifyfrom the app (the controller) already passed it.business_trial_ends_at). An admin starts it explicitly, and the first-run "company use" onboarding starts it too.EditionService.startTrialnow also writes the site settingfile_search_trial_needs_key=true(the secondee/line).FileSearchAccessService(self-hosted, no paid key):trialAvailable:false,keyRequired:'to_start'.keyRequired:'during_trial'.file_search_lockedand now also carrieskeyRequired.LockedCardshows "Register a free Community key under Settings → License to start the 30-day File Search trial." in en/de/it, with a primary link to/settings/license. The Settings → License page is untouched.LICENSE_USAGE_REPORTis in the env table and in.env.example. The "License Verification" section ofdocs/deployment.mdlists exactly what is sent.docs/connectors/file-search.mdhas the key rule.docs/license-faq.mdis untouched.Cloud behaviour: no usage counts. Verify sends
organizationId. File Search is unchanged.Self-hosted behaviour: verify sends the usage counts unless opted out, and never
organizationId. On Community, File Search needs a registered key for trials started from this release. Trials already running and paid keys are unchanged. Code mode, seat limits and plan features are unchanged.Type
Testing
New tests:
license/license-verify-params.spec.ts:LICENSE_USAGE_REPORT=false.setLicenseKeysendsorganizationIdand surfaces the site's self-hosted-licence error.organizationId.file-search-access.service.spec.ts:keyRequired:'to_start', 403 body).edition.service.spec.ts:startTrialwrites the marker.trial-extension.controller.spec.ts: the re-verify now passes the workspace.Commands (Node 25.2.1, after
npm ciandnpx prisma generatein the worktree):packages/backendnpm run lint--fixchangespackages/backendnpx tsc --noEmit -p tsconfig.jsonpackages/backendnpm test -- --maxWorkers=4packages/frontendnpm run lintpackages/frontendnpx tsc --noEmit -p tsconfig.jsonChecklist
npm test)Related Issues
Relates to website PR #485 (
organizationIdon/api/license/verify).Notes for review:
activeUsers,connectors,mcpServers,version).