[6.x] Site keys and a simpler licensing flow - #15355
Draft
jackmcdade wants to merge 21 commits into
Draft
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Skip writing STATAMIC_SITE_KEY in CI, surface cloned-key collisions, and let sites rotate with a 90-day alias via please site:rotate-key. Co-authored-by: Cursor <cursoragent@cursor.com>
Show one primary action based on whether the site is connected, pass APP_NAME into the handoff, and refresh after returning from statamic.com so licenses attach to the right site. Co-authored-by: Cursor <cursoragent@cursor.com>
Ping first so a connected or licensed site gets a status and a site URL instead of another claim code. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
There was a problem hiding this comment.
Individual PRs shouldn't update the CHANGELOG.md
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # CHANGELOG.md
Prefer legacy license keys over site keys, stop remote rotation, host-gate Outpost cache invalidation, and add a fresh-key recovery path when someone else has already linked the public site key. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Link to Account as the rightmost primary action for unlinked sites, hide domain errors until the site is claimed, only offer a fresh key after a failed claim, and stop minting from a claimed .env.example key.
So the claim page can show which domain is being linked even when the site has no authorized domains yet.
getLicenseKey() intentionally prefers STATAMIC_LICENSE_KEY over STATAMIC_SITE_KEY; the facade test was still asserting the opposite.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This introduces a site key: a stable identity shared by a Statamic project’s local, staging, and production installs. It identifies the project; it is not a license.
New projects receive a key during installation. Customers can then connect the project to statamic.com from the Control Panel or CLI and buy, renew, or update licensing without manually creating a site record or copying a replacement key back into every environment.
Installs sharing the key resolve to the same site record and license state. This also lays the groundwork for better visibility of a project’s environments in the Control Panel and on statamic.com, though this PR does not yet build a complete automatic environment inventory.
What changes
statamic:installwrites a new-formatSTATAMIC_SITE_KEYto.envand.env.examplewithout replacing an existing value.php please licenseuses a short URL and device code to connect the site to an account.php please site:fresh-keyseparates a cloned project from its starter;php please site:rotate-keyreplaces a key while the old one remains valid during a grace period.Compatibility
Existing 16-character keys and
STATAMIC_LICENSE_KEYcontinue to work without migration. Populated keys are not overwritten, and the interface consistently distinguishes having a site key from having a license.This is the CMS half of the feature and requires the corresponding account, checkout, and licensing-service changes on statamic.com.
Test plan
.envand.env.example; blank values are filled and populated values remain unchanged.STATAMIC_LICENSE_KEYand 16-character keys still work.php please licensecompletes the device-code flow and skips it when already connected or licensed.site:fresh-keyandsite:rotate-keyupdate.envand.env.example; rotation preserves the previous key during its grace period.statamic:pro:enablepoints tophp please licensewhen no existing key is supplied.