fix(community): bundle the desktop update signing key - #2923
Merged
Merged
Conversation
Community desktop verifies every release manifest against the signing key
configured while packaging, but that key never reached the packaged app:
chat2db-community-update-keys.properties was not part of the filtered
resource set, and the reactor inherits the Spring Boot "@...@" delimiter
configuration, so "${...}" placeholders were never substituted. The failure
was silent: TrustedUpdateKeys loaded no key, UpdateManifestVerifier rejected
every manifest as untrusted, and the application reported "no update".
Filter the bundled key resource in chat2db-community-jcef, enable the default
"${...}" delimiters for that module, and fail packaging when a supplied
COMMUNITY_UPDATE_KEY_ID/COMMUNITY_UPDATE_PUBLIC_KEY_B64 pair is not
substituted. Remove the unreferenced chat2db_update_java_options helper,
whose "chat2db.update.*" prefix no longer matches the runtime lookup.
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.
Problem
Community desktop verifies every release manifest with the Ed25519 key configured at packaging time, but that key never reached the packaged application. A packaged desktop therefore reported "no update" forever:
TrustedUpdateKeysloaded no key andUpdateManifestVerifierrejected every manifest withManifest signing key is not trusted(visible only in the update audit log).Two independent causes, both confirmed on a real build:
chat2db-community-update-keys.propertieswas not part of the filtered resource set (the BOM filters onlyapplication*.properties/yml), so the-Dchat2db.community.update.*values passed bypackage-community-jcef.shwere never substituted.@...@delimiter configuration (resource.delimiter=@,useDefaultDelimiters=false), so the${...}placeholders were not replaced either.Nothing has been released with the updater yet, so there is no upgrade path to preserve.
Fix
chat2db-community-jcef/pom.xml: filter the bundled key resource and enable the default${...}delimiters for this module.script/package/package-community-jcef.sh: newverify_bundled_update_keyfails packaging when a supplied key pair is absent from the built jcef jar; it stays quiet when no key is configured (local builds).script/package/desktop_layout.sh: drop the unreferencedchat2db_update_java_optionshelper, whosechat2db.update.*prefix does not match the runtime lookup (chat2db.community.update.*).Verification
mvn -o -pl :chat2db-community-jcef process-resources -Dchat2db.community.update.key-id=PROBE-KEY-ID -Dchat2db.community.update.public-key=PROBE-PUBLIC-KEYsubstitutes both values; the same command without-Dkeeps the placeholders (dev builds unchanged); thepackageoutput jar carries the substituted values.SKIP_BACKEND=true SKIP_FRONTEND=true bash script/package/package-community-jcef.sh 5.3.0 prepare): no key ->[check] update signing key not supplied(exit 0); key supplied with an unsubstituted jar ->[error] bundled update signing key is not substituted(exit 1); substituted jar ->[check] bundled update signing key present(exit 0).bash -non both scripts,script/package/tests/desktop-layout-test.shpassed,git diff --checkclean.Not run here: full reactor
mvn clean install, native installers, and the release workflow itself (needs CI secrets and target platforms).